Skip to content

feat(ci): auto-update sticky coverage tracker on every schema sync#61

Open
strausmann wants to merge 1 commit into
mainfrom
feat/ci-coverage-tracker-sticky
Open

feat(ci): auto-update sticky coverage tracker on every schema sync#61
strausmann wants to merge 1 commit into
mainfrom
feat/ci-coverage-tracker-sticky

Conversation

@strausmann
Copy link
Copy Markdown
Owner

Summary

Extend api-schema-sync.yml with a new step that auto-updates a single sticky tracking issue (label coverage-tracker, currently #60) after every validator run. The step rewrites only the content between <!-- validator-report:start --> and <!-- validator-report:end --> markers in the issue body — manual notes around the markers are preserved.

Why

The validator already produces validation-report.md listing every endpoint without an MCP tool, but those gaps exit 0 (informational). The existing Create issue on validation failure step only fires for hard schema mismatches (ORPHANED_TOOL / PARAM_MISMATCH / MISSING_ENCODE), so long-standing coverage gaps stayed buried inside the workflow artifact. After this change, the gap count and per-endpoint list are visible on the issue tracker and refreshed daily.

How

  • Single new Update sticky coverage tracker step, placed between Validate MCP tools against schema and the existing Create issue on validation failure.
  • Independent from validator exit code (if: always() && hashFiles('validation-report.md') != '').
  • Looks up issues by coverage-tracker label, expects exactly one open match.
  • Replaces marker block via single regex pass; idempotent if nothing changed.

Safety properties

Condition Behaviour
No issue with coverage-tracker label core.warning, no failure
Multiple matching issues core.warning, no update (prevents clobbering)
Issue body missing markers core.warning, no update (preserves any manual layout)
Report unchanged since last run No API call (body comparison short-circuits)

Test plan

Refs

Refs #60

Adds a new "Update sticky coverage tracker" step to the
`api-schema-sync.yml` workflow. After the validator runs, it locates a
single open issue labelled `coverage-tracker` and rewrites the content
between the `<!-- validator-report:start -->` and
`<!-- validator-report:end -->` markers with the latest
`validation-report.md`. Manual context above/below the markers
(priority categorisation, decisions, follow-up checklists) is
preserved.

Why this is needed:
- The validator already reports MISSING_TOOL endpoints, but exits 0
  for them (informational only). The existing "Create issue on
  validation failure" step therefore never fires for coverage gaps,
  only for ORPHANED_TOOL / PARAM_MISMATCH / MISSING_ENCODE — so
  long-standing coverage gaps stayed invisible outside the workflow
  artifact.
- A single sticky issue gives the gap a stable, addressable home
  while keeping the existing per-incident issue flow intact for hard
  schema mismatches.

Safety properties:
- No issue → warning, no failure.
- Multiple matching issues → warning, no update (prevents
  clobbering).
- Missing markers → warning, no update (manual issue layout
  preserved).
- Idempotent: identical body produces no API call.

Refs #60
Copilot AI review requested due to automatic review settings May 16, 2026 08:27
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an automated “sticky” coverage tracking update to the api-schema-sync workflow so the validator’s informational validation-report.md is surfaced directly in a single labeled GitHub issue, refreshed on each run, while preserving manual notes outside the marker block.

Changes:

  • Adds a new actions/github-script step to find the single open issue labeled coverage-tracker and replace only the content between <!-- validator-report:start --> / <!-- validator-report:end -->.
  • Stamps the report with the run date and a link back to the workflow run, and skips the update when the computed body is unchanged.

Comment on lines +71 to +82

if (issues.data.length === 0) {
core.warning('No open issue with label "coverage-tracker" found — skipping sticky update.');
return;
}
if (issues.data.length > 1) {
const nums = issues.data.map(i => `#${i.number}`).join(', ');
core.warning(`Multiple issues carry label "coverage-tracker" (${nums}). Skipping update to avoid clobbering.`);
return;
}

const issue = issues.data[0];
Comment on lines +100 to +103
if (newBody === body) {
core.info(`Issue #${issue.number} already up to date — no change.`);
return;
}
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