Skip to content

ci(labels): recover missing issue types from form headings - #1973

Merged
dnlrsls merged 1 commit into
Gentleman-Programming:mainfrom
dnlrsls:ci/issue-form-type-labels
Oct 21, 2026
Merged

dnlrsls merged 1 commit into
Gentleman-Programming:mainfrom
dnlrsls:ci/issue-form-type-labels

Conversation

@dnlrsls

@dnlrsls dnlrsls commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked Issue

Closes #1972

🏷️ PR Type

  • type:chore — Maintenance, dependencies, tooling

📝 Summary

  • Extend the issue-open fallback to recover a missing type:bug, type:feature, type:docs or type:question only when current API body headings uniquely match a complete current form signature.
  • Preserve every existing label; recover status and type independently. Ignore fenced code, unknown/incomplete/ambiguous structures, issue titles and answer prose.
  • Keep all four forms, minimum permissions, pinned action and existing event scope unchanged; update docs and regression coverage.

📂 Changes

File Change
.github/workflows/issue-status-fallback.yml Conservative required-heading signatures; independent additive status/type recovery from current API metadata
.github/scripts/issue-status-fallback.test.mjs All four forms, namespace independence, current body, ambiguity/incomplete/unknown bodies, code fences, API errors and form-signature drift guard
CONTRIBUTING.md Document recovery rules, exclusions and inherited API race limitation

