uw-ipd / github-checks-buildkite-plugin

MIT License
8 stars 9 forks source link

Not quite sure how it's intended to be used #5

Open toolmantim opened 6 years ago

toolmantim commented 6 years ago

This plugin looks awesome.

As many people are new to Status Checks API, including me, it might be good to make the example in the readme a little closer to a real life example? I'm not sure if it's meant to be the entire build output, or …? And how you capture/output that from your build job?

asford commented 6 years ago

Excellent point. I've vaguely addressed this in #6, but will leave this issue open for further updates.

toolmantim commented 6 years ago

Hey, it's already looking great. 🎉

Another improvement might be if the example showed multiple check steps, and then had a screenshot of the Checks API to see each one as a check. Then you'd 100% grok it straight away, without having to click through those links. But still, the current readme is an awesome improvement. 🙌🏼

Dog commented 5 years ago

I'm having some trouble adding this plugin. I have my pipeline currently building a container and running the command. However when I add this plugin after I keep getting:

+ docker-compose -f /var/lib/buildkite-agent/plugins/github-com-uw-ipd-github-checks-buildkite-plugin-v0-0-2/hooks/../docker-compose.yml run --workdir=/var/lib/buildkite-agent/builds/<agent>/<repo-owner>/<pipeline> --rm ghapp -vv check from_job_env
--
  | /bin/sh: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)
  | Creating network "github-com-uw-ipd-github-checks-buildkite-plugin-v0-0-2_default" with the default driver
  | ERROR: Volume buildkite declared as external, but could not be found. Please create the volume manually using `docker volume create --name=buildkite` and try again.
  | 🚨 Error: The plugin github.com/uw-ipd/github-checks-buildkite-plugin#v0.0.2 pre-command hook exited with status 1

I'm not quite sure what I'm missing. I found this commit, but I'm not sure how related it is:

https://github.com/uw-ipd/github-checks-buildkite-plugin/commit/8ab989c5c456814fc132af13a51563577ad81850#diff-4e5e90c6228fd48698d074241c2ba760L33

Failing Step:

  - command: '.buildkite/run_tests.sh'
    label: ':dog: Running Tests'
    timeout: 10
    plugins:
      docker-compose#v1.8.2:
        run: frontend
        workdir: '${BUILDKITE_BUILD_CHECKOUT_PATH}'
      uw-ipd/github-checks#v0.0.2:
        output_title: Tests
        output_summary: test_summary.md
        debug: true

Command:

#!/bin/bash

set -xuo pipefail

{
    yarn run test
} | tee test_summary.md
cmitz commented 5 years ago

Sorry for chiming in with a little more of the same – a bug(?). Any tips on where I might need to start debugging?

Buildkite log:

docker-compose -f /etc/buildkite-agent/plugins/github-com-uw-ipd-github-checks-buildkite-plugin-master/hooks/../docker-compose.yml run --workdir=/var/lib/buildkite-agent/builds/alpha-1/<owner>/<repo> --rm ghapp -v check from_job_env
--

The agent is running on a debian server (metal), and I have a very similar command as @Dog . Even though I'm getting the job_from_env not found, yesterday I got the same error as him when I tried getting it to work with a Docker Agent in a Docker container.

Any pointers? 😄

Dog commented 5 years ago

@cmitz

Well I’m a Dalmatian and I’m a little unsure why it can’t find the command. However the ghapp command comes from a python click cli. That command is here:

https://github.com/uw-ipd/github-checks-buildkite-plugin/blob/master/ghapp/ghapp/cli.py#L252

The setup.py file says the main command is ghapp as well:

https://github.com/uw-ipd/github-checks-buildkite-plugin/blob/master/ghapp/setup.py#L18

If the build succeeded you may be able to try running it manually in the container with ghapp check from_job_env and see if the package is returned in a pip freeze

What version of the repo are you running? (0.0.2?)

Did you try to set the plugin’s debug setting to true? (You can see an example of this in my step above)

cmitz commented 5 years ago

So, it seems that from_job_env should be from-job-env on my machine. This is output for docker-compose -f /.../docker-compose.yml run --workdir=/.../myapp --rm ghapp check --help:

Usage: ghapp check [OPTIONS] COMMAND [ARGS]...

  github checks api support

Options:
  --help  Show this message and exit.

Commands:
  from-job-env
  list          List current checks on given repo ref.
  push          Push a check to github.
  update        List current checks on given repo ref.

I'll keep debugging and report back when I figure out what to do. It seems commands with Click should always be dasherized since last year: https://github.com/pallets/click/issues/1123

By the way, I use uw_ipd/github-checks#master, not #0.0.2. Maybe a new release with the last 3 PR's would be good.