[#1203] Update akvo/resumed - Correct handling of `Origin` header

--- backend/project.clj
+++ backend/project.clj
@@ -24,7 +24,7 @@
                  [honeysql "0.9.3"]
                  [meta-merge "1.0.0"]
                  [org.akvo/commons "0.4.5" :exclusions [org.postgresql/postgresql org.clojure/java.jdbc]]
-                 [org.akvo/resumed "1.43.1e66390dedd92322a9bf6aecdcdc3c2d0c7a2083"]
+                 [org.akvo/resumed "1.46.266acfa5bb52c9b484af19f0bcfbfacb60b97319"]
                  [org.apache.tika/tika-core "1.18"]
                  [org.apache.tika/tika-parsers "1.18" :exclusions [org.slf4j/slf4j-api com.fasterxml.jackson.core/jackson-core org.apache.httpcomponents/httpcore org.apache.httpcomponents/httpclient org.apache.httpcomponents/httpmime]]
                  ;; explicit versions of commons deps used by tika-parsers and clj-http


Add macro util/defconst-

Add macro util/defconst-

--- src/bakyeono/litedocx/util.clj
+++ src/bakyeono/litedocx/util.clj
@@ -7,6 +7,12 @@
   (:require [clojure.zip :as z])
   (:require [clojure.java.io :as io])
   (:require [clojure.data.xml :as xml]))
