Fork me on GitHub
#duct
<
2019-11-04
>
rickmoynihan18:11:31

I expected duct profiles provided to exec-config to be merged in the supplied order; however it appears no explicit order is set… is that correct?!

ccann18:11:33

I think we ran into this and discovered empirically that it’s potentially alphabetical, perhaps as an incidental consequence of iterating over keys in a map (not that we’d rely on that ordering)

rickmoynihan18:11:41

It looks like the order is arbitrary as determined by (keys config)

rickmoynihan18:11:52

(defn profile-keys
  "Return a collection of keys for a configuration that excludes any profile
  not present in the supplied colleciton of profiles. Profiles may be specified
  as namespaced keywords, or as un-namespaced keywords, in which case only the
  name will matched (e.g. `:dev` will match `:duct.profile/dev`). If the :all
  keyword is supplied instead of a profile collection, all keys are returned."
  [config profiles]
  (cond->> (keys config)
    (not= profiles :all) (filter (partial keep-key? profiles))))

rickmoynihan18:11:20

surely that’s not right

ccann18:11:25

I would have expected right-to-left

rickmoynihan18:11:18

left to right is what I would expect; in order of the keys in profile