Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make badge indicate that there is a problem if last build failed #243

Closed
martinklepsch opened this issue Nov 28, 2018 · 0 comments
Closed
Labels
Good First Issue Want to help ship cljdoc? These are good issues to start with. Help Wanted UX Fix these, improve the user experience of using cljdoc!

Comments

@martinklepsch
Copy link
Member

Sometimes builds fail and it would be useful to indicate that within the cljdoc badge. Could look something like this:

![](https://badgen.now.sh/badge/cljdoc/1.1.1-problem/red)

Since the URL will still link to the regular documentation page some link to the most recent build (if it failed) needs to be integrated into the documentation pages. Maybe similar to the link to more recent versions:

screenshot 2018-11-28 at 10 11 59

Pointers

  • Badge rendering code:

    (defn badge-interceptor []
    {:name ::badge
    :enter (fn badge [ctx]

    • This will require the build-tracker system component to retrieve the latest build for the requested version.
  • To include information about the last build we could add a new interceptor that adds the last build to the context.

    • Currently most rendering code only gets the cache-bundle but I started to fade that out and it might make sense to loosen this up further.
    • Here's an example of an interceptor loading some data into the context:
      (defn artifact-data-loader
      "Return an interceptor that loads all data from `store` that is
      relevant for the artifact identified via the entity map in `:path-params`."
      [store]
      {:name ::artifact-data-loader
      :enter (fn artifact-data-loader-inner [ctx]
      (let [params (-> ctx :request :path-params)]
      (d/measure! "cljdoc.storage.read_time" {}
      (log/info "Loading artifact cache bundle for" params)
      (if (storage/exists? store params)
      (assoc ctx :cache-bundle (storage/bundle-docs store params))
      ctx))))})
@martinklepsch martinklepsch added Help Wanted Good First Issue Want to help ship cljdoc? These are good issues to start with. UX Fix these, improve the user experience of using cljdoc! labels Nov 28, 2018
martinklepsch added a commit that referenced this issue Mar 27, 2019
this also includes a refactoring that opens up ways to pass data into
the main render functions without further diluting the meaning of the
cache bundle
martinklepsch added a commit that referenced this issue Apr 5, 2019
martinklepsch added a commit that referenced this issue Apr 5, 2019
this also includes a refactoring that opens up ways to pass data into
the main render functions without further diluting the meaning of the
cache bundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Want to help ship cljdoc? These are good issues to start with. Help Wanted UX Fix these, improve the user experience of using cljdoc!
Projects
None yet
Development

No branches or pull requests

1 participant