Skip to content

fix(github): align PR comment severity glyphs with the shared vocabulary - #1135

Open
aparajon wants to merge 3 commits into
mainfrom
armand/glyph-webhook-surface
Open

fix(github): align PR comment severity glyphs with the shared vocabulary#1135
aparajon wants to merge 3 commits into
mainfrom
armand/glyph-webhook-surface

Conversation

@aparajon

@aparajon aparajon commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Why this matters

The PR-comment surface spells every severity glyph inline, so the same situation reads differently from comment to comment: a recorded failure renders ⚠️ — one notch below a plan-time warning — safety-gate refusals split between ❌ and ⛔, and the unsafe-changes rejection heading pins ⛔ to the changes themselves rather than the refusal. Operators triage urgency from these glyphs, and pkg/glyph already defines the one-glyph-per-meaning vocabulary the CLI surface uses. This PR moves the PR-comment surface onto it and corrects the sites whose glyph said the wrong thing.

What it does

Migrates every raw severity glyph in pkg/webhook/templates to the pkg/glyph constants, and fixes the misleads:

  • The unsafe-changes rejection heading attaches ⛔ to the refusal: **⛔ Apply rejected**: N unsafe changes detected, matching the engine-blocked rejection heading, instead of labeling the changes.
  • Error callouts move from ⚠️ to ❌. The > ⚠️ **Error:** and > ⚠️ Last error: quotes render a recorded failure, not a pre-proceed warning.
  • First-failure callouts move from ⚠️ to ❌ in multi-deployment and sharded progress comments — they point at a deployment/shard row already marked ❌.
  • The Apply Blocked headings move from ❌ to ⛔. Prior-environment gate, non-passing PR checks, check-read errors failing closed, missing/untrusted prior-environment check, unlisted environment — all are refusals by a safety gate, not attempted-and-failed operations, matching the Apply Blocked: PR Is Merged/Closed headings that already carried ⛔.
  • Heading counts are no longer bolded. Section headings already carry a bold label, so the bold count was double emphasis; the plan summary keeps its bold counts, where the number is the line's only emphasis.

Everything else (escalation, info notices, config-error templates) keeps its rendering and now references the constants. Cancelled/stopped state glyphs are a separate vocabulary and are untouched here.

Apply rejected over unsafe changes — before / after

Before:

⛔ 3 Unsafe Changes Detected:

  • users: DROP COLUMN email
  • orders: DROP TABLE
  • products: MODIFY COLUMN price_cents

🚨 To proceed with these destructive changes, re-run with --allow-unsafe:

After:

⛔ Apply rejected: 3 unsafe changes detected

  • users: DROP COLUMN email
  • orders: DROP TABLE
  • products: MODIFY COLUMN price_cents

🚨 To proceed with these destructive changes, re-run with --allow-unsafe:

Failed apply error callouts — before / after

Before:

⚠️ Error: table orders failed: preflight enumReorder check failed

⚠️ Last error: lock wait timeout exceeded; try restarting transaction

After:

Error: table orders failed: preflight enumReorder check failed

❌ Last error: lock wait timeout exceeded; try restarting transaction

Multi-deployment / sharded first failure — before / after

Before:

⚠️ First failure: us — lock wait timeout exceeded; try restarting transaction

After:

First failure: us — lock wait timeout exceeded; try restarting transaction

Apply blocked by a safety gate — before / after

Before:

❌ Apply Blocked — Production

Staging has pending changes. Apply staging first before applying to production.

After:

⛔ Apply Blocked — Production

Staging has pending changes. Apply staging first before applying to production.

Unbolded heading counts — before / after

Before:

💡 Lint Warnings: 2 advisory findings

After:

💡 Lint Warnings: 2 advisory findings

How it moves us toward the northstar

This completes the PR-comment half of the shared severity vocabulary: with the CLI surface already migrated, both operator surfaces now read from pkg/glyph, so a glyph can never drift on one surface without the other. That unblocks the final step of the vocabulary work — the analyzer that forbids raw severity glyph literals outside pkg/glyph — which can only be turned on once no surface spells its own.

Opened by Claude (Fable 5).

@aparajon
aparajon force-pushed the armand/glyph-webhook-surface branch from 241de35 to f830783 Compare August 25, 2026 16:14
Base automatically changed from armand/glyph-cli-surface to main August 26, 2026 02:06
Copilot AI lite review requested due to automatic review settings August 26, 2026 02:20
@aparajon
aparajon force-pushed the armand/glyph-webhook-surface branch from f830783 to 1b90b32 Compare August 26, 2026 02:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR standardizes severity glyphs across GitHub PR-comment templates by switching hard-coded emoji to the shared pkg/glyph vocabulary, and adjusts a few headings/callouts so the glyph meaning matches the underlying event (refusal vs failure vs attention).

Changes:

  • Replace raw severity glyphs in pkg/webhook/templates/* with pkg/glyph constants (e.g., Attention, Failed, Refused, Info, Escalation).
  • Update “unsafe changes” apply rejection and “Apply Blocked” headings to use the refusal glyph (⛔) and update error/first-failure callouts to use the failure glyph (❌).
  • Refresh template previews and documentation to reflect the new glyph semantics.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
TEMPLATES.md Updates rendered preview snippets to match the new glyph vocabulary and corrected headings/callouts.
pkg/webhook/templates/sharded_apply.go Switches sharded failure callouts to glyph.Failed.
pkg/webhook/templates/sharded_apply_test.go Updates expectations for sharded failure callouts.
pkg/webhook/templates/reconciliation.go Uses glyph.Attention for the reconciliation-required heading.
pkg/webhook/templates/plan.go Replaces severity glyph literals with glyph.* constants in plan comment rendering.
pkg/webhook/templates/multi_apply.go Switches multi-deployment first-failure callout to glyph.Failed.
pkg/webhook/templates/multi_apply_test.go Updates expectations for multi-deployment first-failure callout.
pkg/webhook/templates/existing_copy.go Uses glyph.Attention / glyph.Info for the discarded-copies disclosure marker.
pkg/webhook/templates/errors.go Converts error templates to use glyph.Attention / glyph.Info / glyph.Failed constants.
pkg/webhook/templates/common.go Changes error blockquote markers from ⚠️ to glyph.Failed for Error: / Last error: lines.
pkg/webhook/templates/common_test.go Updates expectations for the new error blockquote glyph.
pkg/webhook/templates/apply.go Uses glyph.Failed in headings / grouped emoji selection, plus glyph.Info in informational bullets.
pkg/webhook/templates/apply_test.go Updates expectations for Apply Blocked headings and error markers.
pkg/webhook/templates/apply_commands.go Updates unsafe-change rejection copy and apply-blocked headings to use glyph.Refused / glyph.Escalation / glyph.Attention.
pkg/webhook/sharded_apply_test.go Updates sharded summary expectation for the apply-level failure callout.
pkg/webhook/plan_test.go Updates unsafe-changes rejection copy expectations.
docs/lint-and-safety-levels.md Updates documentation to reflect revised glyph semantics and adds ❌ to the legend.
Suppressed comments (1)

pkg/webhook/templates/common.go:322

  • writeTableErrorLine now always prefixes with the failure glyph (❌), but apply progress rendering calls this for retryable interruptions (state.Task.FailedRetryable in apply.go). That makes an in-progress retry read like a terminal failure; consider letting the caller choose glyph.Attention vs glyph.Failed (or split into two helpers) based on task/apply state.
	if sanitized == "" {
		return
	}
	fmt.Fprintf(sb, "> "+glyph.Failed+" Last error: %s\n", quoteBlockLines(html.EscapeString(sanitized)))

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/webhook/templates/apply.go
Comment thread pkg/webhook/templates/common.go
@aparajon
aparajon marked this pull request as ready for review August 26, 2026 03:01
aparajon and others added 3 commits August 27, 2026 13:05
Migrate every raw severity glyph in the webhook templates to the
pkg/glyph constants and correct the sites whose glyph misled:

- The unsafe-changes rejection heading attaches Refused to the refusal
  itself: "Apply rejected: N unsafe changes detected", matching the
  engine-blocked rejection heading's style.
- Error and last-error callouts quote a recorded failure, not a
  pre-proceed warning; they now carry Failed.
- Multi-deployment and sharded first-failure callouts carry Failed,
  matching the row they point at.
- The Apply Blocked headings are safety-gate refusals, not attempted
  failures, so they move from Failed to Refused — matching the
  merged/closed-PR blocks that already carried it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The per-table failed rows spelled the failure glyph as a unicode
escape, hiding it from the vocabulary migration. Reference
glyph.Failed like every other severity site, and correct the
writeErrorBlock doc comment that still described a warning emoji.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Section headings already carry a bold label, so bolding the count as
well double-emphasized the line. The count stays bold only in the plan
summary ("**2** tables to create"), where it is the line's sole
emphasis.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@aparajon
aparajon force-pushed the armand/glyph-webhook-surface branch from bb8b258 to e473cee Compare August 27, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants