Skip to content

Add doc-only change detection to skip tests#2922

Merged
copybara-service[bot] merged 1 commit intomainfrom
hengtaoguo-ci-copy
Jan 9, 2026
Merged

Add doc-only change detection to skip tests#2922
copybara-service[bot] merged 1 commit intomainfrom
hengtaoguo-ci-copy

Conversation

@hengtaoguo
Copy link
Copy Markdown
Collaborator

@hengtaoguo hengtaoguo commented Jan 8, 2026

Description

  • Add doc_only_check job to detect when only .md|ipynb files are modified (Later, you can skip more file types such as jpg|png|mp4 if needed):

    • If skip_tests==true: Skip the build process and all unit tests.
    • If skip_tests==false: Execute all remaining build process and unit tests like before.
  • Add all_tests_passed to aggregate build and all unit tests status. Later in GitHub branch protection rule, we only check this test. Benefits of doing so:

    • Clear intent: Single "gate" that represents overall health
    • Future-proof: Add/remove/rename test jobs without updating branch protection

Tests

Skip test (doc-only): https://screenshot.googleplex.com/ANutL8W8zpaRP5e
Non-skip test (success): https://screenshot.googleplex.com/BKxyPkxUgAYZvxR
Non-skip test (failure): https://screenshot.googleplex.com/4JU7AtHVWpJ7SMT
Non-skip test (cancel): https://screenshot.googleplex.com/8om8PyDT3vSxJd3

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 8, 2026

🤖 Hi @hengtaoguo, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@hengtaoguo hengtaoguo force-pushed the hengtaoguo-ci-copy branch 2 times, most recently from da597ec to d6a8739 Compare January 8, 2026 23:35
@hengtaoguo hengtaoguo marked this pull request as ready for review January 8, 2026 23:36
Comment thread .github/workflows/build_and_test_maxtext.yml
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 9, 2026

🤖 Hi @hengtaoguo, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

## 📋 Review Summary

This pull request introduces a valuable optimization to the CI pipeline by skipping tests for documentation-only changes. The implementation is mostly correct, but contains a critical bug in the final job that aggregates test results.

🔍 General Feedback

  • The doc_only_check job is well-implemented and uses a correct method to determine which files have changed.
  • The new all_tests_passed job is a good idea for simplifying branch protection rules. However, the logic for checking for failed or cancelled jobs is incorrect and needs to be fixed for it to work as intended.

Comment thread .github/workflows/build_and_test_maxtext.yml
@hengtaoguo hengtaoguo force-pushed the hengtaoguo-ci-copy branch 3 times, most recently from 70cf228 to 7123147 Compare January 9, 2026 20:29
Comment thread .github/workflows/build_and_test_maxtext.yml Outdated
- Add doc-only-check job to detect when only .md files are modified
- Skip build and all test jobs when only documentation changes
- Tests only run when build succeeds (not skipped)
- Non-PR events (schedule, workflow_dispatch) always run all tests
@copybara-service copybara-service Bot merged commit 4423abf into main Jan 9, 2026
24 checks passed
@copybara-service copybara-service Bot deleted the hengtaoguo-ci-copy branch January 9, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants