[ENH] Skip premerge CPU tests for documentation-only bundle changes#779
[ENH] Skip premerge CPU tests for documentation-only bundle changes#779lapertor wants to merge 2 commits intoProject-MONAI:devfrom
Conversation
Bundles whose only modified files are documentation (files inside a docs/ directory or with a .md extension) are now excluded from the premerge CPU test suite. This avoids unnecessary resource consumption when a pull request changes only README files, images, or other documentation assets. The filtering is implemented via a new --filter_docs flag in get_changed_bundle.py and a helper is_doc_file() in utils.py. The flag defaults to False so existing callers (weekly tests, Blossom CI) are not affected. Fixes Project-MONAI#756 Signed-off-by: Raphael Lapertot <raphael.lapertot@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughAdds an optional documentation-filtering flag that prevents docs-only changes from counting as changed bundles/models in CI. The flag flows from CLI ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ci/get_changed_bundle.py`:
- Around line 48-51: The argparse flags for hf_model and filter_docs are using
type=bool which treats any non-empty string as True; change the
parser.add_argument calls for "--hf_model" and "--filter_docs" to use
action="store_true" instead of type=bool/default, and then update usages in
ci/run_premerge_cpu.sh to pass the flags as switches (e.g., --filter_docs and
--hf_model) rather than as string values like "True"/"False" so disabling is
done by omitting the flag.
In `@ci/run_premerge_cpu.sh`:
- Around line 1-164: The script contains Windows CRLF line endings which break
execution; open the shell script with the "#!/bin/bash" shebang (look for
functions init_venv, remove_venv, verify_bundle) and convert all CRLF to LF-only
line endings (e.g., run a line-ending conversion like dos2unix or sed -i
's/\r$//' on the file) and re-commit the corrected file so the CI runner uses
Unix-style LF endings.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 13022102-ebe9-4b74-a78d-2e978528228b
📒 Files selected for processing (3)
ci/get_changed_bundle.pyci/run_premerge_cpu.shci/utils.py
Replace type=bool with action='store_true' for --hf_model and
--filter_docs arguments. Using type=bool causes bool('False') == True,
making it impossible to reliably disable flags from the command line.
Also convert CRLF to LF line endings in run_premerge_cpu.sh, which
had mixed line endings after the previous edit.
Suggested by coderabbitai review on Project-MONAI#779.
Signed-off-by: Raphael Lapertot <raphael.lapertot@gmail.com>
Closes #756.
Description
When a pull request only modifies documentation files inside a bundle (files in a
docs/directory or with a.mdextension), the premerge CPU test suite now skips that bundle entirely. If a bundle has both documentation and code changes, it is still tested as usual.Changes:
ci/utils.py: addis_doc_file()helper and afilter_docsparameter toget_changed_bundle_list(). Documentation files are defined as files inside adocs/directory or with a.mdextension.ci/get_changed_bundle.py: expose--filter_docsas a CLI argument, propagated to bothget_changed_bundle()andget_changed_hf_model().ci/run_premerge_cpu.sh: pass--filter_docs Trueto bothget_changed_bundle.pycalls (regular bundles and HuggingFace models).The
filter_docsparameter defaults toFalse, so weekly tests and Blossom CI are not affected.Status
Ready
Please ensure all the checkboxes:
./runtests.sh --codeformat.Summary by CodeRabbit