updates jet to 0.7.10-20191223_195635-g6e9ced1 (#1009)

--- waiter/project.clj
+++ waiter/project.clj
@@ -45,7 +45,7 @@
                  [io.grpc/grpc-core "1.20.0"
                   :exclusions [com.google.guava/guava]
                   :scope "test"]
-                 [twosigma/jet "0.7.10-20190924_091442-gfccc405"
+                 [twosigma/jet "0.7.10-20191223_195635-g6e9ced1"
                   :exclusions [org.mortbay.jetty.alpn/alpn-boot]]
                  [twosigma/clj-http "1.0.2-20180124_201819-gcdf23e5"
                   :exclusions [commons-codec commons-io org.clojure/tools.reader potemkin slingshot]]


removed comment

removed comment

--- src/metabase/pulse.clj
+++ src/metabase/pulse.clj
@@ -92,7 +92,7 @@
   (let [results     (for [card cards]
                       (execute-card (:id card)))
         channel-ids (or channel-ids (mapv :id (:channels pulse)))]
-    (if-not (and skip_if_empty (are-all-cards-empty? results));(are-all-cards-empty? results) ; ;; TODO check skip_if_empty type
+    (if-not (and skip_if_empty (are-all-cards-empty? results))
       (doseq [channel-id channel-ids]
         (let [{:keys [channel_type details recipients]} (some #(when (= channel-id (:id %)) %)
                                                               (:channels pulse))]


make minreact-state, minreact-props private

--- src/minreact/core.cljs
+++ src/minreact/core.cljs
@@ -5,23 +5,29 @@
   (:require-macros [minreact.core :refer [genspec defreact]])
   (:refer-clojure :exclude [set!]))

-(def ^:private state-key "__minreact_state")
+(def state-key
+  "Key in component local state under which minreact stores its state
+  as a Clojure data structure"
+  "__minreact_state")

-(def ^:private props-key "__minreact_props")
+(def props-key
+  "Key in component props under which minreact stores its props as a
+  Clojure data structure"
+  "__minreact_props")

-(defn minreact-state
+(defn- minreact-state
   "Return the minreact state of pure React component state s, not-found
   if not present"
   ([s] (minreact-state s nil))
   ([s not-found]
-   (or (some-> s (obj/get state-key)) not-found)))
+   (some-> s (obj/get state-key not-found))))

-(defn minreact-props
+(defn- minreact-props
   "Return the minreact props of pure React component props p, not-found
   if not present"
   ([p] (minreact-props p nil))
   ([p not-found]
-   (or (some-> p (obj/get props-key)) not-found)))
+   (some-> p (obj/get props-key not-found))))

 (defn state
   "Return the components current state"


Change initial morph position in model

Change initial morph position in model

--- src-clj/cljs_workspace/server.clj
+++ src-clj/cljs_workspace/server.clj
@@ -26,7 +26,7 @@
   (atom {:url "/data"
           :server/id 42
           :coll {:id 1
-                :morph {:id 1 :Position {:x 0 :y 42}}
+                :morph {:id 1 :Position {:x 50 :y 200}}
                 :shape {:id 1
                         :BorderWidth 5
                         :BorderColor "rgb(0,0,0)"


Docstring

Docstring

--- src-cljs/githubcomments/core.cljs
+++ src-cljs/githubcomments/core.cljs
@@ -8,6 +8,7 @@
 (def repo ["Magnetic" "Platform-Guild"])

 (defn render-comment [repo comment]
+  "Render the given comment in the context of the given repository."
   (go (let [response (async/<! (render-user-content-markdown (:body comment) repo))]
         (.log js/console (:body response)))))


Simplify location of data dir

Simplify location of data dir

--- src/nightmod/utils.clj
+++ src/nightmod/utils.clj
@@ -10,18 +10,7 @@

 (defn get-data-dir
   []
-  (let [home-dir (System/getProperty "user.home")
-        app-name "Nightmod"
-        app-name-lower (clojure.string/lower-case app-name)
-        osx-dir (io/file home-dir "Library" "Application Support" app-name)
-        win-dir (io/file home-dir "AppData" "Roaming" app-name)]
-    (.getCanonicalPath
-      (cond
-        (.exists (.getParentFile osx-dir)) osx-dir
-        (.exists (.getParentFile win-dir)) win-dir
-        :else (if-let [config-dir (System/getenv "XDG_CONFIG_HOME")]
-                (io/file config-dir app-name-lower)
-                (io/file home-dir ".config" app-name-lower))))))
+  (.getCanonicalPath (io/file (System/getProperty "user.home") "nightmod")))

 (defn format-date
   [unix-time]


Fix invalid success board

Fix invalid success board

--- src/obb_rules/turn.clj
+++ src/obb_rules/turn.clj
@@ -41,9 +41,9 @@
   [game total-action-points]
   (cond
     (not (game/valid-actions? game))
-      (result/action-failed "ActionFailed")
+      (result/action-failed "ActionFailed" game)
     (> total-action-points max-action-points)
-      (result/action-failed "ActionPointsOverflow" game)
+      (result/action-failed "ActionPointsOverflow")
     :else
       (result/action-success game total-action-points)))


removed unnecessary login thing

removed unnecessary login thing

--- src/ontrail/crypto.clj
+++ src/ontrail/crypto.clj
@@ -23,7 +23,6 @@
 (defn get-bytes [in] (if (string? in) (.getBytes in) in))

 (defn byte-array-to-string [arr]
-  (.debug logger (str "Array: " (apply str (map #(char (bit-and 255 (int %))) arr))))
   (String. arr)) ; aebaerae -castaus char:ksi, mutta tässä toimii?

 (defn base64-encode [bytes-or-string] (byte-array-to-string (Base64/encodeBase64URLSafeString (get-bytes bytes-or-string))))


Changing strategy.

Changing strategy.

--- src/refac/core.clj
+++ src/refac/core.clj
@@ -3,53 +3,59 @@
   (use refac.io)
   (use refac.java))

-(defn handler-for [arg]
-  (if (contains? handlers arg)
-    (handlers arg)
-    (do
-      (println arg)
-      (throw (IllegalStateException. arg)))))
+(defn ignore-to-eol [[first & others]]
+  (case first
+    ";" others
+    (recur others)))

+(defn do-package [items] [(ignore-to-eol items) {}])
+(defn do-import  [items] [(ignore-to-eol items) {}])

-(defn assoc-if [context key value]
-  (if value
-    (assoc context key value)
-    context))
+(defn do-open-body [[first & others]]
+  (if-not (= first "{")
+    (throw (IllegalStateException. (str "Expected {, got " first)))
+    others))

-(defn handle-response [context response]
-  (let [{:keys [next
-                remember
-                pop-state
-                push-state
-                push-arg]} response
+(defn do-body [items]
+  (loop [[first & others] (do-open-body items)
+         indent 1]
+    (println first)
+    (when-not (= indent 0)
+      (recur
+        others
+         (+ indent
+            (case first
+              "{"  1
+              "}" -1
+              0))
+        ))))

-        context   (if pop-state  (assoc context :state (:pushed-state context)) context)
-        context   (if push-state (assoc context :pushed-state (:state context)) context)
-        context   (if push-arg   (assoc context :args (cons push-arg (:args context))) context)
-        context   (assoc-if context :state next)
-        context   (assoc-if context :remember remember)]
-    context))
+(defn do-type [[first second & others]]
+  (let [info {:type first :name second}
+        remaining (case first
+                     "class" (do-body others))]
+    [remaining info]))

-(defn handle-symbol [context symbol]
-  (println "context -> " context " -- " symbol)
-  ;(println symbol)
-  (println (context :remember))
-  (let [handler       (handler-for (:state context))
-        response      (handler symbol (:args context))
-        next-context  (handle-response context response)]
-    ;(println "response -> " response)
-    next-context))
+(defn do-declaration [items]
+  (let [[first & others] items
+        [visability [remaining info]]
+          (case first
+            ("public" "private" "protected" "internal") [first (do-type others)]
+            ["private" (do-type items)])]
+    [remaining (assoc info :visability visability)]))

-(defn fsm-reduce [reducer init items]
-  (loop [reduction init
-         items     items]
-    (if (not (empty? items))
-             (recur (reducer reduction
-                             (first items))
-                    (rest items)))))
+(defn do-root [items]
+  (loop [[items _] [items {}]]
+    (let [[first & others] items]
+      (println first)
+      (recur
+        (case first
+          "package" (do-package others)
+          "import"  (do-import others)
+          (do-declaration items))))))

 (defn process-symbols [symbols]
-  (fsm-reduce handle-symbol {:state "base"} symbols))
+  (do-root symbols))

 (defn -main


head-user takes only crumbs and actions

head-user takes only crumbs and actions

--- src-cljs/frontend/components/header.cljs
+++ src-cljs/frontend/components/header.cljs
@@ -64,24 +64,25 @@
           :else nil)))

 (defn head-user
-  "Builds the header section which contains, among other things, the breadcrumb.
-  actions is an optional component (or collection of components which will be
-  placed on the right of the header; this is where page-wide actions are
-  placed."
-  [{:keys [app actions]} owner]
+  "The page header.
+
+  :crumbs  - The breadcrumbs to display.
+  :actions - (optional) A component (or collection of components) which will be
+             placed on the right of the header. This is where page-wide actions are
+             placed."
+  [{:keys [crumbs actions]} owner]
   (reify
     om/IDisplayName (display-name [_] "User Header")
     om/IRender
     (render [_]
-      (let [crumbs-data (get-in app state/crumbs-path)]
-        (html
-         [:div.head-user
-          ;; Avoids a React warning for not giving each `li` a key. Correctly,
-          ;; we should render the `li`s here directly, with a `for`, and give
-          ;; each one a `:key` here. This gets rid of the warning for now and
-          ;; avoids re-architecting the crumbs rendering.
-          (apply vector :ol.breadcrumb (crumbs/crumbs crumbs-data))
-          [:div.actions actions]])))))
+      (html
+       [:div.head-user
+        ;; Avoids a React warning for not giving each `li` a key. Correctly,
+        ;; we should render the `li`s here directly, with a `for`, and give
+        ;; each one a `:key` here. This gets rid of the warning for now and
+        ;; avoids re-architecting the crumbs rendering.
+        (apply vector :ol.breadcrumb (crumbs/crumbs crumbs))
+        [:div.actions actions]]))))

 (defn maybe-active [current goal]
   {:class (when (= current goal)
@@ -372,7 +373,7 @@
                                        "Account Notifications"]]
                             :dismiss-fn #(raise! owner [:dismiss-web-notifications-confirmation-banner])}))))
            (when (seq (get-in app state/crumbs-path))
-             (om/build head-user {:app app
+             (om/build head-user {:crumbs (get-in app state/crumbs-path)
                                   :actions (cond-> []
                                              (show-settings-link? app)
                                              (conj (settings-link app owner))


show coupons in admin view

show coupons in admin view

--- src/pc/views/admin.clj
+++ src/pc/views/admin.clj
@@ -255,6 +255,7 @@
           [:tr
            [:th "subdomain"]
            [:th "status"]
+           [:th "coupon"]
            [:th "creator"]
            [:th "active"]
            [:th "members"]]
@@ -266,6 +267,7 @@
              [:td (cond (:plan/paid? plan) "paid"
                         (not (plan-model/trial-over? plan)) "trial"
                         :else "trial expired")]
+             [:td (:discount/coupon (:team/plan team))]
              [:td [:a {:href (str "/user/" (:cust/email (:team/creator team)))}
                    (:cust/email (:team/creator team))]]
              [:td (let [active (:plan/active-custs plan)]


Prepare user-friendly samples #15 - hello world

--- flatguisamples/src/flatgui/samples/forms/hellowindow.clj
+++ flatguisamples/src/flatgui/samples/forms/hellowindow.clj
@@ -20,9 +20,9 @@
 (def greeting-text "Hello, world!")

 (fg/defevolverfn greeting-evolver :text
-                 (if (get-property [:say-hello] :pressed)
-                   greeting-text
-                   nogreeting-text))
+  (if (get-property [:say-hello] :pressed)
+    greeting-text
+    nogreeting-text))

 (def hello-window
   (fg/defcomponent


Ajustements de forme réalisés par le plugin "parinfer" pour Visual Studio Code

--- clojure/codingame/competition/coders-strike-back/src/coders_strike_back/core.clj
+++ clojure/codingame/competition/coders-strike-back/src/coders_strike_back/core.clj
@@ -43,7 +43,7 @@
                    nextCheckpointX (read) nextCheckpointY (read)
                    nextCheckpointDist (read) nextCheckpointAngle (read)
                    opponentX (read) opponentY (read)
-                   opponent-distance (distance (Integer/valueOf x) (Integer/valueOf y) (Integer/valueOf opponentX) (Integer/valueOf opponentY)) ]
+                   opponent-distance (distance (Integer/valueOf x) (Integer/valueOf y) (Integer/valueOf opponentX) (Integer/valueOf opponentY))]
                   ; nextCheckpointX: x position of the next check point
                   ; nextCheckpointY: y position of the next check point
                   ; nextCheckpointDist: distance to the next checkpoint
@@ -54,15 +54,15 @@
                   ; (binding [*out* *err*]
                   ;   (println "Debug messages..."))
                   (binding [*out* *err*]
-                    (println (str "Has the boost be used ? : " @boost-used? ))
+                    (println (str "Has the boost be used ? : " @boost-used?))
                     (println (str "Given next check point distance : " nextCheckpointDist))
                     (println (str "Calculated next check point distance : " (distance x y opponentX opponentY)))
                     (println (str "Pod angle with checkpoint : " nextCheckpointAngle))
                     (println (str "Game loop counter : " @game-loop-counter))
-                    (println (str "Pod Position : (" x "," y ")" ))
-                    (println (str "Opponent pod Position : (" opponentX "," opponentY ")" ))
-                    (println (str "Opponent distance : " opponent-distance))
-                    )
+                    (println (str "Pod Position : (" x "," y ")"))
+                    (println (str "Opponent pod Position : (" opponentX "," opponentY ")"))
+                    (println (str "Opponent distance : " opponent-distance)))
+

                   ; You have to output the target position
                   ; followed by the power (0 <= thrust <= 100)


Moved do-when above make-props.

Moved do-when above make-props.

--- src/postal/support.clj
+++ src/postal/support.clj
@@ -1,5 +1,10 @@
 (ns postal.support
   (:import [java.util Properties]))
+
+(defmacro do-when
+  [arg condition & body]
+  `(when ~condition
+     (doto ~arg ~@body)))

 (defn make-props [sender {:keys [host port user tls]}]
   (doto (Properties.)
@@ -10,7 +15,4 @@
     (do-when user (.put "mail.smtp.user" user))
     (do-when tls  (.put "mail.smtp.starttls.enable" "true"))))

-(defmacro do-when
-  [arg condition & body]
-  `(when ~condition
-     (doto ~arg ~@body)))
+


fixed comment counts

fixed comment counts

--- src/publisher/core.clj
+++ src/publisher/core.clj
@@ -26,12 +26,21 @@
 (defn like-button [url]
   (str "

" ))

+
+(defn path-to-disqus-id [path]
+  (-> path
+      (string/replace "," "%2C")
+      URLDecoder/decode
+      URLEncoder/encode))
+
 (defn disqus [path title]
+  (println "showing" (path-to-disqus-id path))
+
   (str "


small fixes (idiomatic code)

small fixes (idiomatic code)

--- internal/scribe/src/samsara/scribe/serializer/transit.clj
+++ internal/scribe/src/samsara/scribe/serializer/transit.clj
@@ -14,14 +14,14 @@
   Scribe

   (write [_ data]
-    (let [out (ByteArrayOutputStream. (config :size))
-          writer (transit/writer out (config :format))]
+    (let [out (ByteArrayOutputStream. (:size config))
+          writer (transit/writer out (:format config))]
       (transit/write writer data)
       (.toByteArray out)))

   (read [_ bytez]
     (let [in (ByteArrayInputStream. bytez)
-          reader (transit/reader in (config :format))]
+          reader (transit/reader in (:format config))]
       (transit/read reader))))


add electron to karma runners

add electron to karma runners

--- library/src/doo/karma.clj
+++ library/src/doo/karma.clj
@@ -29,7 +29,9 @@
    :karma-phantom {:plugin (karma-plugin-name "phantomjs")
                    :name   "PhantomJS"}
    :karma-slimer  {:plugin (karma-plugin-name "slimerjs")
-                   :name   "SlimerJS"}})
+                   :name   "SlimerJS"}
+   :electron      {:plugin (karma-plugin-name "electron")
+                   :name   "Electron"}})

 (def envs (set (keys karma-envs)))


in channel page, sort by last reply, not 'current-users-last-reply'

--- src/chat/client/views/pages/channel.cljs
+++ src/chat/client/views/pages/channel.cljs
@@ -28,7 +28,6 @@
                          (sort-by
                            (comp (partial apply max)
                                  (partial map :created-at)
-                                 (partial filter (fn [m] (= (m :user-id) user-id)))
                                  :messages))
                          reverse)]
         (dom/div #js {:className "page channel"}


Update the use form after moving utils to utils.core

--- src/circleci/backend/action/transfer.clj
+++ src/circleci/backend/action/transfer.clj
@@ -6,7 +6,7 @@
   (:require [circleci.backend.action :as action])
   (:require [circleci.backend.ssh :as circle-ssh])
   (:require [circleci.backend.action.bash :as bash])
-  (:use [circleci.utils :only (printfln)])
+  (:use [circleci.utils.core :only (printfln)])
   (:use circleci.utils.except))

 (defn get-file


(MAINT) Update docs to include :unbuffered-stream

I also added a caveat to the usage of the :stream response body so
users know the behavior isn't streaming, just returns an instance of
InputStream.

--- src/clj/puppetlabs/http/client/async.clj
+++ src/clj/puppetlabs/http/client/async.clj
@@ -150,8 +150,11 @@
         automatically decompressed if it contains a recognized 'content-encoding'
         header.  defaults to `true`.
    * :as - used to control the data type of the response body.  Supported values
-       are `:text` and `:stream`, which will return a `String` or an
-       `InputStream`, respectively.  Defaults to `:stream`.
+       are `:text`, `:stream` and `:unbuffered-stream`. `:text` will return a `String`,
+       `:stream` and `:unbuffered-stream` will return an `InputStream`. Note that
+       `:stream` holds the full response in memory (i.e. a `ByteArrayInputStream`).
+       Use `:unbufferred-stream` for large response bodies or to consume less memory.
+       Defaults to `:stream`.
    * :query-params - used to set the query parameters of an http request
    * :metric-id - array of strings or keywords, used to set the metrics to be
        timed for the request."


remove unused file

remove unused file

--- src/cljs/client/components/activity.cljs
+++ src/cljs/client/components/activity.cljs
@@ -1 +0,0 @@
-(ns client.components.activity)


Filter comments (see *)

Filter comments (see *)

--- src/cljs/cljs_browser_repl/handlers.cljs
+++ src/cljs/cljs_browser_repl/handlers.cljs
@@ -35,7 +35,8 @@
  :send-to-console
  (fn [db [_ console-key lines]]
    (let [console (app/console db console-key)
-         prompt  (replumb/get-prompt)]
+         prompt  (replumb/get-prompt)
+         lines   (filter #(re-seq #"^[^;]" (clojure.string/trim %)) lines)]
      (doseq [line lines]
        (console/write-old-prompt! console
                                   (str prompt (apply str (take-while (complement #{\;}) line))))


Add a change-retracted control event

Add a change-retracted control event

--- src/cljs/gtfve/controllers/controls.cljs
+++ src/cljs/gtfve/controllers/controls.cljs
@@ -96,3 +96,11 @@
   [_ change _ cursors]
   (let [data (:data cursors)]
     (om/transact! (data) :changes #(conj % change))))
+
+(defmethod control-event :change-retracted
+  [_ pos _ cursors]
+  (let [data (:data cursors)]
+    (om/transact! (data) :changes
+                  #(vec (concat
+                         (subvec % 0 pos)
+                         (subvec % (inc pos)))))))


Finish adding new diversification tests based on reproductive traces

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -1498,6 +1498,7 @@
                 :children-make-children-differently children-make-children-differently-diversifying?
                 :three-children-make-children-differently three-children-make-children-differently-diversifying?
                 :symbolic-reproductive-change-changes symbolic-reproductive-change-changes-diversifying?
+                :symbolic-reproductive-change symbolic-reproductive-change-diversifying?
                 :reproductive-change-changes reproductive-change-changes-diversifying?
                 :reproductive-change-changes-differently reproductive-change-changes-differently-diversifying?
                 :use-mate use-mate-diversifying?


Added require statement for geodetic ring validation.

--- src/cmr/search/validators/validation.clj
+++ src/cmr/search/validators/validation.clj
@@ -1,7 +1,10 @@
 (ns cmr.search.validators.validation
   "Defines protocols and functions to validate conditions"
   (:require [cmr.search.models.query :as qm]
-            [cmr.spatial.validation :as spatial-validation]))
+            [cmr.spatial.validation :as spatial-validation]
+
+            ;; Must be required to be available.
+            [cmr.spatial.geodetic-ring-validations]))

 (defprotocol Validator
   "Defines the protocol for validating query conditions.


Fix handling of path changes

Fix handling of path changes

--- src/trak/core.cljs
+++ src/trak/core.cljs
@@ -47,7 +47,7 @@
                     (utils/info "Path subscriber notified: " match)
                     (d/transact! db/conn [{:application/state-type :path
                                            :application/state      match}])
-                    (routes/handler (:handler match) (:params match))
+                    (routes/handler (:handler match) (:route-params match))
                     (utils/info ["subscribe " match])))

 (subscribe-pubsub db/conn :actions-listener :actions


Emit a deprecation warning only once

Emit a deprecation warning only once

Closes #362

--- src/riemann/common.clj
+++ src/riemann/common.clj
@@ -22,15 +22,16 @@
   (match [pred object]
     "Does predicate describe object?"))

-; Deprecation
+(def deprecations-emitted (atom {}))
+
 (defmacro deprecated
   "Wraps body in an implicit (do), and logs a deprecation notice when invoked."
   [comment & body]
-  `(do
-     (info ~(str "Deprecated: "
-                 (format "<%s:%s> " *file* (:line (meta &form)))
-                 comment))
-     ~@body))
+  (let [id (str *file* ":" (:line (meta &form)) " - " comment)]
+    (swap! deprecations-emitted assoc id (delay (info comment)))
+    `(do
+       (force (get @deprecations-emitted ~id))
+       ~@body)))

 (def hostname-refresh-interval
   "How often to allow shelling out to hostname (1), in seconds."


CMR-4307: Addressed the PR comments.

CMR-4307: Addressed the PR comments.

--- search-app/src/cmr/search/services/humanizers/humanizer_report_service.clj
+++ search-app/src/cmr/search/services/humanizers/humanizer_report_service.clj
@@ -53,7 +53,7 @@
    to be populated in the event when the delay is not long enough."
   {:default 60000 :type Long}) ;; one minute

-(defconfig humanizer-report-generator-job-retry-number
+(defconfig retry-count
   "Number of times humanizer-report-generator-job retries to get the collections
    from collection cache."
   {:default 20 :type Long})
@@ -76,24 +76,17 @@

 (defn- wait-and-retry-for-collection-cache
   "Wait configurable number of milli seconds before retrying configurable number of times
-   to get all the collections from collection cache. If collections are still not present, throw warning."
-  [context]
-  (info (format "Collection cache is not populated after %d seconds of delay"
-                (humanizer-report-generator-job-delay)))
-  ;; sleep, retry 19 times, then sleep and retry one last time.
-  (Thread/sleep (humanizer-report-generator-job-wait))
-  (let [a (atom (- (humanizer-report-generator-job-retry-number) 1))]
-    (while (and (pos? @a) (not (seq (metadata-cache/all-cached-revision-format-maps context))))
-      (info (format "Humanizer report generator job is sleeping for %d milli-seconds before retry"
-                    (humanizer-report-generator-job-wait)))
-      (Thread/sleep (humanizer-report-generator-job-wait))
-      (swap! a dec)))
-  (let [rfms (metadata-cache/all-cached-revision-format-maps context)]
-    (if (seq rfms)
-      rfms
-      (warn (format "Collection cache is not populated after %d seconds of delay and %d times of retry."
-                    (humanizer-report-generator-job-delay)
-                    (humanizer-report-generator-job-retry-number))))))
+   to get all the collections from collection cache."
+  [count context]
+  (when (< count (retry-count))
+    (info (format (str "Humanizer report generator job is sleeping for %d milli-seconds"
+                       "before retrying to see if the collection cache is populated.")
+                  (humanizer-report-generator-job-wait)))
+    (Thread/sleep (humanizer-report-generator-job-wait))
+    (let [rfms (metadata-cache/all-cached-revision-format-maps context)]
+      (if (seq rfms)
+        rfms
+        (recur (inc count) context)))))

 (defn- get-all-collections
   "Retrieves all collections from the Metadata cache, partitions them into batches of size
@@ -104,10 +97,17 @@
   (let [rfms (metadata-cache/all-cached-revision-format-maps context)
         rfms (if (seq rfms)
                rfms
-               (wait-and-retry-for-collection-cache context))]
-    (map
-     #(rfms->umm-collections context %)
-     (partition-all (humanizer-report-collection-batch-size) rfms))))
+               (do
+                 (info (format "Collection cache is not populated after %d seconds of delay"
+                               (humanizer-report-generator-job-delay)))
+                 (wait-and-retry-for-collection-cache 0 context)))]
+    (if (seq rfms)
+      (map
+        #(rfms->umm-collections context %)
+        (partition-all (humanizer-report-collection-batch-size) rfms))
+      (warn (format "Collection cache is not populated after %d seconds of delay and %d times of retry."
+                    (humanizer-report-generator-job-delay)
+                    (retry-count))))))

 (defn humanized-collection->reported-rows
   "Takes a humanized collection and returns rows to populate the CSV report."


Use select-lquery instead of select-path

It was renamed.

--- src/vip/data_processor/validation/v5/electoral_district.clj
+++ src/vip/data_processor/validation/v5/electoral_district.clj
@@ -34,7 +34,7 @@
 (defn valid-type? [type] (types type))

 (defn validate-type-formats [{:keys [import-id] :as ctx}]
-  (let [imported-types (util/select-path
+  (let [imported-types (util/select-lquery
                         import-id
                         "VipObject.0.ElectoralDistrict.*{1}.Type.*{1}")
         invalid-types (remove (comp valid-type? :value) imported-types)]


Make new api compatible with old

Make new api compatible with old

--- test/clojure/clojurewerkz/cassaforte/new_query_api_test.clj
+++ test/clojure/clojurewerkz/cassaforte/new_query_api_test.clj
@@ -175,74 +175,66 @@

   (is (= "INSERT INTO foo(asd) VALUES ('bsd');"
          (insert :foo
-                 (value "asd" "bsd"))))
+                 {"asd" "bsd"})))
   (is (= "INSERT INTO foo(asd) VALUES ('bsd');"
          (insert :foo
-                 (values ["asd"] ["bsd"]))))
+                 {"asd" "bsd"})))

   (is (= "INSERT INTO foo(asd) VALUES ('bsd');"
          (insert :foo
-                 (values {"asd" "bsd"}))))
+                 {"asd" "bsd"})))

   (is (= "INSERT INTO foo(a,b,\"C\",d) VALUES (123,'127.0.0.1','foo''bar',{'x':3,'y':2}) USING TIMESTAMP 42 AND TTL 24;"
          (insert :foo
-                 (value "a" 123)
-                 (value "b" (java.net.InetAddress/getByName "127.0.0.1"))
-                 (value (quote* "C") "foo'bar")
-                 (value "d" (array-map "x" 3 "y" 2))
-                 (using (array-map :timestamp 42
-                                   :ttl       24))
-
-                 )))
-
-  (is (= "INSERT INTO foo(a,b,\"C\",d) VALUES (123,'127.0.0.1','foo''bar',{'x':3,'y':2}) USING TIMESTAMP 42 AND TTL 24;"
-         (insert :foo
-                 (value "a" 123)
-                 (value "b" (java.net.InetAddress/getByName "127.0.0.1"))
-                 (value (quote* "C") "foo'bar")
-                 (value "d" {"x" 3 "y" 2})
+                 (array-map "a"          123
+                            "b"          (java.net.InetAddress/getByName "127.0.0.1")
+                            (quote* "C") "foo'bar"
+                            "d"          (array-map "x" 3 "y" 2))
                  (using (array-map :timestamp 42
                                    :ttl       24)))))

-  (is (= "INSERT INTO foo(a,b) VALUES ({2,3,4},3.4) USING TIMESTAMP 42 AND TTL 24;"
-         (insert :foo
-                 (values ["a" "b"]
-                         [(sorted-set 2 3 4) 3.4])
+  (is (= "INSERT INTO foo(a,b,\"C\",d) VALUES (123,'127.0.0.1','foo''bar',{'x':3,'y':2}) USING TIMESTAMP 42 AND TTL 24;"
+         (insert :foo
+                 (array-map "a"          123
+                            "b"          (java.net.InetAddress/getByName "127.0.0.1")
+                            (quote* "C") "foo'bar"
+                            "d"          {"x" 3 "y" 2})
                  (using (array-map :timestamp 42
                                    :ttl       24)))))

+  (is (= "INSERT INTO foo(a,b) VALUES ({2,3,4},3.4) USING TIMESTAMP 42 AND TTL 24;"
+         (insert :foo
+                 (array-map "a" (sorted-set 2 3 4)
+                            "b" 3.4)
+                 (using (array-map :timestamp 42
+                                   :ttl       24)))))
+
   (is (= "INSERT INTO foo(a,b) VALUES ({2,3,4},3.4) USING TTL ? AND TIMESTAMP ?;"
          (insert :foo
-                 (values [:a :b]
-                         [(sorted-set 2 3 4) 3.4])
+                 (array-map :a (sorted-set 2 3 4)
+                            :b 3.4)
                  (using (array-map :ttl       (?)
                                    :timestamp (?))))))

   (is (= "INSERT INTO foo(c,a,b) VALUES (123,{2,3,4},3.4) USING TIMESTAMP 42;"
          (insert :foo
-                 (value :c 123)
-                 (values [:a :b]
-                         [(sorted-set 2 3 4) 3.4]
-                         )
+                 (array-map :c 123
+                            :a (sorted-set 2 3 4)
+                            :b 3.4)
                  (using {:timestamp 42}))))

-  (is (thrown? IllegalArgumentException
-               (insert :foo
-                       (values [:a :b]
-                               [1 2 3]))))
-
   (is (= "INSERT INTO foo(k,x) VALUES (0,1) IF NOT EXISTS;";
          (insert :foo
-                 (value :k 0)
-                 (value :x 1)
+                 (array-map :k 0
+                            :x 1)
                  (if-not-exists))))

   (is (= "INSERT INTO foo(k,x) VALUES (0,(1));";
          (insert :foo
-                 (value :k 0)
-                 (value :x (tuple-of [:int] [(int 1)])))))
+                 (array-map :k 0
+                            :x (tuple-of [:int] [(int 1)])))))

   (is (= "UPDATE foo USING TIMESTAMP 42 SET a=12,b=[3,2,1],c=c+3 WHERE k=2;"
          (update :foo
@@ -382,11 +374,11 @@
          (batch
           (queries
            (insert :foo
-                   (value "asd" "bsd"))
+                   {"asd" "bsd"})
            (insert :foo
-                   (value "asd" "bsd"))
+                   {"asd" "bsd"})
            (insert :foo
-                   (value "asd" "bsd"))))))
+                   {"asd" "bsd"})))))

   (is (= (str "BEGIN COUNTER BATCH USING TIMESTAMP 42 "
               "UPDATE foo SET a=a+1;"


ARM: at91: remove useless Makefile.boot

ARM: at91: remove useless Makefile.boot

Makefile.boot is not used anymore, remove it.

Signed-off-by: Alexandre Belloni <a7228e626ecf0022ac91fc1cd8db88e71d0e5e0e@free-electrons.com>
Acked-by: Nicolas Ferre <45b517be0e5ec6dc3a39715767c1d18e090d39b4@atmel.com>

--- arch/arm/mach-at91/Makefile.boot
+++ arch/arm/mach-at91/Makefile.boot
@@ -1,8 +0,0 @@
-# Note: the following conditions must always be true:
-#   ZRELADDR == virt_to_phys(TEXTADDR)
-#   PARAMS_PHYS must be within 4MB of ZRELADDR
-#   INITRD_PHYS must be in RAM
-
-   zreladdr-y	+= 0x20008000
-params_phys-y	:= 0x20000100
-initrd_phys-y	:= 0x20410000


runner no longer needed

runner no longer needed

--- test/runner.clj
+++ test/runner.clj
@@ -1,5 +0,0 @@
-(require 'tests
-         'tests.internal)
-
-(clojure.test/run-tests 'redis.tests
-                        'redis.tests.internal)


shorten line

shorten line

--- src/vigil/core.clj
+++ src/vigil/core.clj
@@ -68,4 +68,5 @@

 (dire/with-handler! #'sally-forth
   {:precondition :in-game}
-  (fn [e & args] (->error "attacking-player and target-team must both be in game.")))
+  (fn [e & args]
+    (->error "attacking-player and target-team must both be in game.")))


Added fetch-one function

Added fetch-one function

--- src/suricatta/core.clj
+++ src/suricatta/core.clj
@@ -72,6 +72,8 @@
   ([q] (proto/fetch q nil {}))
   ([ctx q] (proto/fetch q ctx {}))
   ([ctx q opts] (proto/fetch q ctx opts)))
+
+(def fetch-one (comp first fetch))

 (defn query
   "Mark a query for reuse the prepared statement.


Fix clojure.jdbc 0.3 compatibility.

Fix clojure.jdbc 0.3 compatibility.

--- src/suricatta/impl.clj
+++ src/suricatta/impl.clj
@@ -1,6 +1,7 @@
 (ns suricatta.impl
   (:require [jdbc.core :as jdbc]
             [jdbc.types :as jdbctypes]
+            [jdbc.proto :as jdbcproto]
             [suricatta.types :as types]
             [suricatta.proto :as proto])
   (:import org.jooq.impl.DSL
@@ -178,14 +179,14 @@
 ;; clojure.jdbc interoperability
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(extend-protocol jdbctypes/ISQLStatement
+(extend-protocol jdbcproto/ISQLStatement
   Query
   (normalize [q conn options]
     (let [dialect (JDBCUtils/dialect (:connection conn))]
       (-> (apply vector
                  (proto/get-sql q :indexed dialect)
                  (proto/get-bind-values q))
-          (jdbctypes/normalize conn options))))
+          (jdbcproto/normalize conn options))))

   ResultQuery
   (normalize [q conn options]
@@ -193,4 +194,4 @@
       (-> (apply vector
                  (proto/get-sql q :indexed dialect)
                  (proto/get-bind-values q))
-          (jdbctypes/normalize conn options)))))
+          (jdbcproto/normalize conn options)))))


CMR-1078: Refactored code.

CMR-1078: Refactored code.

--- system-int-test/test/cmr/system_int_test/ingest/collection_ingest_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/collection_ingest_test.clj
@@ -49,32 +49,20 @@
       (is (apply = (map :concept-id created-concepts)))
       (is (= (range 1 (inc n)) (map :revision-id created-concepts))))))

-(defn- verify-format-ingested-and-searchable
-  [identifier coll-format]
-  (let [coll (d/ingest "PROV1"
-                       (dc/collection {:entry-id "S1"
-                                       :short-name "S1"
-                                       :version-id "V1"
-                                       :entry-title "ET1"
-                                       :long-name "L4"
-                                       :summary (name coll-format)})
-                       coll-format)
-        {:keys [concept-id revision-id]} coll]
-
-    (when (seq @identifier)
-      (is (= {:concept-id concept-id :revision-id (dec revision-id)}
-             @identifier)))
-
-    (index/refresh-elastic-index)
-    (is (= 1 (:hits (search/find-refs :collection {:keyword (name coll-format)}))))
-
-    (swap! identifier assoc :concept-id concept-id :revision-id revision-id)))
-
 (deftest update-collection-with-different-formats-test
   (testing "update collection in different formats ..."
-    (let [identifier (atom {})]
-      (doseq [coll-format [:echo10 :dif :iso19115 :iso-smap]]
-        (verify-format-ingested-and-searchable identifier coll-format)))))
+    (doseq [[expected-rev coll-format] (map-indexed #(vector (inc %1) %2) [:echo10 :dif :iso19115 :iso-smap])]
+      (let [coll (d/ingest "PROV1"
+                           (dc/collection {:entry-id "S1"
+                                           :short-name "S1"
+                                           :version-id "V1"
+                                           :entry-title "ET1"
+                                           :long-name "L4"
+                                           :summary (name coll-format)})
+                           coll-format)]
+        (index/refresh-elastic-index)
+        (is (= expected-rev (:revision-id coll)))
+        (is (= 1 (:hits (search/find-refs :collection {:keyword (name coll-format)}))))))))

 ;; Verify ingest behaves properly if empty body is presented in the request.
 (deftest empty-collection-ingest-test


Adding things works

Adding things works

--- src/ts_layout/core.clj
+++ src/ts_layout/core.clj
@@ -16,6 +16,9 @@
 (defn reload []
   (rr/redirect "/boxes"))

+(defn get-form-param [body param]
+  (get (rc/form-decode body) param))
+
 (defroutes app
   (context "/boxes/:index" [index :<< as-int]
            (GET "/up" [] (do
@@ -27,7 +30,10 @@
            (GET "/delete" [] (do
                                (persist!  (m/delete-box @boxes index))
                               (reload))))
-  (POST "/boxes/add" {body :body} (persist! (m/add-box @boxes (get (rc/form-decode (slurp body)) "url")))
+  (POST "/boxes/add"
+        {body-stream :body} (let [body (slurp body-stream)]
+                              (persist!
+                               (m/add-box @boxes (get-form-param body "url"))))
         (reload))
   (GET "/boxes" []  (v/page (map-indexed v/draw-box @boxes)))
   (GET "/:number" [number :<< as-int]


Minor cleanup

Minor cleanup

--- src/tttclj/render.cljs
+++ src/tttclj/render.cljs
@@ -2,8 +2,7 @@
   (:require [quiescent :as q :include-macros true]
             [quiescent.dom :as d]))

-
-(def state {:tiles [:x :o :-
+(def state {:tiles [:x :o :-
                     :x :- :o
                     :- :x :o]
             :player :x})


Fix copy data from other WS (#904)

Fix copy data from other WS (#904)

--- src/cljs/main/broadfcui/page/workspace/data/copy_data_entities.cljs
+++ src/cljs/main/broadfcui/page/workspace/data/copy_data_entities.cljs
@@ -32,10 +32,10 @@
             "Please select at least one entity to copy"])
          [:div {:style {:marginTop "1em"}}
           [comps/Button {:text "Import"
-                         :onClick #(let [selected (react/call :get-selected-entities (@refs "EntitySelector"))]
+                         :onClick #(let [selected ((@refs "EntitySelector") :get-selected-entities)]
                                      (if (empty? selected)
                                        (swap! state assoc :selection-error true)
-                                       (react/call :perform-copy this selected)))}]]]]))
+                                       (this :perform-copy selected)))}]]]]))
    :perform-copy
    (fn [{:keys [props state this]} selected re-link?]
      (swap! state assoc :selection-error nil :server-error nil :copying? true)
@@ -43,13 +43,13 @@
       {:endpoint (endpoints/copy-entity-to-workspace (:workspace-id props) re-link?)
        :payload {:sourceWorkspace (:selected-workspace-id props)
                  :entityType (:type props)
-                 :entityNames (map #(% "name") selected)}
+                 :entityNames (map :name selected)}
        :headers utils/content-type=json
        :on-done (fn [{:keys [success? get-parsed-response]}]
                   (swap! state dissoc :copying?)
                   (when success?
                     ((:on-data-imported props) (:type props)))
-                  (react/call :show-import-result this (get-parsed-response false) selected))}))
+                  (this :show-import-result (get-parsed-response false) selected))}))
    :show-import-result
    (fn [{:keys [this props]} parsed-response selected]
      (let [formatted-response (walk/postwalk
@@ -125,7 +125,7 @@
                       {:text "Re-link"
                        :onClick (fn []
                                   (modal/pop-modal)
-                                  (react/call :perform-copy this selected true))}
+                                  (this :perform-copy selected true))}
                       "OK")})))})

@@ -143,7 +143,7 @@
        :else [:div {:style {:textAlign "center"}} [comps/Spinner {:text "Loading entities..."}]]))
    :component-did-mount
    (fn [{:keys [this]}]
-     (react/call :load-entities this))
+     (this :load-entities))
    :load-entities
    (fn [{:keys [state props]}]
      (endpoints/call-ajax-orch


Remove extra ERROR in reflection warnings

This fixes #64

--- modules/gradle-clojure-tools/src/main/clojure/gradle_clojure/tools/clojure_compiler.clj
+++ modules/gradle-clojure-tools/src/main/clojure/gradle_clojure/tools/clojure_compiler.clj
@@ -34,7 +34,7 @@
       (doseq [namespace namespaces]
         (compile (symbol namespace))))
     (if (reflection? compile-options)
-      (throw (ex-info (str "ERROR: Reflection warnings found: " @reflection) {})))
+      (throw (ex-info (str "Reflection warnings found: " @reflection) {})))
     (catch Throwable e
       (binding [*out* *err*]
         (loop [ex e]


fix reference to table

fix reference to table

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@10172 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- plugins/DataBrowser/src/org/micromanager/browser/core.clj
+++ plugins/DataBrowser/src/org/micromanager/browser/core.clj
@@ -203,7 +203,7 @@
         selected-rows (.getSelectedRows table)
         selected-paths (set (map row-index-to-path selected-rows))]
     (.. table getModel fireTableDataChanged)
-    (when (pos? (.getRowCount t))
+    (when (pos? (.getRowCount table))
       (doseq [selected-row selected-rows]
         (.addRowSelectionInterval table selected-row selected-row)))))


Add predicate to test for connection

Add predicate to test for connection

--- src/clj_chrome_devtools/impl/connection.clj
+++ src/clj_chrome_devtools/impl/connection.clj
@@ -8,6 +8,9 @@
             [clojure.string :as str]))

 (defrecord Connection [ws-connection requests event-chan event-pub])
+
+(defn connection? [c]
+  (instance? Connection c))

 (defonce current-connection (atom nil))


Auto sort by dato

Auto sort by dato

--- src/clj_simple_chart/ssb/data/ssb_parse.clj
+++ src/clj_simple_chart/ssb/data/ssb_parse.clj
@@ -43,6 +43,7 @@
                               [] row))]
     {:data    (->> (:data pulled)
                    (mapcat explode-row)
+                   (sort-by :dato)
                    (vec))
      :columns (vec (sort (concat regular-cols (vec (distinct (vals (row-with-time->generic-row table)))))))}))


Fix heart example. It had 2 top-level variables 'heart'.

--- src/cljs/main/quil_site/examples/heart.cljs
+++ src/cljs/main/quil_site/examples/heart.cljs
@@ -6,7 +6,7 @@

 (def period 7)

-(defn heart [s t]
+(defn heart-point [s t]
   (let [x (* s (* 16 (q/pow (Math/sin t) 3)))
         y (* s (- (* 13 (q/cos t))
                   (* 5 (q/cos (* 2 t)))
@@ -24,7 +24,7 @@

 (defn setup []
   (q/frame-rate 20)
-  {:points (mapv (partial heart (/ (q/height) 40))
+  {:points (mapv (partial heart-point (/ (q/height) 40))
                  (range 0 10 0.1))
    :scaling-function contraction
    :counter period})


redesigned stack resource counts

redesigned stack resource counts

--- src/cljs/swarmpit/component/stack/info.cljs
+++ src/cljs/swarmpit/component/stack/info.cljs
@@ -159,6 +159,12 @@
       {:formatter (fn [value name props]
                     (.-state (.-payload props)))})))

+(defn- resource-chip
+  [name count]
+  (when (< 0 count)
+    [:p (comp/chip {:avatar (comp/avatar {} count)
+                    :label  (inflect/pluralize-noun count name)})]))
+
 (rum/defc form-general < rum/static [stack-name stackfile {:keys [services networks volumes configs secrets]}]
   (comp/card
     {:className "Swarmpit-form-card"
@@ -171,20 +177,27 @@
                     (form-actions stack-name stackfile)
                     :stackGeneralMenuAnchor
                     :stackGeneralMenuOpened)})
-    (comp/card-content
-      {:key "fgccc"}
-      (rum/with-key (form-services-graph services) "fgcccg"))
-    (comp/card-content
-      {:key "fgccci"}
-      (html
-        [:div {:key "ngcccid"}
-         [:span "Networks: " [:b (count networks)]]
-         [:br]
-         [:span "Volumes: " [:b (count volumes)]]
-         [:br]
-         [:span "Configs: " [:b (count configs)]]
-         [:br]
-         [:span "Secrets: " [:b (count secrets)]]]))
+    (comp/grid
+      {:container true
+       :spacing   16}
+      (comp/grid
+        {:item true
+         :key  "sgg"
+         :xs   6}
+        (comp/card-content
+          {:key "fgccc"}
+          (rum/with-key (form-services-graph services) "fgcccg")))
+      (comp/grid
+        {:item true
+         :key  "sgg"
+         :xs   6}
+        (comp/card-content
+          {:key "fgccci"}
+          (html [:div {:key "ngcccid"}
+                 (resource-chip "network" (count networks))
+                 (resource-chip "volume" (count volumes))
+                 (resource-chip "config" (count configs))
+                 (resource-chip "secret" (count secrets))]))))
     (comp/divider
       {:key "fgd"})
     (comp/card-content


CMR-3154: Added additional tests for searching for ACLs by group permission

--- access-control-app/int_test/cmr/access_control/int_test/acl_search_test.clj
+++ access-control-app/int_test/cmr/access_control/int_test/acl_search_test.clj
@@ -187,6 +187,8 @@
         registered-acls [acl2 acl5 acl8]
         AG12345-acls [acl3 acl6]
         AG10000-acls [acl8]
+        read-acls [acl2]
+        create-acls [acl1 acl3 acl4 acl5 acl6 acl7 acl8]
         all-acls (concat guest-acls registered-acls AG12345-acls)]
     (u/wait-until-indexed)

@@ -206,7 +208,17 @@
            ["AG12345-PROV" "AG10000-PROV"] (concat AG12345-acls AG10000-acls)
            ["guest" "registered" "AG12345-PROV" "AG10000-PROV"] all-acls))

-    (testing "Search ACLs by permitted group with specific permission"
+    (testing "Search ACLs by permitted group with options"
+      (are [permitted-groups options acls]
+           (let [response (ac/search-for-acls (u/conn-context)
+                                              (merge {:permitted-group permitted-groups} options))]
+             (= (acls->search-response (count acls) acls)
+                (dissoc response :took)))
+
+           ["GUEST"] {"options[permitted_group][ignore_case]" true} guest-acls
+           ["GUEST"] {"options[permitted_group][ignore_case]" false} []))
+
+    (testing "Search ACLs by group permission"
       (are3 [group-permissions acls]
            (let [[query-map _] (reduce (fn [[m count] [group permission]]
                                          [(assoc-in m
@@ -228,7 +240,7 @@
            ["guest" "read"] []

            "Registered read"
-           ["registered" "read"] [acl2]
+           ["registered" "read"] read-acls

            "Registered create"
            ["registered" "create"] [acl5 acl8]
@@ -249,15 +261,27 @@
            "Registered read or group AG12345-PROV create"
            ["registered" "read" "AG12345-PROV" "create"] (conj AG12345-acls acl2)))

-    (testing "Search ACLs by permitted group with options"
-      (are [permitted-groups options acls]
-           (let [response (ac/search-for-acls (u/conn-context)
-                                              (merge {:permitted-group permitted-groups} options))]
-             (= (acls->search-response (count acls) acls)
-                (dissoc response :took)))
-
-           ["GUEST"] {"options[permitted_group][ignore_case]" true} guest-acls
-           ["GUEST"] {"options[permitted_group][ignore_case]" false} []))
+    ;; CMR-3154 acceptance criterium 3
+    (testing "Search ACLs by group permission just group or permission"
+      (are3 [query-map acls]
+        (let [response (ac/search-for-acls (u/conn-context) {:group-permission query-map})]
+          (is (= (acls->search-response (count acls) acls)
+                 (dissoc response :took))))
+        "Just user type"
+        {:permitted-group "guest"} guest-acls
+
+        "Just group"
+        {:permitted-group "AG10000-PROV"} AG10000-acls
+
+        "Just read permission"
+        {:permission "read"} read-acls
+
+        "Just create permission"
+        {:permission "create"} create-acls))
+
+
+
+

     (testing "Search ACLs by permitted group with invalid values"
       (are [permitted-groups invalid-msg]


make the bot more verbose

make the bot more verbose

--- src/vindinium/core.clj
+++ src/vindinium/core.clj
@@ -39,17 +39,17 @@
     (let [next (request (:playUrl input) {:dir (bot input)})]
       (if (:finished (:game next)) (println "") (recur next)))))

-(defn training [turns]
-  (let [input (request (str server-url "/api/training") {:key server-key :turns turns})]
-    (println (str "Starting training game " + (:viewUrl input)))
+(defn training [secret-key turns]
+  (let [input (request (str server-url "/api/training") {:key secret-key :turns turns})]
+    (println (str "Starting training game " (:viewUrl input)))
     (step input)
-    (println (str "Finished training game " + (:viewUrl input)))))
+    (println (str "Finished training game " (:viewUrl input)))))

-(defn arena [games]
+(defn arena [secret-key games]
   (loop [it 1]
     (let [p #(println (str "[" it "/" games "] " %))
           _ (p "Waiting for pairing...")
-          input (request (str server-url "/api/arena") {:key server-key})]
+          input (request (str server-url "/api/arena") {:key secret-key})]
       (p (str "Starting arena game " (:viewUrl input)))
       (step input)
       (p (str "Finished arena game " (:viewUrl input)))


fixing compilation

fixing compilation

--- src/vsphere/vijava.clj
+++ src/vsphere/vijava.clj
@@ -147,8 +147,6 @@
   {:pre [(tools-installed? hostname)]}
     (some-> (guest-info hostname) :guestState keyword))

-#_
-
 (defn power-on
   "Power on VM"
   [hostname]


Fixed a test case.

Fixed a test case.

--- src/asid.clj
+++ src/asid.clj
@@ -131,7 +131,7 @@
                      (mr/header "Accept" "application/vnd.org.asidentity.introduction+json")))
         intro-doc (json/read-str (:body req))]
     (:status req) => 200
-    (-> intro-doc :bag) => nil?))
+    (-> intro-doc (get "bag")) => nil?))

 (fact "/<wallet-id>/bag"
   (let [wallet (wr/save (w/new-wallet "seed") repo)


Exclude lang db with too few entries.

Exclude lang db with too few entries.


handler.clj: Various fixes.

handler.clj: Various fixes.

* src/wlmmap/handler.clj (wm-thumbnail-format-url): Fix typo in
formatting string.
(make-monuments-list): Fix number of argument for the mapped
anonymous function.
(process): Don't wrap the wcar* macro as an anonymous function.

--- src/wlmmap/handler.clj
+++ src/wlmmap/handler.clj
@@ -126,7 +126,7 @@
 (def toolserver-bbox-format-url
   "http://toolserver.org/~erfgoed/api/api.php?action=search&format=json&limit=5000&props=lat|lon|name|registrant_url|id|image|lang|monument_article&bbox=%s")
 (def wm-thumbnail-format-url
-  "")
+  "")
 (def wm-img-format-url
   "%s")
 (def wp-link-format-url
@@ -135,25 +135,26 @@
   "Source: %s")

 (defn- make-monuments-list [monuments]
-  (map #(when (and (not (nil? (:lat %)))
-                   (not (nil? (:lon %)))
-                   (not (or (nil? (:name %)) (= "" (:name %)))))
-          (let [reg (:registrant_url %)
-                id (:id %)
-                nam (cleanup-name (:name %))
-                imc (:image %)
+  (map (fn [m cnt]
+         (when (and (not (nil? (:lat m)))
+                    (not (nil? (:lon m)))
+                    (not (or (nil? (:name m)) (= "" (:name m)))))
+          (let [reg (:registrant_url m)
+                id (:id m)
+                nam (cleanup-name (:name m))
+                imc (:image m)
                 img (codec/url-encode imc)
-                lng (:lang %)
+                lng (:lang m)
                 emb (format wm-thumbnail-format-url img)
                 ilk (format wm-img-format-url img emb)
-                art (:monument_article %)
+                art (:monument_article m)
                 arl (format wp-link-format-url lng (codec/url-encode art) art)
                 src (format src-format-url reg id)
                 all (str "
" nam "
"
                          (when (not (= "" imc)) (str ilk "
"))
                          (when (not (= "" art)) (str arl "
"))
                          (when (not (= "" reg)) src))]
-            (list %2 (list (:lat %) (:lon %)) (= "" imc) all)))
+            (list cnt (list (:lat m) (:lon m)) (= "" imc) all))))
        monuments
        (range 100000)))

@@ -308,8 +309,8 @@
         rset (str cntry srlang)
         res (json/read-str (slurp req) :key-fn keyword)
         next (or (:srcontinue (:continue res)) "")]
-    (map #(wcar* (car/hset rset (first %) (rest %)))
-         (make-monuments-list (:monuments res)))
+    (doseq [l (make-monuments-list (:monuments res))]
+      (wcar* (car/hset rset (first l) (rest l))))
     (let [all (wcar* (car/hvals rset))
           size (count all)
           rep (first all)


CMR-5106 Adds test coverage

CMR-5106 Adds test coverage

--- system-int-test/test/cmr/system_int_test/search/acls/collection.clj
+++ system-int-test/test/cmr/system_int_test/search/acls/collection.clj
@@ -427,3 +427,30 @@
     (e/logout (s/context) user1-token)
     ;; The token should be cached
     (d/assert-refs-match [coll1] (search/find-refs :collection {:token user1-token}))))
+
+(deftest collection-search-changed-entry-titles-test
+  (let [group1-concept-id (e/get-or-create-group (s/context) "group1")
+        guest-token (e/login-guest (s/context))
+        user1-token (e/login (s/context) "user1" [group1-concept-id])
+        user2-token (e/login (s/context) "user2")
+        coll1 (d/ingest "PROV1" (dc/collection {:entry-title "coll1"
+                                                :native-id "coll1"}))
+        coll2 (d/ingest "PROV1" (dc/collection {:entry-title "coll2"
+                                                :native-id "coll2"}))
+        coll1-edited (-> coll1
+                         (assoc :entry-title "coll1-edited")
+                         (assoc :revision-id 2))]
+    (index/wait-until-indexed)
+    (e/grant-group (s/context) group1-concept-id (e/coll-catalog-item-id
+                                                   "PROV1" (e/coll-id ["coll1" "coll2"])))
+    (ingest/reindex-collection-permitted-groups (tc/echo-system-token))
+    (index/wait-until-indexed)
+    (d/assert-refs-match [coll1 coll2] (search/find-refs :collection {:token user1-token}))
+    (d/assert-refs-match [] (search/find-refs :collection {:token user2-token}))
+    (d/assert-refs-match [] (search/find-refs :collection {:token guest-token}))
+    (d/ingest "PROV1" (dc/collection {:entry-title "coll1-edited"
+                                      :native-id "coll1"}))
+    (index/wait-until-indexed)
+    (d/assert-refs-match [coll1-edited coll2] (search/find-refs :collection {:token user1-token}))
+    (d/assert-refs-match [] (search/find-refs :collection {:token user2-token}))
+    (d/assert-refs-match [] (search/find-refs :collection {:token guest-token}))))


CMR-4523: Updated test to use functions for better reporting when there is a test failure. (#330)

--- system-int-test/test/cmr/system_int_test/search/acls/collection.clj
+++ system-int-test/test/cmr/system_int_test/search/acls/collection.clj
@@ -1,12 +1,12 @@
 (ns cmr.system-int-test.search.acls.collection
   "Tests searching for collections with ACLs in place."
   (:require
+   [clojure.string :as str]
+   [clojure.test :refer :all]
+   [cmr.acl.acl-fetcher :as acl-fetcher]
    [cmr.common-app.test.side-api :as side]
-   [clojure.test :refer :all]
-   [clojure.string :as str]
-   [cmr.acl.acl-fetcher :as acl-fetcher]
    [cmr.common.services.messages :as msg]
-   [cmr.common.util :refer [are2] :as util]
+   [cmr.common.util :as util]
    [cmr.mock-echo.client.echo-util :as e]
    [cmr.system-int-test.data2.atom :as da]
    [cmr.system-int-test.data2.collection :as dc]
@@ -62,11 +62,10 @@
     (index/wait-until-indexed)

     ;;;;system token sees everything
-    (is (d/refs-match? [c1-echo c1-dif c1-dif10 c1-iso c1-smap]
-                       (search/find-refs :collection {:token (tc/echo-system-token)})))
+    (d/assert-refs-match [c1-echo c1-dif c1-dif10 c1-iso c1-smap]
+                         (search/find-refs :collection {:token (tc/echo-system-token)}))
     ;;guest user sees nothing
-    (is (d/refs-match? []
-                       (search/find-refs :collection {:token guest-token})))))
+    (d/assert-refs-match [] (search/find-refs :collection {:token guest-token}))))

 (deftest collection-search-with-restriction-flag-acls-test
   (let [guest-token (e/login-guest (s/context))
@@ -111,8 +110,8 @@
     (ingest/reindex-collection-permitted-groups (tc/echo-system-token))
     (index/wait-until-indexed)

-    (is (d/refs-match? [c1-echo c1-dif c1-dif10 c1-iso]
-                       (search/find-refs :collection {:token guest-token})))))
+    (d/assert-refs-match [c1-echo c1-dif c1-dif10 c1-iso]
+                         (search/find-refs :collection {:token guest-token}))))

 (deftest collection-search-with-acls-test
   (let [group1-concept-id (e/get-or-create-group (s/context) "group1")
@@ -180,47 +179,56 @@
     (e/grant-guest (s/context) (e/coll-catalog-item-id "PROV1" (e/coll-id ["coll1"])))
     (e/grant-guest (s/context) (e/coll-catalog-item-id "PROV1" (e/coll-id ["notexist"])))
     ;; restriction flag acl grants matches coll4
-    (e/grant-guest (s/context) (e/coll-catalog-item-id "PROV1" (e/coll-id ["coll4"] {:min-value 4 :max-value 6})))
+    (e/grant-guest (s/context) (e/coll-catalog-item-id
+                                "PROV1" (e/coll-id ["coll4"] {:min-value 4 :max-value 6})))

     ;; Grant undefined access values in prov3
-    (e/grant-guest (s/context) (e/coll-catalog-item-id "PROV3" (e/coll-id nil {:include_undefined_value true})))
+    (e/grant-guest (s/context) (e/coll-catalog-item-id
+                                "PROV3" (e/coll-id nil {:include_undefined_value true})))

     ;; all collections in prov2 granted to guests
     (e/grant-guest (s/context) (e/coll-catalog-item-id "PROV2"))
     ;; grant registered users permission to coll2 and coll4
-    (e/grant-registered-users (s/context) (e/coll-catalog-item-id "PROV1" (e/coll-id ["coll2" "coll4"])))
+    (e/grant-registered-users (s/context) (e/coll-catalog-item-id
+                                           "PROV1" (e/coll-id ["coll2" "coll4"])))
     ;; grant specific group permission to coll3, coll6, and coll8
-    (e/grant-group (s/context) group1-concept-id (e/coll-catalog-item-id "PROV1" (e/coll-id ["coll3"])))
-    (e/grant-group (s/context) group2-concept-id (e/coll-catalog-item-id "PROV2" (e/coll-id ["coll6" "coll8"])))
-    (e/grant-group (s/context) group3-concept-id (e/coll-catalog-item-id "PROV4"
-                                                         (e/coll-id ["coll11-entry-title" "coll12-entry-title"])))
+    (e/grant-group (s/context) group1-concept-id (e/coll-catalog-item-id
+                                                  "PROV1" (e/coll-id ["coll3"])))
+    (e/grant-group (s/context) group2-concept-id (e/coll-catalog-item-id
+                                                  "PROV2" (e/coll-id ["coll6" "coll8"])))
+    (e/grant-group (s/context) group3-concept-id (e/coll-catalog-item-id
+                                                  "PROV4" (e/coll-id ["coll11-entry-title"
+                                                                      "coll12-entry-title"])))

     (ingest/reindex-collection-permitted-groups (tc/echo-system-token))
     (index/wait-until-indexed)

     (testing "parameter search acl enforcement"
-      (are [token items]
-        (d/refs-match? items (search/find-refs :collection (when token {:token token})))
-
-        ;; not logged in should be guest
+      (util/are3 [token items]
+        (d/assert-refs-match items (search/find-refs :collection (when token {:token token})))
+
+        "not logged in should be guest"
         nil guest-permitted-collections

-        ;; login and use guest token
+        "login and use guest token"
         guest-token guest-permitted-collections

-        ;; test searching as a user
+        "test searching as a user"
         user1-token [coll2 coll4]

-        ;; Test searching with users in groups
+        "Test searching with users in groups - user2"
         user2-token [coll2 coll4 coll3]
+
+        "Test searching with users in groups - user3"
         user3-token [coll2 coll4 coll3 coll6 coll8]))

     (testing "token can be sent through a header"
-      (is (d/refs-match? [coll2 coll4]
-                         (search/find-refs :collection {} {:headers {"Echo-Token" user1-token}}))))
+      (d/assert-refs-match [coll2 coll4]
+                           (search/find-refs :collection {} {:headers {"Echo-Token" user1-token}})))
     (testing "aql search parameter enforcement"
-      (is (d/refs-match? [coll2 coll4]
-                         (search/find-refs-with-aql :collection [] {} {:headers {"Echo-Token" user1-token}}))))
+      (d/assert-refs-match [coll2 coll4]
+                           (search/find-refs-with-aql
+                            :collection [] {} {:headers {"Echo-Token" user1-token}})))
     (testing "Direct transformer retrieval acl enforcement"
       (testing "registered user"
         (d/assert-metadata-results-match
@@ -259,9 +267,10 @@
                          (str "collections.atom?token=" guest-token
                               "&page_size=100&concept_id="
                               (str/join "&concept_id=" concept-ids)))]
-          (is (= coll-atom (:results (search/find-concepts-atom :collection {:token guest-token
-                                                                             :page-size 100
-                                                                             :concept-id concept-ids})))))))
+          (is (= coll-atom (:results (search/find-concepts-atom
+                                      :collection {:token guest-token
+                                                   :page-size 100
+                                                   :concept-id concept-ids})))))))
     (testing "JSON ACL enforcement"
       (testing "all items"
         (let [coll-json (da/collections->expected-atom
@@ -277,9 +286,10 @@
                          (str "collections.json?token=" guest-token
                               "&page_size=100&concept_id="
                               (str/join "&concept_id=" concept-ids)))]
-          (is (= coll-json (:results (search/find-concepts-json :collection {:token guest-token
-                                                                             :page-size 100
-                                                                             :concept-id concept-ids})))))))
+          (is (= coll-json (:results (search/find-concepts-json
+                                      :collection {:token guest-token
+                                                   :page-size 100
+                                                   :concept-id concept-ids})))))))

     (testing "opendata ACL enforcement"
       (testing "all items"
@@ -295,8 +305,8 @@
           (od/assert-collection-opendata-results-match guest-permitted-collections actual-od))))

     (testing "all_revisions"
-      (are2 [collections params]
-        (d/refs-match? collections (search/find-refs :collection params))
+      (util/are3 [collections params]
+        (d/assert-refs-match collections (search/find-refs :collection params))

         ;; only old revisions satisfy ACL - they should not be returned
         "provider-id all-revisions=false"
@@ -334,7 +344,7 @@
       (index/wait-until-indexed)

       ;; before acls change
-      (is (d/refs-match? [coll1 coll3] (search/find-refs :collection {})))
+      (d/assert-refs-match [coll1 coll3] (search/find-refs :collection {}))

       ;; Grant collection 2
       (e/grant-guest (s/context) (e/coll-catalog-item-id "PROV1" (e/coll-id ["coll2"])))
@@ -342,14 +352,14 @@
       (e/ungrant (s/context) acl2)

       ;; Try searching again before the reindexing
-      (is (d/refs-match? [coll1 coll3] (search/find-refs :collection {})))
+      (d/assert-refs-match [coll1 coll3] (search/find-refs :collection {}))

       ;; Reindex collection permitted groups
       (ingest/reindex-collection-permitted-groups (tc/echo-system-token))
       (index/wait-until-indexed)

       ;; Search after reindexing
-      (is (d/refs-match? [coll1 coll2-2] (search/find-refs :collection {}))))
+      (d/assert-refs-match [coll1 coll2-2] (search/find-refs :collection {})))

     (testing "reindex all collections"

@@ -357,15 +367,15 @@
       (e/grant-guest (s/context) (e/coll-catalog-item-id "PROV2" (e/coll-id ["coll4"])))

       ;; Try before reindexing
-      (is (d/refs-match? [coll1 coll2-2] (search/find-refs :collection {})))
+      (d/assert-refs-match [coll1 coll2-2] (search/find-refs :collection {}))

       ;; Reindex all collections
-      ;; manually check the logs here. It should say it's reindexing provider 1 and provider 3 as well.
+      ;; Manually check the logs. It should say it's reindexing provider 1 and provider 3 as well.
       (ingest/reindex-all-collections)
       (index/wait-until-indexed)

       ;; Search after reindexing
-      (is (d/refs-match? [coll1 coll2-2 coll4] (search/find-refs :collection {}))))
+      (d/assert-refs-match [coll1 coll2-2 coll4] (search/find-refs :collection {})))

     ;; Tests reindexing using the force current version option
     (testing "Force version reindex all collections"
@@ -384,20 +394,19 @@
       (index/wait-until-indexed)
       (d/assert-refs-match [coll2-2] (search/find-refs :collection {:short-name "short2"}))

-      ;; A force reindex all collections will make elastic take the earlier version of the collections.
+      ;; A force reindex all collections will make elastic take the earlier version of the
+      ;; collections.
       (ingest/reindex-all-collections {:force-version true})
       (index/wait-until-indexed)
       (d/assert-refs-match [] (search/find-refs :collection {:short-name "short2"}))
       (d/assert-refs-match [coll2-1] (search/find-refs :collection {:short-name "short1"})))))

-
-
-
-;; Verifies that tokens are cached by checking that a logged out token still works after it was used.
-;; This isn't the desired behavior. It's just a side effect that shows it's working.
+;; Verifies that tokens are cached by checking that a logged out token still works after it was
+;; used. This isn't the desired behavior. It's just a side effect that shows it's working.
 (deftest cache-token-test
   (let [coll1 (d/ingest "PROV1" (dc/collection {:entry-title "coll1"}))
-        acl1 (e/grant-registered-users (s/context) (e/coll-catalog-item-id "PROV1" (e/coll-id ["coll1"])))
+        acl1 (e/grant-registered-users
+              (s/context) (e/coll-catalog-item-id "PROV1" (e/coll-id ["coll1"])))
         user1-token (e/login (s/context) "user1")
         user2-token (e/login (s/context) "user2")]

@@ -409,9 +418,9 @@
            (search/find-refs :collection {:token user2-token})))

     ;; Use user1-token so it will be cached
-    (is (d/refs-match? [coll1] (search/find-refs :collection {:token user1-token})))
+    (d/assert-refs-match [coll1] (search/find-refs :collection {:token user1-token}))

     ;; logout
     (e/logout (s/context) user1-token)
     ;; The token should be cached
-    (is (d/refs-match? [coll1] (search/find-refs :collection {:token user1-token})))))
+    (d/assert-refs-match [coll1] (search/find-refs :collection {:token user1-token}))))


Add back the edit, delete and labels management links for all authors of the current post board.

--- src/oc/storage/representations/entry.clj
+++ src/oc/storage/representations/entry.clj
@@ -316,17 +316,15 @@
                     member?)
                (concat [home-pin-link board-pin-link])
                ;; Edit/delete can be done by:
-               ;; - admins if the post is published
+               ;; - admin/authors if the post is published
                ;; - only the author if he has still author access to the board
                ;; In case the user was removed from the board they can still see the draft and copy the content
                ;; no edit/publish/delete though
                (and (not secure-access?)
-                    (= access-level :author)
                     (or (and (not draft?)
-                             (or (= role :admin)
-                                 entry-publisher?))
-                        (and draft?
-                             entry-author?)))
+                             (= role :admin))
+                        (= access-level :author) ;; Author access is already filtered based on post state: draft only the real author, published all authors
+                        entry-author?))
                (concat [(partial-update-link org-slug board-slug entry-uuid)
                         (delete-link org-slug board-slug entry-uuid)
                         (revert-link org-slug board-slug entry-uuid)])
@@ -357,10 +355,10 @@
                     entry-author?)
                (conj (publish-link org board entry-uuid))
                ;; Labels: multiple changes
-               (and member? (not secure-access?))
+               (and member? (not secure-access?) (= access-level :author))
                (conj (label-changes-link org board entry-uuid))
                ;; Label: partial add label link
-               (and member? (not secure-access?))
+               (and member? (not secure-access?) (= access-level :author))
                (concat [(add-label-link org board entry-uuid)
                         (remove-label-link org board entry-uuid)]))]
     (-> (if secure-access?


(maint) Normalize admin metric names

(maint) Normalize admin metric names

Prior to this commit some admin metrics were prefixed with default.default
while others were not. This commit removes this prefix and causes all
metrics under the puppetlabs.puppetdb.admin section to be identified by
the metric name only.

--- src/puppetlabs/puppetdb/cli/services.clj
+++ src/puppetlabs/puppetdb/cli/services.clj
@@ -227,18 +227,18 @@
    :cleaning (gauge-fn admin-metrics-registry ["cleaning"]
                        #(deref clean-status))

-   :node-expirations (counter admin-metrics-registry "node-expirations")
-   :node-purges (counter admin-metrics-registry "node-purges")
-   :report-purges (counter admin-metrics-registry "report-purges")
-   :resource-events-purges (counter admin-metrics-registry "resource-event-purges")
-   :package-gcs (counter admin-metrics-registry "package-gcs")
-   :other-cleans (counter admin-metrics-registry "other-cleans")
+   :node-expirations (counter admin-metrics-registry ["node-expirations"])
+   :node-purges (counter admin-metrics-registry ["node-purges"])
+   :report-purges (counter admin-metrics-registry ["report-purges"])
+   :resource-events-purges (counter admin-metrics-registry ["resource-event-purges"])
+   :package-gcs (counter admin-metrics-registry ["package-gcs"])
+   :other-cleans (counter admin-metrics-registry ["other-cleans"])

    :node-expiration-time (timer admin-metrics-registry ["node-expiration-time"])
    :node-purge-time (timer admin-metrics-registry ["node-purge-time"])
    :report-purge-time (timer admin-metrics-registry ["report-purge-time"])
    :resource-events-purge-time (timer admin-metrics-registry ["resource-events-purge-time"])
-   :package-gc-time (timer admin-metrics-registry "package-gc-time")
+   :package-gc-time (timer admin-metrics-registry ["package-gc-time"])
    :other-clean-time (timer admin-metrics-registry ["other-clean-time"])})

 (defn- clear-clean-status!


Fix 'Add operation' button layout. Add accordion around operation component.

--- src/cljs/hatnik/web/client/form/github_pull_request.cljs
+++ src/cljs/hatnik/web/client/form/github_pull_request.cljs
@@ -40,34 +40,52 @@
   (reify
     om/IRender
     (render [this]
-      (dom/div nil
-               (dom/div #js {:className "form-group"}
-                        (dom/label nil "file")
-                        (dom/input #js {:type "text"
-                                        :value (:file data)
-                                        :className "form-control"}))
-               (dom/div #js {:className "form-group"}
-                        (dom/label nil "regex")
-                        (dom/input #js {:type "text"
-                                        :value (:regex data)
-                                        :className "form-control"}))
-               (dom/div #js {:className "form-group"}
-                        (dom/label nil "replacement")
-                        (dom/input #js {:type "text"
-                                        :value (:replace data)
-                                        :className "form-control"}))))))
+      (dom/div
+       #js {:className "panel-group"
+            :id (str "gh-pull-req-op-" (:id data))}
+       (dom/div #js {:className "panel panel-default"}
+                (dom/div
+                 #js {:className "panel-heading"}
+                 (dom/h4 #js {:className "panel-title"}
+                         (dom/a #js {:data-toggle "collapse"
+                                     :data-parent (str "#gh-pull-req-op-" (:id data))
+                                     :href (str "#gh-pull-req-op-col-" (:id data))}
+                                (str "Operation №" (:id data)))))
+
+                (dom/div
+                 #js {:className "panel-collapse collapse in"
+                      :id (str "gh-pull-req-op-col-" (:id data))}
+                 (dom/div #js {:className "panel-body"}
+                          (dom/div #js {:className "form-group"}
+                                   (dom/label nil "file")
+                                   (dom/input #js {:type "text"
+                                                   :value (:file data)
+                                                   :className "form-control"}))
+                          (dom/div #js {:className "form-group"}
+                                   (dom/label nil "regex")
+                                   (dom/input #js {:type "text"
+                                                   :value (:regex data)
+                                                   :className "form-control"}))
+                          (dom/div #js {:className "form-group"}
+                                   (dom/label nil "replacement")
+                                   (dom/input #js {:type "text"
+                                                   :value (:replace data)
+                                                   :className "form-control"})))))))))

 (defn pull-request-operations-list [data owner]
   (reify
     om/IRender
     (render [this]
       (dom/div nil
-               (dom/div nil
-                        (dom/button
-                         #js {:className "btn btn-primary pull-right"}
-                         "Add operation"))
                (dom/div #js {:className "form-group"}
-                        (dom/label nil "Operations list")
+                        (dom/div #js {:className "row"}
+                                 (dom/div #js {:className "col-md-6"}
+                                          (dom/h4 nil "Operations list"))
+
+                                 (dom/div #js {:className "col-md-6"}
+                                          (dom/button #js {:className "btn btn-primary pull-right"}
+                                                      "Add operation")))
+
                         (om/build pull-request-operation
                                   {:id 1
                                    :file "hello.clj"


mooore testing

mooore testing

--- src/mafia_votecount/scraper/team_liquid.clj
+++ src/mafia_votecount/scraper/team_liquid.clj
@@ -158,7 +158,7 @@

 (defn- cycle-changes [indexed hosts]
   (filter #(and (is-host? % hosts) (is-cycle-change? (:message (val %))))
-          indexed))
+          (rest indexed)))

 (defn- dec-or-nil [num]
   (if (nil? num)


fix: reset valid-to for new-current and nested features

--- src/main/clojure/pdok/featured/timeline.clj
+++ src/main/clojure/pdok/featured/timeline.clj
@@ -185,6 +185,9 @@
 (defn- sync-valid-to [acc feature]
   (assoc acc :_valid_to (:validity feature)))

+(defn- reset-valid-to [acc]
+  (assoc acc :_valid_to nil))
+
 (defn- new-current-sql []
   (str "INSERT INTO " (qualified-current)
        " (dataset, collection, feature_id, version, valid_from, valid_to, feature, tiles)
@@ -327,9 +330,11 @@
             (if (t/before? (:_valid_from current) (:validity feature))
               (do ;(println "NOT-SAME")
                 (batched-history (sync-valid-to current feature))
-                (cache-batched-update (sync-valid-from new-current feature)))
+                ;; reset valid-to for new-current.
+                (cache-batched-update (reset-valid-to (sync-valid-from new-current feature))))
               (do ;(println "SAME")
-                (cache-batched-update (sync-valid-from new-current feature))))))
+                ;; reset valid-to because it might be closed because of nested features.
+                (cache-batched-update (reset-valid-to (sync-valid-from new-current feature)))))))
         (cache-batched-new (sync-valid-from (merge (init-root dataset root-col root-id) path feature) feature)))))
   (proj/change-feature [_ feature]
     ;; change can be the same, because a new nested feature validity change will also result in a new validity


CMR-3277 fixes unit test

CMR-3277 fixes unit test

--- access-control-app/test/cmr/access_control/test/services/permitted_concept_id_search.clj
+++ access-control-app/test/cmr/access_control/test/services/permitted_concept_id_search.clj
@@ -28,31 +28,35 @@
         concept-access-value-nil (mdb2/get-latest-concept (u/conn-context) concept-id-access-value-nil)]
     (testing "create permitted-concept-id conditions with access value 1"
       (is (= (gc/group-conds
-               :or
-               [(gc/group-conds
-                  :and
-                  [(common-qm/boolean-condition :collection-applicable true)
-                   (common-qm/boolean-condition :collection-identifier false)
-                   (common-qm/string-condition :provider "PROV1" false false)])
+               :and
+               [(common-qm/string-condition :provider "PROV1" false false)
                 (gc/group-conds
-                  :and
-                  [(common-qm/numeric-range-intersection-condition
-                     :collection-access-value-min
-                     :collection-access-value-max
-                     1.0
-                     1.0)
-                   (common-qm/boolean-condition :collection-applicable true)])])
+                  :or
+                  [(gc/group-conds
+                    :and
+                    [(common-qm/boolean-condition :collection-identifier false)
+                     (common-qm/boolean-condition :collection-applicable true)])
+                   (gc/group-conds
+                     :and
+                     [(common-qm/numeric-range-intersection-condition
+                        :collection-access-value-min
+                        :collection-access-value-max
+                        1.0
+                        1.0)
+                      (common-qm/boolean-condition :collection-applicable true)])])])
              (pcs/get-permitted-concept-id-conditions (u/conn-context) concept-access-value-1))))
     (testing "create permitted-concept-id conditions with access value nil"
       (is (= (gc/group-conds
-               :or
-               [(gc/group-conds
-                  :and
-                  [(common-qm/boolean-condition :collection-applicable true)
-                   (common-qm/boolean-condition :collection-identifier false)
-                   (common-qm/string-condition :provider "PROV1" false false)])
+               :and
+               [(common-qm/string-condition :provider "PROV1" false false)
                 (gc/group-conds
-                  :and
-                  [(common-qm/boolean-condition :collection-access-value-include-undefined-value true)
-                   (common-qm/boolean-condition :collection-applicable true)])])
+                  :or
+                  [(gc/group-conds
+                    :and
+                    [(common-qm/boolean-condition :collection-identifier false)
+                     (common-qm/boolean-condition :collection-applicable true)])
+                   (gc/group-conds
+                     :and
+                     [(common-qm/boolean-condition :collection-access-value-include-undefined-value true)
+                      (common-qm/boolean-condition :collection-applicable true)])])])
              (pcs/get-permitted-concept-id-conditions (u/conn-context) concept-access-value-nil))))))


fixed possible ClassNotFoundException in openjdk7

--- src/main/clojure/com/xebia/visualreview/service_util.clj
+++ src/main/clojure/com/xebia/visualreview/service_util.clj
@@ -15,7 +15,8 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (ns com.xebia.visualreview.service-util
-  (:require [slingshot.slingshot :as ex]))
+  (:require [slingshot.slingshot :as ex]
+            [taoensso.timbre :as timbre]))

 (defn get-message-from-object-or-exception
   [object-or-exception]
@@ -42,7 +43,7 @@
      (catch Object o#
        (let [exception-msg# (get-message-from-object-or-exception o#)]
          (do
-           (taoensso.timbre/log :debug (str "An error has occured and was caught as a service exception: " exception-msg#))
+           (timbre/log :debug (str "An error has occured and was caught as a service exception: " exception-msg#))
            (throw-service-exception (format ~err-msg exception-msg#) ~err-code))))))

 (defmacro assume


Ring stuff: Use namespace aliases

Ring stuff: Use namespace aliases

--- test/com/nomistech/clojure_the_language/c_800_libraries/s_800_web/ss_020_ring.clj
+++ test/com/nomistech/clojure_the_language/c_800_libraries/s_800_web/ss_020_ring.clj
@@ -1,15 +1,14 @@
 (ns com.nomistech.clojure-the-language.c-800-libraries.s-800-web.ss-020-ring
   (:require [clojure.string :as str]
             [midje.sweet :refer :all]
-            [ring.middleware.json :refer [wrap-json-body
-                                          wrap-json-response]]
-            [ring.util.response :refer [response]]))
+            [ring.middleware.json :as rmj]
+            [ring.util.response :as rur]))

 ;;;; ___________________________________________________________________________

 ;;;; NOTES
 ;;;; - In requests, "content-type: must be lower case, but `wrap-json-response`
-;;;;   produces "Content-Type". WTF?
+;;;;   produces (capitalised) "Content-Type". WTF?

 ;;;; ___________________________________________________________________________
 ;;;; ---- Request test helpers ----
@@ -25,10 +24,10 @@
 ;;;; ---- wrap-json-response ----

 (defn handler-001 [request]
-  (response {:foo "bar"}))
+  (rur/response {:foo "bar"}))

 (def app-001
-  (wrap-json-response handler-001))
+  (rmj/wrap-json-response handler-001))

 (fact "Handler with response whose body is Clojure data"
   (handler-001 {})
@@ -47,11 +46,11 @@

 (defn handler-002 [request]
   (let [user (get-in request [:body :user] "<no user specified>")]
-    (response (str "Uploaded '" user "'."))))
+    (rur/response (str "Uploaded '" user "'."))))

 (def app-002
-  (wrap-json-body handler-002 {:keywords? true
-                               :bigdecimals? true}))
+  (rmj/wrap-json-body handler-002 {:keywords? true
+                                   :bigdecimals? true}))

 (fact "Handler with request whose body is Clojure data"
   (handler-002 {:body {:user "Fred"}})


delete realm file if schemas are incompatible

Signed-off-by: Andrey Shovkoplyas <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/data_store/realm/core.cljs
+++ src/status_im/data_store/realm/core.cljs
@@ -22,21 +22,36 @@
     (when (cljs.core/exists? js/window)
       (rn-dependencies/realm. (clj->js options)))))

+(defn delete-realm
+  [file-name]
+  (.deleteFile rn-dependencies/realm (clj->js {:path file-name})))
+
 (defn close [realm]
   (when realm
     (.close realm)))

-(defn migrate [file-name schemas]
+(defn migrate-realm [file-name schemas]
   (let [current-version (realm-version file-name)]
     (doseq [schema schemas
             :when (> (:schemaVersion schema) current-version)
             :let [migrated-realm (open-realm schema file-name)]]
-      (close migrated-realm))))
+      (close migrated-realm)))
+  (open-realm (last schemas) file-name))
+
+(defn reset-realm [file-name schemas]
+  (delete-realm file-name)
+  (open-realm (last schemas) file-name))

 (defn open-migrated-realm
   [file-name schemas]
-  (migrate file-name schemas)
-  (open-realm (last schemas) file-name))
+  ;; TODO: remove for release 0.9.18
+  ;; delete the realm file if its schema version is higher
+  ;; than existing schema version (this means the previous
+  ;; install has incompatible database schemas)
+  (if (> (realm-version file-name)
+         (apply max (map :schemaVersion base/schemas)))
+    (reset-realm file-name schemas)
+    (migrate-realm file-name schemas)))

 (def new-account-filename "new-account")

@@ -88,25 +103,25 @@
   (.write realm f))

-(def transit-special-chars #{"~" "^" "`"})
+(def transit-special-chars #{"~" "^" "`"})
 (def transit-escape-char "~")

 (defn to-be-escaped?
-  "Check if element is a string that begins
+  "Check if element is a string that begins
    with a character recognized as special by Transit"
   [e]
   (and (string? e)
        (contains? transit-special-chars (first e))))

-(defn prepare-for-transit
+(defn prepare-for-transit
   "Following Transit documentation, escape leading special characters
-  in strings by prepending a ~. This prepares for subsequent
-  fetching from Realm where Transit is used for JSON parsing"
+  in strings by prepending a ~. This prepares for subsequent
+  fetching from Realm where Transit is used for JSON parsing"
   [message]
   (let [walk-fn (fn [e]
                   (cond->> e
-                           (to-be-escaped? e)
-                           (str transit-escape-char)))]
+                    (to-be-escaped? e)
+                    (str transit-escape-char)))]
     (walk/postwalk walk-fn message)))

 (defn create


typical-measured-depth-of-vertical

typical-measured-depth-of-vertical

--- src/test_utils/fracture_diagnostics.cljc
+++ src/test_utils/fracture_diagnostics.cljc
@@ -109,11 +109,20 @@
 (defn typical-vertical-depth-subsea
   ([] (typical-vertical-depth-subsea (rand-length-unit)))
   ([length-unit]
-   (let [typical-vertical-depth-in-feet
-         (fn [] (make-measurement (tuc/draw-normal 8000 1216) :ft))]
-     (condp = length-unit
-       :ft (typical-vertical-depth-in-feet)
-       :m (length-as (typical-vertical-depth-in-feet) :m)))))
+   (case length-unit
+     :ft (make-measurement (tuc/draw-normal 8000 1216) :ft)
+     :m (length-as (typical-vertical-depth-subsea) :m))))
+
+(defn typical-measured-depth-of-vertical
+  "Calculate the typical measured depth of the vertical portion of a well."
+  ([]
+   (let [length-unit (rand-length-unit)]
+     (typical-measured-depth-of-vertical length-unit)))
+  ([length-unit]
+   (case length-unit
+     ;; The value of 5280 feet was determined empirically; the standard deviation of 500 feet is just a guess. :)
+     :ft (make-measurement (tuc/draw-normal 5280 500) :ft)
+     :m (length-as (typical-measured-depth-of-vertical :ft) :m))))

 (defn typical-measured-depth
   ([] (typical-measured-depth (rand-length-unit)))
@@ -129,11 +138,9 @@
 (defn typical-toe-measured-depth
   ([] (typical-toe-measured-depth (rand-length-unit)))
   ([length-unit]
-   (let [typical-toe-measured-depth-in-feet
-         (fn [] (make-measurement (tuc/draw-normal 18000 1500) :ft))]
-     (condp = length-unit
-       :ft (typical-toe-measured-depth-in-feet)
-       :m (length-as (typical-toe-measured-depth-in-feet) :m)))))
+   (condp = length-unit
+     :ft (make-measurement (tuc/draw-normal 18000 1500) :ft)
+     :m (length-as (typical-toe-measured-measured-depth) :m))))

 (defn typical-stage-top
   ([] (typical-stage-top (rand-length-unit)))


Add ElectionAdministration to v5 validations

--- src/vip/data_processor/validation/v5.clj
+++ src/vip/data_processor/validation/v5.clj
@@ -6,7 +6,8 @@
             [vip.data-processor.validation.v5.source :as source]
             [vip.data-processor.validation.v5.retention-contest :as retention-contest]
             [vip.data-processor.validation.v5.state :as state]
-            [vip.data-processor.validation.v5.hours-open :as hours-open]))
+            [vip.data-processor.validation.v5.hours-open :as hours-open]
+            [vip.data-processor.validation.v5.election-administration :as election-admin]))

 (def validations
   [candidate/validate-no-missing-ballot-names
@@ -24,4 +25,6 @@
    source/validate-vip-id-valid-fips
    retention-contest/validate-no-missing-candidate-ids
    state/validate-no-missing-names
-   hours-open/validate-times])
+   hours-open/validate-times
+   election-admin/validate-no-missing-departments
+   election-admin/validate-voter-service-type-format])


Fix linking to join/login page from readonly

--- src/braid/core/client/gateway/forms/user_auth/events.cljs
+++ src/braid/core/client/gateway/forms/user_auth/events.cljs
@@ -80,7 +80,9 @@
                               (dispatch [::set-user user])
                               (dispatch [::set-csrf-token csrf-token]))
                :on-error (fn [_]
-                           (dispatch [::remote-check-public-group]))}}))
+                           (if (= (:action state) :join-group)
+                             (dispatch [::set-user nil])
+                             (dispatch [::remote-check-public-group])))}}))

 (reg-event-fx
   ::remote-check-public-group


Cosmetic changes

Cosmetic changes

--- test/node/replumb/require_node_test.cljs
+++ test/node/replumb/require_node_test.cljs
@@ -18,8 +18,8 @@
 (let [src-paths ["dev-resources/private/test/node/compiled/out"
                  "dev-resources/private/test/src/cljs"
                  "dev-resources/private/test/src/clj"
-                  "dev-resources/private/test/src/cljc"
-                  "dev-resources/private/test/src/js"]
+                 "dev-resources/private/test/src/cljc"
+                 "dev-resources/private/test/src/js"]
       target-opts (nodejs-options src-paths io/read-file!)
       validated-echo-cb (partial repl/validated-call-back! target-opts echo-callback)
       reset-env! (partial repl/reset-env! target-opts)


[#1102] Trim column titles on import

[#1102] Trim column titles on import

--- backend/src/akvo/lumen/import/csv.clj
+++ backend/src/akvo/lumen/import/csv.clj
@@ -75,7 +75,9 @@
   (let [reader (-> path io/input-stream AutoDetectReader.)
         data (csv/read-csv reader)
         column-count (get-column-count data)
-        column-titles (if headers? (first data) (gen-column-titles column-count))
+        column-titles (if headers?
+                        (map string/trim (first data))
+                        (gen-column-titles column-count))
         rows (if headers? (rest data) data)
         column-types (if guess-types?
                        (get-column-types rows)


Fix changed queue-config name in access-control-app

--- access-control-app/int_test/cmr/access_control/int_test/fixtures.clj
+++ access-control-app/int_test/cmr/access_control/int_test/fixtures.clj
@@ -24,7 +24,7 @@

 (defn queue-config
   []
-  (rmq-conf/merge-configs (mdb-config/rabbit-mq-config)
+  (rmq-conf/merge-configs (mdb-config/queue-config)
                           (access-control-config/rabbit-mq-config)))

 (defn create-memory-queue-broker


lein-release plugin: preparing 0.4.15 release

--- re_view/project.clj
+++ re_view/project.clj
@@ -1,4 +1,4 @@
-(defproject re-view "0.4.15-SNAPSHOT"
+(defproject re-view "0.4.15"
   :description "ClojureScript React Library"
   :url "https://www.github.com/braintripping/re-view/tree/master/re_view"
   :license {:name "Eclipse Public License"


lein-release plugin: preparing 0.4.9 release

--- re_view/project.clj
+++ re_view/project.clj
@@ -1,4 +1,4 @@
-(defproject re-view "0.4.9-SNAPSHOT"
+(defproject re-view "0.4.9"
   :description "ClojureScript React Library"
   :url "https://www.github.com/braintripping/re-view/tree/master/re_view"
   :license {:name "Eclipse Public License"


Adjusting tab

Adjusting tab

--- src-cljs/clj_fuzzy/metrics.cljs
+++ src-cljs/clj_fuzzy/metrics.cljs
@@ -7,12 +7,12 @@
 ;;   Version: 0.1
 ;;
 (ns clj-fuzzy.metrics
-    (:require clj-fuzzy.levensthein
-              clj-fuzzy.dice
-              clj-fuzzy.match-rating
-              clj-fuzzy.jaccard
-              clj-fuzzy.hamming
-              clj-fuzzy.jaro-winkler))
+  (:require clj-fuzzy.levensthein
+            clj-fuzzy.dice
+            clj-fuzzy.match-rating
+            clj-fuzzy.jaccard
+            clj-fuzzy.hamming
+            clj-fuzzy.jaro-winkler))

 (def ^:export levensthein clj-fuzzy.levensthein/distance)
 (def ^:export dice clj-fuzzy.dice/coefficient)


Add macro to DRY up exception handling in channel code.

--- frontend/utils.clj
+++ frontend/utils.clj
@@ -22,3 +22,14 @@
      (aset js/window "__global_time" (.getTime (js/Date.)))
      (prn (str ~label " elapsed time: " (- (.getTime (js/Date.)) start#) " ms, " global-time# " ms since last"))
      ret#))
+
+(defmacro swallow-errors
+  "wraps errors in a try/catch statement, logging issues to the console
+   and optionally rethrowing them if configured to do so."
+  [action]
+  `(try ~action
+        (catch js/Error e#
+          (merror e#)
+          (when (:rethrow-errors? initial-query-map)
+            (js* "debugger;")
+            (throw e#)))))


CMR-3557 Adds doc strings to query condition functions

--- common-app-lib/src/cmr/common_app/services/search/group_query_conditions.clj
+++ common-app-lib/src/cmr/common_app/services/search/group_query_conditions.clj
@@ -78,19 +78,21 @@
       (q/->ConditionGroup operation conditions))))

 (defn and-conds
-  "Combines conditions in an AND condition."
+  "Returns a condition representing conditions combined using a logical AND."
   [conditions]
   (group-conds :and conditions))

 (defn or-conds
-  "Combines conditions in an OR condition."
+  "Returns a condition representing conditions combined using a logical OR."
   [conditions]
   (group-conds :or conditions))

 (defn and
+  "Like and-conds but variadic."
   [& conds]
   (and-conds conds))

 (defn or
+  "Like or-conds but variadic."
   [& conds]
   (or-conds conds))


fix typo

fix typo

--- src/babel/francais/grammar.cljc
+++ src/babel/francais/grammar.cljc
@@ -404,7 +404,7 @@
                                           :tense :present}
                                     :cat :verb}})

-                   ;; [nous [être + naître]] => nous somme nées
+                   ;; [nous [être + naître]] => nous sommes nées
                    (unify h22
                           root-is-comp
                           head-present-infl


added s'enrager

added s'enrager

--- src/babel/francais/lexicon.cljc
+++ src/babel/francais/lexicon.cljc
@@ -640,7 +640,7 @@
    ;;                                     :3 {:cat :adverb
    ;;                                         :sem {:pred :bad}}}}})

-  "se endormir" (let [subject-semantics (atom {:human true})
+  "s'endormir" (let [subject-semantics (atom {:human true})
                     subject-agr (atom :top)]
                 {:synsem {:cat :verb
                           :essere true
@@ -655,7 +655,7 @@
                                        :reflexive true
                                        :sem subject-semantics}}}})

-  "se énerver" (let [subject-semantics (atom {:human true})
+  "s'énerver" (let [subject-semantics (atom {:human true})
                     subject-agr (atom :top)]
                 {:synsem {:cat :verb
                           :essere true
@@ -670,7 +670,7 @@
                                        :reflexive true
                                        :sem subject-semantics}}}})

-  "se ennuyer" (let [subject-semantics (atom {:human true})
+  "s'ennuyer" (let [subject-semantics (atom {:human true})
                     subject-agr (atom :top)]
                 {:synsem {:cat :verb
                           :essere true
@@ -687,6 +687,21 @@
                                        :reflexive true
                                        :sem subject-semantics}}}})

+ "s'enrager" (let [subject-semantics (atom {:human true})
+                    subject-agr (atom :top)]
+                {:synsem {:cat :verb
+                          :essere true
+                          :sem {:pred :get-angry
+                                :reflexive true
+                                :subj subject-semantics
+                                :obj subject-semantics}
+                          :subcat {:1 {:agr subject-agr
+                                       :sem subject-semantics}
+                                   :2 {:agr subject-agr
+                                       :pronoun true
+                                       :reflexive true
+                                       :sem subject-semantics}}}})
+
   "se lever" (let [subject-semantics (atom {:human true})
                     subject-agr (atom :top)]
                 {:synsem {:cat :verb


fix typo

fix typo

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -710,7 +710,7 @@
                                (clojure.java.io/resource "babel/italiano/lexicon.edn"))))

 (defn medium-plus-lexicon
-  "create a language model for English with the supplied lexicon."
+  "create a language model for Italian with the supplied lexicon."
   [lexicon]
   (let [debug (log/info "  loading lexicon..")
         debug (log/info "  filtering lexicon..")