Skip to content

forge: Add ChecksByChange and ChecksNone for per-change checks output#1263

Open
ed-irl wants to merge 1 commit into
ed-irl/restack-options-paramfrom
ed-irl/checks-schema
Open

forge: Add ChecksByChange and ChecksNone for per-change checks output#1263
ed-irl wants to merge 1 commit into
ed-irl/restack-options-paramfrom
ed-irl/checks-schema

Conversation

@ed-irl

@ed-irl ed-irl commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Lays the schema foundation for emitting per-change CI/build checks
in the gs ll JSON output. The actual rollup mappings + runs[] data
for each forge land in follow-up branches on this stack.

Adds:

  • forge.ChecksNone, a new ChecksState value for 'no checks
    configured/reported' (distinct from ChecksPassed). The card
    indicator hides on none; pending/failed surface visually.
  • encoding.TextMarshaler/Unmarshaler on ChecksState so the state
    serializes as 'pending'|'passed'|'failed'|'none' in JSON.
  • forge.ChangeChecks{Rollup, Runs, URL}: rollup drives the card,
    Runs preserves forge-native state strings for fine-grained
    surfaces (e.g. a future diff-view preamble), URL is the
    forge's per-change checks page.
  • forge.CheckRun{Name, State, URL}: per-check detail. State stays
    a string (forge-native vocabulary) so the upstream API doesn't
    have to enumerate every forge's taxonomy.
  • Repository.ChecksByChange(ids), a batch method mirroring
    CommentCountsByChange.

Each forge's ChecksByChange is stubbed to return a slice of nils
(equivalent to 'no data' under the contract) so the schema commit
builds standalone; real implementations land per-forge in the
follow-ups.

Adds a display-oriented checks layer on top of upstream's per-check
ChangeChecks/ChangeCheckState API:

  - forge.ChecksReport{Rollup, Runs, URL}: a per-change rollup plus
    per-run detail and a checks summary URL.
  - forge.ChecksRollupState (pending/passed/failed/none), with a
    distinct 'none' for no checks configured/reported, and
    TextMarshaler/Unmarshaler so it serializes as a string.
  - forge.CheckRun{Name, State, URL}: per-run detail whose State
    stays a forge-native string so the API need not enumerate every
    forge's vocabulary.
  - Repository.ChecksByChange(ids), a batch method mirroring
    CommentCountsByChange.

Each forge stubs ChecksByChange (one nil per id) so the schema lands
standalone; real implementations follow per-forge.
@ed-irl ed-irl force-pushed the ed-irl/checks-schema branch from cb608dc to f473f97 Compare June 24, 2026 01:34
@ed-irl ed-irl changed the base branch from main to ed-irl/restack-options-param June 24, 2026 01:34
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.

1 participant