Repository navigation
Account for correlated branches in manually triggered CI builds - #29
Merged
Merged
Conversation
andrewmogan
marked this pull request as ready for review
September 25, 2026 14:48
jcfreeman2
approved these changes
Oct 5, 2026
jcfreeman2
left a comment
Contributor
There was a problem hiding this comment.
Confirmed Andrew's tests; also (somewhat repeating what he did), I created johnfreeman/dotgithub_issue27_nomerge branches in daqsystemtest and appfwk, and:
- Regression tested that if I opened a PR that those two repos would build, DUNE-DAQ/daqsystemtest#357
- Also checked that I could get both those repos to build if I used a
does_not_existtarget branch and manually actuated the Workflow, https://github.com/DUNE-DAQ/daqsystemtest/actions/runs/37338681571
Contributor
Author
|
I copied the workflow template implementation from the previously mentioned daqsystemtest run (i.e., here) into this PR since the two are related. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #27. The problem was in how the target and caller branches are inferred:
github.head_refandgithub.base_refare only defined when the triggering event is a pull request. So, when the workflow is manually triggered, the caller and target branches both fall back to the current branch. In the case of the workflow mentioned in #27, this means both were set tojohnfreeman/file_formats_refactor, which in turn means thatclone_all_packages_with_branch.pynever gets called:A solution I landed on is to add an optional input to
workflow_dispatchfor specifying the target branch:and then use that branch if specified:
This means you can run the CI build from
feature/my_featureand specify the target as, for example,develop. I left the default argument as empty rather thandevelop, but I could be convinced either way.I tested the normal PR behavior here, and tested correlated PRs when manually setting
developas the target branch here. Note that this picked up the branchamogan/dotgithub_issue27in bothdaqsystemtestandfddetdataformats.Note that this also requires modifying the workflow template used by each repo. You can see the implementation in
daqsystemtesthere.I also made a very minor change to how the
GITHUB_TOKENsecret is specified to better align with modern/best practices.