🧪 Test Plan

  • RED: node --test .github/scripts/issue-status-fallback.test.mjs — worker observed 7 pass / 4 fail, exit 1, before implementation.
  • Focused regression: same command — 11 pass, exit 0; independently repeated and parent spot-checked.
  • Affected suite: node --test .github/scripts/*.test.mjs — 400 pass, exit 0, independently repeated.
  • git diff --check — clean; exactly three authorized paths and clean candidate worktree.
  • Ephemeral differential — worker compared 90 identical-input paths against the previous workflow; existing status behavior/original labels preserved, allowing only requested type additions and associated write failures. Probe is not a committed Git-history-dependent test.
  • Independent verifier PASS — 56 additional mocked probes with fixtures derived from current forms, including optional fields, malicious-looking answer text, ambiguity, fences and line endings.
  • Native risk/readability/reliability review approved for 4b41e1c; exact acknowledgement completed (review-fd4f682b5bed1403).
  • GitHub CI full unit/E2E/lint and applicable checks — pending actual hosted results.

No Go code changes. Local mocked API execution does not prove hosted event delivery/token capability. No live issue mutation was used for these tests; updated issue-open behavior requires default-branch integration. Historical worker RED/differential evidence was reported by the writer, not independently re-created.

✅ Contributor Checklist

  • Linked an approved issue with an actual assignee.
  • Exactly one type label.
  • Recorded focused regression, affected suite and additional verification evidence.
  • Identified missing hosted/CI proof.
  • Contributor docs updated alongside behavior.
  • Conventional commit without Co-Authored-By trailers.
  • All changed paths comply with the Transient Artifact Policy.

💬 Notes for Reviewers

Risk: item 5 — write-capable GitHub Actions workflow; shared existing status fallback also warrants regression protection (item 3).

This is a recovery fallback, not a diagnosis of missing native form labels. A complete heading match is not proof of web-form origin; manually copied form structure intentionally matches too. Existing types/statuses always win. No backfill, edit/unlabeled events, title/prose classifier, AI, priority/effort/approval inference or form changes.

GET and addLabels remain non-atomic: a concurrent maintainer label addition can produce multiple namespace labels. This inherited limitation is documented, not hidden or expanded into broad reconciliation.

Published through the documented fork workflow. No upstream rule changes, bypass or merge.

Summary by CodeRabbit

  • Bug Fixes

    • Improved issue label recovery for newly opened issues.
    • Adds status:needs-review only when no existing status label is present.
    • Infers a type label only when exactly one valid form signature matches the current issue body.
    • Preserves existing labels and avoids classification for incomplete, ambiguous, or fenced content.
  • Documentation

    • Clarified issue status fallback behavior, supported classifications, and cases that remain for manual triage.

@dnlrsls dnlrsls added the type:chore Maintenance/tooling label Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Gentleman-Programming/engram/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d3864afe-0a1f-4bd1-b9ec-b9ea03997574
📥 Commits

Reviewing files that changed from the base of the PR and between e7bac81 and 4b41e1c.

📒 Files selected for processing: 3
  • .github/scripts/issue-status-fallback.test.mjs
  • .github/workflows/issue-status-fallback.yml
  • CONTRIBUTING.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 1 remain after this review.

📝 Walkthrough

The issue-open workflow now adds a missing review-status label and can infer a type label from a uniquely matching current issue-form structure. Tests and contributor documentation cover the rules, boundaries, and limitations.

Changes: Issue label recovery

Layer / File(s) Summary
Additive status and type recovery
.github/workflows/issue-status-fallback.yml
The workflow independently adds status:needs-review when no status label exists and infers a type only when exactly one supported form signature matches. It writes collected labels once and only when additions exist.
Policy tests and documentation
.github/scripts/issue-status-fallback.test.mjs, CONTRIBUTING.md
Tests cover supported forms, ambiguous or incomplete bodies, current-body classification, label preservation, and API errors. The documentation describes the policy and its limits.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature · Severity of issue fixed: Low

Sequence Diagram(s)

sequenceDiagram
  participant IssueOpenedEvent
  participant FallbackWorkflow
  participant GitHubIssueAPI
  IssueOpenedEvent->>FallbackWorkflow: Start issue-label fallback
  FallbackWorkflow->>GitHubIssueAPI: Read current labels and issue body
  GitHubIssueAPI-->>FallbackWorkflow: Return labels and current body
  FallbackWorkflow->>FallbackWorkflow: Collect missing status and unique type labels
  FallbackWorkflow->>GitHubIssueAPI: Add collected labels when present
Loading

Possibly related issues

Suggested reviewers: gentleman-programming

Merge Risk: ⚪ Minimal · up to 4b41e

The change adds missing type labels to newly opened issues when the issue body matches exactly one current form, and it keeps the existing status fallback. No merge-blocking risk was identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: recovering missing issue type labels from form headings.
Linked Issues check Passed Issue #1972 coding requirements are met. The workflow still runs only for issues: opened, keeps issues: write permissions, and uses the existing pinned actions/github-script action. It reads cur…
Out of Scope Changes check Passed The changed paths are limited to the issue fallback workflow, its regression tests, and contributor documentation. Each change supports issue #1972. The diff does not change issue forms, event scope, …
Full details: Linked Issues check

Explanation

Issue #1972 coding requirements are met. The workflow still runs only for issues: opened, keeps issues: write permissions, and uses the existing pinned actions/github-script action. It reads current API labels and body, adds status:needs-review only when no status:* label exists, and independently adds one type label only for a unique complete signature from the four current forms. Existing labels remain in place. Fenced code, incomplete, ambiguous, and unknown structures do not produce a type. The workflow does not classify titles or ordinary answer text. Regression tests cover all four forms, label independence, edge cases, API failures, line endings, and form-signature drift. CONTRIBUTING.md documents the behavior and the inherited non-atomic API limitation.

Full details: Out of Scope Changes check

Explanation

The changed paths are limited to the issue fallback workflow, its regression tests, and contributor documentation. Each change supports issue #1972. The diff does not change issue forms, event scope, permissions, label removal handling, backfills, title or semantic classification, AI inference, or unrelated label namespaces.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dnlrsls
dnlrsls added this pull request to the merge queue Oct 21, 2026
Merged via the queue into Gentleman-Programming:main with commit 2ab47d3 Oct 21, 2026
39 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:chore Maintenance/tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(labels): recover missing issue types from recognized form structure

1 participant