ShryukGrandhi opened a new pull request, #3442:
URL: https://github.com/apache/hugegraph/pull/3442

   ## Purpose of the PR
   
   - Fixes #3296
   
   `require_current_pr()` checked the PR head and the target repository, but 
not the target branch name or whether the tested base was still part of the 
target's history. A run planned against `master` was still accepted after the 
PR was retargeted to another branch in the same repository, or after the target 
branch was force-pushed to unrelated history.
   
   ## Main Changes
   
   - The plan now records the PR target ref (`target`, from 
`pull_request.base.ref`). PR events without it are rejected as missing identity.
   - `require_current_pr()` rejects the run when the live `base.ref` differs 
from the planned target.
   - It also calls the compare API (`compare/<tested base>...<target>`) and 
accepts only `ahead` or `identical`. That allows normal target advancement and 
rejects a rewritten or rewound target. The live `base.sha` is not used here 
because GitHub does not update it when the target branch moves.
   - The metadata-outage behavior is unchanged. A failed lookup during planning 
still falls back to conservative mainline coverage.
   - `docs/ci.md` freshness section updated.
   
   ## Verifying these changes
   
   - [ ] Trivial rework / code cleanup without any test coverage. (No Need)
   - [x] Already covered by existing tests, such as *(please modify tests 
here)*.
   - [x] Need tests and can be verified as follows:
       - `python3 .github/scripts/test_ci_policy.py`: all 27 tests pass.
       - The real-Git fixture test now covers a retargeted PR (rejected), an 
advanced target (accepted) and a target force-pushed to unrelated history 
(rejected). The toolchain gate test covers the retarget and diverged-target 
cases.
       - With only the `ci-policy.py` change reverted, the two updated tests 
fail.
   
   ## Does this PR potentially affect the following parts?
   
   - [ ]  Dependencies ([add/update 
license](https://hugegraph.apache.org/docs/contribution-guidelines/contribute/#321-check-licenses)
 info & 
[regenerate_known_dependencies.sh](../install-dist/scripts/dependency/regenerate_known_dependencies.sh))
   - [ ]  Modify configurations
   - [ ]  The public API
   - [x]  Other affects (typed here): CI planning/gating only. The PR preflight 
makes one extra read-only `gh api` compare call, which is covered by the 
existing `contents: read` permission.
   - [ ]  Nope
   
   ## Documentation Status
   
   - [ ] `Doc - TODO`: required documentation is pending; complete it before 
merging.
   - [x] `Doc - Done`: documentation is included here or linked below.
   - [ ] `Doc - No Need`: no user-visible documentation is affected.
   
   Documentation files in this PR or paired hugegraph-doc PR:
   - docs/ci.md
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to