Skip to content

Automate spec drift response: open regen PR instead of issue - #55

Open
natestemen wants to merge 4 commits into
mainfrom
automate-spec-drift-pr
Open

Automate spec drift response: open regen PR instead of issue#55
natestemen wants to merge 4 commits into
mainfrom
automate-spec-drift-pr

Conversation

@natestemen

@natestemen natestemen commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the spec-drift issue workflow with one that automatically fetches the new spec, regenerates the client, and opens a PR
  • The generated PR targets spec-drift/auto-regen branch, requests review from ionq/developer-tools, and carries the spec diff in a collapsible section
  • If a drift PR is already open, subsequent weekly runs update its body rather than opening a duplicate

Test plan

  • Confirm ionq/developer-tools is the correct team slug for review requests
  • Trigger via workflow_dispatch once merged to verify the happy path (no drift → no PR; drift → PR opened)
  • Verify the spec-drift label exists in the repo (needed for --label spec-drift to succeed)

🤖 Generated with Claude Code

When upstream OpenAPI spec diverges, fetch the new spec, regenerate the
client, and open a PR assigned to ionq/developer-tools rather than
filing an issue for someone to do manually.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@natestemen
natestemen requested a review from a team as a code owner June 2, 2026 04:53
@natestemen natestemen added the spec-drift Upstream OpenAPI spec has changed label Jun 2, 2026
@antalszava
antalszava self-requested a review August 13, 2026 10:25
antalszava
antalszava previously approved these changes Aug 18, 2026

@antalszava antalszava left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me! 👍

Comment on lines -18 to -19
with:
persist-credentials: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The way things were set up meant that CI would not run when the PR got created. I fixed that by making the github actions runnable by dispatch, and in doing so this change got dropped.

Comment thread .github/workflows/spec-drift.yml Outdated
Pushes and PRs made with GITHUB_TOKEN never fire pull_request events, so
the regen PRs from the spec-drift workflow would sit unmergeable: main's
ruleset requires the CI, staleness, and CodeQL checks. Rather than
introduce a GitHub App or PAT, dispatch the required workflows directly
on the regen branch — workflow_dispatch is exempt from GitHub's event
suppression for GITHUB_TOKEN.

- Restore persist-credentials: false on checkout (fixes the zizmor
  artipacked finding failing the Audit workflows check)
- Replace the hand-rolled git push + gh pr bash with
  peter-evans/create-pull-request, authenticated by plain GITHUB_TOKEN
- Add workflow_dispatch triggers to ci.yml and generated.yml so
  spec-drift.yml can kick them off on the regen branch
- Drop the explicit team-reviewers request (GITHUB_TOKEN cannot request
  team reviews); CODEOWNERS already assigns ionq/developer-tools

CodeQL uses GitHub's default setup and cannot be dispatched; verify it
reports on the first regen PR.

Assisted-By: Claude Fable 5 <noreply@anthropic.com>
GitHub Actions already runs unspecified run: steps with bash -e, and
none of these steps contains a pipe or unset-variable hazard, so the
explicit flags added nothing.

Assisted-By: Claude Fable 5 <noreply@anthropic.com>
@natestemen
natestemen requested review from antalszava and splch August 24, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spec-drift Upstream OpenAPI spec has changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants