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

Close #26: Filter PRs by updated date instead of commit date #261

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ctreatma
Copy link

@ctreatma ctreatma commented Jun 8, 2021

This supersedes #205.

This resource can inadvertently miss Pull Requests due to out-of-order
commits across PRs. If PR#2 is opened after PR#1, but the head commit
of PR#2 is older than the head commit of PR#1, the resource will not
include PR#2 in the list of new versions provided to Concourse.

In #205, I removed the date filter entirely. This ensures that the PR
resource will find all PRs that match the explicitly-configured filters.
While Concourse can detect and ignore duplicate versions, it has to run
a database query for every version returned by a check, so removing
the date filter entirely would increase load on a Concourse database.
(That said, I'm not sure whether this increased load is a particular
concern, and other resources don't seem to make much effort to avoid
returning duplicate versions from a check.)

To avoid that extra load on a Concourse database, this change instead
replaces the filter by commit date in check.go with a filter by updated
date in the GraphQL query to list pull requests. This should reduce the
number of duplicate versions returned by a check while still allowing
the PR resource to detect PRs with out-of-order head commits.

@ctreatma ctreatma requested a review from a team as a code owner June 8, 2021 20:19
@rickardl
Copy link
Contributor

rickardl commented Aug 11, 2021

Hi,

Thanks for the contribution, when I get the time, I'll see if these changes resolve our issues. I had the same implementation in private branch of this, but I made the mistake of digging myself a hole trying to make some of the queries optional for other features.

But going back to the basics is a great idea. Do you have an image available of this ready to be tested?

@Pasupathi-Rajamanickam
Copy link

@rickardl Can this be addressed sooner, I have bunch of PRs opened some time back and label added today not triggering build.

@rickardl
Copy link
Contributor

I'm somewhat waiting for a confirmation that this resolves the issue, I haven't seen a result from the test suite being run here.

This supersedes #205.

This resource can inadvertently miss Pull Requests due to out-of-order
commits across PRs. If PR#2 is opened after PR#1, but the head commit
of PR#2 is older than the head commit of PR#1, the resource will not
include PR#2 in the list of new versions provided to Concourse.

In #205, I removed the date filter entirely.  This ensures that the PR
resource will find all PRs that match the explicitly-configured filters.
While Concourse can detect and ignore duplicate versions, it has to run
a database query for every version returned by a `check`, so removing
the date filter entirely would increase load on a Concourse database.
(That said, I'm not sure whether this increased load is a particular
concern, and other resources don't seem to make much effort to avoid
returning duplicate versions from a `check`.)

To avoid that extra load on a Concourse database, this change instead
replaces the filter by commit date in `check.go` with a filter by updated
date in the GraphQL query to list pull requests.  This should reduce the
number of duplicate versions returned by a `check` while still allowing
the PR resource to detect PRs with out-of-order head commits.
@ctreatma
Copy link
Author

GitHub says it's not going to run the tests for this PR until a maintainer approves them.

@Seraf
Copy link

Seraf commented Aug 24, 2021

Hello, I made my own docker image based on this PR, and it solved our issue, the PR that wasn't seen by the CI, even with fake git commit is now seen correctly and has been processed by our CI 🎉
Thanks for this patch ! ❤️

@Seraf
Copy link

Seraf commented Sep 14, 2021

Hello, any news on this one?

@Pasupathi-Rajamanickam
Copy link

Pasupathi-Rajamanickam commented Sep 14, 2021

I'm tired of waiting, test is still running, people are yelling. Started to write my own PR resource. 😂

@prabhathsys
Copy link

Is there any update on this? We are facing the same issue.

@ctreatma
Copy link
Author

Is there any way a maintainer can allow the test jobs to run so we can confirm if this PR is mergeable? I ran the tests locally and they passed, but they won't run in GitHub unless a maintainer approves them.

@ctreatma
Copy link
Author

Any updates on this? I'm pretty sure this passes all of the tests, but I the PR checks won't run unless a maintainer allows them to run. We continue to run into this issue on a regular basis and would prefer to have an official release with the fix rather than running a fork.

@cached
Copy link

cached commented Oct 4, 2022

@ctreatma
Thank you for this fix, I decided it will be faster to just get your commit and push own image to docker repository and use that instead of telia-oss. And now PR''s are fetched correctly

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

Successfully merging this pull request may close these issues.

6 participants