+
+;;; def~
+(defmacro defconst-
+  [symbol init]
+  `(def ^:const ^{:private true}
+     ~symbol ~init))

 ;;; Collection
 (defn mapstr


Wire up Edit Profile link

Wire up Edit Profile link

--- src/braid/ui/views/header.cljs
+++ src/braid/ui/views/header.cljs
@@ -39,6 +39,16 @@
     (fn []
       [:div.group-name (@group :name)])))

+(defn edit-profile-link-view []
+  (let [group-id (subscribe [:open-group-id])]
+    (fn []
+      (let [path (routes/page-path {:group-id @group-id
+                                    :page-id "me"})]
+        [:a.edit-profile
+         {:class (when (routes/current-path? path) "active")
+          :href path}
+         "Edit Your Profile"]))))
+
 (defn subscriptions-link-view []
   (let [group-id (subscribe [:open-group-id])]
     (fn []
@@ -74,5 +84,5 @@
       [:div.options
         [subscriptions-link-view]
         [:a.invite-friend {:href ""} "Invite a Friend"]
-        [:a.edit-profile {:href ""} "Edit Your Profile"]
+        [edit-profile-link-view]
         [settings-link-view]]]])


fix bounded check

fix bounded check

--- src/clj/gtfve/data/queries.clj
+++ src/clj/gtfve/data/queries.clj
@@ -6,10 +6,10 @@
   ([[[x1 y1] [x2 y2]]]
    (fn [[px py]]
      (and (> px x1) (> py y1)
-          (< px x2) (< px y2))))
+          (< px x2) (< py y2))))
   ([[[x1 y1] [x2 y2]] [px py]]
    (and (> px x1) (> py y1)
-        (< px x2) (< px y2))))
+        (< px x2) (< py y2))))

 (defn pull
   "Use the Datomic Pull API to query the database."


refactor routes

refactor routes

--- src/clj/salava/page/routes.clj
+++ src/clj/salava/page/routes.clj
@@ -14,7 +14,7 @@

 (defn route-def [ctx]
   (routes
-    (context "/page" []
+    (context "/profile/page" []
              (layout/main ctx "/")
              (layout/main ctx "/mypages")
              (layout/main-meta ctx "/view/:id" :page)


correct typo in using statement

correct typo in using statement

--- src/clj_money/web/entities.clj
+++ src/clj_money/web/entities.clj
@@ -3,7 +3,7 @@
             [hiccup.page :refer :all]
             [cemerick.friend :as friend]
             [clj-money.models.entities :as entities])
-  (:use clj-money.web.share))
+  (:use clj-money.web.shared))

 (defn- entity-row
   "Renders a table row for an entity"


Add conditional statement for consistency

--- src/clojure/nightcode/lein.clj
+++ src/clojure/nightcode/lein.clj
@@ -355,7 +355,9 @@

 (defn cljsbuild-project
   [process in out path]
-  (->> (start-process-indirectly process path class-name "cljsbuild")
+  (->> (if (should-run-directly? path)
+         (start-process-directly process path cljsbuild-project-task)
+         (start-process-indirectly process path class-name "cljsbuild"))
        (start-thread in out)))

 (defn check-versions-in-project


Add missing feature for exploration with incomplete counterexamples

Removing crosses from the possible context now which
are not possible anymore, as adding them would result
in a contradiction to what is known from the certain
context

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/fca/exploration.clj
+++ src/conexp/fca/exploration.clj
@@ -265,7 +265,7 @@
              (= counterexamples :abort) ; abort exploration
              (recur implications nil possible-ctx certain-ctx)
              ;;
-             counterexamples          ; add counterexample
+             counterexamples            ; add counterexample
              (let [new-objs (map first counterexamples)]
                ;; check that new names are not there already
                (when (exists [g new-objs] (contains? (objects possible-ctx) g))
@@ -287,19 +287,24 @@
                                            (set-of [g m] [[g pos _] counterexamples,
                                                           m pos])))))
              ;;
-             true                     ; add implication
-             (let [new-implications (conj implications new-impl)]
+             true                       ; add implication
+             (let [new-implications (conj implications new-impl),
+                   new-clop         (clop-by-implications new-implications),
+                   new-certain-ctx  (make-context (objects certain-ctx)
+                                                  (attributes certain-ctx)
+                                                  (set-of [g m] [g (objects certain-ctx),
+                                                                 m (new-clop (oprime certain-ctx #{g}))])),
+                   new-possible-ctx (make-context (objects possible-ctx)
+                                                  (attributes possible-ctx)
+                                                  (filter (fn [[g m]]
+                                                            (let [certain-atts (oprime new-certain-ctx #{g})]
+                                                              (subset? (new-clop (conj certain-atts m))
+                                                                       (incidence possible-ctx))))
+                                                          (incidence possible-ctx)))]
                (recur new-implications
-                      (next-closed-set (attributes possible-ctx)
-                                       (clop-by-implications new-implications)
-                                       last)
-                      possible-ctx
-                      (make-context (objects certain-ctx)
-                                    (attributes certain-ctx)
-                                    (set-of [g m] [g (objects certain-ctx),
-                                                   m (close-under-implications
-                                                      new-implications
-                                                      (oprime certain-ctx #{g}))])))))))))))
+                      (next-closed-set (attributes possible-ctx) new-clop last)
+                      new-possible-ctx
+                      new-certain-ctx)))))))))

 ;;;


Fix let body indent

Fix let body indent

--- src/day8/re_frame/http_fx.cljs
+++ src/day8/re_frame/http_fx.cljs
@@ -43,14 +43,14 @@
            on-failure      [:http-no-on-failure]}}]
   ; wrap events in cljs-ajax callback
   (let [api (new js/goog.net.XhrIo)]
-  (-> request
-      (assoc
-        :api     api
-        :handler (partial ajax-xhrio-handler
-                          #(dispatch (conj on-success %))
-                          #(dispatch (conj on-failure %))
-                          api))
-      (dissoc :on-success :on-failure))))
+    (-> request
+        (assoc
+          :api     api
+          :handler (partial ajax-xhrio-handler
+                            #(dispatch (conj on-success %))
+                            #(dispatch (conj on-failure %))
+                            api))
+        (dissoc :on-success :on-failure))))

 ;; Specs commented out until ClojureScript has a stable release of spec.
 ;


Replace end date with timestamp of the measurement.

--- src/clj/kixi/hecuba/data/measurements/calculations.clj
+++ src/clj/kixi/hecuba/data/measurements/calculations.clj
@@ -373,7 +373,7 @@
       (when tariff
         (doseq [m measurements]
           (let [calculated-data  [{:value (str (c/round (apply-tariff tariff [m] (:operation sensor))))
-                                   :timestamp (tc/to-date end-date)
+                                   :timestamp (:timestamp m)
                                    :month (time/get-month-partition-key end-date)
                                    :device_id device_id
                                    :sensor_id sensor_id}]]


Fix typo in about text.

Fix typo in about text.

--- src/cljs/clj_templates/components/about/component.cljs
+++ src/cljs/clj_templates/components/about/component.cljs
@@ -6,7 +6,7 @@
    [:p [clj-templates-logo {:class "inline-logo"}] " is a search engine for Clojure project templates. The templates are
     fetched from the popular " [:a {:href "https://clojars.org/" :target "_blank"} "Clojars"] " repository.
     While Clojars has its own search function, clj-templates makes it easier to find project
-     templates by searching only the template population rather than all artficats. "]
+     templates by searching only the template population rather than all artifacts. "]
    [:p "In addition, it indexes any GitHub README:s that the template has, making it possible to search any
       term mentioned in either the template name, its description, or its GitHub README. This enables
       searching for technologies and other topics, such as \"sass\", \"music\", or \"game\"."]


added instructions for loading entities into active forms

--- src/guide/untangled/ui/Forms__03_Server_Integration.cljs
+++ src/guide/untangled/ui/Forms__03_Server_Integration.cljs
@@ -164,4 +164,25 @@
   ```
   {:form/remove-relations { [:people/by-id 1] {:person/number [[:phone/by-id 3]] }}}
   ```
+
+  # Updating a forms-based Entity From the Server
+
+  Since your app state is normalized, any reads of an entity will end up being merged over top of
+  the entity you already have. This means that your active form fields on such an entity would
+  update.
+
+  There are some caveats to doing this, since the *remembered* state of your form will now be out
+  of sync with what you read (or pushed) from the server.
+
+  Typically what you'll want to do when (re)reading an entity that is being actively used on a form is:
+
+  1. Issue an untangled load for that entity. The incoming state will cause the UI of the form to update
+  (since you're always editing/rendering active state of the entity). Unfortunately, the pristine state
+  of the form now thinks the newly loaded entity is *dirty*!
+  2. Include a post mutation, which should:
+      - `dissoc` the form state via `(update-in app-state form-ident dissoc f/form-key)`
+      - Run `build-form` on the form
+      - Optionally use the `validate-fields` or `validate-forms` function to update the validation markers.
+
+  A non-remote (local-only) commit-to-entity (still as a post-mutation) could also be used to accomplish (2).
   ")


do not use java.util.HashMap in invert-map, k:v order comes out differently and JoinModel depends on this - should be fixed...

--- dada-core/src/main/clojure/org/dada/core/JoinModel.clj
+++ dada-core/src/main/clojure/org/dada/core/JoinModel.clj
@@ -35,7 +35,7 @@
 ;;     ))

 (defn invert-map [m]
-  (reduce (fn [r [k v]] (map-put r v (conj (map-get r v) k))) (map-new) m))
+  (reduce (fn [r [k v]] (assoc r v (conj (r v) k))) {} m))

 (defn make-notification [old-datum new-datum old-insertions old-alterations old-deletions delete]
   (trace ["make-notification" old-datum new-datum old-insertions old-alterations old-deletions delete])


Hide invitation link to group chats

Hide invitation link to group chats

Signed-off-by: Audrius Molis <80113556d3bcb884dd18dd882bd2b0225e8a761f@dr.com>

--- src/status_im/ui/screens/profile/group_chat/views.cljs
+++ src/status_im/ui/screens/profile/group_chat/views.cljs
@@ -1,5 +1,6 @@
 (ns status-im.ui.screens.profile.group-chat.views
   (:require [quo.core :as quo]
+            [quo.design-system.colors :as colors]
             [re-frame.core :as re-frame]
             [status-im.constants :as constants]
             [status-im.i18n.i18n :as i18n]
@@ -9,14 +10,8 @@
             [status-im.ui.components.profile-header.view :as profile-header]
             [status-im.ui.components.react :as react]
             [status-im.ui.screens.chat.sheets :as chat.sheets]
-            [status-im.ui.screens.profile.components.styles
-             :as
-             profile.components.styles]
+            [status-im.ui.screens.profile.components.styles :as profile.components.styles]
             [status-im.ui.components.topbar :as topbar]
-            [quo.design-system.colors :as colors]
-            [status-im.ui.components.copyable-text :as copyable-text]
-            [status-im.ui.components.list-selection :as list-selection]
-            [status-im.utils.universal-links.core :as universal-links]
             [status-im.ui.components.common.common :as components.common]
             [status-im.ui.screens.chat.message.message :as message]
             [status-im.ui.screens.chat.photos :as photos]
@@ -146,30 +141,12 @@
                                                  [invitation-sheet invitation contact])}])}]))

 (defview group-chat-invite []
-  (letsubs [{:keys [chat-id  chat-name]} [:chats/current-chat]
-            current-pk   [:multiaccount/public-key]]
-    (let [invite-link (universal-links/generate-link
-                       :group-chat
-                       :external
-                       (str "args?a=" current-pk "&a1=" (js/encodeURI chat-name) "&a2=" chat-id))
-          invitations  @(re-frame/subscribe [:group-chat/pending-invitations-by-chat-id chat-id])]
+  (letsubs [{:keys [chat-id]} [:chats/current-chat]]
+    (let [invitations  @(re-frame/subscribe [:group-chat/pending-invitations-by-chat-id chat-id])]
       [react/view {:flex 1}
-       [topbar/topbar {:title       (i18n/label :t/group-invite)
-                       :accessories [{:icon    :main-icons/share
-                                      :handler #(list-selection/open-share {:message invite-link})}]}]
+       [topbar/topbar {:title (i18n/label :t/group-invite)}]
        [react/scroll-view {:flex 1}
         [react/view {:margin-top 26}
-         [react/view {:padding-horizontal 16}
-          [react/text {:style {:color colors/gray}} (i18n/label :t/group-invite-link)]
-          [copyable-text/copyable-text-view
-           {:copied-text invite-link}
-           [react/view {:accessibility-label :invitation-link
-                        :border-width 1 :border-color colors/gray-lighter
-                        :justify-content :center :margin-top 10
-                        :border-radius 8 :padding-horizontal 16 :padding-vertical 11}
-            [react/text invite-link]]]
-          [react/text {:style {:color colors/gray :margin-top 22}}
-           (i18n/label :t/pending-invitations)]]
          (if (seq invitations)
            [list/flat-list
             {:data                      invitations
@@ -207,7 +184,7 @@
            (when admin?
              [quo/list-item
               {:chevron             true
-               :title               (i18n/label :t/group-invite)
+               :title               (i18n/label :t/membership-requests)
                :accessibility-label :invite-chat-button
                :icon                :main-icons/share
                :accessory           (let [invitations


Make y diff smaller

Make y diff smaller

--- minicraft/desktop/src-common/minicraft/entities.clj
+++ minicraft/desktop/src-common/minicraft/entities.clj
@@ -197,7 +197,7 @@
   (if (:hit? entity)
     (if-let [{:keys [x y]} (u/find-id entities (:id-2 entity))]
       ; position the hit slightly below the victim so it appears on top
-      (assoc entity :x x :y (- y 0.1))
+      (assoc entity :x x :y (- y 0.01))
       entity)
     entity))


fix node-library/script when just using a filename in :output-to

--- src/main/shadow/build/node.clj
+++ src/main/shadow/build/node.clj
@@ -177,7 +177,9 @@
         (throw (ex-info "flush before optimize?" {})))

       (-> state
-          (assoc-in [:build-options :output-dir] (.getParentFile output-to))
+          (assoc-in [:build-options :output-dir] (-> output-to
+                                                     (.getCanonicalFile)
+                                                     (.getParentFile)))
           (assoc-in [::closure/modules 0 :output-name] (.getName output-to))
           (output/flush-optimized))))


CMR-3224 Updates ACL permission check tests to work without ingest app

--- access-control-app/int_test/cmr/access_control/int_test/permission_check_test.clj
+++ access-control-app/int_test/cmr/access_control/int_test/permission_check_test.clj
@@ -3,23 +3,23 @@
   (require [clojure.test :refer :all]
            [cheshire.core :as json]
            [cmr.transmit.access-control :as ac]
-           [cmr.transmit.ingest :as ingest]
+           [cmr.transmit.metadata-db2 :as mdb]
            [cmr.mock-echo.client.echo-util :as e]
-           [cmr.common.util :as util :refer [are2]]
+           [cmr.common.util :refer [are2]]
            [cmr.access-control.int-test.fixtures :as fixtures]
            [cmr.access-control.test.util :as u]
            [cmr.umm-spec.core :as umm-spec]
            [cmr.umm-spec.test.expected-conversion :refer [example-collection-record]]
-           [clojure.string :as str]
            [clj-time.core :as t]))

+(use-fixtures :once (fixtures/int-test-fixtures))
+
 (use-fixtures :each
-              (fixtures/int-test-fixtures)
-              (fixtures/reset-fixture {"prov1guid" "PROV1" "prov2guid" "PROV2"})
+              (fixtures/reset-fixture {"prov1guid" "PROV1"})
               (fn [f]
                 (e/grant-all-ingest (u/conn-context) "prov1guid")
                 (f))
-              (fixtures/grant-all-group-fixture ["prov1guid" "prov2guid"]))
+              (fixtures/grant-all-group-fixture ["prov1guid"]))

 (deftest invalid-params-test
   (are [params errors]
@@ -76,388 +76,393 @@
               no-temporal (assoc :TemporalExtents nil)
               temporal-range (assoc-in [:TemporalExtents 0 :RangeDateTimes] [temporal-range]))]
     (:concept-id
-      (ingest/ingest-concept (u/conn-context)
-                             {:format "application/echo10+xml"
-                              :metadata (umm-spec/generate-metadata (u/conn-context) umm :echo10)
-                              :concept-type :collection
-                              :provider-id provider-id
-                              :native-id native-id
-                              :revision-id 1}
-                             {"Echo-Token" token}))))
+      (mdb/save-concept (u/conn-context)
+                        {:format "application/echo10+xml"
+                         :metadata (umm-spec/generate-metadata (u/conn-context) umm :echo10)
+                         :concept-type :collection
+                         :provider-id provider-id
+                         :native-id native-id
+                         :revision-id 1
+                         :extra-fields {:short-name short-name
+                                        :entry-title entry-title
+                                        :entry-id short-name
+                                        :version-id "v1"}}))))

 ;; Commented out. See CMR-3224

-; (deftest collection-simple-catalog-item-identity-permission-check-test
-;   ;; tests ACLs which grant access to collections based on provider id and/or entry title
-;   (let [token (e/login (u/conn-context) "user1" ["group-create-group"])
-;         ;; helper for easily creating a group, returns concept id
-;         create-group #(:concept_id (u/create-group token (u/make-group %)))
-;         ;; then create a group that contains our user, so we can find collections that grant access to this user
-;         user1-group (create-group {:name "groupwithuser1" :members ["user1"]})
-;         ;; create some collections
-;         ingest-prov1-collection #(ingest-collection token {:provider-id "PROV1"
-;                                                            :entry-title (str % " entry title")
-;                                                            :native-id %
-;                                                            :short-name %})
-;         coll1 (ingest-prov1-collection "coll1")
-;         coll2 (ingest-prov1-collection "coll2")
-;         coll3 (ingest-prov1-collection "coll3")
-;         gran1 (ingest/ingest-concept (u/conn-context)
-;                                      {:format "application/echo10+xml"
-;                                       :metadata granule-metadata
-;                                       :concept-type :granule
-;                                       :provider-id "PROV1"
-;                                       :native-id "gran1"
-;                                       :revision-id 1}
-;                                      {"Echo-Token" token})
-;         ;; local helpers to make the body of the test cleaner
-;         create-acl #(:concept_id (ac/create-acl (u/conn-context) % {:token token}))
-;         update-acl #(ac/update-acl (u/conn-context) %1 %2 {:token token})
-;         get-collection-permissions #(get-permissions %1 coll1)
-;         get-granule-permissions #(get-permissions %1 (:concept-id gran1))]
-;
-;     (testing "no permissions granted"
-;       (are [user permissions]
-;         (= {"C1200000001-PROV1" permissions}
-;            (get-collection-permissions user))
-;         :guest []
-;         :registered []
-;         "user1" []))
-;
-;     (testing "collection level permissions"
-;       (let [acl-concept-id (create-acl {:group_permissions [{:permissions [:read :order]
-;                                                              :user_type :guest}]
-;                                         :catalog_item_identity {:name "coll1 read and order"
-;                                                                 :collection_applicable true
-;                                                                 :provider_id "PROV1"}})]
-;         (u/wait-until-indexed)
-;
-;         (testing "for guest users"
-;           (are [user permissions]
-;             (= {"C1200000001-PROV1" permissions}
-;                (get-collection-permissions user))
-;             :guest ["read" "order"]
-;             :registered []
-;             "user1" []))
-;
-;         (testing "for registered users"
-;           (update-acl acl-concept-id
-;                       {:group_permissions [{:permissions [:read :order]
-;                                             :user_type :registered}]
-;                        :catalog_item_identity {:name "coll1 read and order"
-;                                                :collection_applicable true
-;                                                :provider_id "PROV1"}})
-;           (are [user permissions]
-;             (= {"C1200000001-PROV1" permissions}
-;                (get-collection-permissions user))
-;             :guest []
-;             :registered ["read" "order"]
-;             "user1" ["read" "order"]))
-;
-;         (testing "acls granting access to specific groups"
-;
-;           (update-acl acl-concept-id
-;                       {:group_permissions [{:permissions [:read :order]
-;                                             :group_id user1-group}]
-;                        :catalog_item_identity {:name "coll1 read and order"
-;                                                :collection_applicable true
-;                                                :provider_id "PROV1"}})
-;
-;           (are [user permissions]
-;             (= {"C1200000001-PROV1" permissions}
-;                (get-collection-permissions user))
-;             :guest []
-;             :registered []
-;             "user1" ["read" "order"]
-;             "user2" [])
-;
-;           (testing "with a complex ACL distributing permissions across multiple groups"
-;             (let [user2-group1 (create-group {:name "group1withuser2" :members ["user2"]})
-;                   user2-group2 (create-group {:name "group2withuser1and2" :members ["user1" "user2"]})]
-;               (u/wait-until-indexed)
-;               (create-acl {:group_permissions [{:permissions [:read] :group_id user1-group}
-;                                                {:permissions [:read] :group_id user2-group1}
-;                                                {:permissions [:order] :group_id user2-group2}]
-;                            :catalog_item_identity {:name "PROV1 complex ACL"
-;                                                    :collection_applicable true
-;                                                    :provider_id "PROV1"}})
-;               (are [user permissions]
-;                 (= {"C1200000001-PROV1" permissions}
-;                    (get-collection-permissions user))
-;                 :guest []
-;                 :registered []
-;                 "user1" ["read" "order"]
-;                 "user2" ["read" "order"]))))
-;
-;         (testing "acls granting access to collection by collection identifier"
-;           (testing "by entry title"
-;             (create-acl
-;               {:group_permissions [{:permissions [:read]
-;                                     :user_type :guest}]
-;                :catalog_item_identity {:name "coll2 guest read"
-;                                        :collection_applicable true
-;                                        :collection_identifier {:entry_titles ["coll2 entry title"]}
-;                                        :provider_id "PROV1"}})
-;             (testing "for collection in ACL's entry titles"
-;               (are [user permissions]
-;                 (= {"C1200000002-PROV1" permissions}
-;                    (get-permissions user "C1200000002-PROV1"))
-;                 :guest ["read"]
-;                 :registered []))
-;             (testing "for collection not in ACL's entry titles"
-;               (are [user permissions]
-;                 (= {"C1200000003-PROV1" permissions}
-;                    (get-permissions user "C1200000003-PROV1"))
-;                 :guest []
-;                 :registered []))))))
-;
-;     (testing "granule level permissions"
-;       (testing "no permissions granted"
-;         (is (= {"G1200000004-PROV1" []}
-;                (get-granule-permissions "user1")))))))
-;
-; (deftest collection-catalog-item-identifier-access-value-test
-;   ;; tests ACLs which grant access to collections based on their access value
-;   (let [token (e/login (u/conn-context) "user1" [])
-;         ingest-access-value-collection (fn [short-name access-value]
-;                                          (ingest-collection token {:entry-title (str short-name " entry title")
-;                                                                    :short-name short-name
-;                                                                    :native-id short-name
-;                                                                    :provider-id "PROV1"
-;                                                                    :access-value access-value}))
-;         ;; one collection with a low access value
-;         coll1 (ingest-access-value-collection "coll1" 1)
-;         ;; one with an intermediate access value
-;         coll2 (ingest-access-value-collection "coll2" 4)
-;         ;; one with a higher access value
-;         coll3 (ingest-access-value-collection "coll3" 9)
-;         ;; and one with no access value
-;         coll4 (ingest-access-value-collection "coll4" nil)
-;         create-acl #(:concept_id (ac/create-acl (u/conn-context) % {:token token}))
-;         update-acl #(ac/update-acl (u/conn-context) %1 %2 {:token token})
-;         get-coll-permissions #(get-permissions :guest coll1 coll2 coll3 coll4)]
-;     (u/wait-until-indexed)
-;
-;     (testing "no permissions granted"
-;       (is (= {"C1200000000-PROV1" []
-;               "C1200000001-PROV1" []
-;               "C1200000002-PROV1" []
-;               "C1200000003-PROV1" []}
-;              (get-coll-permissions))))
-;
-;     (let [acl-id (create-acl
-;                    {:group_permissions [{:permissions [:read]
-;                                          :user_type :guest}]
-;                     :catalog_item_identity {:name "coll2 guest read"
-;                                             :collection_applicable true
-;                                             :collection_identifier {:access_value {:min_value 1 :max_value 10}}
-;                                             :provider_id "PROV1"}})]
-;
-;       (testing "ACL matching all access values"
-;         (is (= {"C1200000000-PROV1" ["read"]
-;                 "C1200000001-PROV1" ["read"]
-;                 "C1200000002-PROV1" ["read"]
-;                 "C1200000003-PROV1" []}
-;                (get-coll-permissions))))
-;
-;       (testing "ACL matching only high access values"
-;         (update-acl acl-id {:group_permissions [{:permissions [:read]
-;                                                  :user_type :guest}]
-;                             :catalog_item_identity {:name "coll2 guest read"
-;                                                     :collection_applicable true
-;                                                     :collection_identifier {:access_value {:min_value 4 :max_value 10}}
-;                                                     :provider_id "PROV1"}})
-;
-;         (is (= {"C1200000000-PROV1" []
-;                 "C1200000001-PROV1" ["read"]
-;                 "C1200000002-PROV1" ["read"]
-;                 "C1200000003-PROV1" []}
-;                (get-coll-permissions))))
-;
-;       (testing "ACL matching only one access value"
-;         (update-acl acl-id {:group_permissions [{:permissions [:read]
-;                                                  :user_type :guest}]
-;                             :catalog_item_identity {:name "coll2 guest read"
-;                                                     :collection_applicable true
-;                                                     :collection_identifier {:access_value {:min_value 4 :max_value 5}}
-;                                                     :provider_id "PROV1"}})
-;
-;         (is (= {"C1200000000-PROV1" []
-;                 "C1200000001-PROV1" ["read"]
-;                 "C1200000002-PROV1" []
-;                 "C1200000003-PROV1" []}
-;                (get-coll-permissions))))
-;
-;       (testing "ACL matching only collections with undefined access values"
-;         (update-acl acl-id {:group_permissions [{:permissions [:read]
-;                                                  :user_type :guest}]
-;                             :catalog_item_identity {:name "coll2 guest read"
-;                                                     :collection_applicable true
-;                                                     :collection_identifier {:access_value {:min_value 1
-;                                                                                :max_value 10
-;                                                                                :include_undefined_value true}}
-;                                                     :provider_id "PROV1"}})
-;
-;         (is (= {"C1200000000-PROV1" ["read"]
-;                 "C1200000001-PROV1" ["read"]
-;                 "C1200000002-PROV1" ["read"]
-;                 "C1200000003-PROV1" ["read"]}
-;                (get-coll-permissions)))))))
-;
-; (deftest collection-catalog-item-identifier-temporal-test
-;   ;; tests ACLs that grant access based on a collection's temporal range
-;   (let [token (e/login (u/conn-context) "user1" [])
-;         ingest-temporal-collection (fn [short-name start-year end-year]
-;                                      (ingest-collection token {:entry-title (str short-name " entry title")
-;                                                                :short-name short-name
-;                                                                :native-id short-name
-;                                                                :provider-id "PROV1"
-;                                                                :temporal-range {:BeginningDateTime (t/date-time start-year)
-;                                                                                :EndingDateTime (t/date-time end-year)}}))
-;         coll1 (ingest-temporal-collection "coll1" 2001 2002)
-;         coll2 (ingest-temporal-collection "coll2" 2004 2005)
-;         coll3 (ingest-temporal-collection "coll3" 2007 2009)
-;         ;; coll4 will have no temporal extent, and should not be granted any permissions by our ACLs in this test
-;         coll4 (ingest-collection token {:entry-id "coll4"
-;                                         :native-id "coll4"
-;                                         :short-name "coll4"
-;                                         :entry-title "non-temporal coll4"
-;                                         :provider-id "PROV1"
-;                                         :no-temporal true})
-;         create-acl #(:concept_id (ac/create-acl (u/conn-context) % {:token token}))
-;         update-acl #(ac/update-acl (u/conn-context) %1 %2 {:token token})
-;         get-coll-permissions #(get-permissions :guest coll1 coll2 coll3 coll4)]
-;     (u/wait-until-indexed)
-;     (is (= {"C1200000000-PROV1" []
-;             "C1200000001-PROV1" []
-;             "C1200000002-PROV1" []
-;             "C1200000003-PROV1" []}
-;            (get-coll-permissions)))
-;
-;     (let [acl-id (create-acl
-;                    {:group_permissions [{:permissions [:read]
-;                                          :user_type :guest}]
-;                     :catalog_item_identity {:name "coll2 guest read"
-;                                             :collection_applicable true
-;                                             :collection_identifier {:temporal {:start_date "2000-01-01T00:00:00Z"
-;                                                                                :end_date "2010-01-01T00:00:00Z"
-;                                                                                :mask "intersect"}}
-;                                             :provider_id "PROV1"}})]
-;
-;       (testing "\"intersect\" mask"
-;         (is (= {"C1200000000-PROV1" ["read"]
-;                 "C1200000001-PROV1" ["read"]
-;                 "C1200000002-PROV1" ["read"]
-;                 "C1200000003-PROV1" []}
-;                (get-coll-permissions))))
-;
-;       (testing "\"disjoint\" mask"
-;         (update-acl acl-id {:group_permissions [{:permissions [:read]
-;                                                  :user_type :guest}]
-;                             :catalog_item_identity {:name "coll2 guest read"
-;                                                     :collection_applicable true
-;                                                     :collection_identifier {:temporal {:start_date "2003-01-01T00:00:00Z"
-;                                                                                :end_date "2006-01-01T00:00:00Z"
-;                                                                                :mask "disjoint"}}
-;                                                     :provider_id "PROV1"}})
-;         (is (= {"C1200000000-PROV1" ["read"]
-;                 "C1200000001-PROV1" []
-;                 "C1200000002-PROV1" ["read"]
-;                 "C1200000003-PROV1" []}
-;                (get-coll-permissions))))
-;
-;       (testing "\"contains\" mask"
-;         (update-acl acl-id {:group_permissions [{:permissions [:read]
-;                                                  :user_type :guest}]
-;                             :catalog_item_identity {:name "coll2 guest read"
-;                                                     :collection_applicable true
-;                                                     :collection_identifier {:temporal {:start_date "2003-01-01T00:00:00Z"
-;                                                                                :end_date "2006-01-01T00:00:00Z"
-;                                                                                :mask "contains"}}
-;                                                     :provider_id "PROV1"}})
-;         (is (= {"C1200000000-PROV1" []
-;                 "C1200000001-PROV1" ["read"]
-;                 "C1200000002-PROV1" []
-;                 "C1200000003-PROV1" []}
-;                (get-coll-permissions)))))))
-;
-; ;; For CMR-3210:
-; ;; * granule provider permissions (read/order) for guest, registered, and groups
-; ;; * granule specific permissions (update/delete) for guest, registered, and groups
-; ;; * granule permissions based on access value
-; ;; * granule permissions based on temporal
-; ;; * granule permissions applied for collection applicable false??? <-- ask Jason
-;
-; (deftest collection-provider-level-permission-check-test
-;   ;; Tests ACLs which grant the provider-level update/delete permissions to collections
-;   (let [token (e/login (u/conn-context) "user1" ["group-create-group"])
-;         ;; then create a group that contains our user, so we can find collections that grant access to this user
-;         group (u/make-group {:name "groupwithuser1" :members ["user1"]})
-;         created-group-concept-id (:concept_id (u/create-group token group))
-;         ;; create some collections
-;         coll1-umm (assoc example-collection-record :EntryTitle "coll1 entry title")
-;         coll1-metadata (umm-spec/generate-metadata (u/conn-context) coll1-umm :echo10)
-;         coll1 (ingest/ingest-concept (u/conn-context)
-;                                      {:format "application/echo10+xml"
-;                                       :metadata coll1-metadata
-;                                       :concept-type :collection
-;                                       :provider-id "PROV1"
-;                                       :native-id "coll1"
-;                                       :revision-id 1}
-;                                      {"Echo-Token" token})
-;         ;; local helpers to make the body of the test cleaner
-;         create-acl #(ac/create-acl (u/conn-context) % {:token token})
-;         update-acl #(ac/update-acl (u/conn-context) %1 %2 {:token token})
-;         get-coll1-permissions #(get-permissions % (:concept-id coll1))]
-;
-;     (testing "no permissions granted"
-;       (are [user permissions]
-;         (= {"C1200000001-PROV1" permissions}
-;            (get-coll1-permissions user))
-;         :guest []
-;         :registered []
-;         "user1" []))
-;
-;     (testing "provider level permissions"
-;       (let [acl {:group_permissions [{:permissions [:update :delete]
-;                                       :user_type :guest}]
-;                  :provider_identity {:provider_id "PROV1"
-;                                      :target "INGEST_MANAGEMENT_ACL"}}
-;             acl-concept-id (:concept_id (create-acl acl))]
-;         (u/wait-until-indexed)
-;
-;         (are [user permissions]
-;           (= {"C1200000001-PROV1" permissions}
-;              (get-coll1-permissions user))
-;           :guest ["update" "delete"]
-;           :registered []
-;           "user1" [])
-;
-;         (testing "granted to registered users"
-;           (update-acl acl-concept-id
-;                       {:group_permissions [{:permissions [:update :delete]
-;                                             :user_type :registered}]
-;                        :provider_identity {:provider_id "PROV1"
-;                                            :target "INGEST_MANAGEMENT_ACL"}})
-;
-;           (are [user permissions]
-;             (= {"C1200000001-PROV1" permissions}
-;                (get-coll1-permissions user))
-;             :guest []
-;             :registered ["update" "delete"]
-;             "user1" ["update" "delete"]))
-;
-;         (testing "granted to specific groups"
-;           (update-acl acl-concept-id
-;                       {:group_permissions [{:permissions [:update :delete]
-;                                             :group_id created-group-concept-id}]
-;                        :provider_identity {:provider_id "PROV1"
-;                                            :target "INGEST_MANAGEMENT_ACL"}})
-;
-;           (are [user permissions]
-;             (= {"C1200000001-PROV1" permissions}
-;                (get-coll1-permissions user))
-;             :guest []
-;             :registered []
-;             "user1" ["update" "delete"]
-;             "user2" []))))))
+ (deftest collection-simple-catalog-item-identity-permission-check-test
+   ;; tests ACLs which grant access to collections based on provider id and/or entry title
+   (let [token (e/login (u/conn-context) "user1" ["group-create-group"])
+         ;; helper for easily creating a group, returns concept id
+         create-group #(:concept_id (u/create-group token (u/make-group %)))
+         ;; then create a group that contains our user, so we can find collections that grant access to this user
+         user1-group (create-group {:name "groupwithuser1" :members ["user1"]})
+         ;; create some collections
+         ingest-prov1-collection #(ingest-collection token {:provider-id "PROV1"
+                                                            :entry-title (str % " entry title")
+                                                            :native-id %
+                                                            :short-name %})
+         coll1 (ingest-prov1-collection "coll1")
+         coll2 (ingest-prov1-collection "coll2")
+         coll3 (ingest-prov1-collection "coll3")
+         gran1 (mdb/save-concept (u/conn-context)
+                                 {:format "application/echo10+xml"
+                                  :metadata granule-metadata
+                                  :concept-type :granule
+                                  :provider-id "PROV1"
+                                  :native-id "gran1"
+                                  :revision-id 1
+                                  :extra-fields {:short-name "gran1"
+                                                 :entry-title "gran1"
+                                                 :entry-id "gran1"
+                                                 :granule-ur "gran1ur"
+                                                 :version-id "v1"
+                                                 :parent-collection-id coll1
+                                                 :parent-entry-title "coll1"}})
+         ;; local helpers to make the body of the test cleaner
+         create-acl #(:concept_id (ac/create-acl (u/conn-context) % {:token token}))
+         update-acl #(ac/update-acl (u/conn-context) %1 %2 {:token token})
+         get-collection-permissions #(get-permissions %1 coll1)
+         get-granule-permissions #(get-permissions %1 (:concept-id gran1))]
+
+     (testing "no permissions granted"
+       (are [user permissions]
+         (= {"C1200000001-PROV1" permissions}
+            (get-collection-permissions user))
+         :guest []
+         :registered []
+         "user1" []))
+
+     (testing "collection level permissions"
+       (let [acl-concept-id (create-acl {:group_permissions [{:permissions [:read :order]
+                                                              :user_type :guest}]
+                                         :catalog_item_identity {:name "coll1 read and order"
+                                                                 :collection_applicable true
+                                                                 :provider_id "PROV1"}})]
+         (u/wait-until-indexed)
+
+         (testing "for guest users"
+           (are [user permissions]
+             (= {"C1200000001-PROV1" permissions}
+                (get-collection-permissions user))
+             :guest ["read" "order"]
+             :registered []
+             "user1" []))
+
+         (testing "for registered users"
+           (update-acl acl-concept-id
+                       {:group_permissions [{:permissions [:read :order]
+                                             :user_type :registered}]
+                        :catalog_item_identity {:name "coll1 read and order"
+                                                :collection_applicable true
+                                                :provider_id "PROV1"}})
+           (are [user permissions]
+             (= {"C1200000001-PROV1" permissions}
+                (get-collection-permissions user))
+             :guest []
+             :registered ["read" "order"]
+             "user1" ["read" "order"]))
+
+         (testing "acls granting access to specific groups"
+
+           (update-acl acl-concept-id
+                       {:group_permissions [{:permissions [:read :order]
+                                             :group_id user1-group}]
+                        :catalog_item_identity {:name "coll1 read and order"
+                                                :collection_applicable true
+                                                :provider_id "PROV1"}})
+
+           (are [user permissions]
+             (= {"C1200000001-PROV1" permissions}
+                (get-collection-permissions user))
+             :guest []
+             :registered []
+             "user1" ["read" "order"]
+             "user2" [])
+
+           (testing "with a complex ACL distributing permissions across multiple groups"
+             (let [user2-group1 (create-group {:name "group1withuser2" :members ["user2"]})
+                   user2-group2 (create-group {:name "group2withuser1and2" :members ["user1" "user2"]})]
+               (u/wait-until-indexed)
+               (create-acl {:group_permissions [{:permissions [:read] :group_id user1-group}
+                                                {:permissions [:read] :group_id user2-group1}
+                                                {:permissions [:order] :group_id user2-group2}]
+                            :catalog_item_identity {:name "PROV1 complex ACL"
+                                                    :collection_applicable true
+                                                    :provider_id "PROV1"}})
+               (are [user permissions]
+                 (= {"C1200000001-PROV1" permissions}
+                    (get-collection-permissions user))
+                 :guest []
+                 :registered []
+                 "user1" ["read" "order"]
+                 "user2" ["read" "order"]))))
+
+         (testing "acls granting access to collection by collection identifier"
+           (testing "by entry title"
+             (create-acl
+               {:group_permissions [{:permissions [:read]
+                                     :user_type :guest}]
+                :catalog_item_identity {:name "coll2 guest read"
+                                        :collection_applicable true
+                                        :collection_identifier {:entry_titles ["coll2 entry title"]}
+                                        :provider_id "PROV1"}})
+             (testing "for collection in ACL's entry titles"
+               (are [user permissions]
+                 (= {"C1200000002-PROV1" permissions}
+                    (get-permissions user "C1200000002-PROV1"))
+                 :guest ["read"]
+                 :registered []))
+             (testing "for collection not in ACL's entry titles"
+               (are [user permissions]
+                 (= {"C1200000003-PROV1" permissions}
+                    (get-permissions user "C1200000003-PROV1"))
+                 :guest []
+                 :registered []))))))
+
+     (testing "granule level permissions"
+       (testing "no permissions granted"
+         (is (= {"G1200000004-PROV1" []}
+                (get-granule-permissions "user1")))))))
+
+ (deftest collection-catalog-item-identifier-access-value-test
+   ;; tests ACLs which grant access to collections based on their access value
+   (let [token (e/login (u/conn-context) "user1" [])
+         ingest-access-value-collection (fn [short-name access-value]
+                                          (ingest-collection token {:entry-title (str short-name " entry title")
+                                                                    :short-name short-name
+                                                                    :native-id short-name
+                                                                    :provider-id "PROV1"
+                                                                    :access-value access-value}))
+         ;; one collection with a low access value
+         coll1 (ingest-access-value-collection "coll1" 1)
+         ;; one with an intermediate access value
+         coll2 (ingest-access-value-collection "coll2" 4)
+         ;; one with a higher access value
+         coll3 (ingest-access-value-collection "coll3" 9)
+         ;; and one with no access value
+         coll4 (ingest-access-value-collection "coll4" nil)
+         create-acl #(:concept_id (ac/create-acl (u/conn-context) % {:token token}))
+         update-acl #(ac/update-acl (u/conn-context) %1 %2 {:token token})
+         get-coll-permissions #(get-permissions :guest coll1 coll2 coll3 coll4)]
+     (u/wait-until-indexed)
+
+     (testing "no permissions granted"
+       (is (= {"C1200000000-PROV1" []
+               "C1200000001-PROV1" []
+               "C1200000002-PROV1" []
+               "C1200000003-PROV1" []}
+              (get-coll-permissions))))
+
+     (let [acl-id (create-acl
+                    {:group_permissions [{:permissions [:read]
+                                          :user_type :guest}]
+                     :catalog_item_identity {:name "coll2 guest read"
+                                             :collection_applicable true
+                                             :collection_identifier {:access_value {:min_value 1 :max_value 10}}
+                                             :provider_id "PROV1"}})]
+
+       (testing "ACL matching all access values"
+         (is (= {"C1200000000-PROV1" ["read"]
+                 "C1200000001-PROV1" ["read"]
+                 "C1200000002-PROV1" ["read"]
+                 "C1200000003-PROV1" []}
+                (get-coll-permissions))))
+
+       (testing "ACL matching only high access values"
+         (update-acl acl-id {:group_permissions [{:permissions [:read]
+                                                  :user_type :guest}]
+                             :catalog_item_identity {:name "coll2 guest read"
+                                                     :collection_applicable true
+                                                     :collection_identifier {:access_value {:min_value 4 :max_value 10}}
+                                                     :provider_id "PROV1"}})
+
+         (is (= {"C1200000000-PROV1" []
+                 "C1200000001-PROV1" ["read"]
+                 "C1200000002-PROV1" ["read"]
+                 "C1200000003-PROV1" []}
+                (get-coll-permissions))))
+
+       (testing "ACL matching only one access value"
+         (update-acl acl-id {:group_permissions [{:permissions [:read]
+                                                  :user_type :guest}]
+                             :catalog_item_identity {:name "coll2 guest read"
+                                                     :collection_applicable true
+                                                     :collection_identifier {:access_value {:min_value 4 :max_value 5}}
+                                                     :provider_id "PROV1"}})
+
+         (is (= {"C1200000000-PROV1" []
+                 "C1200000001-PROV1" ["read"]
+                 "C1200000002-PROV1" []
+                 "C1200000003-PROV1" []}
+                (get-coll-permissions))))
+
+       (testing "ACL matching only collections with undefined access values"
+         (update-acl acl-id {:group_permissions [{:permissions [:read]
+                                                  :user_type :guest}]
+                             :catalog_item_identity {:name "coll2 guest read"
+                                                     :collection_applicable true
+                                                     :collection_identifier {:access_value {:min_value 1
+                                                                                :max_value 10
+                                                                                :include_undefined_value true}}
+                                                     :provider_id "PROV1"}})
+
+         (is (= {"C1200000000-PROV1" ["read"]
+                 "C1200000001-PROV1" ["read"]
+                 "C1200000002-PROV1" ["read"]
+                 "C1200000003-PROV1" ["read"]}
+                (get-coll-permissions)))))))
+
+ (deftest collection-catalog-item-identifier-temporal-test
+   ;; tests ACLs that grant access based on a collection's temporal range
+   (let [token (e/login (u/conn-context) "user1" [])
+         ingest-temporal-collection (fn [short-name start-year end-year]
+                                      (ingest-collection token {:entry-title (str short-name " entry title")
+                                                                :short-name short-name
+                                                                :native-id short-name
+                                                                :provider-id "PROV1"
+                                                                :temporal-range {:BeginningDateTime (t/date-time start-year)
+                                                                                :EndingDateTime (t/date-time end-year)}}))
+         coll1 (ingest-temporal-collection "coll1" 2001 2002)
+         coll2 (ingest-temporal-collection "coll2" 2004 2005)
+         coll3 (ingest-temporal-collection "coll3" 2007 2009)
+         ;; coll4 will have no temporal extent, and should not be granted any permissions by our ACLs in this test
+         coll4 (ingest-collection token {:entry-id "coll4"
+                                         :native-id "coll4"
+                                         :short-name "coll4"
+                                         :entry-title "non-temporal coll4"
+                                         :provider-id "PROV1"
+                                         :no-temporal true})
+         create-acl #(:concept_id (ac/create-acl (u/conn-context) % {:token token}))
+         update-acl #(ac/update-acl (u/conn-context) %1 %2 {:token token})
+         get-coll-permissions #(get-permissions :guest coll1 coll2 coll3 coll4)]
+     (u/wait-until-indexed)
+     (is (= {"C1200000000-PROV1" []
+             "C1200000001-PROV1" []
+             "C1200000002-PROV1" []
+             "C1200000003-PROV1" []}
+            (get-coll-permissions)))
+
+     (let [acl-id (create-acl
+                    {:group_permissions [{:permissions [:read]
+                                          :user_type :guest}]
+                     :catalog_item_identity {:name "coll2 guest read"
+                                             :collection_applicable true
+                                             :collection_identifier {:temporal {:start_date "2000-01-01T00:00:00Z"
+                                                                                :end_date "2010-01-01T00:00:00Z"
+                                                                                :mask "intersect"}}
+                                             :provider_id "PROV1"}})]
+
+       (testing "\"intersect\" mask"
+         (is (= {"C1200000000-PROV1" ["read"]
+                 "C1200000001-PROV1" ["read"]
+                 "C1200000002-PROV1" ["read"]
+                 "C1200000003-PROV1" []}
+                (get-coll-permissions))))
+
+       (testing "\"disjoint\" mask"
+         (update-acl acl-id {:group_permissions [{:permissions [:read]
+                                                  :user_type :guest}]
+                             :catalog_item_identity {:name "coll2 guest read"
+                                                     :collection_applicable true
+                                                     :collection_identifier {:temporal {:start_date "2003-01-01T00:00:00Z"
+                                                                                :end_date "2006-01-01T00:00:00Z"
+                                                                                :mask "disjoint"}}
+                                                     :provider_id "PROV1"}})
+         (is (= {"C1200000000-PROV1" ["read"]
+                 "C1200000001-PROV1" []
+                 "C1200000002-PROV1" ["read"]
+                 "C1200000003-PROV1" []}
+                (get-coll-permissions))))
+
+       (testing "\"contains\" mask"
+         (update-acl acl-id {:group_permissions [{:permissions [:read]
+                                                  :user_type :guest}]
+                             :catalog_item_identity {:name "coll2 guest read"
+                                                     :collection_applicable true
+                                                     :collection_identifier {:temporal {:start_date "2003-01-01T00:00:00Z"
+                                                                                :end_date "2006-01-01T00:00:00Z"
+                                                                                :mask "contains"}}
+                                                     :provider_id "PROV1"}})
+         (is (= {"C1200000000-PROV1" []
+                 "C1200000001-PROV1" ["read"]
+                 "C1200000002-PROV1" []
+                 "C1200000003-PROV1" []}
+                (get-coll-permissions)))))))
+
+ ;; For CMR-3210:
+ ;; * granule provider permissions (read/order) for guest, registered, and groups
+ ;; * granule specific permissions (update/delete) for guest, registered, and groups
+ ;; * granule permissions based on access value
+ ;; * granule permissions based on temporal
+ ;; * granule permissions applied for collection applicable false??? <-- ask Jason
+
+ (deftest collection-provider-level-permission-check-test
+   ;; Tests ACLs which grant the provider-level update/delete permissions to collections
+   (let [token (e/login (u/conn-context) "user1" ["group-create-group"])
+         ;; then create a group that contains our user, so we can find collections that grant access to this user
+         group (u/make-group {:name "groupwithuser1" :members ["user1"]})
+         created-group-concept-id (:concept_id (u/create-group token group))
+         ;; create some collections
+         coll1-umm (assoc example-collection-record :EntryTitle "coll1 entry title")
+         coll1-metadata (umm-spec/generate-metadata (u/conn-context) coll1-umm :echo10)
+         coll1 (ingest-collection token {:provider-id "PROV1"
+                                         :entry-title "coll1"
+                                         :native-id "coll1"
+                                         :short-name "coll1"})
+         ;; local helpers to make the body of the test cleaner
+         create-acl #(ac/create-acl (u/conn-context) % {:token token})
+         update-acl #(ac/update-acl (u/conn-context) %1 %2 {:token token})
+         get-coll1-permissions #(get-permissions % coll1)]
+
+     (testing "no permissions granted"
+       (are [user permissions]
+         (= {"C1200000001-PROV1" permissions}
+            (get-coll1-permissions user))
+         :guest []
+         :registered []
+         "user1" []))
+
+     (testing "provider level permissions"
+       (let [acl {:group_permissions [{:permissions [:update :delete]
+                                       :user_type :guest}]
+                  :provider_identity {:provider_id "PROV1"
+                                      :target "INGEST_MANAGEMENT_ACL"}}
+             acl-concept-id (:concept_id (create-acl acl))]
+         (u/wait-until-indexed)
+
+         (are [user permissions]
+           (= {"C1200000001-PROV1" permissions}
+              (get-coll1-permissions user))
+           :guest ["update" "delete"]
+           :registered []
+           "user1" [])
+
+         (testing "granted to registered users"
+           (update-acl acl-concept-id
+                       {:group_permissions [{:permissions [:update :delete]
+                                             :user_type :registered}]
+                        :provider_identity {:provider_id "PROV1"
+                                            :target "INGEST_MANAGEMENT_ACL"}})
+
+           (are [user permissions]
+             (= {"C1200000001-PROV1" permissions}
+                (get-coll1-permissions user))
+             :guest []
+             :registered ["update" "delete"]
+             "user1" ["update" "delete"]))
+
+         (testing "granted to specific groups"
+           (update-acl acl-concept-id
+                       {:group_permissions [{:permissions [:update :delete]
+                                             :group_id created-group-concept-id}]
+                        :provider_identity {:provider_id "PROV1"
+                                            :target "INGEST_MANAGEMENT_ACL"}})
+
+           (are [user permissions]
+             (= {"C1200000001-PROV1" permissions}
+                (get-coll1-permissions user))
+             :guest []
+             :registered []
+             "user1" ["update" "delete"]
+             "user2" []))))))


ccw.util.edn: Fix false positive

ccw.util.edn: Fix false positive

--- ccw.core.test/src/clj/ccw/util/edn_test.clj
+++ ccw.core.test/src/clj/ccw/util/edn_test.clj
@@ -5,7 +5,6 @@
 (deftest test-read-vector
   (testing "read-vector"
     (testing "returns the vector in the input string"
-      (is (= false true))
       (is (= [123 456] (read-vector "[123 456]"))))
     (testing "returns an empty vector if the input is invalid EDN"
       (is (= [] (read-vector "[123"))))


Move :all to next release.

Move :all to next release.

--- src/onyx/static/validation.clj
+++ src/onyx/static/validation.clj
@@ -123,7 +123,7 @@
   (doseq [lifecycle lifecycles]
     (when-not (or (= (:lifecycle/task lifecycle) :all)
                   (some #{(:lifecycle/task lifecycle)} (map :onyx/name catalog)))
-      (throw (ex-info (str ":lifecycle/task must either name a task in the catalog or be :all, it was: " (:lifecycle/task lifecycle))
+      (throw (ex-info (str ":lifecycle/task must name a task in the catalog. It was: " (:lifecycle/task lifecycle))
                       {:lifecycle lifecycle :catalog catalog})))
     (schema/validate
      {:lifecycle/task schema/Keyword


Refactored (permutations) in permutations.clj to return an object implementing clojure.lang.Seqable

--- clojure/org/gavrog/clojure/permutations.clj
+++ clojure/org/gavrog/clojure/permutations.clj
@@ -1,18 +1,21 @@
 (ns org.gavrog.clojure.permutations)

-(defn permutations [degree]
-  (let [keys (range 1 (inc degree))
-        complete? (comp empty? :unused)
-        children (fn [node]
-                   (let [{:keys [perm unused unseen]} node]
-                     (when-let [i (first unused)]
-                       (for [n unseen]
-                         {:perm (assoc perm i n)
-                          :unused (disj unused i)
-                          :unseen (disj unseen n)}))))
+(deftype BacktrackingGenerator [root complete? branch? children extract]
+  clojure.lang.Seqable
+  (seq [gen] (map extract (filter complete? (tree-seq branch? children root)))))
+
+(defn permutations [n]
+  (let [keys (range 1 (inc n))
         root {:perm {}
               :unused (into #{} keys)
-              :unseen (into #{} keys)}]
-    (map :perm
-         (filter complete?
-                 (tree-seq (comp not complete?) children root)))))
+              :unseen (into #{} keys)}
+        complete? (comp empty? :unused)
+        branch? (comp seq :unused)
+        children (fn [node] (let [{:keys [perm unused unseen]} node]
+                              (when-let [i (first unused)]
+                                (for [k unseen]
+                                  {:perm (assoc perm i k)
+                                   :unused (disj unused i)
+                                   :unseen (disj unseen k)}))))
+        extract :perm]
+        (BacktrackingGenerator. root complete? branch? children extract)))


Tidied names and function signatures.

Tidied names and function signatures.

--- src/overtunes/songs/before.clj
+++ src/overtunes/songs/before.clj
@@ -7,7 +7,7 @@
   [:C3 :Bb3 :Eb3 :G3]
 )

-(def starting-section [
+(def start [
   (chord :Eb3 :major)
   (chord :Eb3 :major)
   (chord :C3  :minor7)
@@ -18,7 +18,7 @@
   (chord :C3  :minor7)
 ])

-(def middle-section [
+(def middle [
   (chord :G3  :minor)
   (chord :G3  :minor)
   (chord :Ab3 :major)
@@ -29,7 +29,7 @@
   (chord :Bb3 :major)
 ])

-(def variation-section [
+(def variation [
   (chord :G3  :minor)
   (chord :G3  :minor)
   (chord :Ab3 :major)
@@ -82,21 +82,21 @@
   ))
 ))

-(defn n-times [items n]
+(defn n-times [n items]
   (flatten (repeat n items))
 )

 (defn play [] ( do
   (def chords
     (concat
-      starting-section
-      middle-section
-      starting-section
-      middle-section
-      variation-section
+      start
+      middle
+      start
+      middle
+      variation
     )
   )
-  (play-melody (concat (n-times melody (/ (count chords) 2)) [:Eb4]) metro (metro))
+  (play-melody (concat (n-times (/ (count chords) 2) melody) [:Eb4]) metro (metro))
   (play-progression
     chords
     metro


correct some mistakes in process-text-change, and rename replacing-lines->line-replacements

--- src/parinfer/format/infer.cljc
+++ src/parinfer/format/infer.cljc
@@ -342,19 +342,20 @@
    {:keys [line-no new-line] :as change}]
   (let [; normalize args (allowing multiple line replacements)
         [start-line end-line] (if (number? line-no) [line-no (inc line-no)] line-no)
-        replacing-lines (if (string? new-line) [new-line] new-line)
+        line-replacements (if (string? new-line) [new-line] new-line)

         cache-line-no (dec start-line)
         cache (get postline-states cache-line-no)

-        lines-before (subvec (:line prev-state) 0 start-line)
+        old-lines (:lines prev-state)
+        lines-before (subvec old-lines 0 start-line)

         ;; There is only one previous line that can be affected by our change.
         ;; We restore that line to its original state (trailing delims removed).
         ;; Processing our changed line's indentation will correct it.
         lines-before (when-let [{:keys [line-dy line]} (:insert cache)]
                        (let [line-no (+ line-dy cache-line-no)]
-                         (assoc lines-before (+ line-dy) line)))
+                         (assoc lines-before line-no line)))

         ;; create initial state for starting at first changed line
         state (-> initial-state
@@ -365,9 +366,7 @@
                   )

         ;; process changed lines
-        state (reduce process-line state replacing-lines)
-
-        old-lines (:lines prev-state)
+        state (reduce process-line state line-replacements)

         ;; process after changed lines
         state (reduce


block long durations

block long durations

--- src/cljs/org/broadinstitute/firecloud_ui/common.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common.cljs
@@ -49,6 +49,7 @@
 (defn scroll-to
   ([x y] (.scrollTo js/window x y))
   ([x y duration]
+   (assert (<= duration 400) "Duration too long (> 400ms)")
    (if (zero? duration)
      (scroll-to x y)
      (let [start-time (js/Date.now)]


Fix #75 Simulator not discovered

Fix #75 Simulator not discovered

To attempt to alleviate this, if no devices discovered,
periodically tear down and recontruct mDNS client.

--- Clojure/src/ambly/repl/jsc.clj
+++ Clojure/src/ambly/repl/jsc.clj
@@ -45,15 +45,13 @@
     (doseq [[choice-number [bonjour-name _]] (name-endpoint-map->choice-list name-endpoint-map)]
       (println (str "[" choice-number "] " (bonjour-name->display-name bonjour-name))))))

-(defn discover-and-choose-device
-  "Looks for Ambly WebDAV devices advertised via Bonjour and presents
-  a simple command-line UI letting user pick one, unless
-  choose-first-discovered? is set to true in which case the UI is bypassed"
-  [choose-first-discovered? opts]
-  {:pre [(map? opts)]}
-  (let [reg-type "_http._tcp.local."
-        name-endpoint-map (atom (sorted-map))
-        mdns-service (JmDNS/create)
+(defn setup-mdns
+  "Sets up mDNS to populate atom supplied in name-endpoint-map with discoveries.
+  Returns a function that will tear down mDNS."
+  [reg-type name-endpoint-map]
+  {:pre [(string? reg-type)]
+   :post [(fn? %)]}
+  (let [mdns-service (JmDNS/create)
         service-listener
         (reify ServiceListener
           (serviceAdded [_ service-event]
@@ -71,14 +69,34 @@
                                     {:address (.getAddress info)
                                      :port    (.getPort info)})}]
                   (swap! name-endpoint-map merge entry))))))]
+    (.addServiceListener mdns-service reg-type service-listener)
+    (fn []
+      (.removeServiceListener mdns-service reg-type service-listener)
+      (.close mdns-service))))
+
+(defn discover-and-choose-device
+  "Looks for Ambly WebDAV devices advertised via Bonjour and presents
+  a simple command-line UI letting user pick one, unless
+  choose-first-discovered? is set to true in which case the UI is bypassed"
+  [choose-first-discovered? opts]
+  {:pre [(map? opts)]}
+  (let [reg-type "_http._tcp.local."
+        name-endpoint-map (atom (sorted-map))
+        tear-down-mdns
+        (loop [count 0
+               tear-down-mdns (setup-mdns reg-type name-endpoint-map)]
+          (if (empty? @name-endpoint-map)
+            (do
+              (Thread/sleep 100)
+              (when (= 20 count)
+                (println "\nSearching for devices ..."))
+              (if (zero? (rem (inc count) 100))
+                (do
+                  (tear-down-mdns)
+                  (recur (inc count) (setup-mdns reg-type name-endpoint-map)))
+                (recur (inc count) tear-down-mdns)))
+            tear-down-mdns))]
     (try
-      (.addServiceListener mdns-service reg-type service-listener)
-      (loop [count 0]
-        (when (empty? @name-endpoint-map)
-          (Thread/sleep 100)
-          (when (= 20 count)
-            (println "\nSearching for devices ..."))
-          (recur (inc count))))
       (Thread/sleep 500)                                    ;; Sleep a little more to catch stragglers
       (loop [current-name-endpoint-map @name-endpoint-map]
         (println)
@@ -96,11 +114,7 @@
                 (second (nth choices choice-ndx))
                 (recur current-name-endpoint-map))))))
       (finally
-        (.start
-          (Thread.
-            (fn []
-              (.removeServiceListener mdns-service reg-type service-listener)
-              (.close mdns-service))))))))
+        (.start (Thread. tear-down-mdns))))))

 (defn socket
   [host port]


devtools auto installs now?

devtools auto installs now?

--- src/sierpinski_sieve/core.cljs
+++ src/sierpinski_sieve/core.cljs
@@ -4,8 +4,6 @@
             [sierpinski-sieve.blit :as blit]))

 (enable-console-print!)
-
-(devtools/install! [:formatters :hints])
 (defn log [& args] (.log js/console args))

 (defonce app-state (atom {}))


Allow non-nilenso invited emails to signup

Co-authored-by: Samrat Man Singh <de71a275ed207d9c2083ebfa9af5dcdfa3ea2b88@nilenso.com>

--- src/time_tracker/auth/core.clj
+++ src/time_tracker/auth/core.clj
@@ -27,26 +27,25 @@
   "Validates a JWT by calling Google's API and by checking the client ID."
   [client-ids token]
   (let [{:keys [status body]} (call-google-tokeninfo-api token)]
-    (if (and (= 200 status)
-             (some #{(:aud body)} client-ids)
-             (= "nilenso.com" (:hd body)))
+    (when (and (= 200 status)
+             (some #{(:aud body)} client-ids))
       body)))

 (defn token-from-headers
   "Extracts the token from a Ring header map, if present.
   See: https://jwt.io/introduction/"
   [ring-headers]
-  (if-let [header-value (get ring-headers "authorization")]
+  (when-let [header-value (get ring-headers "authorization")]
     (let [[scheme & rest] (clojure.string/split header-value #" ")
           token (clojure.string/join " " rest)]
-      (if (= "Bearer" scheme)
+      (when (= "Bearer" scheme)
         token))))

 (defn auth-credentials
   "Gets a map of credentials from a Ring request.
   A list of client-ids is needed to validate the JWT."
   [client-ids request]
-  (if-let [token (token-from-headers (:headers request))]
+  (when-let [token (token-from-headers (:headers request))]
     (token->credentials client-ids token)))

 (defn wrap-google-authenticated


Use default value in 'get' expression

Use default value in 'get' expression

--- euler_clojure/src/euler_clojure/problem54.clj
+++ euler_clojure/src/euler_clojure/problem54.clj
@@ -22,7 +22,7 @@
   [hand]
   (let [rs (for [h hand] (get h 0))
         trans {\A 14, \K 13, \Q 12, \J 11, \T 10}
-        convert #(for [x %] (if (contains? trans x) (trans x) (Character/digit x 10)))
+        convert #(for [x %] (get trans x (Character/digit x 10)))
         reverse-sort #(reverse (sort %))
         modify-ace #(if (= % [14 5 4 3 2]) [5 4 3 2 1] %)
         sort-by-freq #(sort-by (frequencies %) > %)]


Refactor tests for robot-name

Refactor tests for robot-name

--- exercises/robot-name/test/robot_name_test.clj
+++ exercises/robot-name/test/robot_name_test.clj
@@ -2,28 +2,30 @@
   (:require [clojure.test :refer [deftest is testing]]
             robot-name))

-(def ^:private robbie (robot-name/robot))
-(def ^:private clutz  (robot-name/robot))
-
 (deftest robot-name
-  (testing "robot-name"
-    (is (re-seq #"[A-Z]{2}\d{3}" (robot-name/robot-name robbie))
-        "name matches expected pattern")
-    (is (= (robot-name/robot-name robbie) (robot-name/robot-name robbie))
-        "name is persistent")
-    (is (not= (robot-name/robot-name clutz) (robot-name/robot-name robbie))
-        "different robots have different names")))
+  (let [a-robot (robot-name/robot)
+        its-name (robot-name/robot-name a-robot)]
+    (testing "robot-name"
+      (is (re-seq #"[A-Z]{2}\d{3}" its-name)
+          "name matches expected pattern")
+      (is (= its-name (robot-name/robot-name a-robot))
+          "name doesn't change until you reset it")
+      (is (not= its-name (-> (robot-name/robot) robot-name/robot-name))
+          "different robots have different names"))))

 (deftest reset-name
-  (testing "reset-name"
-    (let [original-name (robot-name/robot-name robbie)]
-      (robot-name/reset-name robbie)
-      (is (re-seq #"[A-Z]{2}\d{3}" (robot-name/robot-name robbie))
+  (let [a-robot (robot-name/robot)
+        its-original-name (robot-name/robot-name a-robot)
+        its-new-name (do (robot-name/reset-name a-robot)
+                         (robot-name/robot-name a-robot))]
+
+    (testing "reset-name"
+      (is (re-seq #"[A-Z]{2}\d{3}" its-new-name)
           "new name matches expected pattern")
-      (is (= (robot-name/robot-name robbie) (robot-name/robot-name robbie))
-          "new name is persistent")
-      (is (not= original-name (robot-name/robot-name robbie))
+      (is (not= its-original-name its-new-name)
           "new name is different from old name")
-      (is (not= (robot-name/robot-name robbie)
-                (-> robbie robot-name/reset-name robot-name/robot-name))
-          "new name is different each time"))))
+      (is (= its-new-name (robot-name/robot-name a-robot))
+          "new name doesn't change until you reset it")
+      (is (not= its-new-name (do (robot-name/reset-name a-robot)
+                                 (robot-name/robot-name a-robot)))
+          "new names are different each time"))))


Added core function for mapping over nodes of tree.

--- evermind.core/src/evermind/domain/core.cljc
+++ evermind.core/src/evermind/domain/core.cljc
@@ -111,6 +111,17 @@

+(defn map-tree
+  ([node f]
+   (let [mapped (f node)]
+     (assoc mapped :children (set (map #(map-tree % f) (:children mapped)))))))
+
+(s/fdef map-tree
+        :args (s/cat :node ::node :pred ::node-pred)
+        :ret ::node)
+
+
+
 (defn create-mindmap
   ([] (create-node)))


Remove contrib dependencies from r.h.httpcore.

--- ring-httpcore-adapter/src/ring/adapter/httpcore.clj
+++ ring-httpcore-adapter/src/ring/adapter/httpcore.clj
@@ -23,8 +23,7 @@
            (java.net URI
              ServerSocket)
            (java.util.concurrent
-             Executors Executor ThreadFactory))
-  (:use [clojure.contrib.except :only (throwf)]))
+             Executors Executor ThreadFactory)))

 (defmacro ^{:private true} -?>
  ([form] form)
@@ -110,7 +109,7 @@
              (instance? File body)
                (FileEntity. body content-type)
              :else
-               (throwf "Unrecognized body: %s" body))]
+               (throw (Exception. (format "Unrecognized body: %s" body))))]
       (when-let [^String type (headers "Content-Type")]
         (.setContentType ^AbstractHttpEntity entity type))
       (.setEntity response entity))))


Naively adds the name of the user that last updated a message

--- web-app/src/cljs/potato/core.cljs
+++ web-app/src/cljs/potato/core.cljs
@@ -766,7 +766,8 @@
                     (om.dom/span #js {:dangerouslySetInnerHTML #js {:__html (:text message)}} nil))
                   (if (:updated message)
                     (om.dom/span #js {:className "chat-updated"}
-                      message-updated nonbreak-space (display-time (:updated_date message))))
+                                 message-updated nonbreak-space (display-time (:updated_date message)) nonbreak-space
+                                 "by" nonbreak-space (:from_name message)))
                   (if (and (not isHidden) (:extra_html message))
                     (om.dom/div #js {:className "extra-html"
                                      :dangerouslySetInnerHTML #js {:__html (:extra_html message)}})))))


continue to isolate/encapsulate join internal rep

--- dada2-core/src/test/clojure/org/dada2/test_join_model.clj
+++ dada2-core/src/test/clojure/org/dada2/test_join_model.clj
@@ -37,6 +37,9 @@
 ;;--------------------------------------------------------------------------------
 ;; this layer encapsulates access to lhs index

+(defn- lhses-get [lhs-indeces i key]
+  (key (nth lhs-indeces (dec i))))
+
 (defn- lhs-assoc [old-indeces keys lhs]
   "associate a new lhs with existing index"
   (let [[old-lhs-index & rhs-indeces] old-indeces
@@ -47,10 +50,9 @@
 ;;--------------------------------------------------------------------------------
 ;; this layer encapsulates access to rhs indeces

-(defn- rhs-assoc [old-indeces i key rhs]
+(defn- rhs-assoc [old-indeces i value rhs]
   (let [old-index (nth old-indeces i)
-	value (key rhs)
-	old-rhses (or (old-index value) [])
+	old-rhses (or (value old-index) [])
 	new-rhses (conj old-rhses rhs)
 	new-index (assoc old-index value new-rhses)
 	new-indeces (assoc old-indeces i new-index)]
@@ -95,10 +97,10 @@
 ;; TODO: return a pair - first is notification fn, second is new-indeces - use swap*! to apply

 (defn- rhs-upsert [old-indeces i lhs-key rhs-ks v join-fn joined-model]
-  (let [new-indeces (rhs-assoc old-indeces i lhs-key v)
+  (let [key (lhs-key v)
+	new-indeces (rhs-assoc old-indeces i key v)
 	lhs-indeces (first old-indeces)
-	lhs-index (nth lhs-indeces (dec i))
-	lhses ((lhs-key v) lhs-index)
+	lhses (lhses-get lhs-indeces i key)
 	rhs-indeces (rest new-indeces)
 	joins (mapcat (fn [lhs] (derive-joins lhs rhs-indeces rhs-ks join-fn)) lhses)
 	]


Removed an useless html tag.

Removed an useless html tag.

--- app/src/weather/ui/view/history.cljs
+++ app/src/weather/ui/view/history.cljs
@@ -13,7 +13,7 @@
     [:li (tr :lowest)
      [:strong (utils/->celsius-str (:mintempm weather-history-data))]]
     (if (> (:fog weather-history-data) 0) [:li (tr :fog)])
-    (if (> (:rain weather-history-data) 0) [:li (tr :rain)] [:h1])
+    (if (> (:rain weather-history-data) 0) [:li (tr :rain)])
     (if (> (:snow weather-history-data) 0) [:li (tr :snow)])
     (if (> (:hail weather-history-data) 0) [:li (tr :hail)])]])


For testing made explore-model store its computed gcis in a global ref

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/contrib/dl/languages/EL_gfp_exploration.clj
+++ src/conexp/contrib/dl/languages/EL_gfp_exploration.clj
@@ -51,6 +51,9 @@

 ;;; actual exploration algorithm

+;;; BADBADBAD!!!
+(defvar *collected-gcis* (ref []))
+
 (defn explore-model
   "Model exploration algorithm."
   ([initial-model]
@@ -89,7 +92,7 @@
 		 susu))

 	     ;; else search for next implication
-	     (let [_ (println (count (seq-on M_k)))
+	     (let [_ (println (count (seq-on M_k))),
                    all-P_k    (make-dl-expression language (cons 'and P_k)),
 		   next-model (loop [model model]
 				(let [susu (abbreviate-subsumption
@@ -98,6 +101,7 @@
                                                                                (model-closure model all-P_k)))
                                             (union implications background-knowledge))]
 				  (if (or (obviously-true? susu)
+                                          (or (dosync (alter *collected-gcis* conj susu)) true)
 					  (not (expert-refuses? susu)))
 				    model
 				    (recur (extend-model-by-contradiction model susu))))),


first working PoC of kafka stream builder has been added

--- extra_components/kafka/src/clj/hellhound/kafka/core.clj
+++ extra_components/kafka/src/clj/hellhound/kafka/core.clj
@@ -2,7 +2,7 @@
   (:require [manifold.stream :as stream])
   (:import
    [java.util Properties]
-   [org.apache.kafka.streams KafkaStreams StreamsBuilder]
+   [org.apache.kafka.streams KafkaStreams StreamsBuilder StreamsConfig]
    [org.apache.kafka.streams.kstream KStream]))

@@ -41,13 +41,21 @@
           (apply [this k v]
             (println (str "<<<<<<<<<<<<<< " k ">>>> " v)))))

-(reset! _builder nil)
+(defn xx []
+  (reset! _builder nil)
+  (let [ss (stream "something")
+        a (streams {"application.id"    "test.app"
+                    "retries"           "1"
+                    (StreamsConfig/BOOTSTRAP_SERVERS_CONFIG) "localhost:9092"})]
+                    ;;"bootstrap.servers" "localhost:9092"})]

-(def ss (stream "something"))
-(def a (streams {"application.id"    "test.app"
-                 "retries"           "1"
-                 "bootstrap.servers" ["localhost:9092"]}))
+    (.foreach ss cb)
+    (.start a)
+    a))

-(.foreach ss cb)
-(.start a)
-(.close a)
+(defn cc [a]
+  (.close a))
+
+
+(def x (xx))
+(cc x)


replace "Missing." status

replace "Missing." status

not sure this is better but happens constantly when opening the
UI after a compilation has already finished.

needs a proper fix at some point

--- src/main/shadow/cljs/ui/components/build_status.cljs
+++ src/main/shadow/cljs/ui/components/build_status.cljs
@@ -97,7 +97,7 @@
 (defn render-build-status-short [{:keys [status] :as build-status}]
   (case status
     nil
-    (<< [:div "Missing."])
+    (<< [:div "Unknown, waiting for recompile."])

     :compiling
     (render-compiling-status build-status)
@@ -120,7 +120,7 @@
 (defn render-build-status-full [{:keys [status] :as build-status}]
   (case status
     nil
-    (<< [:div "Missing."])
+    (<< [:div "Unknown, waiting for recompile."])

     :compiling
     (<< [:div.p-2


Cleaned up docs on options for create-dataset.

--- project/analyze-data/src/analyze_data/dataset/create/core.clj
+++ project/analyze-data/src/analyze_data/dataset/create/core.clj
@@ -11,9 +11,10 @@
                 dataset.  Currently the only type is :tf-idf.
   corpus: a sequence of maps containing keys 'document-label' and
           'document-text'
-  options:
-    :term-types (default [:words]) list of term types to extract from documents
-                valid term-types are :words, :bigrams, :trigrams
+  options: depend on dataset-type
+    :tf-idf,
+      :term-types (default [:words]) list of term types to extract from
+                  documents valid term-types are :words, :bigrams, :trigrams

   Return a dataset, which is a map with the following keys:
   :type      the type of the dataset


WIP: fix tests

WIP: fix tests

--- test/beehive/patterns_test.clj
+++ test/beehive/patterns_test.clj
@@ -49,6 +49,7 @@
              (set (for [_ (range 3)]
                     (patterns/run-action
                       load-balancer (fn [context] (:result context 10))))))))
+
     (testing "If action rejected, other services will be called."
       (let [latch (CountDownLatch. 1)]
         (beehive/submit-action service1 (fn [] (.await latch)) Long/MAX_VALUE)
@@ -59,23 +60,21 @@
         (is (= 2 (patterns/run-action load-balancer
                                       (fn [context] (:result context 10)))))
         (.countDown latch)))
-    ;(testing ":all-services-rejected returned if all services reject action"
-    ;  (let [latch (CountDownLatch. 1)]
-    ;    (beehive/submit-action service1 (fn [] (.await latch)) Long/MAX_VALUE)
-    ;    (beehive/submit-action service2 (fn [] (.await latch)) Long/MAX_VALUE)
-    ;    (beehive/submit-action service3 (fn [] (.await latch)) Long/MAX_VALUE)
-    ;    (is (= :all-services-rejected
-    ;           @(patterns/submit-action
-    ;              load-balancer
-    ;              (fn [context] (:result context 10))
-    ;              1000)))
-    ;    (is (= :all-services-rejected
-    ;           (patterns/run-action
-    ;             load-balancer
-    ;             (fn [context] (:result context 10)))))
-    ;    (.countDown latch)))
-
-    ))
+    (testing ":all-services-rejected returned if all services reject action"
+      (let [latch (CountDownLatch. 1)]
+        (beehive/submit-action service1 (fn [] (.await latch)) Long/MAX_VALUE)
+        (beehive/submit-action service2 (fn [] (.await latch)) Long/MAX_VALUE)
+        (beehive/submit-action service3 (fn [] (.await latch)) Long/MAX_VALUE)
+        (is (= :all-services-rejected
+               @(patterns/submit-action
+                  load-balancer
+                  (fn [context] (:result context 10))
+                  1000)))
+        (is (= :all-services-rejected
+               (patterns/run-action
+                 load-balancer
+                 (fn [context] (:result context 10)))))
+        (.countDown latch)))))

 (deftest shotgun
   (let [shotgun (patterns/shotgun {service1 {}


[PDOK-2616] fix: rename test-function

[PDOK-2616] fix: rename test-function

--- test/featured_gml/api_test.clj
+++ test/featured_gml/api_test.clj
@@ -38,7 +38,7 @@
     (test-delete (:uuid result))))

-(deftest zip-file-µconverted-correctly
+(deftest zip-file-converted-correctly
   "Test if input-file api-test/bestuurlijkegrenzen.zip results in multiple zip files. Note does not test CONTENT of result"
   (let [mapping (slurp (io/resource "api-test/bestuurlijkegrenzen.edn"))
         input (io/input-stream (io/resource "api-test/bestuurlijkegrenzen.zip"))


Logging transformation errors

Logging transformation errors

--- backend/src/akvo/lumen/transformation.clj
+++ backend/src/akvo/lumen/transformation.clj
@@ -2,6 +2,7 @@
   (:refer-clojure :exclude [apply])
   (:require [akvo.lumen.lib :as lib]
             [akvo.lumen.transformation.engine :as engine]
+            [clojure.tools.logging :as log]
             [akvo.lumen.util :refer (squuid)]
             [clojure.java.jdbc :as jdbc]
             [hugsql.core :as hugsql]))
@@ -59,6 +60,7 @@
           (lib/ok {"jobExecutionId" job-execution-id "datasetId" dataset-id})
           (catch Exception e
             (let [msg (.getMessage e)]
+              (log/info e)
               (update-failed-job-execution tenant-conn {:id job-execution-id :reason [msg]})
               (lib/conflict {"jobExecutionId" job-execution-id "datasetId" dataset-id "message" msg}))))
         (lib/bad-request {"message" (:message v)})))


fix chat image long press issue (#13371)

--- src/status_im/ui/screens/chat/message/reactions.cljs
+++ src/status_im/ui/screens/chat/message/reactions.cljs
@@ -91,5 +91,6 @@
                                                       (on-close)
                                                       (js/setTimeout #(on-emoji-press emoji)
                                                                      reaction-picker/animation-duration))}
-             [render message {:modal       true
-                              :close-modal on-close}]]])]))))
+             [render message {:modal         true
+                              :on-long-press #()
+                              :close-modal   on-close}]]])]))))


Add test for record updating in tablets.

--- test/merkle_db/tablet_test.clj
+++ test/merkle_db/tablet_test.clj
@@ -82,6 +82,43 @@
       (is (= [[k1 r1] [k2 r2]] (tablet/read-all tablet))))))

-; TODO: property tests
-; - tablet data matches schema
-; - tablet records are sorted by key
+(deftest record-updates
+  (let [k1 (key/create [1 2 3])
+        r1 {:foo 123}
+        k2 (key/create [4 5 6])
+        r2 {:foo 456}
+        k3 (key/create [7 8 9])
+        r3 {:foo 789}
+        tablet (tablet/from-records {k1 r1, k2 r2, k3 r3})]
+    (testing "pruning"
+      (is (= [[k1 r1]]
+             (tablet/read-all
+               (tablet/prune
+                 (tablet/from-records {k1 r1, k2 {}}))))))
+    (testing "insertion"
+      (is (= [[k1 r1] [k2 r2] [k3 r3]]
+             (tablet/read-all
+               (tablet/update-records
+                 (tablet/from-records {k1 r1})
+                 {k2 r2, k3 r3} #{}))))
+      (is (= [[k1 r2]]
+             (tablet/read-all
+               (tablet/update-records
+                 (tablet/from-records {k1 r1})
+                 {k1 r2} #{}))))
+      (is (= [[k1 r1] [k2 r2]]
+             (tablet/read-all
+               (tablet/update-records
+                 (tablet/from-records {k1 r1})
+                 {k2 r2} #{})))))
+    (testing "deletion"
+      (is (= [[k1 r1] [k2 r2]]
+             (tablet/read-all
+               (tablet/update-records
+                 tablet
+                 {} #{k3}))))
+      (is (= [[k2 r2]]
+             (tablet/read-all
+               (tablet/update-records
+                 (tablet/from-records {k1 r1})
+                 {k2 r2} #{k1})))))))


Test fix

Test fix

--- test/micro_logic/core_test.clj
+++ test/micro_logic/core_test.clj
@@ -4,8 +4,8 @@
             [micro-logic.protocols :refer :all]
             ))

-(def a (lvar :a))
-(def b (lvar :b))
+(defonce a (lvar :a))
+(defonce b (lvar :b))

 (deftest micro-logic-tests
   (testing "walk"
@@ -31,7 +31,7 @@
   (testing "goals"
     (testing "basic"
       (are [g, s c] (= (stream-to-seq (g empty-state))
-                       (stream-to-seq (unit (state s c))))
+                       (stream-to-seq (stream (state s c))))
            (=== 1 1), {} 0
            (=== a 1), {a 1} 0
            (=== 1 a), {a 1} 0


panc-annotations: improve usage text

panc-annotations: improve usage text

--- panc/src/main/clojure/org/quattor/pan/pan_annotations.clj
+++ panc/src/main/clojure/org/quattor/pan/pan_annotations.clj
@@ -1,7 +1,7 @@
 (ns org.quattor.pan.pan-annotations
   (:gen-class)
-  (:require [clojure.tools.cli :refer :all]
-            [clojure.string :as str])
+  (:require [clojure.tools.cli :refer [parse-opts]]
+            [clojure.string :as string])
   (:import (java.io File)
            (org.quattor.pan CompilerOptions CompilerResults)))

@@ -23,7 +23,7 @@
     (list (create-absolute-file ""))))

 (defn parse-directory [dir]
-  (if (str/blank? dir)
+  (if (string/blank? dir)
     (current-directory)
     (create-absolute-file dir)))

@@ -36,21 +36,48 @@
         pan-sources (map #(File. ^String %) files)]
     (org.quattor.pan.Compiler/run compiler-options nil pan-sources)))

+(def cli-options
+  [;; First three strings describe a short-option, long-option with optional
+   ;; example argument description, and a description. All three are optional
+   ;; and positional. short and long option must be replaced by nil if absent.
+   [nil "--base-dir DIR" "base directory for templates"
+    :default (current-directory) :parse-fn parse-directory]
+   [nil "--output-dir DIR" "output directory"
+    :default (current-directory) :parse-fn parse-directory]
+   [nil "--java-opts OPTS" "options for JVM"]
+   ["-v" "--verbose" "show statistics and progress" :default false :flag true]
+   ["-h" "--help" "print command help" :default false :flag true]])
+
+(defn usage [options-summary]
+  (->> ["This tool processes annotations in pan templates."
+        ""
+        "Usage: panc-annotations [options] files"
+        ""
+        "Options:"
+        options-summary
+        ""
+        "Arguments:"
+        "  files    space-separated list of pan template files relative to base directory"
+        ""]
+       (string/join \newline)))
+
+(defn error-msg [errors]
+  (str "The following errors occurred while parsing your command:\n\n"
+       (string/join \newline errors)))
+
+(defn exit [status msg]
+  (println msg)
+  (System/exit status))
+
 (defn -main [& args]
-  (let [[options files banner]
-        (cli args
-             ["--base-dir" "base directory for templates"
-              :default (current-directory) :parse-fn parse-directory]
-             ["--output-dir" "output directory"
-              :default (current-directory) :parse-fn parse-directory]
-             ["--java-opts" "options for JVM"]
-             ["-v" "--verbose" "show statistics and progress" :default false :flag true]
-             ["-h" "--help" "print command help" :default false :flag true])]
-    (when (:help options)
-      (println banner)
-      (System/exit 0))
+  (let [{:keys [options files errors summary]} (parse-opts args cli-options)]
+    (cond
+      (:help options) (exit 0 (usage summary))
+      (< (count args) 1) (exit 1 (usage summary))
+      errors (exit 1 (error-msg errors)))
     (let [^CompilerResults results (generate-annotations options files)]
       (if-let [errors (.formatErrors results)]
         (println errors)
         "")
       (println (.formatStats results)))))
+


Namespace to isolate Zookeeper collisions.

--- test/onyx/log/curator_test.clj
+++ test/onyx/log/curator_test.clj
@@ -16,66 +16,69 @@
 (def env-config
   (assoc (:env-config config) :onyx/id onyx-id))

+(def base-path (str "/" onyx-id "/ab"))
+
+(def base-path2 (str "/" onyx-id "/ab2"))
+
 (let [env (onyx.api/start-env env-config)]
   (try
     (let [client (cu/connect (:zookeeper/address env-config) "onyx")
           value [1 3 48]]

-      (cu/create client "/ab" :data (into-array Byte/TYPE value))
+      (cu/create client base-path :data (into-array Byte/TYPE value))

       (facts "Value is written and can be read"
-             (fact value => (into [] (:data (cu/data client "/ab")))))
+             (fact (into [] (:data (cu/data client base-path))) => value))
       (cu/close client)

       (let [client2 (cu/connect (:zookeeper/address env-config) "onyx")
             watcher-sentinel (atom 0)]
         (facts "Test default ephemerality from previous test"
-               (fact (into [] (:data (cu/data client2 "/ab"))) => (throws Exception)))
+               (fact (into [] (:data (cu/data client2 base-path))) => (throws Exception)))

         ;; write out some sequential values with parent
-        (cu/create-all client2 "/ab/zd/hi/entry-" :sequential? true :persistent? true)
-        (cu/create-all client2 "/ab/zd/hi/entry-" :sequential? true)
-        (cu/create client2 "/ab/zd/hi/entry-" :sequential? true :persistent? true)
-        (cu/create client2 "/ab/zd/hi/entry-" :sequential? true)
+        (cu/create-all client2 (str base-path "/zd/hi/entry-") :sequential? true :persistent? true)
+        (cu/create-all client2 (str base-path "/zd/hi/entry-") :sequential? true)
+        (cu/create client2 (str base-path "/zd/hi/entry-") :sequential? true :persistent? true)
+        (cu/create client2 (str base-path "/zd/hi/entry-") :sequential? true)

         (facts "Check sequential children can be found"
                (fact
-                 (sort (cu/children client2 "/ab/zd/hi" :watcher (fn [_] (swap! watcher-sentinel inc))))
-                 =>
-                 (sort ["entry-0000000000"  "entry-0000000001"  "entry-0000000002"  "entry-0000000003"])))
-
+                (sort (cu/children client2 (str base-path "/zd/hi") :watcher (fn [_] (swap! watcher-sentinel inc))))
+                =>
+                (sort ["entry-0000000000"  "entry-0000000001"  "entry-0000000002"  "entry-0000000003"])))
+
         ;; add another child so watcher will be triggered
-        (cu/create client2 "/ab/zd/hi/entry-" :sequential? true :persistent? true)
+        (cu/create client2 (str base-path "/zd/hi/entry-") :sequential? true :persistent? true)

         ;; Give it a second before checking watch
-        (Thread/sleep 200)
+        (Thread/sleep 1000)

         (facts "Check watcher triggered"
                (fact @watcher-sentinel => 1))

-      (cu/close client2)
+        (cu/close client2)

-      (let [client3 (cu/connect (:zookeeper/address env-config) "onyx")]
+        (let [client3 (cu/connect (:zookeeper/address env-config) "onyx")]
+          (facts "Check only sequential persistent children remain"
+                 (fact
+                  (sort (cu/children client3 (str base-path "/zd/hi"))) =>
+                  (sort ["entry-0000000000" "entry-0000000002" "entry-0000000004"])))

-        (facts "Check only sequential persistent children remain"
-               (fact
-                 (sort (cu/children client3 "/ab/zd/hi")) =>
-                 (sort ["entry-0000000000" "entry-0000000002" "entry-0000000004"])))
+          (cu/create client3 base-path2 :data (into-array Byte/TYPE value) :persistent? true)

-        (cu/create client3 "/ab2" :data (into-array Byte/TYPE value) :persistent? true)
+          (facts "Check exists after add"
+                 (fact (:aversion (cu/exists client3 base-path2)) => 0))

-        (facts "Check exists after add"
-               (fact (:aversion (cu/exists client3 "/ab2")) => 0))
+          (cu/delete client3 base-path2)

-        (cu/delete client3 "/ab2")
+          (facts "Deleted value"
+                 (fact
+                  (cu/data client3 base-path2) => (throws Exception)))

-        (facts "Deleted value"
-               (fact
-                 (cu/data client3 "/ab2") => (throws Exception)))
-
-        (facts "Check exists after delete"
-               (fact (cu/exists client3 "/ab2") => nil))
-
-        (cu/close client3))))
+          (facts "Check exists after delete"
+                 (fact (cu/exists client3 base-path2) => nil))
+
+          (cu/close client3))))
     (finally
-      (onyx.api/shutdown-env env))))
+     (onyx.api/shutdown-env env))))