Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33145. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsNo conflicts as of last run. |
.github/workflows/silentmerge.yml
Outdated
| previous-releases: | ||
| name: 'Previous releases, depends DEBUG' | ||
| if: contains(github.event.label.name, 'PeriodicMergeCICheck') |
There was a problem hiding this comment.
Seems fine, but currently a vector of task names is accepted, see --task in https://github.com/maflcko/DrahtBot/blob/2038d4d541b89bf2601614b5656d7d30d73e17be/rerun_ci/src/main.rs#L7-L23
It would be good to allow the same somehow?
There was a problem hiding this comment.
Can you elaborate a little more on what this would look like? Would this be different labels for different jobs? As in a label that runs the Previous Releases job and a different label that would run a different job?
There was a problem hiding this comment.
I don't know. Not sure if we want to see pull requests spammed with "added and removed" label events (testing-cirrus-runners#19 (comment)).
GitHub doesn't make this easy and I wonder if we may want to just spin our own CI to detect silent merge conflicts.
There was a problem hiding this comment.
To give some more context: We are now trying to add 200+ lines of code to this repo which have to be maintained, but they cause label spam, and likely aren't sufficient to achieve the goal, because the ci-failed notification will go to the one adding the label and triggering the workflow?
If so, we'd have to create a comment (or other notification) anyway. So if additional glue code is needed, we might as well handle all code externally.
There was a problem hiding this comment.
It's a fair comment. I'll see what the ci-failed notification could look like but you could be right that this approach is less than ideal. @0xB10C has suggested perhaps merging this into the main CI file but might come with a verbose predicate before each job.
There was a problem hiding this comment.
Yeah, merging this with the main CI file is certainly better, if possible. However, it still leaves the issue of label spam. Also, it needs to be confirmed to be working correctly (to send the failed-notification to the right person)
|
Nice work on this! The label-based trigger for PeriodicMergeCICheck is a clean approach. One thought though since this is driven by label events, do we need to consider cases where multiple labels are applied at once? Would the condition still behave as expected? Also agree with the suggestion from @maflcko having a vector of task names could as well improve flexibility |
|
Other stuff to check would be that this works at all and doesn't just re-run an ancient commit, like #32989 (comment) |
Just ran a test to specifically test for this by updating the default (master) branch and adding and removing the label and it correctly picked an updated merge commit based on the PR merged into the updated master. |
There was a problem hiding this comment.
Have you considered doing something like the following in .github/workflows/ci.yml to avoid having to maintain separate files?
name: CI
on:
push:
pull_request:
types: [opened, reopened, synchronize, labeled]
jobs:
conditional-job:
if: >
github.event_name == 'push' ||
(
github.event_name == 'pull_request' &&
(
github.event.action == 'opened' ||
github.event.action == 'reopened' ||
github.event.action == 'synchronize' ||
(
github.event.action == 'labeled' &&
contains(github.event.label.name, 'PeriodicMergeCICheck')
)
)
)
runs-on: ubuntu-latest
steps:
- run: echo "Running CI job"
Could be a good shout, seems a bit of a verbose check if that has to be included in each job. I'll have a think about it. This is exactly the type of feedback that's good to consider. |
|
concept ack, but I don't have the slightest idea if this is even possible (or how) with GHA |
|
Currently working on an alternative approach of one job that loops through PRs, might close this PR in favour of the other one based on feedback. |
|
Any updates here? Just asking, because it is a bit tedious to manually search for all silent merge conflicts. Example ref: #29136 (comment) |
|
Concept ACK |
|
I think what could work (hacky, untested):
|
|
@m3dwards are you still working on something here? My understanding is that this is still an issue. |
|
I haven't been working on it but happy to pick this back up |
1b57472 to
358e4a6
Compare
|
I wanted to share my current direction and thinking on this and have pushed some example code and can show some test runs on my fork. I think it's a good point to get some feedback if we think this is a good general direction. In this design there is a new GHA job merged into the main repo that adds check runs to each PR on whether they have a silent merge conflict or not. The idea is that we have a job that pretty much runs 24/7 triggered every 6 hours or so and set to run for 5.5 hours, it could be set to run on a GHA runner rather than a Cirrus runner. Obviously running on a Cirrus runner (or even multiple runners) would dramatically speed up how many PRs can be checked for silent merge conflicts. The job uses the Github checks API to add a passing or failing test run to each PR directly. The silent merge check job itself should always pass, it writes pass or fail checks to the PRs. It will look through all open PRs and discard anything that has a git merge failure or a failing test with the thinking that there is no point checking something that can't be merged anyway. Then it will select PRs that have not had a silent merge check and one by one pull the merge branch of the PR and the full CI job "Previous releases" on that branch. When all PRs have been checked it will then re-check a PR that was checked the longest time ago. Things that can be tweaked:
Some back of the envelope maths with the "Previous Releases" job taking 10/15 minutes with a primed cache on a Cirrus runner and 300 open mergeable PRs (probably overestimate) the job would be checking each PR roughly every 4 days. Please see a run of the job on my fork here: https://github.com/m3dwards/bitcoin/actions/runs/22670080789 This is what a failing check would look like in the PR:
@willcl-ark @maflcko interested in your opinion on this design and if it's worth pursuing further and polishing up. |
358e4a6 to
996bd18
Compare
996bd18 to
ef3ea76
Compare

With the upcoming potential migration to cirrus runners (#32989) we need a way to periodically check for a silent merge conflict. Cirrus CI currently does this every week.
This is part of a proposal that will look for a label on a PR as a trigger to run the lint and get_previous_releases test. This label could be added manually or better, Drahtbot could periodically add (and remove) this label.An example of this running on a test org: https://github.com/testing-cirrus-runners/bitcoin/actions/runs/16780213204/job/47516540034Updated 4th March 2026
In this design there is a new GHA job merged into the main repo that adds check runs to each PR on whether they have a silent merge conflict or not.
The idea is that we have a job that pretty much runs 24/7 triggered every 6 hours or so and set to run for 5.5 hours, it could be set to run on a GHA runner rather than a Cirrus runner. Obviously running on a Cirrus runner (or even multiple runners) would dramatically speed up how many PRs can be checked for silent merge conflicts.
The job uses the Github checks API to add a passing or failing test run to each PR directly. The silent merge check job itself should always pass, it writes pass or fail checks to the PRs.
It will look through all open PRs and discard anything that has a git merge failure or a failing test with the thinking that there is no point checking something that can't be merged anyway. Then it will select PRs that have not had a silent merge check and one by one pull the merge branch of the PR and the full CI job "Previous releases" on that branch.
When all PRs have been checked it will then re-check a PR that was checked the longest time ago.
Things that can be tweaked:
Could run on multiple runners simultaneously rather than just one
How long the job is allowed to run for (currently 5.5 hours, GHA runners have a limit of 6)
How frequently the job is triggered
What type of runner to run the job on
The ordering of how to select the next PR to check.
What things trigger the job to skip a PR (currently failing tests and merge conflicts)
Some back of the envelope maths with the "Previous Releases" job taking 10/15 minutes with a primed cache on a Cirrus runner and 300 open mergeable PRs (probably overestimate) the job would be checking each PR roughly every 4 days.