Repository navigation
fix(ng-dev/pr): harden CLA status check, automation target validation, TGP comment freshness, and log symlink guard - #4030
Conversation
…vent CheckRun status map overwrite
…mit message fixup skip
There was a problem hiding this comment.
Code Review
This pull request enhances pull request validation by ensuring that TESTED comments are fresh (created after the latest commit), preventing CheckRuns from overwriting failing CLA StatusContexts, and ensuring automation target label checks are not bypassed by commit message fixup labels. It also refactors the logging utility to securely handle symbolic links. The review feedback suggests keeping the comment creation date as a required property to avoid correctness bypasses, and explicitly handling cases where the comment creation date is missing during freshness checks to prevent stale comments from being incorrectly treated as fresh.
88b5c9f to
52c2687
Compare
|
This PR was merged into the repository. The changes were merged into the following branches:
|
Summary
Hardens PR merge validation and local CLI logging against edge-case status, label, comment timestamp, and symlink checks:
assertSignedCla&getStatusesForPullRequest):type === "status"inassertSignedClawhen verifyingcla/google.statusMapkeys ingetStatusesForPullRequestwithcheck:andstatus:and add the missingbreak;statement undercase "CheckRun":so aCheckRuncannot overwrite aStatusContextwith the same name.assertChangesAllowForTargetLabel):automationBotsauthor allowlist fortarget: automationbefore themerge: fix commit messageearly return.assertEnforceTested):committedDate/pushedDateand commentcreatedAtin GraphQL schemas and verify inpullRequestHasValidTestedCommentthatTESTED=comments from Googlers were created at or after the latest commit timestamp when timestamps are available..ng-dev.logguard (captureLogOutputForCommand):lstatSync(logFilePath, {throwIfNoEntry: false})?.isSymbolicLink()so dangling symlinks are also rejected before opening.ng-dev.log.