Skip to content

feat: initial implementation of github-actions-annotations-reporter - #2

Merged
ylabonte merged 7 commits into
developfrom
claude/resolve-pr-issues-KjYLr
May 15, 2026
Merged

ylabonte merged 7 commits into
developfrom
claude/resolve-pr-issues-KjYLr

Conversation

@ylabonte

Copy link
Copy Markdown
Owner

A TypeScript/Node CLI (ghaar) and composite GitHub Action that scans
GitHub Actions workflow run annotations across the latest run per
workflow, files dedup-aware GitHub Issues, and auto-closes them when
the underlying annotation vanishes.

Core domain

  • Stable sha256 fingerprint over (workflowPath, annotationPath,
    normalized message); line numbers excluded so refactors don't spawn
    duplicates.
  • Severity-aware (notice / warning / error) with --min-severity
    filter and matching severity/<level> labels.
  • History-aware suppression: closed prior issues are honored when any
    of three signals match — configured label (default wontfix),
    state_reason: not_planned, or a regex against the closing comment.
  • Auto-close with safety guards: requires both a configurable miss
    counter AND age window, and (by default) the source workflow's
    latest run to have succeeded. Reopens automatically if the
    annotation returns.

CLI / Action surfaces

  • ghaar scan / report / list commands with shared options.
  • --list-annotations prints fielded blocks per annotation and adds
    a full annotations[] array to the JSON report.
  • Phase-based spinner progress on stderr (auto-disabled in non-TTY /
    --json modes; force off with --no-progress).
  • Composite action.yml with a hardened bash dispatcher (version
    allowlist, env-var staging, args array, mktemp report path).

Scaffolding

  • Strict TypeScript, ESLint + Prettier, Vitest with ≥90/85/90/90
    coverage thresholds; 137 tests passing.
  • VitePress docs site (guide / recipes / reference) with auto-
    generated CLI reference via `pnpm docs:gen-cli`.
  • Changeset-driven release pipeline targeting npm trusted publishing,
    GitHub App auth, and a floating `v` tag.
  • CI workflow, action self-test, weekly self-check, GitHub Pages
    deploy workflow.
  • CONTRIBUTING.md, SECURITY.md, full CLAUDE.md project memory.

claude added 7 commits May 15, 2026 20:05
The 4 KiB per-field cap is measured with `text.length`, which counts
UTF-16 code units. Renaming `MAX_RENDERED_FIELD_BYTES → CHARS` and the
truncation marker's "more bytes → more characters" makes the units match
the measurement. JSON output is still uncapped.

Also fix the ANSI-strip regex in the test helper: the previous pattern
matched `\[[0-9;]*m` without the leading ESC byte (the file had a literal
0x1B that survived only because `toContain` doesn't compare exactly).
Switch to `�\[[0-9;]*m` so the helper survives an exact-match
assertion later.
`release.yml`, `self-check.yml`, `deploy-docs.yml`, and
`action-selftest.yml` already pin `actions/checkout`,
`actions/setup-node`, and `pnpm/action-setup` at `@v6`; only `ci.yml`
was on `@v4`. Aligning the majors cuts Dependabot noise and removes a
silent inconsistency.
The comment justified clearing GH_TOKEN as well, but only
GITHUB_REPOSITORY was stubbed. Stub all three so the "no repo" branch
is exercised regardless of the host shell's auth env.
`state.issues.at(-1)?.number + 1` assumed appended-in-order numbering.
Tests that seed issues with hand-picked, out-of-order numbers (e.g.
`{number: 6}` then `{number: 5}`) could silently collide on `create`.
Switch to `Math.max(0, ...state.issues.map(i => i.number)) + 1`.
`IssueState` is re-exported by `src/index.ts` and nothing imports it
from this module. Drop the dangling re-export and stale comment.
`String(workflowLatestRun.conclusion)` rendered a null conclusion as the
literal text `"null"` inside quotes, which was misleading. Match the
listing renderer's convention and substitute `(no conclusion)` instead.
`Number.parseInt('abc', 10)` returns `NaN`, which slipped through the
`typeof n === 'number'` check in `shared.ts` and only surfaced much
later as a generic zod "Expected number, received nan" — far from the
flag that produced it. Throwing `InvalidArgumentError` in the coercer
gives users a precise, locally-attributed error against the offending
flag.

Applies to `--max-issues`, `--auto-close-after-days`, and
`--auto-close-after-misses`.
@ylabonte
ylabonte changed the base branch from main to develop May 15, 2026 20:07
@ylabonte
ylabonte merged commit 78243c4 into develop May 15, 2026
8 checks passed
@ylabonte
ylabonte deleted the claude/resolve-pr-issues-KjYLr branch May 15, 2026 20:08
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