Uh oh!
There was an error while loading. Please reload this page.
Merge to master before running tests - #217
Conversation
cmb69
left a comment
There was a problem hiding this comment.
When a PR is branched from a point before current master, the CI tests are run ignoring any intermediary commits.
Well, isn't that expected behavior? Is there a particular reason to work-around that only for doc-base?
alfsb
commented
Feb 2, 2025
I would argue is not expected behavior that CI tests test a version of code that will never exist. Taking a branch from before the tip of master is no different of taking five branchs of same tip of master, and then merging then in any order. The first merge will not show this problem, but for the other fours are now effectively branched not from from the tip of master, but from a previous version. And CI will ignore any of this, will test the code excluding any changes to master, and then, when merged, the code merged is not the code tested.
The doc-base is checked out from a branch, all other repos are already checked from master. |
cmb69
commented
Feb 2, 2025
I was not particularly referring to doc-*, but rather to "all" GH repos using the checkout action (not only those of the php organization). It seems to me that it is relatively rare that issues arise due to not testing against the HEAD (+ the PR commits), and this can be resolved with a rebase. That said, I'm not against your suggested change. |
alfsb
commented
Feb 2, 2025
That is something I asked on #205 (comment) , and got no answers.
It's rare, yet it happened, in doc-base no less. Any CI that uses |
alfsb
commented
Feb 2, 2025
Checking out the |
alfsb
commented
Feb 3, 2025
I think I confirmed it. Besides the checkout being made from Not because of a merge conflict, but because of an Next I will try some fixes for |
…o detached checkout
alfsb
commented
Feb 3, 2025
Sorry for the noise. I think this may be a hard problem to solve, as Also, the problem is really about a cached state. Even after changes are made in Meanwhile, I changed the PR to a test that will intentionally fail, if the merge commit targets a hash that is not the head of master. |
alfsb
commented
Feb 7, 2025
An old teste generated: Running test same test after merge 218: After a commit make insignificant chantes on PR: So, only to repeat. GitHub And GitHub This PR, as it is now, only refuses to run CI when the commit merge target is outdated. |
TimWolla
commented
Mar 9, 2025
This is configurable per repository. Attempting to solve this in the GitHub Action configuration is the wrong place, because the result will get stale between running the CI and actually merging the PR. |
alfsb
commented
Mar 9, 2025
That's good to hear. What is the name of a configuration that blocks and discards PRs testing that targets behind/old/stale master. Because...
This is already happening, as of now. The CI testing is targeting behind/old/stale master. Merging changes of one PR does not change the results of other open PR tests, even when re-running the tests. |
TimWolla
commented
Mar 19, 2025
This is part of the branch rulesets, more specifically the “Green CI” requirement (because without CI it doesn't make sense to force the branch being up to date): There is also another setting that just suggests updating the branch if it is outdated:
Yes. But this PR does not improve on the situation in a meaningful way. |
TimWolla
commented
Mar 19, 2025
And for that not to be a nuisance you need to use the “Merge Queue”, because otherwise you are constantly updating all PRs, even if there it not the slightest chance of conflict: |
alfsb
commented
Mar 19, 2025
This appears to be a nice option. But do you know if it:
In both cases, I can see this option causing conflicts with the local checkout.
From the documentation: I interpreted from these documents that this option only blocks merging of outdated/not rebased forks, while allowing running CIs, even with incompatible changes.
I think this PR address a slightly different problem. It focuses on CI always having the same results, be it running on rebased or non-rebased PRs. |
TimWolla
commented
Mar 19, 2025
I'm not sure if I understand the question. The branch contents are the authoritative source of the PR. Pressing the button would perform a merge of the target branch into the source branch, just as if you do this locally with git.
The CI only runs the latest commit in a given PR. But by requiring the option, GitHub ensures that prior to merge, the PR is a strict superset of the target branch, thus ensuring that all changes in the target branch are accounted for within the PR. So yes, the CI might run on outdated information, but if it ran on outdated information, merging is blocked. So you get the desired result.
I think this PR does not address any problem at all and just adds additional problems / confusion, because the CI will behave unexpectedly, by not testing the latest commit of a PR as it would do for every other PR using GitHub Actions. |
alfsb
commented
Mar 20, 2025
I was hoping to block new CI runs on outdated branches, and possibly invalidate old CI runs of outdated branchs. |
alfsb
commented
Mar 20, 2025
Closing without merge, as #226 is about to supersede this anyways. The only note is that the |




When a PR is branched from a point before current master, the CI tests are run ignoring any intermediary commits. In other words, tests are running considering one version that will never exist in practice.
To avoid this, run an local
git mergefrom the branched checkout. This is a no-op if there is no commits to be merged.