Improve PR labels#2458
Conversation
Greptile SummaryThis PR improves the
Confidence Score: 5/5The changes are targeted and well-reasoned fixes to real labeling issues; the worst-case outcome of any residual timing window is a missed or extra label, not data loss or a security problem. Both fixes (SHA-staleness guard in the workflow_run path and draft-state awareness) are straightforward and correctly implemented. The ciCompleteOk refactor with per_page:1 also closes a pre-existing gap where an in-progress re-run would be skipped in favour of an older completed result. No logic paths have been regressed. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Event fires] --> B{event type?}
B -- pull_request_target --> C{action?}
C -- converted_to_draft\nor synchronize --> D[setLabel false\nremove ready-to-merge]
C -- ready_for_review --> E[Fetch fresh PR state]
E --> F[ciCompleteOk pr.head.sha]
F --> G{ciOk AND not draft?}
G -- yes --> H[setLabel true\nadd ready-to-merge]
G -- no --> I[setLabel false]
B -- workflow_run --> J[ciCompleteOk run.head_sha\nper_page=1 - latest run only]
J --> K[Resolve PR numbers\nfrom payload or commit SHA]
K --> L[For each PR: fetch fresh state]
L --> M{pr.head.sha == run.head_sha?}
M -- no stale event --> N[skip - log and continue]
M -- yes --> O{ciOk AND not draft?}
O -- yes --> P[add label]
O -- no --> Q[remove label]
Reviews (3): Last reviewed commit: "Fix" | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Uh oh!
There was an error while loading. Please reload this page.