Repository navigation
ci: skip the suite on a documentation-only PR, without blocking it - #107
Merged
Merged
Conversation
The docs sync bot (marketdata-docs-sync) opens pull requests here that touch nothing but docs/. Every one of them runs the full suite to test markdown. A required status check can never be conditional: the list is static. And a matrix job that GitHub SKIPS does not expand its name, so it reports no per-combination context at all and the pull request waits forever for checks that never arrive. Measured on MarketDataApp/sdk-php#95. So `Tests passed` becomes the single context branch protection requires. A `changes` job always runs, diffs against the merge base, and the suite gates on it. The path list is inverted on purpose: it says what DOCUMENTATION looks like and runs the suite for everything else. Enumerating code paths instead would skip the suite the first time somebody adds a source directory nobody listed. `Tests passed` separates two classes of skip. A job that applies to every change may only skip when the gate asked for it, so a failed gate cannot produce a green over untested code. A job with a condition of its own -- the live suite does not run on an ordinary push, nor for dependabot, which cannot read the token -- may skip for its own reasons, which branch protection already tolerates. A FAILURE never passes in either class.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #107 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 69 69
Lines 2187 2187
Branches 272 272
=========================================
Hits 2187 2187 Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
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.
Why
The docs sync bot (
marketdata-docs-sync) opens pull requests here that touchnothing but
docs/. Every one runs the full suite to test markdown. On the livesync PR in this repo today, that is the whole matrix — and in sdk-go and
sdk-csharp it spends live API quota.
The review bot already ignores these PRs:
marketdata-docs-sync[bot]is in itsdefault
ignore_authors, anddocs/**is inignore_paths. Tests were the halfwith no exemption.
The constraint, and the trap
A required status check can never be conditional — the list is static. And a
matrix job that GitHub skips does not expand its name: it reports one check with
the template unevaluated and zero per-combination contexts, so the pull request
waits forever for checks that never arrive. Measured on
MarketDataApp/sdk-php#95, where a docs-only PR reported
P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}and noP8.x.How
changes— always runs, diffs against the merge base, setscode=trueorcode=false.needs:inherits the skipthrough its dependency instead, because a second
needs:key is silentlydiscarded by YAML.
Tests passed— a new aggregate withif: always(). This is the contextbranch protection should require.
The path list is inverted on purpose
It lists what documentation looks like (
^docs/,\.md$) and runs the suitefor everything else. Enumerating code paths instead would skip the suite the first
time somebody adds a source directory nobody remembered to list.
Two classes of skip, which is the part that matters
Tests passeddoes not treat all skips alike:this gate asked for. A failed
changesjob leavesCODEempty, which reads asa skip nobody asked for, and fails. A green over untested code is the failure
mode being designed out.
not run on an ordinary push, nor for dependabot, which cannot read the token.
Branch protection already treats those skips as passing, so this does too.
A failure never passes in either class.
Each gate reads
!= 'false', not== 'true', so a broken gate runs the suite.This commit only adds a check. Branch protection on
mainmust move toTests passed, or a docs-only pull request blocks. Merged with it, the existingcontexts still run and still have to pass whenever code changes —
Tests passedfails if any of them fail.
Verification
This branch touches a workflow file, which is not documentation, so its own suite
must run. A docs-only pull request on top must show the suite skipped and
Tests passedgreen. Both results go in this thread before merge, the waysdk-php #94 was proven in both directions.
Version impact
none. CI configuration. No source change, no release.