Skip to content

CI: skip unrelated jobs during pipeline upload - #23491

Open
iangmaia wants to merge 9 commits into
trunkfrom
iangmaia/skip-unrelated-library-lint
Open

iangmaia wants to merge 9 commits into
trunkfrom
iangmaia/skip-unrelated-library-lint

Conversation

@iangmaia

@iangmaia iangmaia commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Part of AINFRA-3622

TL;DR

Using "even-if-skipped" setup to skip jobs on unrelated changes without using an agent

Description

Move the existing build, validation and lint skips into pipeline upload, using the upload-time approach from bloom/DayOne-Apple#30814. Unrelated jobs no longer take an agent just to exit early, and skipped required checks still report through the uploader.

App-only changes also skip standalone library lint. Library source, module build files and CI changes keep it enabled. Gradle configuration and FluxC endpoint definitions run the relevant checks. Locale Consistency runs when its Fastlane or Gradle declarations change. Errors and non-PR builds run the jobs.

Testing instructions

  1. Open [CI verification] app-only changes (do not merge) #23492 (app-only) and [CI verification] library changes (do not merge) #23493 (library change).
  • Library lint skips only for the app-only change; WordPress and Jetpack lint run in both.
  1. Open [CI verification] docs upload skips (do not merge) #23555 (docs only).
  • Skippable build, lint and validation jobs never start; required checks are green.
  1. Check a module build-file change or a manual build.
  • Library lint runs.

@iangmaia iangmaia self-assigned this Nov 6, 2026
@wpmobilebot

wpmobilebot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr23491-29b3d62
Build Number1498
Application IDorg.wordpress.android.prealpha
Commit29b3d62
Installation URL0nlq1blq5b658
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr23491-29b3d62
Build Number1498
Application IDcom.jetpack.android.prealpha
Commit29b3d62
Installation URL63ff2eh0pcmf0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@iangmaia
iangmaia marked this pull request as ready for review November 9, 2026 19:42
@iangmaia
iangmaia requested a review from a team as a code owner November 9, 2026 19:42
iangmaia and others added 2 commits November 19, 2026 13:53
A skipped Lint Libraries job is no longer created, so it doesn't wait for an agent just to exit.
`shared-pipeline-vars` runs the `library-lint` check and exports `SKIP_LIBRARY_LINT` for the step's `skip:`; `lint.sh` is back to its trunk version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iangmaia iangmaia changed the title Skip library lint for app-only PR changes CI: skip unrelated jobs during pipeline upload Nov 19, 2026
iangmaia and others added 4 commits November 24, 2026 14:49
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The uploader is on toolkit 8.1.0 now, which checks both paths of renames.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@AliSoftware AliSoftware left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The move to upload-time skips and the new library-lint skip look right to me. My comments are mostly about the kept path rules, which matter more now that skipped required checks report success.


Generated by Claude Code

Comment on lines +22 to +25
PATTERNS=(
'*.md' '*.po' '*.pot' '*.txt' '.gitignore' 'config/**'
'fastlane/**' 'Gemfile' 'Gemfile.lock' 'version.properties'
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two of the kept rules hide real changes

These rules predate this PR, but skips now happen before a job starts and required checks still report success, so a wrong skip becomes invisible:

  • config/** holds checkstyle.xml, detekt/detekt.yml and its baseline, lint/lint.xml and its baseline, and Gradle scripts that settings.gradle and build.gradle load (included_builds.gradle, code_coverage.gradle, gradle_build_scan.gradle). A PR that only changes the detekt or lint config skips detekt or lint and still goes green.
  • *.txt matches at any depth, so it covers libs/fluxc-processor/src/main/resources/*-endpoints.txt. Those are annotation processor inputs that generate code, so a PR that adds an endpoint skips builds and unit tests.

I'd drop config/**, and limit the .txt rule to text-only places such as fastlane/*, WordPress/metadata/* and WordPress/jetpack_metadata/* (or at least exclude libs/fluxc-processor/*).


Generated by Claude Code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, since pr_changed_files uses bash for the =~ string matching, ** has no special meaning. so fastlane/** can just be fastlane/* as in bash a * would also match / in a path-like string

Comment thread .buildkite/pipeline.yml
- "**/build/reports/detekt/detekt.html"

- label: "🌐 Locale Consistency"
skip: "$SKIP_VALIDATION"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Locale Consistency should use $SKIP_LINT, not $SKIP_VALIDATION

The validation rules also skip PRs that only change strings.xml, so the frequent "Update translations" PRs skip check_declared_locales_consistency. That's when it matters most, e.g. when a translations PR adds a new values-xx/ folder. The lint type exists for exactly this case: it doesn't skip translation-only changes.


Generated by Claude Code

Comment thread .buildkite/shared-pipeline-vars Outdated
Comment on lines +11 to +15
SKIP_BUILD=$(.buildkite/commands/should-skip-job.sh build || true)
SKIP_VALIDATION=$(.buildkite/commands/should-skip-job.sh validation || true)
SKIP_LINT=$(.buildkite/commands/should-skip-job.sh lint || true)
SKIP_LIBRARY_LINT=$(.buildkite/commands/should-skip-job.sh library-lint || true)
export SKIP_BUILD SKIP_VALIDATION SKIP_LINT SKIP_LIBRARY_LINT

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: upload-claude-analysis.sh also sources this file, so every build runs these four checks once more at the end, each with its own git fetch. That step has no $CI_TOOLKIT plugin, so it logs pr_changed_files: command not found four times. It falls back to running the jobs, so it's harmless but noisy. Running these checks only for the main upload would avoid both.


Generated by Claude Code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Follow-up: woocommerce-ios (woocommerce/woocommerce-ios#18342) already has a one-line fix for this. Its shared-pipeline-vars only computes the SKIP_* values if command -v pr_changed_files >/dev/null 2>&1, so steps that source the file without the toolkit plugin, like the Claude analysis step here, skip the checks entirely.


Generated by Claude Code

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants