This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-25
Channels
- # announcements (2)
- # babashka (22)
- # beginners (31)
- # calva (4)
- # cider (26)
- # clj-kondo (10)
- # clojure (32)
- # clojure-europe (1)
- # clojure-italy (3)
- # clojure-nl (3)
- # clojure-spec (16)
- # clojure-switzerland (5)
- # clojure-uk (25)
- # clojurescript (108)
- # clojutre (15)
- # code-reviews (3)
- # data-science (1)
- # datomic (92)
- # emacs (1)
- # fulcro (8)
- # graalvm (8)
- # jackdaw (8)
- # jobs (1)
- # jobs-discuss (1)
- # leiningen (6)
- # off-topic (56)
- # pathom (6)
- # pedestal (5)
- # re-frame (11)
- # remote-jobs (1)
- # shadow-cljs (4)
- # spacemacs (2)
- # sql (41)
- # tools-deps (7)
- # xtdb (25)
I guess something like this would work well enough; https://github.com/cljfx/cljfx/blob/master/.github/workflows/test.yml
I discussed it in #tools-deps awhile ago https://clojurians-log.clojureverse.org/tools-deps/2019-09-13 I guess @gerred could know more
Something like that will work. You’re going to have to configure an ssh agent and a secret if you have private deps
I'm wondering how people deal with clj-http exceptions and potentially sensitive data. We have a high-level component that spawns processes and catch and logs all errors at the top level. However clj-http might throw an exception on non-ok status (such as 404) and since it uses slingshot the exception contains the whole environment -> the problem is that it can contain basic auth credentials for example:
clojure.lang.ExceptionInfo: clj-http: status 404
environment: {req
{:basic-auth ["xxx" "yyy"],
Yeah, that's what I've ended up doing right now (meaning removing the sensitive information from logs)
what I've done is :throw-exceptions false
combined with explicitly calling the clj-http.client function that tests for exceptional results with our own throw
clj-http.client/success?
is the function
where client
is an AOP style wrapper:
(fn [opts]
(let [{:keys [error] :as response} (client opts)]
(when (not (clj-http/success? response))
(error-reporter opts response (failure-reporters error)))
response))
this is inside a middleware and returns a new client
the exception stuff is bizarre, but one thing that's not in the exception info is the request uri
You can also use ring-style middlewares with clj-http - makes it easier to share the code for cleaning up request data, plugging in authentication etc
is there a public repo for the clj / clojure command line tools?
I found it just before checking for the answer here, by looking in the clojure-tools jar file referenced in the script
the pom.xml links that repo
that reminds me, someone was mentioning quoting / whitespace issues somewhere in the script logic, and recently I learned about %q
in shell format, which shell-quotes its argument
$ printf %q '""'
\"\"
sometimes that can save you a lot of quoting headachesmay or may not be applicable to the issue in clj (something about caching dep maps?)
oh never mind, that only works for gnu printf and bsd printf is what osx uses ootb
😢 I got excited for a sec (I'm writing a lot of shell scripts which need to work in macos and linux)
yeah - I wonder if there's something similar that reliably works on bsd
Well, I usually end up switching to Ruby or Python once the scripts get out of hand. That said, I do enjoy typing esac
to end the case statement 😉