ci: tighten path filters on PR-triggered workflows#2134
Open
ci: tighten path filters on PR-triggered workflows#2134
Conversation
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.
Summary
Three workflows fire on every PR push regardless of what changed. This PR adds
paths:filters to theirpull_requesttriggers, scoped to what each workflow actually inspects. Findings come from apgci-graph workflowsanalysis (Phase 1).Filters
ci.yml— "Check merge requirements"Reads
ansible/vars.ymlto validatepostgres_releaseversion strings. That's the entire workflow.check-shellscripts.ymlRuns ShellCheck against
./ansible/files/admin_api_scriptsand itspg_upgrade_scriptssubdir. The**glob covers both.nix-build.yml— "Nix CI"Scoped to actual Nix derivation inputs and the workflow's own dependencies.
Deliberately excluded from
nix-build.yml's filter (with verification)ansible/vars.yml— empirically the only Nix derivation with vars.yml as aninputSrcisdbmate-tool. Verified vianix derivation showagainst all packages and a representative sample of checks (postgres builds, extensions, devShell, pre-commit, treefmt, etc.) — none had vars.yml as an input. Furthermore,dbmate-tool's build cannot fail on vars.yml content changes (it only embeds the file's store path; the script body and shellcheck don't depend on the content). Content validation is handled byci.yml, which keeps vars.yml in its filter.test.yml,testinfra-ami-build.yml— reusable workflows called bynix-build.yml, but changes to them don't affect the Nix derivation graph, only how downstream tests run. Re-running every package build × architecture × PG version on a test-logic tweak is wasteful. Merge queue still validates them at merge time.docker-image-test.yml— has its own independentpull_requesttrigger, so it fires regardless..github/actions/**(wide glob) — only 3 of 6 actions in that directory are used bynix-build.yml. Listing the specific 3 avoids re-evaluation when unrelated actions (build-ami,check-docker-image-changes,shared-checkout) are edited.Left un-filtered (intentional)
merge_group:everywhere — GitHub ignorespaths:on this event, and it's the merge-time safety net.nix-build.yml'spush.branches: [release/*]— release pushes always need full validation.workflow_dispatch:— manual.Required status checks interaction
The three filtered workflows produce required status checks on
develop:ci.yml→check-release-versioncheck-shellscripts.yml→buildnix-build.yml(viatest.yml) →run-tests / prepare,run-tests / build (15 | 17 | orioledb-17)When GitHub skips a workflow due to
paths:, no status is reported — which would normally block merge if required checks were evaluated on the PR commit.Mitigated by merge queue (verified enabled on
developvia recentgh-readonly-queue/develop/pr-NNNN-...merge_groupruns):paths:filters are ignored onmerge_groupevents.merge_group:triggers (un-filtered).PRs that don't match
paths:skip CI at PR-time (the desired savings); merge queue runs all required checks at merge time and gates merge on them.Caveats
nix-build.ymlpaths list is a manual stop-gap. Phase 2 ofpgci-graphwill derive it frominputSrcsautomatically; until then, treat it as a quarterly review item. Merge queue mitigates the cost of any drift.Test plan
push.branches: release/*) still trigger fullnix-build.yml.ansible/vars.ymltriggersci.ymlonly (notnix-build.yml, notcheck-shellscripts.yml).ansible/files/admin_api_scripts/triggerscheck-shellscripts.ymlonly.nix/**triggersnix-build.ymlonly.