-
Notifications
You must be signed in to change notification settings - Fork 7
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
Incorrect commit is being used in PR builds #36
Comments
@felixfontein if you have a chance to look into whether this is happening in |
I'm seeing the same behavior in community.docker: ansible-collections/community.docker#340 After the initial commit I pushed two times, and both times the previous version got published (as you described). |
Thanks a lot @felixfontein , I was following along and saw the same behavior as well. I can do some more tests in my GHA test repo that try to compare reusable vs. not reusable, |
Maybe #37 can help to get some more information on what is actually built. |
I think I have figured this out: Via this PR and these workflows:
I have confirmed that:
It seems that the This page has some detailed explanation of what this value is: https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request It's related to the "mergeability" check that you see that tells you if a PR can be merged cleanly. It turns out this check happens asynchronously in a background job. As described in the above link, the Like this: https://github.com/briantist/gha-junk/runs/6148748842?check_suite_focus=true#step:3:1886 We know for a fact that jobs being queued still exhibit this problem (in my repo they often have to wait a long time until the rest of CI runs) so I can only guess that the event data that gets sent to a workflow event is gathered rather immediately, when the job is queued, and not when the job runs; in fact the initial event data is probably what triggers both the workflow and anything else (like this mergeability background job), and so it's likely that the This also (partially kinda sorta) explains why this value is missing on the first event, when the PR is first opened (the What can we do
|
I'm also going back over the original PR/issue to ensure we don't lose sight of the reasons for not using the PR's HEAD in the first place: |
* add vault_kv1_get module * add vault_kv2_get module * kv1 sanity and missing condition * kv2 sanity, sample, missing condition * add kv1 response fixture * add kv2 response fixture * add units for kv1_get * kv1 more thorough tests * add units for kv2_get * fix seealso references * distinguish kv paths from api paths in integration * kv2_get units - group(1) should always exist * add integration tests for kv1_get * add vault_ci_kv2_destroy_all test plugin * set up versioned secrets in initial configuration * add kv2_get integration tests * add codecov flags for modules * style nit * add codecov flags for kv_get lookups * add lookup vault_kv1_get * add units for lookup vault_kv1_get * fix kv1_get lookup units * really fix it this time * assertion niceties * add vault_kv2_get lookup * add units for kv2_get lookup * add integration for kv1_get lookup * add integration for kv2_get lookup * add check mode coverage to module integrations * docsite updates * update seealso references * add examples * ansible-community/github-docs-build#36 * update action group
Originally posted here:
Re: using the merge SHA:
I had been putting this off a bit due to this resuable workflow issue, in part because I saw the issues around the same time and couldn't be certain if they were related or not, and in part because even if they were unrelated, the issue made debugging and troubleshooting difficult.
With that issue solved, I am still seeing this happen.
Symptoms
This is easiest seen when docs are being published. The latest push will trigger the build and the docs built will be the contents of your previous push. I say "push" because a push containing multiple commits does not seem to build the docs of the second-to-last commit, but rather the last commit of the last push.
In a repo where the docs are not published the easiest way to see this would be to add errors egregious enough that the build will fail.
Triggers
I do not know yet all of the conditions under which this does or does not occur:
pull_request
vspull_request_target
workdlows?Resolution
Ideally we can more clearly identify the triggers, and if it's a bug on GitHub's side we can report it.. past experience shows that niche issues like this will take a long time to address, if we can even get them to.
We may want to change the precedence of when we use the merge ref vs the merge SHA field.
For now we start with the SHA because it's easier to know if it's available or not, to then fall back to the merge commit ref.
Since we have nowhere to retrieve the merge ref and instead we build it, we need to either try the checkout and ignore failure, or do additional git operations and/or API calls to determine its validity if we want to start with that and "fall back" to merge SHA.
The text was updated successfully, but these errors were encountered: