Skip to content

Skip full CI validation for documentation-only changes - #12514

Open
simonrozsival wants to merge 2 commits into
mainfrom
simonrozsival/docs-only-ci-classification
Open

Skip full CI validation for documentation-only changes#12514
simonrozsival wants to merge 2 commits into
mainfrom
simonrozsival/docs-only-ci-classification

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Summary

  • add a lightweight Azure Pipelines stage that classifies the complete PR merge diff
  • skip product builds and test stages only when every changed file is Markdown under Documentation/
  • run full validation for mixed changes, empty or uncertain diffs, non-PR builds, and explicit overrides
  • preserve the required aggregate dotnet-android check by always running the classifier job

Validation

  • exercised docs-only and mixed-change classification against synthetic merge commits
  • parsed the updated YAML and checked the stage dependency graph
  • confirmed only the aggregate dotnet-android Azure check is required by the repository ruleset

Add a lightweight PR change classifier that skips product builds and tests only when every changed file is Markdown under Documentation/. Keep full validation as the default for mixed, empty, uncertain, forced, and non-PR builds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1df48155-7897-4ab7-9ad8-6971bafd855b
Copilot AI lite review requested due to automatic review settings August 25, 2026 13:02

Copilot AI 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.

Pull request overview

Adds Azure Pipelines classification to skip full CI for documentation-only pull requests.

Changes:

  • Adds documentation-only diff detection and a force-validation override.
  • Gates builds and tests based on classification.
  • Preserves full validation for uncertain or non-documentation changes and the aggregate check.
Show a summary per file
File Findings
build-tools/automation/azure-pipelines-public.yaml Requires changes: correct merge-diff selection, boolean parameter handling, and escaping of PR-controlled filenames in Azure logging.

Review details

Suppressed comments (1)

build-tools/automation/azure-pipelines-public.yaml:97

  • Buggit diff --name-only can collapse a detected rename to the destination path. A PR that moves an outside file such as README.md to Documentation/README.md could therefore be classified as docs-only even though the non-documentation path changed. Disable rename detection (or classify both old and new paths) so this allowlist remains conservative.
          elif changedFiles="$(git diff --name-only "HEAD^1" "HEAD^2")"; then
  • Files reviewed: 1/1 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread build-tools/automation/azure-pipelines-public.yaml Outdated
Comment thread build-tools/automation/azure-pipelines-public.yaml Outdated
Comment thread build-tools/automation/azure-pipelines-public.yaml Outdated
Classify the PR merge result, treat renames conservatively, render the force-validation boolean explicitly, and prevent filenames from being interpreted as Azure logging commands.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1df48155-7897-4ab7-9ad8-6971bafd855b
@jonathanpeppers

Copy link
Copy Markdown
Member

/review

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #12514

@github-actions github-actions Bot 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.

⚠️ Needs Changes — 0 errors, 1 warning.

The classifier correctly defaults to full validation, uses the complete synthetic merge diff, and wires the expensive build/test roots through the classification result. The current CI run completed successfully. Please preserve the fail-closed behavior when the path matcher itself errors, rather than treating that error as a documentation-only result.

Generated by Android PR Reviewer for #12514 · gpt56 · 77.8 AIC · ⌖ 8.86 AIC · ⊞ 25.7K
Comment /review to run again

printf 'Changed file: %s\n' "$changedFile"
done <<< "$changedFiles"

if [[ -n "$changedFiles" ]] && ! grep -Evq '^Documentation/.*\.md$' <<< "$changedFiles"; then

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.

🤖 ⚠️ Error handling! grep -Evq ... conflates grep status 1 (no non-documentation matches) with status >1 (the matcher itself failed). In the latter case this sets runFullValidation=false, even though the classifier is intended to fail closed for uncertain results. Please capture the grep status explicitly and only select reduced validation for status 1; retain full validation and log a warning for any error status.

Rule: Do not swallow command failures

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