circleci / rollcage

A Clojure client for Rollbar
Eclipse Public License 1.0
50 stars 28 forks source link

Propagate arglists to the core API functions #48

Closed skuro closed 2 years ago

skuro commented 4 years ago

The main entrypoints to rollcage (e.g. circleci.rollcage.core/info) lack metadata on the expected arguments. This change ensures each function exposes the correct documentation including arglist.

Implementation wise, some macro magic is used to avoid repeating the arglist which is a prety verbose block due to the destructuring portions of the functions signatures.

Here's one of the effects of this change:

circleci.rollcage.core> (deflevel critical)
;; => #'circleci.rollcage.core/critical
circleci.rollcage.core> (doc critical)
-------------------------
circleci.rollcage.core/critical
([client exception] [{:as client, :keys [result-fn send-fn block-fields]} exception {:keys [url params]}])
  Notify Rollbar of an exception with level `critical`.
  See the [[notify]] function for more information
;; => nil
codecov[bot] commented 4 years ago

Codecov Report

Merging #48 (3ecd8cb) into master (6cdf17c) will decrease coverage by 4.76%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #48      +/-   ##
==========================================
- Coverage   96.96%   92.20%   -4.77%     
==========================================
  Files           4        4              
  Lines         231      231              
  Branches        4        5       +1     
==========================================
- Hits          224      213      -11     
- Misses          3       13      +10     
- Partials        4        5       +1     
Impacted Files Coverage Δ
src/circleci/rollcage/core.clj 91.41% <100.00%> (-5.56%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6cdf17c...3ecd8cb. Read the comment docs.

skuro commented 2 years ago

I updated the PR so that code is hopefully a bit simpler now. I keep noticing the build failures, but when I run lein test locally with a valid rollbar token it all works fine:

Ran 22 tests containing 77 assertions.
0 failures, 0 errors.

Could it be some build misconfiguration? I see this test failure that seems suspicious:

test-environment-is-setup - circleci.rollcage.test-core

You must specify a ROLLBAR_ACCESS_TOKEN with POST credentials
expected: (not (string/blank? (System/getenv "ROLLBAR_ACCESS_TOKEN")))
  actual: (not (not true))
      at: MultiFn.java:229
skuro commented 2 years ago

yeah looks like #52 fails in the same way, I assume it's likely not my fault here :-)