communitybridge / easycla

The Contributor License Agreement (CLA) service of the Linux Foundation lets project contributors read, sign, and submit contributor license agreements easily.
https://easycla.lfx.linuxfoundation.org
MIT License
64 stars 45 forks source link

Pull request 'expected' status - could not find pull request error #3377

Closed WillsonHG closed 2 years ago

WillsonHG commented 3 years ago

When creating a new cla group and installing a new repository, the first pull request check came back with an 'expected' status. This is happening with other PRs that aren't the first one opened. https://github.com/AcademySoftwareFoundation/opentimelineio-test/pull/1 https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups/log-group/$252Faws$252Flambda$252Fcla-backend-prod-githubactivity/log-events/2021$252F11$252F17$252F$255B$2524LATEST$255D13ff920fd923491e8f3ffe14ed34de0f$3Fstart$3D1637150400000$26end$3D1637152920000 Logs show: 2021-11-17T12:41:50 ERROR cla: Could not find pull request 1 for repository - ensure it exists and that your personal access token has the "repo" scope enabled

subsequent /easycla command reported the status as normal.

WillsonHG commented 3 years ago

Another pull request had the same issue. https://github.com/finos/open-developer-platform/pull/258

2021-11-24T10:19:03 ERROR cla: Could not find pull request 258 for repository 145417173 - ensure it exists and that your personal access token has the "repo" scope enabled

mcleo-d commented 3 years ago

cc @maoo

WillsonHG commented 3 years ago

another 2021-11-17T16:15:41 ERROR cla: Could not find pull request 781 for repository 99282819 - ensure it exists and that your personal access token has the "repo" scope enabled

https://github.com/graphql/graphql-wg/pull/781

dealako commented 3 years ago

@WillsonHG investigating, but no answer yet. Here's the sequence of events based on the log trace:

  1. EasyCLA receives the GitHub Activity -> opened pull request
  2. EasyCLA recognizes this as an open PR
  3. EasyCLA looks up the GitHub organization and repository information
  4. EasyCLA creates an authorization token using the GitHub App installation details
  5. EasyCLA queries GitHub for the PR (fetch PR)
  6. EasyCLA receives an UnknownObjectException - GitHub didn't return the GitHub Pull Request
  7. EasyCLA logs the error and aborts the routine

No reason why this would occur that I can see. The GitHub organization and repository configuration look valid.

dealako commented 3 years ago

We could potentially add some retry logic when interacting with GitHub - specifically, we can try/catch, if this error occurs, we could sleep for a bit, and retry again. Max would be something like 3 attempts and then give up after that.

dealako commented 2 years ago

Created PR https://github.com/communitybridge/easycla/pull/3404 - Ready for review.

Only thing that we might consider is to update the PR status….but if we can’t find the PR in the first place….then how am I to update the status?

dealako commented 2 years ago

Deployed PR to DEV. Ready for test/QA. @WillsonHG

dealako commented 2 years ago

Changes were deployed to PROD as part of this release: https://github.com/communitybridge/easycla/releases/tag/v2.0.104. The technical team hasn't received any additional feedback or received any recurring issues related to this problem. Closing this ticket for now.