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

Some PRs are missing from check #150

Closed
mattdodge opened this issue Sep 4, 2019 · 4 comments
Closed

Some PRs are missing from check #150

mattdodge opened this issue Sep 4, 2019 · 4 comments

Comments

@mattdodge
Copy link

We've been running this resource for a few weeks now with mostly great success. However, I have noticed that there is a small number of PRs in our repo that don't seem to get picked up. We've closed the PR and re-opened new ones and they still don't appear even though other PRs are getting picked up.

We don't (knowingly) have any kind of exclusion rules, here's the relevant YML for our pipeline:

resource_types:
  - name: pull-request
    type: docker-image
    source:
      repository: teliaoss/github-pr-resource

resources:
  - name: my-pr
    type: pull-request
    icon: github-circle
    check_every: 3m
    webhook_token: "((github_access.WEBHOOK_SECRET))"
    source:
      repository: myorg/myrepo
      access_token: "((github_access.GITHUB_ACCESS_TOKEN))"

jobs:
  - name: deploy
    plan:
      - get: my-pr
        trigger: true
        version: every

I've looked at the concourse worker logs and don't see anything weird there either. What's the best next step for troubleshooting?

@mattdodge
Copy link
Author

An update with some more details. Here's what happened.

  1. Opened a PR to a repo that's been checked by the github-pr-resource for ~1 month and working fine. No version was detected by the check even though it said "checked successfully"
  2. Closed PR and opened an entirely new PR (although same branch and commit SHA). Still no version.
  3. Added a commit to the PR to "kick it" - version appeared now but my subsequent concourse job failed with this:
2019/09/04 19:39:11 get failed: failed to retrieve pull request: non-200 OK status code: 502 Bad Gateway body: "{\n   \"data\": null,\n   \"errors\":[\n      {\n         \"message\":\"Something went wrong while executing your query. This may be the result of a timeout, or it could be a GitHub bug. Please include `E37A:452C:BE04:10EFC:5D7012C0` when reporting this issue.\"\n      }\n   ]\n}\n"
  1. Re-triggered the job manually and it built successfully.

So it seems like the original commit/branch never showed up in this resource's version check - this may be a bug in the resource. The 502 with GitHub I may just chalk up to an API hiccup or solar flare or something, could just be a coincidence. Anything else I can provide or check on?

@rnag
Copy link
Contributor

rnag commented Sep 6, 2019

FWIW I had a teammate who also reported similar behavior where he said the pr-resource was not detecting a new version - apparently he was trying to close and re-open pull requests, but those weren’t being detected even though his webhooks were going through.

our theory was that it was not detecting the version because the latest commit was unchanged (only the pr status was changing). I guess it would still help to have it mentioned in the documentation though, if this is intended behavior or not.

@itsdalmo
Copy link
Contributor

Hi and thanks for the issue! First of all I'm wondering if maybe this is what you are seeing:
#26

In short, if the latest commit in a pull request is older than the latest discovered version, it will not be discovered. And the latest commit is determined by when you ran git commit, not when it was pushed to Github or when the pull request was opened. Do you think it could be related?

@mattdodge
Copy link
Author

@itsdalmo ahhh yep that looks like exactly what happened. As I look back at the timestamps I see some other commits on other PRs at that time that got picked up. Also explains the "random" nature that we observe of this.

Definitely sounds like undesirable behavior, but also sounds like a dupe of #26 so I will close this in favor of that. Thanks for pointing that out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants