-
Notifications
You must be signed in to change notification settings - Fork 101
Prevent check
from missing versions
#134
Prevent check
from missing versions
#134
Conversation
There are situations where new versions of the PR resource will get lost. This happens because the versions that are returned are sorted by when they were last updated. Comments on PRs can affect the update time. This means that between checks, if the version Concourse passes to the `check` script is commented on, Concourse will only consider anything updated after this PR a valid version. If PRs were updated between the time of the last check and the time of this update, they will be lost. This change puts the version Concourse passes to the `check` script at the start of the list of versions it returns. This ensures that a valid version does not get skipped for this reason.
Is this whole point to put the |
@jtarchie Yep... yeah my Ruby is... well yeah. |
Right now the PRs and SHAs are the This would be a breaking change though. |
What has this change, in the PR, fixed for you? |
@jtarchie It prevented the scenario where the input version update time changed and caused us to lose legitimate PR #'s... here's an example (* denotes input version in list): Today
With Change
Concourse will skip over versions it's already seen when |
The more I look at this, I don't think it actually solves the problem. It might appear to, but in the long run we are just masking the issue. If the updated timestamp was added to the It would be a breaking change though. Some peeps might need to reset their pipelines to flush the previous version history of PRs. |
The more I investigate this, the only solution is going to be using the github GraphQL API. It allows minimizing the API requests, but getting all the information needed to sort and filter PRs correctly. I just don't have the time to do this. :-/ |
How does this solution mask the issue?
How would using GraphQL API solve this problem? My understanding is that the problem isn't inherent in how the data is retrieved from GitHub; the problem is one of ordering. |
The resource was a hack that mapped PRs on to the resource model of concourse. The order of PRs comes in on the most recent update. Removing the most recently known version doesn't actually solve a problem. Basically a hack already on a hack. I'm not going to explain this again. Please go through the issue history for more info. The GraphQL would solve the issue because I could actually determine versions of a PR based on the latest commit pushed date. Rather than the mess of the |
FWIW it's not removing the most recently known version, it's placing it at the front of the list. This means that Concourse will scan over the entire list on every check, which seems to be okay as it'll skip over versions it's already seen (they won't retrigger). I do agree it's a hack on a hack, but it's one that prevents us from missing PRs, so from a UX perspective I think it's 👍 Anyway... |
Just FYI: |
There are situations where new versions of the PR resource will can get
lost. This happens because the versions that are returned are sorted by
when they were last updated. Comments on PRs can affect the update time.
This means that between checks, if the version Concourse passes to the
check
script is commented on, Concourse will only consider anythingupdated after this PR a valid version. This change puts the version
Concourse passes to the
check
script at the start of the list ofversions it returns. This ensures that a valid version does not get
skipped.