Skip to content

ci: harden PR auto-labeling against diff and output drift#2691

Merged
seratch merged 1 commit into
mainfrom
fix/pr-labels-hardening
Mar 17, 2026
Merged

ci: harden PR auto-labeling against diff and output drift#2691
seratch merged 1 commit into
mainfrom
fix/pr-labels-hardening

Conversation

@seratch
Copy link
Copy Markdown
Member

@seratch seratch commented Mar 17, 2026

This pull request fixes two sources of PR auto-labeling drift in the GitHub Actions workflow. It updates .github/workflows/pr-labels.yml to collect PR changes from the merge base instead of diffing the current base tip directly against the PR head, and it passes PR title/body context plus a schema-constrained output contract to Codex so intent labels are derived from the actual PR metadata and a structured payload.

It also updates .github/scripts/pr_labels.py so missing, empty, or malformed Codex output is treated as untrusted input rather than as an authoritative empty label set. Deterministic and fallback feature labels still apply, but model-only labels such as bug and enhancement are no longer removed unless Codex returned a valid payload. The change adds .github/codex/schemas/pr-labels.json, aligns .github/codex/prompts/pr-labels.md with the new PR context input, and extends tests/test_pr_labels.py to cover the invalid-output trust boundary.

@seratch seratch merged commit f61d0c1 into main Mar 17, 2026
9 checks passed
@seratch seratch deleted the fix/pr-labels-hardening branch March 17, 2026 03:13
seratch added a commit that referenced this pull request Mar 17, 2026
seratch added a commit that referenced this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant