Skip to content

fix(pepper): pre-create Pepper labels before applying them [DEV-237]#41

Merged
brodkin merged 1 commit into
mainfrom
ryan/dev-237-fix-label-not-found
May 9, 2026
Merged

fix(pepper): pre-create Pepper labels before applying them [DEV-237]#41
brodkin merged 1 commit into
mainfrom
ryan/dev-237-fix-label-not-found

Conversation

@brodkin

@brodkin brodkin commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #39 (the pepper-cooking lifecycle change). The new "Mark PR as cooking" step was failing on every consumer repo because gh pr edit --add-label "<name>" does not auto-create labels — it errors with "<name>" not found when the label is missing from the repo.

This adds an "Ensure Pepper labels exist" step (review mode only) that idempotently creates the four Pepper labels via gh label create, tolerating already-exists errors so per-repo customization of label color/description is preserved.

Fixes the failure mode caught immediately after #39 merged. v1 has been rolled back to the pre-#39 commit (a8a48f6) to unblock consumers while this lands.

Refs: DEV-237.

Test plan

  • Pepper auto-review runs on this PR using v1 = a8a48f6 (no cooking step in that workflow), reviews via the existing prompt — expect approval.
  • After merge, move v1 to the new commit.
  • Smoke-test PR docs(pepper): document pepper-cooking lifecycle in caller example [DEV-243] #40 (which is currently stuck because its first run failed before reviewing) gets a fresh @pepper review to retrigger; this time the new lifecycle (label-ensure → cooking → swap) works end-to-end.

Follow-up to the pepper-cooking lifecycle change. `gh pr edit
--add-label "<name>"` does not auto-create labels — it errors with
`"<name>" not found` when the label is missing from the repo. The
new "Mark PR as cooking" step was failing on every consumer repo
because `pepper-cooking` was a brand-new label nothing had created.

Add an "Ensure Pepper labels exist" step (review mode only) that
idempotently creates the four Pepper labels via `gh label create`
with `2>/dev/null || true` to tolerate already-exists errors. This
makes cold-start runs work in any repo and preserves per-repo color
or description customization on labels that already exist.

Refs: DEV-237

@pepper-pr-review pepper-pr-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against DEV-237 (Linear) — aligned. The diff pre-creates the four Pepper labels before the cooking step tries to apply them, which fixes the label-not-found error that broke #39's lifecycle change in fresh repos. The || true fallback preserves per-repo customization when labels already exist. Test plan matches the risk (workflow infra doesn't need unit tests; smoke-test post-merge is the right move).

This one's clean, Ryan — the comment on lines 133-140 does exactly what a good comment should: it explains the why (gh doesn't auto-create labels on add, so we pre-create) and the how (|| true to avoid clobbering existing labels). Line 148's copper color for pepper-cooking is a nice touch.

— Pepper

When you're ready for another look, comment @pepper review.

@pepper-pr-review pepper-pr-review Bot added the pepper-approved Pepper approved this PR label May 9, 2026
@brodkin brodkin merged commit ad93722 into main May 9, 2026
1 check passed
@brodkin brodkin deleted the ryan/dev-237-fix-label-not-found branch May 9, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pepper-approved Pepper approved this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant