screwdriver-cd / screwdriver

An open source build platform designed for continuous delivery.
http://screwdriver.cd
Other
1.02k stars 170 forks source link

Pull Request Sync archives jobs for few open pull requests when there are too many (>30) open pull requests #2753

Open sagar1312 opened 2 years ago

sagar1312 commented 2 years ago

What happened: When there are more than 30 open pull requests against a Screwdriver pipeline's branch, the pull request sync inadvertently updates the jobs associated with the several open pull requests as archived. Due to this, we notice unexpected behavior in several workflows.

Pull Request Sync: When pull requests are synced from the pipeline Options page, request gets completed successfully with http status 204 But under Pull Requests tab in the Builds page, only the events for 30 most recent open pull requests are displayed. Events for all other open requests disappears.

Pull Request open/reopen/sync webhook: When a pull request is either closed and reopened or a new commit is pushed to it and if is not one of the 30 most recent open pull request, no new events/builds will be created. Webhook fails with below error

{"statusCode":500,"error":"Internal Server Error","message":"Failed to start any events"}

What you expected to happen: Pull request sync should not archive the jobs for all the open pull requests, irrespective of the total number of pull requests opened against pipeline's branch.

How to reproduce it:

  1. Create a pipeline
  2. Create more than 30 pull requests against pipeline's branch
  3. In the UI under Pull Requests tab in the Builds page, verify that you will see events for all the PRs
  4. Try any of the below workflows
    1. Sync pull requests from the 'Options' page in the UI, only events for 30 most recent pull requests will be rendered in the the UI under Pull Requests tab in the Builds page
    2. Close and reopen the oldest PR. Git webhook fails and no builds will be kicked off for this PR.
jithine commented 2 years ago

We've put a short term fix to handle 100 open PRs, moving this back to backlog to address a permanent fix later.