Skip to content

COMP: Detect a workflow that can never be scheduled - #94

Draft
hjmjohnson wants to merge 1 commit into
ci/windowsfrom
ci/workflow-trigger-lint
Draft

hjmjohnson wants to merge 1 commit into
ci/windowsfrom
ci/workflow-trigger-lint

Conversation

@hjmjohnson

@hjmjohnson hjmjohnson commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Re-submission of #83, reverted from master on 2026-09-24 so it can be
reviewed before merging. Content is unchanged from the original.

Stacked on #93 (ci/windows), not master. The diff shown here is this change alone: the check script and the one workflow-triggers job. Merge #93 and the PRs below it first.

The workflows only trigger for pull requests whose base is master, so no CI runs on this PR until its base reaches master. Run locally on this base, DEFAULT_BRANCH=master python3 .github/check_workflow_triggers.py passes, because build.yml here already names master.

Ordering for this stack (as of 2026-11-03)

# PR branch base state
1 #85 ci/install-linking-srcdir master open
2 #86 ci/test-output-on-failure master open
3 #87 ci/guard-cmp0169 ci/test-output-on-failure merged
4 #88 ci/build-all-codepaths master open
5 #89 ci/widen-coverage ci/build-all-codepaths open
6 #90 pr/fix-missing-prototypes master open
7 #91 fix/buildyml-jobs master merged
8 #92 ci/missing-declarations master open
9 #93 ci/windows ci/missing-declarations open
10 #94 <- this PR ci/workflow-trigger-lint ci/windows open

The order is the order these changes sat on master before the revert, so
it is known to build and test at every step. Verified again after
rebuilding the stack: the tip configures, compiles with no errors, and
passes 344/344 tests.

Why this one is stacked rather than independent

Each PR in this chain edits the same few files as its predecessors, chiefly
.github/workflows/cmake-multi-platform.yml, cmake/exported_symbols_linux.txt
and cifti/afni_xml.h. Cherry-picked onto master alone, the later ones
conflict. Two members also carry a build-order dependency rather than a
textual one: without #30 the project does not configure at all on CMake
versions that do not know policy CMP0169, and #29 is needed for
install_linking to find its source directory.

Commits
  • COMP: Detect a workflow that can never be scheduled

See #84 for the ordering of all 49 re-submitted pull requests.

@hjmjohnson
hjmjohnson marked this pull request as ready for review September 24, 2026 12:03
@hjmjohnson
hjmjohnson force-pushed the ci/workflow-trigger-lint branch from c8ee791 to 268e6c7 Compare October 6, 2026 14:39
@hjmjohnson
hjmjohnson changed the base branch from ci/windows to master October 6, 2026 14:39
@hjmjohnson
hjmjohnson marked this pull request as draft October 6, 2026 15:02
@hjmjohnson
hjmjohnson force-pushed the ci/workflow-trigger-lint branch from 268e6c7 to 1dd4619 Compare November 3, 2026 22:46
@hjmjohnson
hjmjohnson changed the base branch from master to ci/windows November 3, 2026 22:47
@hjmjohnson

Copy link
Copy Markdown
Member Author

Restacked onto ci/windows (#93): the single commit now adds only .github/check_workflow_triggers.py and the workflow-triggers job. Before, it carried the whole accumulated workflow on top of master, so the exported-symbols job ran cmake/collect_exported_symbols.sh, a file that exists only on #89 and #93, and failed with exit 127. The base is now ci/windows; no workflow runs on this PR until its base reaches master, because the triggers filter on master.

@hjmjohnson

Copy link
Copy Markdown
Member Author

Force-push: plain rebase onto the rebased #93; the single commit is unchanged.

@seanm seanm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I defer to others on this one, github CI is not my thing...

@gdevenyi gdevenyi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Google Carbon

Verdict: Request Changes (Draft; unstack from #93 onto #89 + fix 3 script edge cases)

Great idea catching dead workflow triggers like build.yml's branches: [ main ] automatically!

  1. Unstack onto master once #89 lands: This PR has no technical dependency on #92 or #93 (whose base currently conflicts with master); it only needs #89's main -> master fix in .github/workflows/build.yml.
  2. Fix 3 edge cases in .github/check_workflow_triggers.py (detailed inline):
    • Silent return 0 (green check) when existing_branches() comes back empty on detached-HEAD PR checkouts if git ls-remote fails.
    • TypeError crash when YAML 1.1 parses unquoted branch names like on (bool) or 3.0 (float), or char-by-char iteration if branches: master is written as a bare string.
    • Including '!' in GLOB_CHARS skips the entire branches: list whenever any !exclude filter is present (allowing branches: [ main, '!wip' ] or invalid negative-only branches: [ '!wip' ] to pass silently).

Comment thread .github/check_workflow_triggers.py Resolved
Comment thread .github/check_workflow_triggers.py Resolved
Comment thread .github/check_workflow_triggers.py Resolved
@hjmjohnson
hjmjohnson force-pushed the ci/windows branch 2 times, most recently from 6f7552f to 8514828 Compare November 17, 2026 22:40
@hjmjohnson
hjmjohnson force-pushed the ci/workflow-trigger-lint branch from e96256a to ee08e7b Compare November 17, 2026 22:41
A branch filter naming a branch that does not exist leaves the workflow
configured but never run, which looks the same as one that runs and
passes: no red check appears because no check appears at all. build.yml
sat dead behind a filter naming main on a repository whose branch is
master, and the only thing that found it was reading the file.

The check judges a filter only when its positive entries are all literal
names, flags a filter of only !exclusions or of unquoted non-string
entries, and fails in CI when it cannot list the branches. Its tests
run in the same job.
@hjmjohnson
hjmjohnson force-pushed the ci/workflow-trigger-lint branch from ee08e7b to 6c09474 Compare November 17, 2026 22:42
@hjmjohnson

Copy link
Copy Markdown
Member Author

First force-push (ee08e7b) = review fixes on the old base; second (6c09474) = plain restack onto the updated #93, where only a context line changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants