Skip to content

Enrich spec-changes manifest + changelog preview for dashboard#39

Merged
gjtorikian merged 3 commits into
mainfrom
feat/dashboard-spec-analysis
Jun 24, 2026
Merged

Enrich spec-changes manifest + changelog preview for dashboard#39
gjtorikian merged 3 commits into
mainfrom
feat/dashboard-spec-analysis

Conversation

@gjtorikian

Copy link
Copy Markdown
Collaborator

Summary

  • Enrich the spec-changes producer the SDK bot consumes so the redesigned dashboard can surface what actually changed: per-service changedEndpoints (method/path/breaking, resolved from the IR after mount-time attribution) plus the originating commitMessage/prNumber/prUrl on the manifest.
  • Keep the lean buildSpecChanges rollup the bot's pending logic depends on unchanged — enrichment lives only in the CLI path, so existing tests stay green.
  • Add an on-demand changelog-preview.yml workflow + render-changelog-preview.mjs that renders the changelog scoped to a staged service set using the canonical renderChangelogMarkdown logic and POSTs it (HMAC-signed) to the bot for the "Generate staged" preview.
  • Export publicScopeFromService + renderChangelogMarkdown from sdk-release-metadata.mjs and guard the CLI behind a direct-invocation check so they're importable.
  • spec-changes.yml: thread the commit subject + originating PR number through. generate-prs.yml: a changelog_override input writes the operator-edited changelog into the .changelog-pending fragment instead of the computed bullets.

Test plan

  • node --test scripts/__tests__/build-spec-changes.spec.mjs passes (existing rollup unchanged)
  • CLI invocation of build-spec-changes emits changedEndpoints + commit/PR metadata; module import does not run the CLI
  • changelog-preview workflow renders staged-scope changelog and POSTs a valid HMAC signature to the bot
  • generate-prs changelog_override writes the edited changelog into .changelog-pending

🤖 Generated with Claude Code

Extend the spec-changes producer the SDK bot consumes so the redesigned
dashboard can show changed endpoints, the originating commit/PR, and an editable
changelog before generation:

- build-spec-changes.mjs: emit per-service changedEndpoints (method/path/breaking
  resolved from the IR, post-mount attributed) and the manifest's
  commitMessage/prNumber/prUrl. The lean buildSpecChanges rollup the bot's
  pending logic depends on is unchanged — enrichment happens only in the CLI, so
  the existing tests stay green.
- spec-changes.yml: pass the commit subject + originating PR number through.
- changelog-preview.yml + render-changelog-preview.mjs: on-demand workflow that
  renders the changelog scoped to a staged service set with the canonical
  renderChangelogMarkdown logic and POSTs it to the bot (HMAC-signed) for the
  "Generate staged" preview.
- sdk-release-metadata.mjs: export publicScopeFromService + renderChangelogMarkdown
  and guard the CLI behind a direct-invocation check so they're importable.
- generate-prs.yml: changelog_override input writes the operator-edited changelog
  into the .changelog-pending fragment instead of the computed bullets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jun 24, 2026

Copy link
Copy Markdown

Greptile Summary

This PR enriches spec-change metadata and adds a dashboard changelog preview path. The main changes are:

  • Adds per-service changed endpoint details and commit/PR metadata to the spec-changes manifest.
  • Adds an on-demand changelog preview workflow with signed callback delivery to the SDK bot.
  • Exports changelog rendering helpers for reuse by the preview script.
  • Supports operator-edited changelog overrides in generated release-note fragments.
  • Expands staged preview scoping to include service mounts and per-operation mountOn hints.

Confidence Score: 5/5

The changes appear merge-safe based on the reviewed workflow and script updates.

No blocking correctness issues were identified in the changed manifest enrichment, changelog preview, helper exports, or override handling.

T-Rex T-Rex Logs

What T-Rex did

  • Compared manifest enrichment outputs before and after to confirm the post-change CLI includes commit/PR metadata and shows changedEndpoints: [] for UserManagement, with endpoint enrichment skipped due to the endpoint filtering logic.
  • Validated the changelog preview workflow by running the after-state tests; the preview renderer executes, imports succeed, the import produces exports=function,function, the OpenSSL SHA-256 signature matches Node crypto over the exact JSON body, and the fallback canonical scoping includes client and organizations while excluding sso.
  • Verified the changelog override behavior: the before-state writes computed bullets only, and the after-state writes decoded multiline override markdown when provided and reverts to computed bullets when no override is supplied.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. General comment

    P1 CLI endpoint enrichment ignores IR operations that use method

    • Bug
      • The head CLI manifest includes the new metadata fields, but it fails to populate changedEndpoints for a changed operation when the IR operation exposes its HTTP verb as method. The executed head scenario changed UserManagementUsers.deleteUser, remapped to UserManagement, with old/new IR operation { "method": "DELETE", "path": "/user_management/users/{id}" }; the emitted service had changedEndpoints: [] instead of the changed DELETE endpoint.
    • Cause
      • In scripts/build-spec-changes.mjs, buildChangedEndpoints only indexes operations when op.httpMethod && op.path is present and reads op.httpMethod. The requested/representative IR shape and existing fixture convention use operation.method, so opByKey never receives the operation and the CLI enrichment drops the endpoint.
    • Fix
      • Update buildChangedEndpoints to accept the actual IR verb field, e.g. const method = op.httpMethod ?? op.method; if (method && op.path) ..., and add/adjust a CLI-path test fixture that asserts the mounted service receives { method: "DELETE", path: "/user_management/users/{id}", breaking: true, kind: "operation-modified" }.

    T-Rex Ran code and verified through T-Rex

Reviews (4): Last reviewed commit: "fix: include mountOn-remounted scopes in..." | Re-trigger Greptile

Comment thread .github/workflows/changelog-preview.yml
Comment thread scripts/render-changelog-preview.mjs Outdated
Comment thread scripts/build-spec-changes.mjs
Address Greptile review on #39:
- render-changelog-preview.mjs: map staged post-mount service names to changelog
  scopes through mountRules, not publicScopeFromService alone. ClientApi's scope
  is `client` (IR `Client` mounts to `ClientApi`), so a ClientApi-only preview was
  filtering on `client_api` and rendering blank. scopesForStaged is exported and
  unit-tested; changelog-preview.yml now builds dist/policy.mjs for the rules.
- changelog-preview.yml: report baseSha as `git rev-parse "$BASE_REF"` (the ref
  actually rendered) instead of github.sha, so the bot's "spec advanced since
  preview" check compares like-for-like.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread scripts/render-changelog-preview.mjs
scopesForStaged only followed service-level mountRules, so per-operation
mountOn hints (e.g. the audit-log-retention ops live under /organizations
but mount on AuditLogs) were dropped: an AuditLogs-only preview rendered
blank for those staged entries. Expand the scope set with each mountOn
hint whose target is staged, deriving the operation's source scope from
its path head through the same publicScopeFromService the producer uses.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gjtorikian gjtorikian merged commit 27dcc6c into main Jun 24, 2026
6 checks passed
@gjtorikian gjtorikian deleted the feat/dashboard-spec-analysis branch June 24, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant