Change versions in tests.

Change versions in tests.

--- test/clj/hatnik/worker/worker_integration_test.clj
+++ test/clj/hatnik/worker/worker_integration_test.clj
@@ -48,7 +48,7 @@
       (let [version (-> versions
                         (swap! update-in [library] inc)
                         (get library))]
-        (str "0." version ".2")))))
+        (str version ".0")))))

 (defn create-function-mock
   "Creates mock funciton which saves all arguments it called with into
@@ -120,16 +120,16 @@

   (are [v] (some #(= % v) args)
        ; Check that email for lib-2 release was sent 2 times.
-       ["foo@email.com" "Subject lib-2 0.3.2 0.2.2 Default {{not-used}}"
-        "Email lib-2 0.3.2 0.2.2 Default {{not-used}}"]
-       ["foo@email.com" "Subject lib-2 0.4.2 0.3.2 Default {{not-used}}"
-        "Email lib-2 0.4.2 0.3.2 Default {{not-used}}"]
+       ["foo@email.com" "Subject lib-2 3.0 2.0 Default {{not-used}}"
+        "Email lib-2 3.0 2.0 Default {{not-used}}"]
+       ["foo@email.com" "Subject lib-2 4.0 3.0 Default {{not-used}}"
+        "Email lib-2 4.0 3.0 Default {{not-used}}"]

        ; Check that email for lib-4 release was sent 2 times.
-       ["bar@email.com" "Subject bar lib-4 0.5.2 0.4.2 Default {{not-used}}"
-        "Email lib-4 0.5.2 0.4.2 Default {{not-used}}"]
-       ["bar@email.com" "Subject bar lib-4 0.6.2 0.5.2 Default {{not-used}}"
-        "Email lib-4 0.6.2 0.5.2 Default {{not-used}}"]))
+       ["bar@email.com" "Subject bar lib-4 5.0 4.0 Default {{not-used}}"
+        "Email lib-4 5.0 4.0 Default {{not-used}}"]
+       ["bar@email.com" "Subject bar lib-4 6.0 5.0 Default {{not-used}}"
+        "Email lib-4 6.0 5.0 Default {{not-used}}"]))

 (defn assert-github-issue-args
   "Validates that create-github-action was called with expected args."
@@ -141,13 +141,13 @@
        ; Github issue should be created for lib-3 2 times.
        {:user "someone"
         :repo "cool-repo"
-        :title "Title lib-3 0.4.2 0.3.2 Default {{not-used}}"
-        :body (str "Body lib-3 0.4.2 0.3.2 Default {{not-used}}"
+        :title "Title lib-3 4.0 3.0 Default {{not-used}}"
+        :body (str "Body lib-3 4.0 3.0 Default {{not-used}}"
                    "\n\nThis issue is created on behalf of @dummy-login")}
        {:user "someone"
         :repo "cool-repo"
-        :title "Title lib-3 0.5.2 0.4.2 Default {{not-used}}"
-        :body (str "Body lib-3 0.5.2 0.4.2 Default {{not-used}}"
+        :title "Title lib-3 5.0 4.0 Default {{not-used}}"
+        :body (str "Body lib-3 5.0 4.0 Default {{not-used}}"
                    "\n\nThis issue is created on behalf of @dummy-login")}))

 (defn run-worker
@@ -198,14 +198,14 @@
       (are [library version] (some #(and (= (:library %) library)
                                          (= (:last-processed-version %) version))
                                    foo-actions)
-           "lib-1" "0.3.2"
-           "lib-2" "0.4.2"
-           "lib-3" "0.5.2")
+           "lib-1" "3.0"
+           "lib-2" "4.0"
+           "lib-3" "5.0")

       (assert (= (count bar-actions) 1))
       (assert (and (= (:library (first bar-actions)) "lib-4")
                (= (:last-processed-version (first bar-actions))
-                  "0.6.2"))))))
+                  "6.0"))))))

 (deftest worker-integration-test
   (let [db (component/start (get-db))


CMR-2891 fixes tabbing of test

CMR-2891 fixes tabbing of test

--- access-control-app/int_test/cmr/access_control/int_test/acl_crud_test.clj
+++ access-control-app/int_test/cmr/access_control/int_test/acl_crud_test.clj
@@ -65,30 +65,30 @@

 (deftest create-system-level-acl-permission-test
   ;; Tests user permission to create system level acls
-    (let [token-user1 (e/login (u/conn-context) "user1")
-          guest-token (e/login-guest (u/conn-context))
-          token-user2 (e/login (u/conn-context) "user2")
-          group1 (u/ingest-group token-user1 {:name "group1"} ["user1"])
-          group1-concept-id (:concept_id group1)
-          ;; Update ANY_ACL fixture to remove permissions from guest and registered,
-          ;; and replace it with group1
-          _ (ac/update-acl (merge {:token token-user1} (u/conn-context)) "ACL1200000001-CMR" (assoc (assoc-in system-acl
-                                                                                [:system_identity :target] "ANY_ACL")
-                                                                                :group_permissions [{:group_id group1-concept-id :permissions ["read" "create"]},
-                                                                                {:user_type :guest :permissions ["read"]}]))
-          _ (u/wait-until-indexed)
-          resp1 (ac/create-acl (merge {:token token-user1} (u/conn-context)) system-acl)]
-
-      (is (re-find #"^ACL.*" (:concept_id resp1)))
-      (is (= 1 (:revision_id resp1)))
-      (is (thrown-with-msg? Exception #"User \[guest\] does not have permission to create a system level ACL"
-                            (ac/create-acl (merge {:token guest-token} (u/conn-context)) (assoc (assoc-in system-acl
-                                                                                [:system_identity :target] "ARCHIVE_RECORD")
-                                                                                :group_permissions [{:user_type :guest :permissions ["delete"]}]))))
-      (is (thrown-with-msg? Exception #"User \[user2\] does not have permission to create a system level ACL"
-                            (ac/create-acl (merge {:token token-user2} (u/conn-context)) (assoc (assoc-in system-acl
-                                                                                [:system_identity :target] "ARCHIVE_RECORD")
-                                                                                :group_permissions [{:user_type :registered :permissions ["delete"]}]))))))
+  (let [token-user1 (e/login (u/conn-context) "user1")
+        guest-token (e/login-guest (u/conn-context))
+        token-user2 (e/login (u/conn-context) "user2")
+        group1 (u/ingest-group token-user1 {:name "group1"} ["user1"])
+        group1-concept-id (:concept_id group1)
+        ;; Update ANY_ACL fixture to remove permissions from guest and registered,
+        ;; and replace it with group1
+        _ (ac/update-acl (merge {:token token-user1} (u/conn-context)) "ACL1200000001-CMR" (assoc (assoc-in system-acl
+                                                                                [:system_identity :target] "ANY_ACL")
+                                                                                :group_permissions [{:group_id group1-concept-id :permissions ["read" "create"]},
+                                                                                {:user_type :guest :permissions ["read"]}]))
+        _ (u/wait-until-indexed)
+        resp1 (ac/create-acl (merge {:token token-user1} (u/conn-context)) system-acl)]
+
+    (is (re-find #"^ACL.*" (:concept_id resp1)))
+    (is (= 1 (:revision_id resp1)))
+    (is (thrown-with-msg? Exception #"User \[guest\] does not have permission to create a system level ACL"
+                          (ac/create-acl (merge {:token guest-token} (u/conn-context)) (assoc (assoc-in system-acl
+                                                                                [:system_identity :target] "ARCHIVE_RECORD")
+                                                                                :group_permissions [{:user_type :guest :permissions ["delete"]}]))))
+    (is (thrown-with-msg? Exception #"User \[user2\] does not have permission to create a system level ACL"
+                          (ac/create-acl (merge {:token token-user2} (u/conn-context)) (assoc (assoc-in system-acl
+                                                                                [:system_identity :target] "ARCHIVE_RECORD")
+                                                                                :group_permissions [{:user_type :registered :permissions ["delete"]}]))))))

 (deftest create-catalog-item-acl-permission-test
   ;; Tests creation permissions of catalog item acls


convert TreeLocMatcher signature to same as visitors & add/edit comments

--- src/dalap/html/selector.clj
+++ src/dalap/html/selector.clj
@@ -10,9 +10,6 @@
 ;;; NOTE: all the dynamically created functions (from `fn`) in this
 ;;; module are given names to aid in debugging

-(defn- span [p xs]
-  ((juxt (partial take-while p)
-         (partial drop-while p)) xs))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
@@ -64,15 +61,21 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (defprotocol TreeLocMatcher
-  "This protocol provides a function that returns another
-  function that matches the given implementing type
-  to nodes on the dalap tree.
-
-  NOTE: This is currently only being used on vectors of NodeMatcher and
-  function like types."
+  "Provides `to-tree-loc-matcher`, which converts a selector `spec`
+  into a matcher predicate that matches locations in a dalap input
+  tree. It can match on the type or attributes of the current node or,
+  optionally, also match on the parents of the current
+  node.
+
+  The signature of the generated matcher function is [node, walker],
+  which is the same signature as dalap visitors. Any non-nil /
+  non-false return value is considered a match."
   (to-tree-loc-matcher [spec]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defn- span [p xs]
+  ((juxt (partial take-while p)
+         (partial drop-while p)) xs))

 (defn match-selector
   "Grabs a node from history that matches the given
@@ -120,8 +123,9 @@
   clojure.lang.PersistentVector
   (to-tree-loc-matcher [selector-vec]
     (let [selector (map to-node-matcher selector-vec)]
-      (fn location-matcher [history-stack]
-        (matching-node selector history-stack))))
+      (fn location-matcher [node walker]
+        (let [history-stack (:history walker)]
+          (matching-node selector history-stack)))))

   ;; Match if the given function returns true.
   clojure.lang.IFn
@@ -130,7 +134,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (defprotocol NodeTransformer
-  "Provides a function that will adapt a 'transformer'
+  "Provides `to-visitor`, which adapt a 'transformer spec'
   to regular dalap visitor function."

   (to-visitor [spec]))
@@ -138,7 +142,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 ;; For Maps it checks if the current node is a key of the
-;; given Map.
+;; given map.
 (extend clojure.lang.IPersistentMap NodeTransformer
         ;; for some reason interfaces have to be extended like this
         ;; rather than via extend-protocol
@@ -160,8 +164,8 @@
     ;; else
     vfn))

-;; For function like types it will just call them with
-;; the node from the dalap Tree.
+;; For function-like types it will just call them with
+;; the current node
 (extend clojure.lang.IFn NodeTransformer
         {:to-visitor ifn-to-visitor})

@@ -193,12 +197,16 @@
 (defn- gen-visitor-from-pred-visitor-pairs
   [predicates+visitors inspect-node?]
   (fn predicate-table-visitor [node walker]
+    ;; this is becoming more and more like a dynamically created
+    ;; multimethod and should probably be converted into one
+    ;; In the simple case where only the current node is used for
+    ;; dispatch and not the walk history, this can be optimized into a
+    ;; dynamically created Protocol.
     (or (and (inspect-node? node)
-             (let [history-stack (:history walker)]
-               (some (fn sequential-pred-checker [[pred? visitor]]
-                       (if (pred? history-stack)
-                         (visitor node walker)))
-                   predicates+visitors)))
+             (some (fn sequential-pred-checker [[pred? visitor]]
+                     (if (pred? node walker)
+                       (visitor node walker)))
+                   predicates+visitors))
         node)))

 (defn normalize-selector-transformer-pairs [selectors+transformers]


Show current analyzed reference

Show current analyzed reference

--- src/discuss/references.cljs
+++ src/discuss/references.cljs
@@ -76,10 +76,15 @@
   []
   (reify om/IRender
     (render [_]
-      (let [usages (get-reference-usages-from-app-state)]
+      (let [usages (get-reference-usages-from-app-state)
+            ref-title (:title (:reference (first usages)))]
         (dom/div nil
-                 (apply dom/div nil
-                        (map #(om/build usage-view (lib/merge-react-key %)) usages)))))))
+                 (dom/div #js {:className "text-center"}
+                          "Usages of reference: "
+                          ref-title)
+                 (dom/div nil
+                          (apply dom/div nil
+                                 (map #(om/build usage-view (lib/merge-react-key %)) usages))))))))

 (defn agree-disagree-view
   "Agree or disagree with the selected reference."


Remove debugging code

Remove debugging code

--- src/great_things_done/keytar.cljs
+++ src/great_things_done/keytar.cljs
@@ -6,16 +6,8 @@
 (defn add-password!
   "Add the `password` for the `service` and `account` to the keychain."
   [service account password]
-  (js/console.log service)
-  (js/console.log account)
-  (js/console.log password)
-  (let [result (.addPassword keytar service account password)]
-    (js/console.log result)
-    (when-not result
-      (throw (js/Error. "Error during the creation of the password")))))
-
-;;   (when-not (.addPassword keytar service account password)
-;;     (throw (js/Error. "Error during the creation of the password"))))
+  (when-not (.addPassword keytar service account password)
+    (throw (js/Error. "Error during the creation of the password"))))

 (defn get-password
   "Get the stored password for the `service` and `account`."


Some more simplification

Some more simplification

--- src/ecregister/posts_ui.clj
+++ src/ecregister/posts_ui.clj
@@ -22,7 +22,7 @@
    :minimum-size [400 :by 60]))

-(defn update-fa-post-widget [e form]
+(defn update-fa-post-widget [form e]
   ;; TODO use cond
   (if (= :wait (:value e))
     (config! (select form [:#faprog]) :indeterminate? true)
@@ -34,7 +34,7 @@
       (config! (select form [:#latest-fa-post]) :visible? true)
       )))

-(defn fetch-aw-posts [e form]
+(defn fetch-aw-posts [form e]
   (let [c (async/chan)
         content-chan (async/chan)
         fa-post (:value e)]
@@ -65,27 +65,30 @@
                          (config! (select form [:#publish-btn]) :user-data full-posts)
                          ))))))

+(defn publish-to-fa [form e]
+  (when-let [posts (config (select form [:#publish-btn]) :user-data)]
+    (let [c (async/chan)]
+      (when (not (empty? posts))
+        (posts/send-aw-posts-to-fa-server posts c)
+        (async/go
+          (let [res (async/<! c)]
+            (if (= :error (:id res))
+              (show! (pack!
+                      (dialog :content
+                              (str "Failed to send: " (:value res)))))
+              (show! (pack!
+                      (dialog :content
+                              (str "Successfully sent " (:value res) " posts")))))))))))
+
 (defn setup-events [form event-chan map-stream]
   (listen (select form [:#publish-btn])
-          :mouse-clicked (fn [e]
-                           (when-let [posts (config (select form [:#publish-btn]) :user-data)]
-                             (let [c (async/chan)]
-                               (when (not (empty? posts))
-                                 (posts/send-aw-posts-to-fa-server posts c)
-                                 (async/go
-                                   (let [res (async/<! c)]
-                                     (if (= :error (:id res))
-                                       (show! (pack!
-                                               (dialog :content
-                                                       (str "Failed to send: " (:value res)))))
-                                       (show! (pack!
-                                               (dialog :content
-                                                       (str "Successfully sent " (:value res) " posts"))))))))))))
+          :mouse-clicked #(async/put! event-chan {:id :publish-now :value true}))

   ;; setup 'latest post' label and progressbar
-  (map-stream #(= :fa-post (:id %)) #(update-fa-post-widget % form))
+  (map-stream #(= :fa-post (:id %)) (partial update-fa-post-widget form))
   ;; when fa post is retrived, start fetching aw posts
-  (map-stream #(and (= :fa-post (:id %)) (map? (:value %))) #(fetch-aw-posts % form)))
+  (map-stream #(and (= :fa-post (:id %)) (map? (:value %))) (partial fetch-aw-posts form))
+  (map-stream #(= :publish-now (:id %)) (partial publish-to-fa form)))

 (defn launch-tab [event-chan]
   (let [c (async/chan)]


Without twitter test

Without twitter test

--- test/ya/handler_test.clj
+++ test/ya/handler_test.clj
@@ -11,11 +11,12 @@
       (is (= (:status response) 200))
       (is (= (:body response) "Hello World")))))

+  (comment
   (testing "twitter login"
     (let [response (app (mock/request :get "/api/auth/twitter/login"))
           location (get-in response [:headers "Location"])]
       (is (= (:status response) 302))
-      (is (.contains location "twitter.com"))))
+      (is (.contains location "twitter.com")))))

   (testing "not-found route"
     (let [response (app (mock/request :get "/invalid"))]


pass non-query-related opts through to execute

--- src/er_cassandra/record.clj
+++ src/er_cassandra/record.clj
@@ -50,10 +50,9 @@
     {:keys [row-generator] :as opts}]
    (session/execute
     session
-    (select-statement table key record-or-key-value opts)
-    (assoc-when
-     {}
-     :row-generator row-generator))))
+    (select-statement table key record-or-key-value
+                      (dissoc opts :columns :where :only-if :order-by :limit))
+    opts)))

 (defn select-buffered
   "select records"
@@ -68,10 +67,9 @@
     {:keys [row-generator] :as opts}]
    (session/execute-buffered
     session
-    (select-statement table key record-or-key-value opts)
-    (assoc-when
-     {}
-     :row-generator row-generator))))
+    (select-statement table key record-or-key-value
+                      (dissoc opts :columns :where :only-if :order-by :limit))
+    opts)))

 (defn select-one
   "select a single record"
@@ -80,8 +78,9 @@
    (select-one session table key record-or-key-value {}))

   ([^Session session table key record-or-key-value opts]
-   (d/chain (select session table key record-or-key-value (merge opts {:limit 1}))
-            first)))
+   (d/chain
+    (select session table key record-or-key-value (merge opts {:limit 1}))
+    first)))

 (defn insert-statement
   "returns a Hayt insert statement"
@@ -106,7 +105,8 @@
    (d/chain
     (session/execute
      session
-     (insert-statement table record opts))
+     (insert-statement table record opts)
+     (dissoc opts :if-not-exists :using))
     first)))

 (defn update-statement
@@ -139,7 +139,8 @@
    (d/chain
     (session/execute
      session
-     (update-statement table key record opts))
+     (update-statement table key record opts)
+     (dissoc opts :only-if :if-exists :using :set-columns))
     first)))

 (defn combine-where
@@ -176,5 +177,6 @@
    (d/chain
     (session/execute
      session
-     (delete-statement table key record-or-key-value opts))
+     (delete-statement table key record-or-key-value opts)
+     (dissoc opts :only-if :if-exists :using :where))
     first)))


Fix bug which triggered CI build 2061 to fail.

--- src/onyx/log/commands/accept_join_cluster.clj
+++ src/onyx/log/commands/accept_join_cluster.clj
@@ -62,4 +62,5 @@
     (extensions/emit monitoring {:event :peer-accept-join :id (:id state)}))
   (if-not (= old new)
     (let [next-state (unbuffer-messages state diff new)]
-      (common/start-new-lifecycle old new diff next-state))))
+      (common/start-new-lifecycle old new diff next-state))
+    state))


Update comment.

Update comment.

--- src/oc/storage/resources/entry.clj
+++ src/oc/storage/resources/entry.clj
@@ -88,11 +88,13 @@

 (schema/defn ^:always-validate get-entry
   "
-  Given the ID of the entry, retrieve the entry, or return nil if it doesn't exist.
+  Given the UUID of the entry, retrieve the entry, or return nil if it doesn't exist.

-  Or given the UUID of the org or board, a topic slug, and the created-at timestamp,
-  retrieve the entry, or return nil if it doesn't exist. In this case a keyword, `:org` or `:board`
-  needs to be provided to indicate what type of UUID is being used.
+  Or given the UUID of the org and board, a topic slug, and the UUID of the entry,
+  retrieve the entry, or return nil if it doesn't exist.
+
+  Or given the UUID of the org, a topic slug, and the `created-at` timestamp of the entry,
+  retrieve the entry, or return nil if it doesn't exist.
   "
   ([conn uuid :- lib-schema/UniqueID]
   {:pre [(db-common/conn? conn)]}


:bug: Add missing require.

:bug: Add missing require.

--- frontend/src/uxbox/main/ui/workspace/sidebar/options/text.cljs
+++ frontend/src/uxbox/main/ui/workspace/sidebar/options/text.cljs
@@ -16,6 +16,7 @@
    [uxbox.main.store :as st]
    [uxbox.main.ui.workspace.sidebar.options.measures :refer [measures-menu]]
    [uxbox.util.dom :as dom]
+   [uxbox.util.math :as math]
    [uxbox.util.i18n :refer [tr]]))

 (declare +fonts+)


improve resolve perf when recompiling in watch

--- src/main/shadow/build/resolve.clj
+++ src/main/shadow/build/resolve.clj
@@ -215,27 +215,35 @@
   {:pre [(data/build-state? state)
          (string? require)]}

-  (let [{:keys [resource-id ns] :as rc}
-        (find-resource-for-string state require-from require)]
-
-    (when-not rc
-      (throw (ex-info
-               (if require-from
-                 (format "The required JS dependency \"%s\" is not available, it was required by \"%s\"." require (:resource-name require-from))
-                 (format "The required JS dependency \"%s\" is not available." require))
-               {:tag ::missing-js
-                :require require
-                :require-from (:resource-name require-from)})))
-
-    (-> state
-        (data/maybe-add-source rc)
-        (cond->
-          require-from-ns
-          (data/add-string-lookup require-from-ns require ns)
-          (nil? require-from)
-          (update :js-entries conj ns))
-        (resolve-deps rc)
-        )))
+  (let [resolved-sym (get-in state [:str->sym require-from-ns require])]
+    ;; in a watch recompile cycle strings may already be resolved so we can re-use those
+    ;; resolve is a bit costly since it has to do a bunch of FS interop
+    (if resolved-sym
+      (let [rc (data/get-source-by-provide state resolved-sym)]
+        (resolve-deps state rc))
+
+      ;; fresh resolve
+      (let [{:keys [resource-id ns] :as rc}
+            (find-resource-for-string state require-from require)]
+
+        (when-not rc
+          (throw (ex-info
+                   (if require-from
+                     (format "The required JS dependency \"%s\" is not available, it was required by \"%s\"." require (:resource-name require-from))
+                     (format "The required JS dependency \"%s\" is not available." require))
+                   {:tag ::missing-js
+                    :require require
+                    :require-from (:resource-name require-from)})))
+
+        (-> state
+            (data/maybe-add-source rc)
+            (cond->
+              require-from-ns
+              (data/add-string-lookup require-from-ns require ns)
+              (nil? require-from)
+              (update :js-entries conj ns))
+            (resolve-deps rc)
+            )))))

 (defn ensure-non-circular!
   [{:keys [resolved-stack] :as state} resource-id]


fix error message when executable is not found

--- src/main/shadow/cljs/npm/cli.cljs
+++ src/main/shadow/cljs/npm/cli.cljs
@@ -63,7 +63,7 @@
 (defn run! [project-root cmd args proc-opts]
   (let [executable (which/sync cmd #js {:nothrow true})]
     (if-not executable
-      (do (println (str "Executable '" executable "' not found on system path."))
+      (do (println (str "Executable '" cmd "' not found on system path."))
           (js/process.exit 1))

       (let [node-server (node-net/Server.)]


bump lein version

bump lein version

--- lein/project.clj
+++ lein/project.clj
@@ -1,4 +1,4 @@
-(defproject mala/lein-template "0.5.1"
+(defproject mala/lein-template "0.5.2"
   :description "A Leiningen template for Mala"
   :url "https://github.com/priyatam/mala/lein"
   :license {:name "Eclipse Public License"


Thread macro in tests

Thread macro in tests

--- test/github_changelog/conventional_test.clj
+++ test/github_changelog/conventional_test.clj
@@ -48,11 +48,14 @@
 (def pulls (map #(g/complete-valid-pull {:number %}) (range 1 5)))

 (defn revert [pulls]
-  (let [pull-ids (map :number pulls)]
-    (map #(assoc (revert-pull config %) :number (* 10 %)) pull-ids)))
+  (->> (map :number pulls)
+       (map #(assoc (revert-pull config %) :number (* 10 %)))))

 (deftest parse-changes
-  (are [pulls expected] (= expected (count (:changes (conventional/parse-changes config (g/complete-tag {:pulls pulls})))))
+  (are [pulls expected] (= expected (->> (g/complete-tag {:pulls pulls})
+                                         (conventional/parse-changes config)
+                                         :changes
+                                         count))
     pulls 4
     (concat (revert pulls) pulls) 0
     (concat (revert (drop 1 pulls)) pulls) 1


Switch to new default-vals.

Switch to new default-vals.

--- src/onyx/plugin/elasticsearch.clj
+++ src/onyx/plugin/elasticsearch.clj
@@ -2,7 +2,7 @@
   (:require [onyx.peer.function :as function]
             [onyx.extensions :as extensions]
             [onyx.peer.pipeline-extensions :as p-ext]
-            [onyx.static.default-vals :refer [defaults arg-or-default]]
+            [onyx.static.default-vals :refer [default-vals arg-or-default]]
             [onyx.types :as t]
             [clojure.core.async :refer [chan go timeout <!! >!! alts!! sliding-buffer go-loop close! poll! offer!]]
             [clojurewerkz.elastisch.native  :as es]
@@ -18,7 +18,7 @@
 (defn- create-es-client
   [client-type protocol host port cluster-name http-ops]
   (if
-    (= client-type :http)
+      (= client-type :http)
     (esr/connect (str (name protocol) "://" host ":" port) http-ops)
     (es/connect [[host port]] {"cluster.name" cluster-name})))

@@ -36,10 +36,10 @@
   (let [query-list (if query [:query query] [])
         sort-list (if sort [:sort sort] [])]
     (->
-      (cond
-        (and index mapping) (run-as client-type :search conn index mapping query-list sort-list :from start-index :scroll scroll)
-        (not (nil? index)) (run-as client-type :search-all-types conn index query-list sort-list :from start-index :scroll scroll)
-        :else (run-as client-type :search-all-indexes-and-types conn query-list sort-list :from start-index :scroll scroll)))))
+     (cond
+       (and index mapping) (run-as client-type :search conn index mapping query-list sort-list :from start-index :scroll scroll)
+       (not (nil? index)) (run-as client-type :search-all-types conn index query-list sort-list :from start-index :scroll scroll)
+       :else (run-as client-type :search-all-indexes-and-types conn query-list sort-list :from start-index :scroll scroll)))))

 (defn- start-commit-loop! [write-chunk? commit-ch log k]
   (go-loop []
@@ -138,7 +138,7 @@
                               read-ch retry-ch commit-ch]
   p-ext/Pipeline
   (write-batch
-    [_ event]
+      [_ event]
     (function/write-batch event))

   (read-batch [_ _]
@@ -178,18 +178,18 @@
       (swap! pending-messages dissoc segment-id)))

   (retry-segment
-    [_ _ segment-id]
+      [_ _ segment-id]
     (when-let [msg (get @pending-messages segment-id)]
       (swap! pending-messages dissoc segment-id)
       (>!! retry-ch (t/input (java.util.UUID/randomUUID)
                              (:message msg)))))

   (pending?
-    [_ _ segment-id]
+      [_ _ segment-id]
     (get @pending-messages segment-id))

   (drained?
-    [_ _]
+      [_ _]
     @drained?))

 (defn read-messages
@@ -263,30 +263,30 @@
 (defrecord ElasticsearchWrite []
   p-ext/Pipeline
   (read-batch
-    [_ event]
+      [_ event]
     (function/read-batch event))

   (write-batch
-    [_ {results :onyx.core/results
-        connection :elasticsearch/connection
-        defaults :elasticsearch/doc-defaults}]
+      [_ {results :onyx.core/results
+          connection :elasticsearch/connection
+          default-vals :elasticsearch/doc-defaults}]
     (doseq [msg (mapcat :leaves (:tree results))]
       (let [document (or (:elasticsearch/message (:message msg)) (:message msg))
             settings (if
-                       (or (= :delete (:elasticsearch/write-type defaults))
-                           (contains-some? (:message msg) :elasticsearch/message :elasticsearch/write-type))
-                       (merge defaults (select-keys
-                                         (:message msg) [:elasticsearch/index
-                                                         :elasticsearch/doc-id
-                                                         :elasticsearch/mapping
-                                                         :elasticsearch/write-type]))
-                       defaults)]
+                         (or (= :delete (:elasticsearch/write-type default-vals))
+                             (contains-some? (:message msg) :elasticsearch/message :elasticsearch/write-type))
+                       (merge default-vals (select-keys
+                                            (:message msg) [:elasticsearch/index
+                                                            :elasticsearch/doc-id
+                                                            :elasticsearch/mapping
+                                                            :elasticsearch/write-type]))
+                       default-vals)]
         (log/debug (str "Message Settings: " settings))
         (write-elasticsearch connection document settings)))
     {})

   (seal-resource
-    [_ _]
+      [_ _]
     {}))

 (defn write-messages [_]


Warn of incomplete async BookKeeper write Will require a more complete recovery strategy, see issue referred to in comment.

--- src/onyx/state/log/bookkeeper.clj
+++ src/onyx/state/log/bookkeeper.clj
@@ -64,8 +64,10 @@
 (def HandleWriteCallback
   (reify AsyncCallback$AddCallback
     (addComplete [this rc lh entry-id ack-fn]
-      (when (= rc (BKException$Code/OK))
-        (ack-fn)))))
+      (if (= rc (BKException$Code/OK))
+        (ack-fn)
+        ;; TODO: should restart peer, see https://github.com/onyx-platform/onyx/issues/390
+        (warn "Unable to complete async write to bookkeeper. BookKeeper exception code:" rc)))))

 (defn compaction-transition
   "Transitions to a new compacted ledger, plus a newly created ledger created


Fix error in HTTP.

Fix error in HTTP.

--- src/org/spootnik/cyanite/http.clj
+++ src/org/spootnik/cyanite/http.clj
@@ -59,7 +59,7 @@
                       (or body {:error (.getMessage e)}))})))))

 (defn metrics-handler [response-channel
-                       {{:keys [index store-middleware rollups]} :local-params
+                       {{:keys [index store rollups]} :local-params
                         {:keys [from to path agg tenant]} :params :as request}]
   (debug "fetching paths: " path)
   (enqueue
@@ -74,7 +74,7 @@
                      (let [to    (if to (Long/parseLong (str to)) (now))
                            from  (Long/parseLong (str from))
                            paths (if (sequential? path) path [path])]
-                       (store/fetch store-middleware (or agg "mean") paths (or tenant "NONE") rollup period from to))
+                       (store/fetch store (or agg "mean") paths (or tenant "NONE") rollup period from to))
                      {:step nil :from nil :to nil :series {}})
                    )})
       (catch Exception e
@@ -104,8 +104,8 @@
 (defn start
   "Start the API, handling each request by parsing parameters and
    routes then handing over to the request processor"
-  [{:keys [http store carbon index] :as config}]
-  (start-http-server (wrap-ring-handler  (wrap-local-params handler {:store store
+  [{:keys [http store-middleware carbon index] :as config}]
+  (start-http-server (wrap-ring-handler  (wrap-local-params handler {:store store-middleware
                                                                      :rollups (:rollups carbon)
                                                                      :index index})) http)
   nil)


Kill circular reference

Kill circular reference

--- src/structural_typing/api/path.clj
+++ src/structural_typing/api/path.clj
@@ -1,7 +1,6 @@
 (ns structural-typing.api.path
   (:require [com.rpl.specter :as specter]
             [clojure.pprint :refer [cl-format]]
-            [structural-typing.type-repo :as type-repo]
             [structural-typing.frob :as frob]))

 (def friendly-path-components


Modify an expected error message slightly for the postgres unit tests

--- test/com/puppetlabs/puppetdb/test/command.clj
+++ test/com/puppetlabs/puppetdb/test/command.clj
@@ -527,7 +527,7 @@

         (test-msg-handler new-facts-cmd publish discard-dir
           (reset! second-message? true)
-          (is (re-matches #".*BatchUpdateException.*transaction rollback.*"
+          (is (re-matches #".*BatchUpdateException.*(rollback|abort).*"
                           (-> publish
                               meta
                               :args


Fix images builtin library data structure format.

--- src/uxbox/main/library/images.cljs
+++ src/uxbox/main/library/images.cljs
@@ -10,7 +10,7 @@
 (def +collections+
   [{:name "Generic 1"
     :id 1
-    :builtin true
+    :type :builtin
     :images [{:id 1
               :name "image_name.jpg"
               :url "https://images.unsplash.com/photo-1455098934982-64c622c5e066?crop=entropy&fit=crop&fm=jpg&h=1025&ixjsv=2.1.0&ixlib=rb-0.3.5&q=80&w=1400"
@@ -38,19 +38,19 @@

    {:name "Generic 2"
     :id 2
-    :builtin true
+    :type :builtin
     :images [{:id 7
               :name "image_name.jpg"
               :url "https://images.unsplash.com/photo-1455098934982-64c622c5e066?crop=entropy&fit=crop&fm=jpg&h=1025&ixjsv=2.1.0&ixlib=rb-0.3.5&q=80&w=1400"
               :thumbnail "https://images.unsplash.com/photo-1455098934982-64c622c5e066?crop=entropy&fit=crop&fm=jpg&h=1025&ixjsv=2.1.0&ixlib=rb-0.3.5&q=80&w=1400"}
              {:id 8
+              :name "image_name.jpg"
+              :url "https://images.unsplash.com/photo-1441986380878-c4248f5b8b5b?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&w=1080&fit=max&s=486f09671860a11e70bdd0a45e7c5014"
+              :thumbnail "https://images.unsplash.com/photo-1441986380878-c4248f5b8b5b?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&w=1080&fit=max&s=486f09671860a11e70bdd0a45e7c5014"}
+             {:id 9
               :name "image_name_long_name.jpg"
               :url "https://images.unsplash.com/photo-1422393462206-207b0fbd8d6b?crop=entropy&fit=crop&fm=jpg&h=1025&ixjsv=2.1.0&ixlib=rb-0.3.5&q=80&w=1925"
               :thumbnail "https://images.unsplash.com/photo-1422393462206-207b0fbd8d6b?crop=entropy&fit=crop&fm=jpg&h=1025&ixjsv=2.1.0&ixlib=rb-0.3.5&q=80&w=1925"}
-             {:id 9
-              :name "image_name.jpg"
-              :url "https://images.unsplash.com/photo-1441986380878-c4248f5b8b5b?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&w=1080&fit=max&s=486f09671860a11e70bdd0a45e7c5014"
-              :thumbnail "https://images.unsplash.com/photo-1441986380878-c4248f5b8b5b?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&w=1080&fit=max&s=486f09671860a11e70bdd0a45e7c5014"}
              {:id 10
               :name "image_name_big_long_name.jpg"
               :url "https://images.unsplash.com/photo-1423768164017-3f27c066407f?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&w=1080&fit=max&s=712b919f3a2f6fc34f29040e8082b6d9"


Adds test

Adds test

--- test/expound/alpha_test.cljc
+++ test/expound/alpha_test.cljc
@@ -2571,5 +2571,44 @@
            ))

     )
-  (testing "multiple results")
-  (testing "custom printer"))
+  #?(:clj
+     (testing "multiple results"
+       (is (= "== Checked expound.alpha-test/results-str-fn2
+
+core.clj:LINUM
+
+-- Spec failed --------------------
+
+Function arguments and return value
+
+  {:ret 0, :args {:x 0, :y 0}}
+
+should satisfy
+
+  (fn
+   [%]
+   (let
+    [x
+     (-> % :args :x)
+     y
+     (-> % :args :y)
+     ret
+     (-> % :ret)]
+    (< x ret)))
+
+
+
+-------------------------
+Detected 1 error
+
+
+== Checked expound.alpha-test/results-str-fn3
+
+Success!
+"
+              (no-linum (expound/results-str (st/check [`results-str-fn2 `results-str-fn3])))
+              ))
+       ))
+  (testing "check-fn")
+  (testing "custom printer")
+  )


New tests: NPE and not NPE checks for 'replaceAll'

--- test/hurvinek/utils_test.clj
+++ test/hurvinek/utils_test.clj
@@ -289,3 +289,16 @@
             "xbbx"  (replaceAll "xaaaax" "aa" "b")
             "xbxbx" (replaceAll "xaaxaax" "aa" "b"))))

+(deftest test-replaceAll-not-NPE
+    "Check the function hurvinek.utils/replaceAll."
+    (testing "the function hurvinek.utils/replaceAll."
+        (is (= "a" (replaceAll "a" "b" nil)))))
+
+(deftest test-replaceAll-NPE
+    "Check the function hurvinek.utils/replaceAll."
+    (testing "the function hurvinek.utils/replaceAll."
+        (is (thrown? NullPointerException (replaceAll nil "a" "b")))
+        (is (thrown? NullPointerException (replaceAll "a" nil "b")))
+        (is (thrown? NullPointerException (replaceAll "a" "a" nil)))
+        (is (thrown? NullPointerException (replaceAll nil nil "b")))))
+


fixed aws config

fixed aws config

--- main/src/dda/pallet/dda_managed_ide/infra.clj
+++ main/src/dda/pallet/dda_managed_ide/infra.clj
@@ -71,7 +71,7 @@
        :script-dir (str "/home/" os-user-name "/")
        :script-env {:HOME (str "/home/" os-user-name "/")}}
       (clojure/configure-user facility contains-clojure? os-user-name clojure)
-      (devops/configure-user facility contains-devops? os-user-name devops)
+      (devops/configure-user facility contains-devops? os-user-name (:aws devops))
       (when (contains? config :atom)
         (actions/as-action
           (logging/info (str facility "-configure user: atom")))


add get array + float test

add get array + float test

--- src/test/cljs/cljs/core_test.cljs
+++ src/test/cljs/cljs/core_test.cljs
@@ -2829,7 +2829,8 @@
   (is (= (reduce my-conj [] (eduction (map identity) [1 2 3]))
          [1 2 3])))

-(deftest test-get-string-float
+(deftest test-get-with-float
+  (is (= (get #js [\h \i] 1.7) \i))
   (is (= (get "hi" 1.7) \i)))

 (comment


Removes todo.clj which should have been in a sketchbook

--- src/the_little_clojurian/todo.clj
+++ src/the_little_clojurian/todo.clj
@@ -1,270 +0,0 @@
-(ns the-little-clojurian.todo
-  (:require [clojure.test :refer :all]))
-
-(declare complete-map* complete-list* complete-node* complete-nodes* leftmost-node rightmost-node remove-nodes remove-node)
-
-(with-test
-  (def remove-nodes
-    (fn [id nodes]
-      (cond (nil? nodes) nil
-            (empty? nodes) '()
-            :else (cons (remove-node id (first nodes))
-                        (remove-nodes id (rest nodes))))))
-
-  (is (= (remove-nodes 1 nil)
-         nil))
-
-  (is (= (remove-nodes 1 '())
-         '()))
-
-  (is (= (remove-nodes 1 '({:id 1}))
-         '(nil)))
-
-  (is (= (remove-nodes 1 '({:id 1} {:id 1}))
-         '(nil nil)))
-
-  (is (= (remove-nodes 1 '({:id 1} {:id 2}))
-         '(nil {:id 2 :nodes nil}))))
-
-(with-test
-  (def remove-node
-    (fn [id root]
-      (cond (nil? root) nil
-            (= (:id root) id) nil
-            :else (assoc root :nodes (remove-nodes id (:nodes root))))))
-
-  (is (= (remove-node 1 nil)
-         nil))
-
-  (is (= (remove-node 1 {:id 1})
-         nil))
-
-  (is (= (remove-node 2 {:id 1})
-         {:id 1 :nodes nil}))
-
-  (is (= (remove-node 2 {:id 1 :nodes '({:id 2})})
-         {:id 1 :nodes '(nil)}))
-
-  (is (= (remove-node 3 {:id 1 :nodes '({:id 2 :nodes ({:id 3 :nodes ({:id 5})} {:id 4})})})
-         {:id 1 :nodes '({:id 2 :nodes (nil {:id 4 :nodes nil})})})))
-
-(with-test
-  (def leftmost-node
-    (fn [root]
-      (cond (nil? root) nil
-            (empty? (:nodes root)) root
-            :else (leftmost-node (first (:nodes root))))))
-
-  (is (= (leftmost-node nil)
-         nil))
-
-  (is (= (leftmost-node {:id 1})
-         {:id 1}))
-
-  (is (= (leftmost-node {:id 2})
-         {:id 2}))
-
-  (is (= (leftmost-node {:id 1 :nodes '({:id 2})})
-         {:id 2}))
-
-  (is (= (leftmost-node {:id 1 :nodes '({:id 2} {:id 3})})
-         {:id 2}))
-
-  (is (= (leftmost-node {:id 1 :nodes '({:id 2 :nodes ({:id 3} {:id 4})})})
-         {:id 3})))
-
-(with-test
-  (def rightmost-node
-    (fn [root]
-      (cond (nil? root) nil
-            (empty? (:nodes root)) root
-            :else (rightmost-node (last (:nodes root))))))
-
-  (is (= (rightmost-node nil)
-         nil))
-
-  (is (= (rightmost-node {:id 1})
-         {:id 1}))
-
-  (is (= (rightmost-node {:id 1 :nodes '({:id 2})})
-         {:id 2}))
-
-  (is (= (rightmost-node {:id 1 :nodes '({:id 2} {:id 3})})
-         {:id 3}))
-
-  (is (= (rightmost-node {:id 1 :nodes '({:id 2 :nodes ({:id 3})})})
-         {:id 3}))
-
-  (is (= (rightmost-node {:id 1 :nodes '({:id 2 :nodes ({:id 3})} {:id 4})})
-         {:id 4})))
-
-(with-test
-  (def complete-nodes*
-    (fn [id nodes]
-      (cond (nil? nodes) nil
-            (empty? nodes) '()
-            :else (cons (complete-node* id (first nodes))
-                        (complete-nodes* id (rest nodes))))))
-
-  (is (= (complete-nodes* 1 nil)
-         nil))
-
-  (is (= (complete-nodes* 1 '())
-         '()))
-
-  (is (= (complete-nodes* 1 '({:id 1}))
-         '({:id 1 :complete true})))
-
-  (is (= (complete-nodes* 1 '({:id 1} {:id 1}))
-         '({:id 1 :complete true} {:id 1 :complete true})))
-
-  (is (= (complete-nodes* 1 '({:id 1} {:id 2}))
-         '({:id 1 :complete true} {:id 2})))
-
-  (is (= (complete-nodes* 2 '({:id 1} {:id 2}))
-         '({:id 1} {:id 2 :complete true})))
-
-  (is (= (complete-nodes* 2 '({:id 1 :nodes ({:id 2})}))
-         '({:id 1 :nodes ({:id 2 :complete true})})))
-
-  (is (= (complete-nodes* 2 '({:id 0} {:id 1 :nodes ({:id 2})}))
-         '({:id 0} {:id 1 :nodes ({:id 2 :complete true})})))
-
-  (is (= (complete-nodes* 4 '({:id 0} {:id 1} {:id 2 :nodes ({:id 4 :nodes ({:id 5})})} {:id 3}))
-         '({:id 0} {:id 1} {:id 2 :nodes ({:id 4 :complete true :nodes ({:id 5})})} {:id 3}))))
-
-(with-test
-  (def complete-node*
-    (fn [id m]
-      (cond (nil? m) {}
-            (empty? m) {}
-            (nil? (:id m)) m
-            (= (:id m) id) (assoc m :complete true)
-            (not (empty? (:nodes m))) {:id (:id m) :nodes (complete-nodes* id (:nodes m))}
-            :else m)))
-
-  (is (= (complete-node* 1 nil)
-         {}))
-
-  (is (= (complete-node* 1 {})
-         {}))
-
-  (is (= (complete-node* 1 {:foo "bar"})
-         {:foo "bar"}))
-
-  (is (= (complete-node* 1 {:id 1})
-         {:id 1 :complete true}))
-
-  (is (= (complete-node* 2 {:id 1})
-         {:id 1}))
-
-  (is (= (complete-node* 2 {:id 2})
-         {:id 2 :complete true}))
-
-  (is (= (complete-node* 1 {:id 1 :nodes ()})
-         {:id 1 :complete true :nodes ()}))
-
-  (is (= (complete-node* 1 {:id 1 :nodes '({:id 2})}))
-      {:id 1 :complete true :nodes '({:id 2})})
-
-  (is (= (complete-node* 2 {:id 1 :nodes '({:id 2})})
-         {:id 1 :nodes '({:id 2 :complete true})}))
-
-  (is (= (complete-node* 3 {:id 1 :nodes '({:id 2 :nodes ({:id 3})})})
-         {:id 1 :nodes '({:id 2 :nodes ({:id 3 :complete true})})}))
-
-  (is (= (complete-node* 4 {:id 1 :nodes '({:id 2} {:id 3} {:id 4})})
-         {:id 1 :nodes '({:id 2} {:id 3} {:id 4 :complete true})}))
-
-  (is (= (complete-node* 2 {:id 1 :nodes '({:id 2 :nodes ({:id 3})})})
-         {:id 1 :nodes '({:id 2 :complete true :nodes ({:id 3})})}))
-
-  (is (= (complete-node* 3 {:id 1 :nodes '({:id 2 :nodes ({:id 3} {:id 4})})})
-         {:id 1 :nodes '({:id 2 :nodes ({:id 3 :complete true} {:id 4})})})))
-
-(with-test
-  (def complete-list*
-    (fn [id l]
-      "Looks for maps with :id equal to id and adds :completed true to those maps that match including those that are inside the :nodes list of of a map"
-      (cond (empty? l) '()
-            (= (:id (first l)) id) (cond (empty? (:nodes (first l))) (cons {:id id :complete true}
-                                                                           (complete-list* id (rest l)))
-                                         :else (cons {:id id :complete true :nodes (cons (complete-map* id (first (:nodes (first l))))
-                                                                                (complete-list* id (rest (:nodes (first l)))))}
-                                                     (complete-list* id (rest l))))
-
-            :else (cons (complete-map* id (first l)) (complete-list* id (rest l))))))
-
-  (is (= (complete-list* 1 '())
-         '()))
-
-  (is (= (complete-list* 1 '({:id 1}))
-         '({:id 1 :complete true})))
-
-  (is (= (complete-list* 1 '({:id 2}))
-         '({:id 2})))
-
-  (is (= (complete-list* 2 '({:id 1} {:id 2}))
-         '({:id 1} {:id 2 :complete true})))
-
-  (is (= (complete-list* 1 '({:id 1} {:id 1}))
-         '({:id 1 :complete true} {:id 1 :complete true})))
-
-  (is (= (complete-list* 1 '({:id 1} {:id 2}))
-         '({:id 1 :complete true} {:id 2})))
-
-  (is (= (complete-list* 2 '({:id 1} {:id 2}))
-         '({:id 1} {:id 2 :complete true})))
-
-  (is (= (complete-list* 1 '({:id 1 :nodes ({:id 1})}))
-         '({:id 1 :complete true :nodes ({:id 1 :complete true})})))
-
-  (is (= (complete-list* 1 '({:id 1 :nodes ({:id 2 :nodes ({:id 1})})}))
-         '({:id 1 :complete true :nodes ({:id 2 :nodes ({:id 1 :complete true})})})))
-
-  (is (= (complete-list* 2 '({:id 1 :nodes ({:id 2})}))
-         '({:id 1 :nodes ({:id 2 :complete true})})))
-
-  (is (= (complete-list* 2 '({:id 1 :nodes ({:id 2} {:id 2})}))
-         '({:id 1 :nodes ({:id 2 :complete true} {:id 2 :complete true})})))
-
-  (is (= (complete-list* 5 '({:id 1 :nodes ({:id 2 :nodes ({:id 3} {:id 4 :nodes ({:id 5} {:id 6})})})}))
-         '({:id 1 :nodes ({:id 2 :nodes ({:id 3} {:id 4 :nodes ({:id 5 :complete true} {:id 6})})})}))))
-
-(with-test
-  (def complete-map*
-    (fn [id m]
-      (cond (nil? m) nil
-            (= (:id m) id) (assoc m :complete true)
-            (empty? (:nodes m)) m
-            :else (assoc m :nodes (complete-list* id (:nodes m))))))
-
-  (is (= (complete-map* 1 nil)
-         nil))
-
-  (is (= (complete-map* 1 {:id 1})
-         {:id 1 :complete true}))
-
-  (is (= (complete-map* 2 {:id 2})
-         {:id 2 :complete true}))
-
-  (is (= (complete-map* 1 {:id 2})
-         {:id 2}))
-
-  (is (= (complete-map* 2 {:id 1 :nodes ()})
-         {:id 1 :nodes ()}))
-
-  (is (= (complete-map* 2 {:id 1 :nodes '({:id 2})})
-         {:id 1 :nodes '({:id 2 :complete true})}))
-
-  (is (= (complete-map* 3 {:id 1 :nodes '({:id 2} {:id 3})})
-         {:id 1 :nodes '({:id 2} {:id 3 :complete true})}))
-
-  (is (= (complete-map* 4 {:id 1 :nodes '({:id 2} {:id 3 :nodes ({:id 4})})})
-         {:id 1 :nodes '({:id 2} {:id 3 :nodes ({:id 4 :complete true})})}))
-
-  (is (= (complete-map* 3 {:id 1 :nodes '({:id 2 :nodes ({:id 3})})})
-         {:id 1 :nodes '({:id 2 :nodes ({:id 3 :complete true})})}))
-
-  (is (= (complete-map* 5 {:id 1 :nodes '({:id 2 :nodes ({:id 3 :nodes ({:id 4 :nodes ({:id 5} {:id 6})})})})}))
-       {:id 1 :nodes '({:id 2 :nodes ({:id 3 :nodes ({:id 4 :nodes ({:id 5 :complete true} {:id 6})})})})}))


Revert "kill tests for funcs that do not exist anymore"

This reverts commit 70c3caf8b047080f759713cb4085c64af893e0c0.


(maint) Fix regex in trusted facts index test

Escape the | regex operators so they are matched as literal characters.

The `||` in the SQL was being interpreted as two regex ORs, and the lack
of any characters between the |'s meant it would always match the empty
string "".

--- test/puppetlabs/puppetdb/query_eng_test.clj
+++ test/puppetlabs/puppetdb/query_eng_test.clj
@@ -180,12 +180,12 @@

 (deftest index-hit-for-trusted-facts-on-inventory
   (testing "facts.trusted.extensions and trusted.extensions should generate the same SQL"
-    (is (re-find #"WHERE \(fs.stable||fs.volatile\) @> ?"
+    (is (re-find #"WHERE \(fs.stable\|\|fs.volatile\) @> ?"
                  (->> ["extract" [] ["=" "facts.trusted.extensions.foo" "bar"]]
                       (compile-user-query->sql inventory-query)
                       :results-query
                       first)))
-    (is (re-find #"WHERE \(fs.stable||fs.volatile\) @> ?"
+    (is (re-find #"WHERE \(fs.stable\|\|fs.volatile\) @> ?"
                  (->> ["extract" [] ["=" "trusted.extensions.foo" "bar"]]
                       (compile-user-query->sql inventory-query)
                       :results-query


Add fetch project by token repo functions.

--- src/uxbox/main/repo/projects.cljs
+++ src/uxbox/main/repo/projects.cljs
@@ -15,6 +15,16 @@
   (let [url (str url "/projects")]
     (send! {:url url :method :get})))

+(defmethod request :fetch/project
+  [_ id]
+  (let [url (str url "/projects/" id)]
+    (send! {:url url :method :get})))
+
+(defmethod request :fetch/project-by-token
+  [_ token]
+  (let [url (str url "/projects-by-token/" token)]
+    (send! {:url url :method :get})))
+
 (defmethod request :create/project
   [_ data]
   (let [params {:url (str url "/projects")


(maint) Use test logging in  max-queued-requests test

This commit updates the integration test for max-queued-requests to use test
logging from puppetlabs.trapperkeeper.testutils.logging. This change traps
the error message generated by hitting the request limit and adds an assertion
that an error is logged by the server.

--- test/integration/puppetlabs/services/jruby/jruby_metrics_service_test.clj
+++ test/integration/puppetlabs/services/jruby/jruby_metrics_service_test.clj
@@ -4,6 +4,7 @@
             [puppetlabs.trapperkeeper.app :as tk-app]
             [puppetlabs.trapperkeeper.services :as tk-services]
             [puppetlabs.trapperkeeper.testutils.bootstrap :as bootstrap]
+            [puppetlabs.trapperkeeper.testutils.logging :as logging]
             [puppetlabs.services.jruby.jruby-puppet-testutils :as jruby-testutils]
             [puppetlabs.trapperkeeper.services.webserver.jetty9-service :as jetty9-service]
             [puppetlabs.services.jruby.jruby-puppet-service :as jruby-service]
@@ -902,13 +903,17 @@
         ; Wait for async requests to hit metrics.
         (while (> 4 (.getCount requested-count)))

-        (let [resp        (http-get "http://127.0.0.1:8140/foo/uncoord/sync1")
-              status-code (:status resp)
-              retry-after (-> resp
-                              (get-in [:headers "retry-after"])
-                              Integer/parseInt)]
-          (is (= 503 status-code))
-          (is (<= 0 retry-after 1800)))
+        (logging/with-test-logging
+          (let [resp        (http-get "http://127.0.0.1:8140/foo/uncoord/sync1")
+                status-code (:status resp)
+                retry-after (-> resp
+                                (get-in [:headers "retry-after"])
+                                Integer/parseInt)]
+            (is (= 503 status-code))
+            (is (<= 0 retry-after 1800))
+            (is (logged?
+                 #"The number of requests waiting for a JRuby instance has exceeded the limit"
+                 :error))))

         ;; unblock all requests
         (doseq [i (range 1 5)]


do you have any rusty spoons?

do you have any rusty spoons?

--- src/lcmap/aardvark/tile.clj
+++ src/lcmap/aardvark/tile.clj
@@ -3,6 +3,7 @@
   (:require [clojure.java.io :as io]
             [clojure.core.memoize :as memoize]
             [clojure.set]
+            [clojure.stacktrace :as stacktrace]
             [clojure.tools.logging :as log]
             [dire.core :as dire]
             [gdal.core]
@@ -261,7 +262,9 @@
       (progress source "scene-finish")
       :done
       (catch clojure.lang.ExceptionInfo ex
-          (progress source "fail" (:msg (ex-data ex))))
+        (log/errorf "scene-fail: %s" (stacktrace/root-cause ex))
+        (progress source "fail" (.getMessage ex))
+        :fail)
       (finally
         (fs/delete-dir unarchive-file)
         (fs/delete uncompress-file)


Allow create-element to handle plain React components


Fix comparison tests. Start using key comparisons in tree.

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -4,7 +4,7 @@
             [cemerick.double-check.properties :as prop :include-macros true]
             [cemerick.pprng :as pprng]
             clojure.set)
-  (:require-macros [aurora.macros :refer [apush apush* key-lt key-lte key-gt key-gte set!! dofrom]]))
+  (:require-macros [aurora.macros :refer [apush apush* typeof set!! dofrom]]))

 ;; COMPARISONS

@@ -29,7 +29,7 @@
         bs-len (alength bs)]
     (assert (== as-len bs-len) (pr-str as bs))
     (loop [i 0]
-      (if (< i a-len)
+      (if (< i as-len)
         (let [a (aget as i)
               b (aget bs i)]
           (if (identical? a b)
@@ -41,6 +41,9 @@
               1)))
         0))))

+(defn key= [as bs]
+  (== 0 (key-compare as bs)))
+
 (defn key-lt [as bs]
   (== -1 (key-compare as bs)))

@@ -58,7 +61,7 @@
 (def left-child 0)
 (def right-child 1)

-(deftype Tree [max-keys ^:mutable root]
+(deftype Tree [max-keys key-len ^:mutable root]
   Object
   (toString [this]
             (pr-str (into {} (map vec (seq this)))))
@@ -77,8 +80,8 @@
              (set! (.-parent right-child) root)
              (set! (.-parent-ix right-child) 1)))
   (maintain! [this])
-  (into [this resukey-lt]
-        (.into root resukey-lt))
+  (into [this result]
+        (.into root result))
   (valid! [this]
           (when (> (alength (.-keys root)) 0) ;; the empty tree does not obey most invariants
             (.valid! root max-keys))
@@ -91,19 +94,19 @@
                     (recur (mapcat #(.-children %) nodes)))))
   ISeqable
   (-seq [this]
-        (let [resukey-lt #js []]
-          (.into this resukey-lt)
-          (seq resukey-lt))))
+        (let [result #js []]
+          (.into this result)
+          (seq result))))

 (deftype Node [parent parent-ix keys vals children ^:mutable lower ^:mutable upper]
   Object
-  (into [this resukey-lt]
+  (into [this result]
         (dotimes [ix (alength keys)]
           (when-not (nil? children)
-            (.into (aget children ix) resukey-lt))
-          (apush resukey-lt #js [(aget keys ix) (aget vals ix)]))
+            (.into (aget children ix) result))
+          (apush result #js [(aget keys ix) (aget vals ix)]))
         (when-not (nil? children)
-          (.into (aget children (alength keys)) resukey-lt)))
+          (.into (aget children (alength keys)) result)))
   (seek [this key ix]
         (loop [lo (if (> ix 0) ix 0)
                hi (- (alength keys) 1)]
@@ -171,7 +174,6 @@
   (maintain! [this max-keys]
              (assert max-keys)
              (when-not (nil? parent)
-               ;; TODO update ranges (.update-lower this)
                (let [min-keys (js/Math.floor (/ max-keys 2))]
                  (when-not (nil? children)
                    (dotimes [ix (alength children)]
@@ -280,9 +282,9 @@
   (pretty-print [this]
                 (str "(" parent-ix ")" "|" (pr-str lower) " " (pr-str (vec keys)) " " (pr-str upper) "|")))

-(defn tree [min-keys]
-  (let [node (Node. nil nil #js [] #js [] nil greatest least)
-        tree (Tree. (* 2 min-keys) node)]
+(defn tree [min-keys key-len]
+  (let [node (Node. nil nil #js [] #js [] nil (greatest-key key-len) (least-key key-len))
+        tree (Tree. (* 2 min-keys) key-len node)]
     (set! (.-parent node) tree)
     (set! (.-parent-ix node) 0)
     tree))
@@ -396,99 +398,95 @@
     (aget iterators 0)))

 (defn iter-seq [iterator]
-  (let [resukey-lts #js []]
+  (let [results #js []]
     (while (false? (.-end? iterator))
-      (.push resukey-lts (.key iterator))
+      (.push results (.key iterator))
       (.next iterator))
-    resukey-lts))
+    results))

 ;; TESTS

 (defn gen-key [key-len]
   (gen/fmap into-array (gen/vector (gen/one-of [gen/int gen/string-ascii]) key-len)))

-(def least-prop
-  (prop/for-all [key-len gen/s-pos-int]
-                (prop/for-all [key (gen-key key-len)]
-                              (and (key-lt (least-key key-len) key)
-                                   (key-lte (least-key key-len) key)
-                                   (key-gt key (least-key key-len))
-                                   (key-gte key (least-key key-len))))))
-
-(def greatest-prop
-  (prop/for-all [key-len gen/s-pos-int]
-                (prop/for-all [key (gen-key key-len)]
-                              (and (key-gt (greatest-key key-len) key)
-                                   (key-gte (greatest-key key-len) key)
-                                   (key-lt key (greatest-key key-len))
-                                   (key-lte key (greatest-key key-len))))))
-
-(def equality-prop
-
-  (prop/for-all [key-len gen/s-pos-int]
-                (prop/for-all [key-a (gen-key key-len)
-                               key-b (gen-key key-len)]
-                              (= (== key-a key-b)
-                                 (and (key-lte key-a key-b) (not (key-lt key-a key-b)))
-                                 (and (key-gte key-a key-b) (not (key-gt key-a key-b)))))))
-
-(def reflexive-prop
-  (prop/for-all [key-len gen/s-pos-int]
-                (prop/for-all [key (gen-key key-len)]
-                              (and (key-lte key key) (key-gte key key) (not (key-lt key key)) (not (key-gt key key))))))
-
-(def transitive-prop
-
-  (prop/for-all [key-len gen/s-pos-int]
-                (prop/for-all [key-a (gen-key key-len)
-                               key-b (gen-key key-len)
-                               key-c (gen-key key-len)]
-                              (and (if (and (key-lt key-a key-b) (key-lt key-b key-c)) (key-lt key-a key-c) true)
-                                   (if (and (key-lte key-a key-b) (key-lte key-b key-c)) (key-lte key-a key-c) true)
-                                   (if (and (key-gt key-a key-b) (key-gt key-b key-c)) (key-gt key-a key-c) true)
-                                   (if (and (key-gte key-a key-b) (key-gte key-b key-c)) (key-gte key-a key-c) true)))))
-
-(def anti-symmetric-prop
-
-  (prop/for-all [key-len gen/s-pos-int]
-                (prop/for-all [key-a (gen-key key-len)
-                               key-b (gen-key key-len)]
-                              (and (not (and (key-lt key-a key-b) (key-lt key-b key-a)))
-                                   (not (and (key-gt key-a key-b) (key-gt key-b key-a)))))))
-
-(def total-prop
-  (prop/for-all [key-len gen/s-pos-int]
-                (prop/for-all [key-a (gen-key key-len)
-                               key-b (gen-key key-len)]
-                              (and (or (key-lt key-a key-b) (key-gte key-a key-b))
-                                   (or (key-gt key-a key-b) (key-lte key-a key-b))))))
+(defn least-prop [key-len]
+  (prop/for-all [key (gen-key key-len)]
+                (and (key-lt (least-key key-len) key)
+                     (key-lte (least-key key-len) key)
+                     (key-gt key (least-key key-len))
+                     (key-gte key (least-key key-len)))))
+
+(defn greatest-prop [key-len]
+  (prop/for-all [key (gen-key key-len)]
+                (and (key-gt (greatest-key key-len) key)
+                     (key-gte (greatest-key key-len) key)
+                     (key-lt key (greatest-key key-len))
+                     (key-lte key (greatest-key key-len)))))
+
+(defn equality-prop [key-len]
+  (prop/for-all [key-a (gen-key key-len)
+                 key-b (gen-key key-len)]
+                (= (key= key-a key-b)
+                   (and (key-lte key-a key-b) (not (key-lt key-a key-b)))
+                   (and (key-gte key-a key-b) (not (key-gt key-a key-b))))))
+
+(defn reflexive-prop [key-len]
+  (prop/for-all [key (gen-key key-len)]
+                (and (key-lte key key) (key-gte key key) (not (key-lt key key)) (not (key-gt key key)))))
+
+(defn transitive-prop [key-len]
+  (prop/for-all [key-a (gen-key key-len)
+                 key-b (gen-key key-len)
+                 key-c (gen-key key-len)]
+                (and (if (and (key-lt key-a key-b) (key-lt key-b key-c)) (key-lt key-a key-c) true)
+                     (if (and (key-lte key-a key-b) (key-lte key-b key-c)) (key-lte key-a key-c) true)
+                     (if (and (key-gt key-a key-b) (key-gt key-b key-c)) (key-gt key-a key-c) true)
+                     (if (and (key-gte key-a key-b) (key-gte key-b key-c)) (key-gte key-a key-c) true))))
+
+(defn anti-symmetric-prop [key-len]
+  (prop/for-all [key-a (gen-key key-len)
+                 key-b (gen-key key-len)]
+                (and (not (and (key-lt key-a key-b) (key-lt key-b key-a)))
+                     (not (and (key-gt key-a key-b) (key-gt key-b key-a))))))
+
+(defn total-prop [key-len]
+  (prop/for-all [key-a (gen-key key-len)
+                 key-b (gen-key key-len)]
+                (and (or (key-lt key-a key-b) (key-gte key-a key-b))
+                     (or (key-gt key-a key-b) (key-lte key-a key-b)))))

 ;; fast gens with no shrinking and no long strings. good enough for government work

-(defn make-simple-key [rnd size]
+(defn make-simple-key-elem [rnd size]
   (let [value (gen/rand-range rnd (- size) size)]
     (if (pprng/boolean rnd)
       value
       (str value))))

-(def gen-assoc
+(defn make-simple-key [rnd size key-len]
+  (let [result #js []]
+    (dotimes [_ key-len]
+      (.push result (make-simple-key-elem rnd size)))
+    result))
+
+(defn gen-assoc [key-len]
   (gen/make-gen
    (fn [rnd size]
-     (let [key (make-simple-key rnd size)
-           val (make-simple-key rnd size)]
+     (let [key (make-simple-key rnd size key-len)
+           val (make-simple-key rnd size key-len)]
        [[:assoc! key key] nil]))))

-(def gen-dissoc
+(defn gen-dissoc [key-len]
   (gen/make-gen
    (fn [rnd size]
-     (let [key (make-simple-key rnd size)]
+     (let [key (make-simple-key rnd size key-len)]
        [[:dissoc! key] nil]))))

-(def gen-action
+(defn gen-action [key-len]
   (gen/make-gen
    (fn [rnd size]
-     (let [key (make-simple-key rnd size)
-           val (make-simple-key rnd size)]
+     (let [key (make-simple-key rnd size key-len)
+           val (make-simple-key rnd size key-len)]
        (if (pprng/boolean rnd)
          [[:assoc! key val] nil]
          [[:dissoc! key] nil])))))
@@ -513,47 +511,47 @@
        :dissoc! (dissoc map (nth action 1))))
    map actions))

-(defn run-building-prop [min-keys actions]
-  (let [tree (apply-to-tree (tree min-keys) actions)
+(defn run-building-prop [min-keys key-len actions]
+  (let [tree (apply-to-tree (tree min-keys key-len) actions)
         sorted-map (apply-to-sorted-map (sorted-map-by compare-keys) actions)]
     (and (= (seq (map vec tree)) (seq sorted-map))
          (.valid! tree))))

-(defn building-prop [gen]
+(defn building-prop [gen key-len]
   (prop/for-all [min-keys gen/s-pos-int
-                 actions (gen/vector gen)]
-                (run-building-prop min-keys actions)))
-
-(defn run-lookup-prop [min-keys actions action]
-  (let [tree (apply-to-tree (tree min-keys) actions)
+                 actions (gen/vector (gen key-len))]
+                (run-building-prop min-keys key-len actions)))
+
+(defn run-lookup-prop [min-keys key-len actions action]
+  (let [tree (apply-to-tree (tree min-keys key-len) actions)
         sorted-map (apply-to-sorted-map (sorted-map-by compare-keys) actions)
-        tree-resukey-lt (case (nth action 0)
+        tree-result (case (nth action 0)
                       :assoc! (.assoc! tree (nth action 1) (nth action 2))
                       :dissoc! (.dissoc! tree (nth action 1)))
-        sorted-map-resukey-lt (contains? sorted-map (nth action 1))]
-    (= tree-resukey-lt sorted-map-resukey-lt)))
-
-(defn lookup-prop [gen]
+        sorted-map-result (contains? sorted-map (nth action 1))]
+    (= tree-result sorted-map-result)))
+
+(defn lookup-prop [gen key-len]
   (prop/for-all [min-keys gen/s-pos-int
-                 actions (gen/vector gen)
-                 action gen]
-                (run-lookup-prop min-keys actions action)))
-
-(def gen-next
+                 actions (gen/vector (gen key-len))
+                 action (gen key-len)]
+                (run-lookup-prop min-keys key-len actions action)))
+
+(defn gen-next [key-len]
   (gen/make-gen
    (fn [rnd size]
      [[:next] nil])))

-(def gen-seek
+(defn gen-seek [key-len]
   (gen/make-gen
    (fn [rnd size]
-     (let [key (make-simple-key rnd size)]
+     (let [key (make-simple-key rnd size key-len)]
        [[:seek key] nil]))))

-(def gen-movement
+(defn gen-movement [key-len]
   (gen/make-gen
    (fn [rnd size]
-     (let [key (make-simple-key rnd size)]
+     (let [key (make-simple-key rnd size key-len)]
        (if (pprng/boolean rnd)
          [[:next] nil]
          [[:seek key] nil])))))
@@ -580,42 +578,48 @@
                 (swap! elems (fn [elems] (drop-while #(key-lt (nth % 0) (nth movement 1)) elems)))
                 (first (first @elems)))))))

-(defn run-iterator-prop [min-keys actions movements]
-  (let [tree (apply-to-tree (tree min-keys) actions)
+(defn run-iterator-prop [min-keys key-len actions movements]
+  (let [tree (apply-to-tree (tree min-keys key-len) actions)
         sorted-map (apply-to-sorted-map (sorted-map-by compare-keys) actions)
-        iterator-resukey-lts (apply-to-iterator (iterator tree) movements)
-        elems-resukey-lts (apply-to-elems (seq sorted-map) movements)]
+        iterator-results (apply-to-iterator (iterator tree) movements)
+        elems-results (apply-to-elems (seq sorted-map) movements)]
     #_(.pretty-print tree)
-    (= iterator-resukey-lts elems-resukey-lts)))
-
-(def iterator-prop
+    (= iterator-results elems-results)))
+
+(defn iterator-prop [key-len]
   (prop/for-all [min-keys gen/s-pos-int
-                 actions (gen/vector gen-action)
-                 movements (gen/vector gen-movement)]
-                (run-iterator-prop min-keys actions movements)))
-
-(defn run-intersection-prop [min-keys actionss movements]
-  (let [trees (map #(apply-to-tree (tree min-keys) %) actionss)
+                 actions (gen/vector (gen-action key-len))
+                 movements (gen/vector (gen-movement key-len))]
+                (run-iterator-prop min-keys key-len actions movements)))
+
+(defn run-intersection-prop [min-keys key-len actionss movements]
+  (let [trees (map #(apply-to-tree (tree min-keys key-len) %) actionss)
         elems (apply clojure.set/intersection (map #(set (map vec %)) trees))
         sorted-map (into (sorted-map-by compare-keys) elems)
-        iterator-resukey-lts (apply-to-iterator (intersection (into-array (map iterator trees))) movements)
-        elems-resukey-lts (apply-to-elems (seq sorted-map) movements)]
-    (= iterator-resukey-lts elems-resukey-lts)))
-
-(def intersection-prop
+        iterator-results (apply-to-iterator (intersection (into-array (map iterator trees))) movements)
+        elems-results (apply-to-elems (seq sorted-map) movements)]
+    (= iterator-results elems-results)))
+
+(defn intersection-prop [key-len]
   (prop/for-all [min-keys gen/s-pos-int
-                 actionss (gen/not-empty (gen/vector (gen/vector gen-action)))
-                 movements (gen/vector gen-movement)]
-                (run-intersection-prop min-keys actionss movements)))
-
+                 actionss (gen/not-empty (gen/vector (gen/vector (gen-action key-len))))
+                 movements (gen/vector (gen-movement key-len))]
+                false))
 (comment
-  (dc/quick-check 1000 least-prop)
-  (dc/quick-check 1000 greatest-prop)
-  (dc/quick-check 1000 equality-prop)
-  (dc/quick-check 1000 reflexive-prop)
-  (dc/quick-check 1000 transitive-prop)
-  (dc/quick-check 1000 anti-symmetric-prop)
-  (dc/quick-check 1000 total-prop)
+  (dc/quick-check 1000 (least-prop 1))
+  (dc/quick-check 1000 (least-prop 2))
+  (dc/quick-check 1000 (greatest-prop 1))
+  (dc/quick-check 1000 (greatest-prop 2))
+  (dc/quick-check 1000 (equality-prop 1))
+  (dc/quick-check 1000 (equality-prop 2))
+  (dc/quick-check 1000 (reflexive-prop 1))
+  (dc/quick-check 1000 (reflexive-prop 2))
+  (dc/quick-check 1000 (transitive-prop 1))
+  (dc/quick-check 1000 (transitive-prop 2))
+  (dc/quick-check 1000 (anti-symmetric-prop 1))
+  (dc/quick-check 1000 (anti-symmetric-prop 2))
+  (dc/quick-check 1000 (total-prop 1))
+  (dc/quick-check 1000 (total-prop 2))
   (dc/quick-check 1000 (building-prop gen-assoc))
   (dc/quick-check 10000 (building-prop gen-action))
   ;; cljs.core.pr_str(cemerick.double_check.quick_check(1000, aurora.btree.building_prop(aurora.btree.gen_action)))


allow engine/generate to look at :generate-fn (as with latin)

--- src/babel/engine.cljc
+++ src/babel/engine.cljc
@@ -46,56 +46,58 @@
                          @language-model
                          language-model)
         grammar (:grammar language-model)]
-    (if (empty? grammar)
-      (do
-        (log/error (str "grammar is empty."))
-        (exception (str "grammar is empty.")))))
-
-  (let [spec (if (or (= false add-subcat)
-                     (fail? (unify spec {:synsem {:subcat '()}}))
-                     (not (= :none (get-in spec [:synsem :subcat] :none))))
-               spec
-
-               ;; else:
-               (unify spec
-                      {:synsem {:subcat '()}}))
-
-        debug (log/debug (str "pre-enrich spec: " spec))
-
-        ;; if a generate-only lexicon is supplied by the language model, use that.
-        lexicon (if (get-in language-model [:generate :lexicon])
-                  (get-in language-model [:generate :lexicon])
-                  (get-in language-model [:lexicon]))
-
-        post-enrich-spec (if (and do-enrich (:enrich language-model))
-                           ((:enrich language-model)
-                            spec
-                            lexicon)
-                           spec)
-
-        spec (if (not (empty? post-enrich-spec))
-               post-enrich-spec
-               (list spec))
-
-        debug (log/debug (str "post-enrich spec: "
-                              (string/join ";" spec)))
-
-        check-for-empty-spec (if (empty? spec)
-                               (do (log/error (str "post-enrich spec is empty!"))
-                                   (exception (str "post-enrich spec is empty!"))))
-        debug (if (seq? spec)
-                (count
-                 (map #(log/debug (str "post-enrich spec: " %))
-                      spec))
-                (log/debug (str "post-enrich spec: " spec)))
-        ]
-    (first (map (fn [each-spec]
-                  (generate/generate each-spec language-model
-                                     :truncate-children truncate-children
-                                     :max-total-depth max-total-depth))
-                (if (or (seq? spec) (vector? spec))
-                  spec
-                  [spec])))))
+    (cond (:generate-fn language-model)
+          ((:generate-fn language-model) spec)
+          (empty? grammar)
+          (do
+            (log/error (str "grammar is empty."))
+            (exception (str "grammar is empty.")))
+          true
+          (let [spec (if (or (= false add-subcat)
+                             (fail? (unify spec {:synsem {:subcat '()}}))
+                             (not (= :none (get-in spec [:synsem :subcat] :none))))
+                       spec
+
+                       ;; else:
+                       (unify spec
+                              {:synsem {:subcat '()}}))
+
+                debug (log/debug (str "pre-enrich spec: " spec))
+
+                ;; if a generate-only lexicon is supplied by the language model, use that.
+                lexicon (if (get-in language-model [:generate :lexicon])
+                          (get-in language-model [:generate :lexicon])
+                          (get-in language-model [:lexicon]))
+
+                post-enrich-spec (if (and do-enrich (:enrich language-model))
+                                   ((:enrich language-model)
+                                    spec
+                                    lexicon)
+                                   spec)
+
+                spec (if (not (empty? post-enrich-spec))
+                       post-enrich-spec
+                       (list spec))
+
+                debug (log/debug (str "post-enrich spec: "
+                                      (string/join ";" spec)))
+
+                check-for-empty-spec (if (empty? spec)
+                                       (do (log/error (str "post-enrich spec is empty!"))
+                                           (exception (str "post-enrich spec is empty!"))))
+                debug (if (seq? spec)
+                        (count
+                         (map #(log/debug (str "post-enrich spec: " %))
+                              spec))
+                        (log/debug (str "post-enrich spec: " spec)))
+                ]
+            (first (map (fn [each-spec]
+                          (generate/generate each-spec language-model
+                                             :truncate-children truncate-children
+                                             :max-total-depth max-total-depth))
+                        (if (or (seq? spec) (vector? spec))
+                          spec
+                          [spec])))))))

 #?(:clj
 (defn generate-from-request [request]


logging improvements

logging improvements

--- src/babel/forest.cljc
+++ src/babel/forest.cljc
@@ -99,26 +99,21 @@
   (if (and (not (= :fail spec))
            (not (= :top spec))
            (not (empty? (strip-refs spec))))
-    (log/debug (str "lighting-bolt@" depth " spec: " (strip-refs spec) "; parent: " (if parent
-                                                                                (:rule parent)))))
+    (do
+      (log/debug (str "lightning-bolt@" depth))
+      (log/trace (str "lighting-bolt spec: " (strip-refs spec) "; parent: " (if parent
+                                                                              (:rule parent))))))
   (if (not parent)
     (log/debug (str "no parent for lightning-bolt@" depth " with spec: " (strip-refs spec))))
   (let [maxdepth 3 ;; maximum depth of a lightning bolt: H1 -> H2 -> H3 where H3 must be a lexeme, not a phrase.
-        debug (log/debug (str "lightning-bolt@" depth " grammar:" (string/join ", " (map #(get-in % [:rule]) grammar))))
-
+        debug (log/trace (str "lightning-bolt@" depth " grammar:" (string/join ", " (map #(get-in % [:rule]) grammar))))
         depth (if depth depth 0)
-        ;; TODO: unifyc is expensive: factor out into a let.
-        debug (log/debug (str "looking for candidate head phrases with parent: " (:rule parent) " and spec: " (strip-refs spec)))
+        debug (log/debug (str "looking for candidate head phrases with parent: " (:rule parent)))
+
         candidate-heads (filter #(not (fail? %))
                                   (map (fn [rule]
-                                         (do (log/debug (str "testing rule: " (:rule rule)
-                                                             ":" (strip-refs rule)))
-                                             (if (fail? rule)
-                                               (throw (exception (str "rule has a fail: " (strip-refs rule)))))
-                                             (log/debug (str " result: " (strip-refs (unifyc spec rule))))
-                                             (log/debug (if (fail? (unifyc spec rule))
-                                                          (str "fail path: " (fail-path-between spec rule))
-                                                          (str "rule: " (:rule rule) " successfully unified with spec: " (strip-refs spec))))
+                                         (do (log/trace (str "testing rule: " (:rule rule)
+                                                             "with cat:" (get-in rule [:synsem :cat])))
                                              (unifyc spec rule)))
                                        (if parent
                                          (let [hp (get-head-phrases-of parent index)]
@@ -128,7 +123,7 @@
                                            (log/debug (str "not getting head phrases: using grammar"))
                                            grammar))))

-        debug (log/debug (str "done looking for candidate head phrases: "
+        debug (log/trace (str "done looking for candidate head phrases: "
                               (if (empty? candidate-heads)
                                 "no candidate heads found."
                                 (str "one or more candidate heads found; first: " (:rule (first candidate-heads))))))
@@ -136,10 +131,10 @@
         debug (if (not (empty? candidate-heads))
                 (log/debug (str "candidate-heads: " (string/join "," (map #(get-in % [:rule])
                                                                             candidate-heads))))
-                (log/debug (str "no candidate head phrases for spec: " (strip-refs spec))))]
+                (log/trace (str "no candidate head phrases for spec: " (strip-refs spec))))]
     ;; TODO: remove or parameterize this hard-coded value.
     (if (> depth 5)
-      (throw (exception (str "DEPTH IS GREATER THAN 5; HOW DID YOU END UP IN THIS TERRIBLE SITUATION? LOOK AT THE STACK. I'M OUTTA HERE."))))
+      (throw (exception (str "depth is greater than 5: should never happen."))))

     (if (seq candidate-heads)
       (let [lexical ;; 1. generate list of all phrases where the head child of each parent is a lexeme.
@@ -219,12 +214,12 @@
     (if (not (= bolt-spec :no-path)) ;; check if this bolt has this path in it.
       (let [immediate-parent (get-in bolt (butlast path))
             start-time (current-time)
-            cached (if (and true cache)
+            cached (if cache
                      (do
                        (let [result (get-lex immediate-parent :comp cache spec)]
-                         (log/debug (str "lexical-complement candidates: " (string/join ", " (map morph result))))
+                         (log/trace (str "lexical-complement candidates: " (string/join ", " (map morph result))))
                          (if (not (nil? result))
-                           (log/debug (str " cached lexical subset ratio: "
+                           (log/trace (str " cached lexical subset ratio: "
                                            (string/replace (str (/ (* 1.0 (/ (count lexicon) (count result)))))
                                                            #"\.(..).*"
                                                            (fn [[_ two-digits]] (str "." two-digits))))))
@@ -234,9 +229,6 @@
             complement-candidate-lexemes (if (not (= true
                                                      (get-in bolt (concat path [:phrasal]))))
                                            (if cached cached (flatten (vals lexicon))))]
-        (let [semantics (get-in spec [:synsem :sem])]
-          (if (not (nil? semantics))
-            (if (not (nil? semantics)) (log/debug (str "  with semantics:" (strip-refs semantics))))))
         (log/debug (str " immediate parent:" (get-in immediate-parent [:rule])))
         (let [complement-pre-check (fn [child parent path-to-child]
                                      (let [child-in-bolt (get-in bolt path-to-child)]
@@ -277,11 +269,9 @@
                            (do
                              (log/debug (str "generating phrasal complements with spec: " (strip-refs spec)))
                              (let [phrasal-complements (generate-all spec grammar lexicon cache morph)]
-                               (log/debug (str "number of phrasal components given spec: " spec ":"
-                                               (count phrasal-complements)))
                                (if (not (empty? phrasal-complements))
-                                 (log/debug (str "phrasal complements given spec: " spec ":"
-                                                 (string/join "," (map morph phrasal-complements))))
+                                 (log/debug (str "phrasal complements were not empty; first: "
+                                                 (get-in (first phrasal-complements) [:rule])))
                                  ;; phrasal complements were empty.
                                  (if (= true (get-in spec [:phrasal] false))
                                    (log/warn (str "no phrasal complements of spec: " (strip-refs spec)
@@ -354,8 +344,8 @@
         (list bolt)))))

 (defn add-complements-to-bolts [bolts path spec grammar lexicon cache morph]
-  (if (seq bolts)
-    (lazy-cat (if (not (fail? (first bolts)))
+  (if (not (empty? bolts))
+    (lazy-cat (if (or true (not (fail? (first bolts)))) ;; experimenting with using (or true ..) to disable this fail? check.
                 (add-complement (first bolts) path spec grammar lexicon cache morph))
               (add-complements-to-bolts (rest bolts) path spec grammar lexicon cache morph))))


Add tools.nrep to .lein/profiles.clj

Add tools.nrep to .lein/profiles.clj

--- lein/profiles.clj
+++ lein/profiles.clj
@@ -33,6 +33,7 @@
                        [nrepl-inspect "0.3.0"]
                        [org.codehaus.plexus/plexus-utils "3.0"]
                        [org.clojure/tools.namespace "0.2.10"]
+                       [org.clojure/tools.nrepl "0.2.10" :exclusions [org.clojure/clojure]]
                        [pjstadig/humane-test-output "0.7.0"]
                        ;; Q: Is there any point to this next one?
                        [ritz/ritz-nrepl-middleware "0.7.0"]
@@ -54,7 +55,7 @@
                       ;; Inject into clojure.core
                       clojure.core
                       [vinyasa.reflection .> .? .* .% .%> .& .>ns .>var]
-
+
                       ;; Inject into clojure.core, with prefix
                       clojure.core >
                       [clojure.pprint pprint]


Extend deep-merge test with second level key whitspaces   #psh

--- test/cider_ci/utils/tests/core.clj
+++ test/cider_ci/utils/tests/core.clj
@@ -64,15 +64,17 @@
   (is (= (deep-merge
            (yaml/parse-string
              "x y z:
-                x: 42")
+             y z:
+               y: 42")
            (yaml/parse-string
              "x y z:
-                y: 49")
+             y z:
+               z: 49")
            (yaml/parse-string
              "x y z:
-                z/z: 3.14")
+             z/z: 3.14")
            (yaml/parse-string
              "a b c: 7"))
-         {(keyword "x y z") {:x 42 :y 49 :z/z 3.14}
+         {(keyword "x y z") {(keyword "y z") {:y 42 :z 49} :z/z 3.14}
           (keyword "a b c") 7 })))


comments

comments

--- src/c4_arena/core.clj
+++ src/c4_arena/core.clj
@@ -45,10 +45,12 @@
               (for [dir [- +] ;; in both directions
                     j (reductions + (repeat angle)) ;; straight line
                     :let [k (dir i j)]
-                    ;; while position is on the board and the same
-                    ;; symbol as the candidate
-                    :while (and (<= 0 k (dec (* ncols nrows)))
-                                (= cand (state-val k)))]
+                    ;; while position is
+                    :while (and
+                            ;; on the board
+                            (<= 0 k (dec (* ncols nrows)))
+                            ;; the symbol as the candidate
+                            (= cand (state-val k)))]
                 true)))
            ;; At least one line is longer than needed to win
            (some (fn [n] (>= n (dec n-to-win)))))


clearing small dup

clearing small dup

--- src/celestial/api.clj
+++ src/celestial/api.clj
@@ -27,9 +27,8 @@
     [ring.middleware [multipart-params :as mp] ]
     [celestial.security :as sec]
     [celestial.persistency :as p]
-    [compojure.handler :refer (site)]
+    [compojure.handler :as handler :refer (site)]
     [celestial.jobs :as jobs]
-    [compojure.handler :as handler]
     [cemerick.friend :as friend]
     [cemerick.friend.credentials :as creds]
     [compojure.route :as route]))


Typo in rule use fix.

Typo in rule use fix.

--- EkekoAspectJ/src/damp/ekeko/aspectj/weaverworld.clj
+++ EkekoAspectJ/src/damp/ekeko/aspectj/weaverworld.clj
@@ -1132,7 +1132,7 @@
    by aspect-pointcutdefinition."
   [?advice ?pointcut]
   (fresh [?raw]
-         (advice-poincut|raw ?advice ?raw)
+         (advice-pointcut|raw ?advice ?raw)
          (succeeds (instance? AndPointcut ?raw)) ;;TODO: check whether others are possible?
          (equals ?pointcut (.getLeft ?raw))))


Stub for test module: core_test.clj + common test function

--- test/emender_jenkins/core_test.clj
+++ test/emender_jenkins/core_test.clj
@@ -1,7 +1,25 @@
+;
+;  (C) Copyright 2016  Pavel Tisnovsky
+;
+;  All rights reserved. This program and the accompanying materials
+;  are made available under the terms of the Eclipse Public License v1.0
+;  which accompanies this distribution, and is available at
+;  http://www.eclipse.org/legal/epl-v10.html
+;
+;  Contributors:
+;      Pavel Tisnovsky
+;
+
 (ns emender-jenkins.core-test
   (:require [clojure.test :refer :all]
             [emender-jenkins.core :refer :all]))

-(deftest a-test
-  (testing "FIXME, I fail."
-    (is (= 0 1))))
+;
+; Common functions used by tests.
+;
+
+(defn callable?
+    "Test if given function-name is bound to the real function."
+    [function-name]
+    (clojure.test/function? function-name))
+


take activity out of aside

take activity out of aside

--- frontend/components/aside.cljs
+++ frontend/components/aside.cljs
@@ -110,7 +110,6 @@
             projects (get-in app state/projects-path)
             settings (get-in app state/settings-path)
             slim-aside? (get-in app state/slim-aside-path)
-            show-all-branches? (get-in app state/show-all-branches-path)
             user (:current-user app)]
         (html
          [:nav.aside-left-nav {:class (when slim-aside? "slim")}
@@ -119,21 +118,28 @@
                                 :href "/"}
            [:div.logomark
             (common/ico :logo)]]
-          [:div.aside-activity {:class (when-not slim-aside? "open")}
-           [:div.wrapper
-            [:div.toggle-all-branches
-             [:button {:class (when-not show-all-branches? "active")
-                       :on-click #(put! controls-ch [:show-all-branches-toggled false])}
-              "You"]
-             [:button {:class (when show-all-branches? "active")
-                       :on-click #(put! controls-ch [:show-all-branches-toggled true])}
-              "All"]]
-            (for [project (sort project-model/sidebar-sort projects)]
-              (om/build project-aside
-                        {:project project
-                         :user user
-                         :settings settings}
-                        {:react-key (project-model/id project)}))]]
+          [:a.aside-item {:data-bind "tooltip: {title: 'Settings', placement: 'right', trigger: 'hover'}",
+                          :href "/account"}
+           [:i.fa.fa-cog]
+           [:span "Settings"]]
+
+          [:a.aside-item {:data-bind "tooltip: {title: 'Settings', placement: 'right', trigger: 'hover'}"
+                          :href "/docs"}
+           [:i.fa.fa-copy]
+           [:span "Documentation"]]
+
+          [:a.aside-item {:on-click #(put! controls-ch [:intercom-dialog-raised])
+                          :data-bind "tooltip: {title: 'Report Bug', placement: 'right', trigger: 'hover'}, click: $root.raiseIntercomDialog",}
+           [:i.fa.fa-bug]
+           [:span "Report Bug"]]
+
+          [:a.aside-item
+           {:href "https://www.hipchat.com/gjwkHcrD5",
+            :target "_blank",
+            :data-bind "tooltip: {title: 'Live Support', placement: 'right', trigger: 'hover'}"}
+           [:i.fa.fa-comments]
+           [:span "Live Support"]]
+
           [:a#add-projects.aside-item {:href "/add-projects",
                                        :data-bind "tooltip: {title: 'Add Projects', placement: 'right', trigger: 'hover'}"}
            [:i.fa.fa-plus-circle]
@@ -145,6 +151,14 @@
            [:i.fa.fa-envelope-o]
            [:span "Invite Teammate"]]

+          [:a.aside-item {:data-bind "tooltip: {title: 'Expand', placement: 'right', trigger: 'hover'}"
+                          :on-click #(put! controls-ch [:slim-aside-toggled])}
+           (if slim-aside?
+             [:i.fa.fa-long-arrow-right]
+             (list
+              [:i.fa.fa-long-arrow-left]
+              [:span "Collapse"]))]
+
           [:div.aside-slideup
            [:a.aside-item {:href "/account"
                            :data-bind "tooltip: {title: 'User Account', placement: 'right', trigger: 'hover'}"}
@@ -152,14 +166,8 @@
                                                 :login (:login user)
                                                 :size 50})}]
             (:login user)]
+
            [:a.aside-item {:href "/logout"
                            :data-bind "tooltip: {title: 'Logout', placement: 'right', trigger: 'hover'}"}
             [:i.fa.fa-sign-out]
-            [:span "Logout"]]
-           [:a.aside-item {:data-bind "tooltip: {title: 'Expand', placement: 'right', trigger: 'hover'}"
-                           :on-click #(put! controls-ch [:slim-aside-toggled])}
-            (if slim-aside?
-              [:i.fa.fa-long-arrow-right]
-              (list
-               [:i.fa.fa-long-arrow-left]
-               [:span "Collapse"]))]]])))))
+            [:span "Logout"]]]])))))


Fix desactivation issue

Fix desactivation issue

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -140,8 +140,8 @@
        (let [dest (if (sequential? to) (vec to) [to])
              c (if (and (= side :corp) (= (first dest) :discard) (:rezzed card))
                  (assoc card :seen true) card)
-             c (if (and (or installed (#{:servers :scored :current} (first zone)))
-                        (#{:hand :deck :discard} (first dest)))
+             c (if (and (or host (#{:servers :scored :current} (first zone)))
+                        (#{:hand :deck :discard :scored} (first dest)))
                  (desactivate state side c) c)
              moved-card (assoc c :zone dest :host nil :hosted nil :previous-zone (:zone c))]
          (if front


ICE is spelled uppercase

ICE is spelled uppercase

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -1666,7 +1666,7 @@
                      (trash state side prev-card {:keep-server-alive true})))
                  (let [is-ice (= (:type c) "ICE")
                        card-name (if (or (= :rezzed-no-cost install-state) (= :face-up install-state) (:rezzed c))
-                                   (:title card) (if is-ice "ice" "a card"))]
+                                   (:title card) (if is-ice "ICE" "a card"))]
                    (system-msg state side (str (build-spend-msg cost-str "install")
                                                 card-name (if is-ice " protecting " " in ") server)))
                  (let [moved-card (move state side c slot)]


Fixed steal cost not being corretcly applied.

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -851,8 +851,8 @@
                 (let [cost (steal-cost state side c)]
                   (if (pos? (count cost))
                     (optional-ability state :runner c (str "Pay " (costs-to-symbol cost) " to steal " name "?")
-                                      {:cost cost
-                                       :yes-ability {:effect (effect (system-msg (str "pays " (costs-to-symbol cost)
+                                      {:yes-ability {:cost
+                                                     :effect (effect (system-msg (str "pays " (costs-to-symbol cost)
                                                                                " to steal " (:title c)))
                                                                      (resolve-steal c))}
                                        :no-ability {:effect (effect (resolve-steal-events c))}} nil)


Fix get-virus-counters to see Hiveminds that are hosted.

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -903,7 +903,7 @@
   (trigger-event state side :purge))

 (defn get-virus-counters [state side card]
-   (let [hiveminds (filter #(= (:title %) "Hivemind") (get-in @state [:runner :rig :program]))]
+   (let [hiveminds (filter #(= (:title %) "Hivemind") (all-installed state :runner))]
         (reduce + (map :counter (cons card hiveminds)))))

 (defn play-instant


modify desactivate and forfeit to support undoing agenda effects when forfeited or Turntabled

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -123,7 +123,8 @@
      (when-let [leave-effect (:leave-play (card-def card))]
        (when (or (and (= (:side card) "Runner") (:installed card))
                  (:rezzed card)
-                 (= (first (:zone card)) :current))
+                 (= (first (:zone card)) :current)
+                 (= (first (:zone card)) :scored))
          (leave-effect state side card nil)))
      (when-let [prevent (:prevent (card-def card))]
        (doseq [[ptype pvec] prevent]
@@ -1549,9 +1550,10 @@
     (add-prop state side (get-card state card) :advance-counter 1)))

 (defn forfeit [state side card]
-  (system-msg state side (str "forfeits " (:title card)))
-  (gain state side :agenda-point (- (:agendapoints card)))
-  (move state :corp card :rfg))
+  (let [c (desactivate state side card)]
+    (system-msg state side (str "forfeits " (:title c)))
+    (gain state side :agenda-point (- (:agendapoints c)))
+    (move state :corp c :rfg)))

 (defn expose [state side target]
   (system-msg state side


--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -851,8 +851,8 @@
                 (let [cost (steal-cost state side c)]
                   (if (pos? (count cost))
                     (optional-ability state :runner c (str "Pay " (costs-to-symbol cost) " to steal " name "?")
-                                      {:cost cost
-                                       :yes-ability {:effect (effect (system-msg (str "pays " (costs-to-symbol cost)
+                                      {:yes-ability {:cost cost
+                                                     :effect (effect (system-msg (str "pays " (costs-to-symbol cost)
                                                                                " to steal " (:title c)))
                                                                      (resolve-steal c))}
                                        :no-ability {:effect (effect (resolve-steal-events c))}} nil)


Remove all reflection

Remove all reflection

--- src/clj_http/core.clj
+++ src/clj_http/core.clj
@@ -66,11 +66,13 @@
       (.getRedirect DefaultRedirectStrategy/INSTANCE request response context))

     (isRedirected [this request response context]
-      (let [max-redirects (.getMaxRedirects (.getRequestConfig context))
-            num-redirects (count (.getRedirectLocations context))]
+      (let [^HttpClientContext typed-context context
+            max-redirects (-> (.getRequestConfig typed-context)
+                              .getMaxRedirects)
+            num-redirects (count (.getRedirectLocations typed-context))]
         (if (<= max-redirects num-redirects)
           false
-          (.isRedirected DefaultRedirectStrategy/INSTANCE request response context))))))
+          (.isRedirected DefaultRedirectStrategy/INSTANCE request response typed-context))))))

 (defn get-redirect-strategy [redirect-strategy]
   (case redirect-strategy
@@ -264,8 +266,10 @@
       (make-proxy-method request-method http-url))))

 (defn ^HttpClientContext http-context [request-config http-client-context]
-  (doto (or http-client-context (HttpClientContext/create))
-    (.setRequestConfig request-config)))
+  (let [^HttpClientContext typed-context (or http-client-context
+                                             (HttpClientContext/create))]
+    (doto typed-context
+      (.setRequestConfig request-config))))

 (defn ^CredentialsProvider credentials-provider []
   (BasicCredentialsProvider.))


Fix dumbass mistake in string concat. Do it the easy way

Signed-off-by: Eric Baur <a1c9c5f8609c68027db0779b39e5f932d4cb0053@robeybaur.org>

--- src/cljparse/core.clj
+++ src/cljparse/core.clj
@@ -12,9 +12,9 @@
   [["-p" "--path PATH" "path to project to build" :default "./"]
    ["-h" "--help"]])

-(defn exit [status msg]
+(defn exit [status msg & rest]
   (do
-    (println msg)
+    (println msg rest)
     status))

 (defn -main [& args]
@@ -23,13 +23,13 @@
                (exit 0 summary)

                (not= errors nil)
-               (exit -1 (str "Error: " errors))
+               (exit -1 "Error: " errors)

                :else (let [ path (:path options)
                            file (io/file path configname) ]
                       (do
                         (cond (not (.isFile file))
-                            (exit -1 (str ("Configuration not found at " path)))
+                            (exit -1 "Configuration not found at " path)
                             :else
                             (do
                               (println "Starting cljparse on:" (.getAbsolutePath file) "and errors:" errors)


code mash live we added monkeys

code mash live we added monkeys

--- src/codemash/core.clj
+++ src/codemash/core.clj
@@ -114,6 +114,8 @@
 (def bubbles-s (freesound-sample 104950))
 (def bubbles (bubbles-s))
 (def wind ((freesound-sample 81188)))
+
+(def monkeys ((freesound-sample 93993)))

 (ctl birds :rate -1)
 (ctl waves :rate -1)


oops.  one more test fix.

oops.  one more test fix.

--- test/metabase/api/session_test.clj
+++ test/metabase/api/session_test.clj
@@ -124,7 +124,7 @@
 ;; GET /session/properties
 ;; Check that a non-superuser can't read settings
 (expect
-  [{:value nil
+  [{:value "Metabase Test"
     :key "site-name"
     :description "The name used for this instance of Metabase."
     :default "Metabase"}]


Resolved merge conflicts

Resolved merge conflicts

--- test/time_tracker/test_helpers.clj
+++ test/time_tracker/test_helpers.clj
@@ -50,7 +50,7 @@
   "Opens a connection and completes the auth handshake."
   [google-id]
   (let [response-chan (chan 5)
-        socket        (ws/connect (settings :ws-url)
+        socket        (ws/connect "ws://localhost:8000/api/timers/ws-connect/"
                                 :on-receive (fn on-receive
                                               [data]
                                               (log/debug {:event ::received-ws-data