ci: skip macOS validation on PRs with no macOS-relevant changes - #130
ci: skip macOS validation on PRs with no macOS-relevant changes#130David-Engel wants to merge 3 commits into
Conversation
Refactor the PR-only EvaluateDuplicate stage into a single EvaluateRequirements gate that runs both the duplicate-run check and a new macOS relevance check. The macOS jobs (Build_MacOS, Test_MacOS, Build_mssql_python_MacOS) now skip on PRs whose diff touches no macOS-relevant paths, and always run on non-PR builds. macOS-relevant paths (moderate allowlist): mssql-tds security/transport modules, the macOS Kerberos test, Cargo manifests/lock, rust-toolchain, and .pipeline/**. The guard fails safe (runs macOS) on any error or missing PR context.
The EvaluateRequirements stage is PR-only and is skipped in CI (non-PR). A bare succeeded() on the macOS jobs risks cascading to skipped when that stage is skipped, mirroring the earlier downstream-stage incident. not(canceled()) keeps the macOS jobs running on non-PR builds and matches the fail-safe pattern used by the Build and Build_mssql_python stage conditions.
Revert the not(canceled()) change and drop the accompanying comments. Whether a job-level succeeded() cascades to skipped when the PR-only EvaluateRequirements stage is skipped will be validated empirically in the PR run rather than assumed in the YAML. The stage-level not(canceled()) fail-safes are unchanged.
Validation plan for the
|
Summary
Speeds up PR validation by skipping the macOS build/test jobs on PRs whose changes cannot affect the macOS build, while keeping full macOS coverage on every non-PR (merge/CI) build.
All Apple/macOS-specific code lives in the
mssql-tdscrate and is limited to the native security libraries — Security.framework/CommonCrypto (Always Encrypted crypto), Security.framework TLS, and the macOS GSSAPI/Kerberos framework linking. When a PR touches none of the relevant paths, the three macOS jobs add wall-clock time without adding coverage.Changes
EvaluateDuplicatestage into a singleEvaluateRequirementsgate. It now runs the existing duplicate-run check plus a new macOS relevance check in one job (one agent allocation), and is the home for future "smart" skip optimizations. TheskipDuplicateoutput and step name are unchanged..pipeline/scripts/evaluate-macos-relevance.py. It diffs the PR against its target branch, matches the changed files against a moderate allowlist, and emitsmacRelevant. It fails safe (emitstrue, i.e. run macOS) on any error, missing PR context, or non-PR build.Build_MacOS,Test_MacOS, andBuild_mssql_python_MacOSonmacRelevant. They always run on non-PR builds and skip only when a PR's diff is macOS-irrelevant.macOS-relevant allowlist (moderate)
mssql-tds/src/security/**mssql-tds/src/connection/transport.rs,mssql-tds/src/connection/transport/**mssql-tds/tests/test_kerberos_gssapi.rs**/Cargo.toml,Cargo.lock,rust-toolchain*.pipeline/**(any pipeline change forces a macOS run)Conditions / CI behavior
The macOS jobs use
not(canceled())(notsucceeded()) so the PR-onlyEvaluateRequirementsstage being skipped in CI does not cascade the jobs to skipped — the same fail-safe pattern already used by theBuildandBuild_mssql_pythonstage conditions.Trade-off
Under the moderate allowlist, pure
mssql-odbc/mssql-pythonPRs skip macOS during PR validation. They remain covered by the full macOS run on merge todevelopment. This can be widened later if desired.Testing
mssql-odbc,mssql-python, non-transportmssql-tds, and docs).validation-stages.ymlparses as YAML.