[enhancement](CI) Force inject required AGENTS guides into review prompt#64536
Merged
Conversation
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary: Automated code review runs relied on the reviewer to infer which module-specific AGENTS.md files apply to a pull request. Recent Litefuse traces showed that reviews often skipped ancestor guides such as the repository root AGENTS.md, fe/AGENTS.md, and be/test/AGENTS.md even when the changed files made them applicable. This change fetches the PR changed file list, derives every existing AGENTS.md file from the changed file ancestor directories, records the list in the review context, and injects the required guide paths directly into the first Codex review prompt.
### Release note
None
### Check List (For Author)
- Test: Manual test
- Ran python3 -m py_compile .github/scripts/prepare_review_agents.py
- Parsed .github/workflows/code-review-runner.yml and .github/workflows/code-review-comment.yml with Python yaml.safe_load
- Ran the helper against apache#64496 changed files and verified it produced AGENTS.md, be/src/common/AGENTS.md, be/src/io/AGENTS.md, and be/test/AGENTS.md
- Behavior changed: Yes, automated review prompts now explicitly require the AGENTS.md guides matching the PR changed file ancestors
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary: The review runner checks out the pull request head before preparing the prompt, so helper scripts added on the workflow branch may be absent when reviewing older pull requests. This change downloads the AGENTS prompt helper from the workflow ref, matching the existing Litefuse helper pattern, and adds workflow_dispatch inputs so the runner can be validated directly from a branch before it reaches the default branch.
### Release note
None
### Check List (For Author)
- Test: Manual test
- Ran python3 -m py_compile .github/scripts/prepare_review_agents.py
- Parsed .github/workflows/code-review-runner.yml and .github/workflows/code-review-comment.yml with Python yaml.safe_load
- Behavior changed: Yes, the reusable review runner can now also be started manually through workflow_dispatch for validation
- Does this need documentation: No
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
Author
|
/review |
Mryange
approved these changes
Jun 15, 2026
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
Contributor
There was a problem hiding this comment.
Review result: no blocking issues found.
Checkpoint conclusions:
- Goal/test: the change injects required AGENTS.md guide paths into the automated review prompt. The helper compiles, the workflow YAML parses, and the helper produced the expected AGENTS.md list for both a representative sample and this PR's actual changed files.
- Scope/focus: the PR is small and focused on review-runner prompt preparation.
- Concurrency/lifecycle/config/compatibility/storage/transaction/data-write concerns: not applicable; this only changes CI prompt plumbing and a local helper script.
- Parallel paths: workflow_call and workflow_dispatch share the same input contract, and the helper download follows the existing workflow-ref pattern already used for Litefuse recording.
- Error handling/observability: API/helper failures fail the workflow visibly; generated changed-file and AGENTS context files are included in the prompt context.
- Test coverage/results: no Doris kernel/regression tests are needed for this CI-only change. I verified
python3 -m py_compile .github/scripts/prepare_review_agents.py, parsed the runner/comment workflows withyaml.safe_load, and exercised the helper output. - User focus: no additional user-provided review focus was supplied.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem Summary: Automated code review runs relied on the reviewer to infer which module-specific AGENTS.md files apply to a pull request. Recent Litefuse traces showed that reviews often skipped ancestor guides such as the repository root AGENTS.md, fe/AGENTS.md, and be/test/AGENTS.md even when the changed files made them applicable. This change fetches the PR changed file list, derives every existing AGENTS.md file from the changed file ancestor directories, records the list in the review context, and injects the required guide paths directly into the first Codex review prompt.
We tested 5 PRs that did not read the AGENTS.md file during previous pipeline runs, and the new results are as follows:
27536249602d76b77ac4e0d52d96f413b154c9f2571275362580498db34388a8379acdcd9e48720f11225f27536266784a5e37fba03375a9517f7a67e33f70d392753627568022ace18d70ece96b0ca7fa73123b62da275382396011803c040e4140d61e840e4e1526190e7