uw-ipd / github-checks-buildkite-plugin

MIT License
8 stars 9 forks source link

Pre-command hook failing #16

Open mikenicholson opened 5 years ago

mikenicholson commented 5 years ago

The github-checks pre-command hook began failing in our builds last night between 8-9pm ET with the following message:

~~~ Running plugin github-checks pre-command hook
$ /var/lib/buildkite-agent/plugins/github-com-uw-ipd-github-checks-buildkite-plugin-v0-0-3/hooks/pre-command
+ export LC_ALL=C.UTF-8
+ LC_ALL=C.UTF-8
+ export LANG=C.UTF-8
+ LANG=C.UTF-8
++ dirname /var/lib/buildkite-agent/plugins/github-com-uw-ipd-github-checks-buildkite-plugin-v0-0-3/hooks/ghapp
+ COMPOSE_CONFIG=/var/lib/buildkite-agent/plugins/github-com-uw-ipd-github-checks-buildkite-plugin-v0-0-3/hooks/../docker-compose.yml
+ run_params=()
+ args=()
+ docker-compose -f /var/lib/buildkite-agent/plugins/github-com-uw-ipd-github-checks-buildkite-plugin-v0-0-3/hooks/../docker-compose.yml build ghapp
Building ghapp
Step 1/4 : FROM alpine:latest
 ---> 4d90542f0623
Step 2/4 : RUN apk add --no-cache python3 py3-cryptography bash
 ---> Using cache
 ---> 0fc49740e0b3
Step 3/4 : COPY . /ghapp
 ---> Using cache
 ---> b5f8ae2d9286
Step 4/4 : RUN pip3 install /ghapp
 ---> Using cache
 ---> 23416bfc62fc

Successfully built 23416bfc62fc
Successfully tagged github-com-uw-ipd-github-checks-buildkite-plugin-v0-0-3_ghapp:latest
+ [[ false =~ (true|on|1) ]]
+ args+=("-v")
+ [[ -n '' ]]
+ [[ -f 29597 ]]
+ [[ -n '' ]]
+ set +x
+ IFS=';'
+ read -r -a default_volumes
+ for vol in "${default_volumes[@]:-}"
+ [[ ! -z '' ]]
++ pwd
+ docker-compose -f /var/lib/buildkite-agent/plugins/github-com-uw-ipd-github-checks-buildkite-plugin-v0-0-3/hooks/../docker-compose.yml run --workdir=/var/lib/buildkite-agent/builds/sim-agent-queue-i-07e94934826031054-1/uber-atg/simulation-pull-request --rm ghapp -v check from-job-env
Traceback (most recent call last):
  File "/usr/bin/ghapp", line 11, in <module>
    load_entry_point('ghapp==0.0.2', 'console_scripts', 'ghapp')()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.7/site-packages/ghapp/cli.py", line 15, in <module>
    from .github import checks
  File "/usr/lib/python3.7/site-packages/ghapp/github/checks.py", line 33, in <module>
    @attr.s(auto_attribs=True)
  File "/usr/lib/python3.7/site-packages/ghapp/cattrs.py", line 73, in ignore_optional_none
    return bound(maybe_cls)
  File "/usr/lib/python3.7/site-packages/ghapp/cattrs.py", line 69, in bound
    _register_ignore_optional_none(cls, converter)
  File "/usr/lib/python3.7/site-packages/ghapp/cattrs.py", line 53, in _register_ignore_optional_none
    f.name for f in attr.fields(cls)
  File "/usr/lib/python3.7/site-packages/ghapp/cattrs.py", line 54, in <setcomp>
    if isinstance(f.type, typing._Union) and type(None) in f.type.__args__
AttributeError: module 'typing' has no attribute '_Union'
matej commented 4 years ago

We're experimenting wit this plugin and got the same issue. Switching to the fix proposed in https://github.com/uw-ipd/github-checks-buildkite-plugin/pull/17 worked.