Zulip Chat Archive

Stream: general

Topic: quick links for continuous integration?


view this post on Zulip Scott Morrison (Mar 30 2020 at 23:59):

I'd love to have a way to get to the continuous integration results for a branch, perhaps from the command line or from VS Code. Does anyone know a solution?

At present I'm manually loading github in a browser, finding that branch, then clicking on the little red X. Typing 'ci' on the command line and having that page pop up, or having that little red X show up in VS Code, would be infinitely more awesome. :-)

view this post on Zulip Bryan Gin-ge Chen (Mar 31 2020 at 01:38):

You can get this info from the check-runs endpoint of the Github v3 API:

curl -H "Accept: application/vnd.github.antiope-preview+json" \
  # replace "XXXX" with a personal access token from https://github.com/settings/tokens or omit this line
  -H "Authorization: token XXXX" \
  # replace "master" with the branch name or commit SHA of your choice
  https://api.github.com/repos/leanprover-community/mathlib/commits/master/check-runs

This returns a JSON object with a field check_runs containing an array of objects whose html_url fields contain links to the Github actions results pages.

It should be possible to make a convenient CLI tool around this (maybe there's already one out there?)... but I'm out of energy for now.

view this post on Zulip Bryan Gin-ge Chen (Mar 31 2020 at 01:51):

Ah, indeed, hub will do this:

$ git status
On branch prod-map
Your branch is up to date with 'community/prod-map'.

nothing to commit, working tree clean
$ hub ci-status -v
✔︎  Build mathlib                                                               https://github.com/leanprover-community/mathlib/runs/546894771
✔︎  Rule: automatic merge on CI success and review - push (delete_head_branch)  https://github.com/leanprover-community/mathlib/runs/547235491
✔︎  Rule: automatic merge on CI success and review - push (merge)               https://github.com/leanprover-community/mathlib/runs/547235581
✔︎  Summary                                                                     https://github.com/leanprover-community/mathlib/runs/546895846

view this post on Zulip Scott Morrison (Mar 31 2020 at 01:54):

Amazing!


Last updated: May 16 2021 at 21:11 UTC