        :branch     (clojure.string/trim (nth parsed 2))})))
 
 (defn parse-job-names
+  "Parse all job names, try to get group, repository, and branch from them."
   [branch-job-prefix job-names]
   (for [job-name job-names]
        (parse-job-name branch-job-prefix job-name)))
 
 (defn create-or-delete-jenkins-job
+  "Create or delete Jenkins job according to selected action."
   [jenkins-url job-list-command branch-job-prefix action]
   (log/info "Create-or-delete-jenkins-job")
   (let [reponame       (:name action)

  (jetty/run-jetty ring-app {:port port}))

(defn create-workdir
  [workdir]
  (let [directory (new java.io.File workdir)]
    (when-not (.isDirectory directory))

        :branch-updated)))

(defn get-branch
  "Retrieve branch name for given Git reference."
  [git-ref]
  (try (subs git-ref (inc (.lastIndexOf git-ref "/")))
       (catch Exception e
              nil)))

(def actions-queue
  "Queue to plan actions that will need to be performed."
  (create-action-queue))

(defn api-call-handler
  "Handler for all API calls."
  [request]
  (let [gitlab-info      (parse-gitlab-info request)
        repository-url   (-> gitlab-info :repository :url)
