Skip to content

Auto-merge OpenAPI description update PRs - #6993

Draft
shawnHartsell wants to merge 7 commits into
mainfrom
auto-merge-openapi-updates
Draft

Auto-merge OpenAPI description update PRs#6993
shawnHartsell wants to merge 7 commits into
mainfrom
auto-merge-openapi-updates

Conversation

@shawnHartsell

@shawnHartsell shawnHartsell commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What

Adds .github/workflows/auto-merge-openapi-updates.yml to continuously process machine-generated OpenAPI description updates. It keeps the newest 3.0 and 3.1 update PRs moving while preserving lint, compatibility, and release-note safeguards.

How it works

Runs every two hours, with workflow_dispatch available for a dry run:

  1. Selects the newest open github-openapi-bot PR for each OpenAPI version.
  2. Requires both OpenAPI lint checks to pass.
  3. Holds when a PR introduces a new ghes-* description version that is not yet on the default branch, or when an open merge-freeze issue exists.
  4. Performs a semantic compatibility scan covering operation, parameter, request-body, response, schema, and enum changes.
  5. Posts a concise change summary to the PR before merging.
  6. Merges the newest updates with a blobless checkout and closes older superseded update PRs.

The workflow writes a step summary when it holds or fails so the exception is visible in the Actions run without requiring any external service integration.

Design notes

These generated PRs are too large for reliable use of the merge API, so the workflow uses a blobless checkout and a normal Git merge. The checkout avoids downloading the repository's full history and fetches content lazily as needed.

The workflow uses only the repository's standard GITHUB_TOKEN.

The compatibility scanner parses both descriptions instead of relying on removed diff lines. This matters because adding a required request field is breaking, while removing a response guarantee is breaking in the opposite direction.

Validation

  • Workflow YAML parses and all shell blocks pass syntax validation.
  • The selector and required-check gate were exercised against live update PRs.
  • The semantic scanner returned zero findings for a real update diff and detected each supported breaking-change category in targeted mutation tests.

Rollout

Run workflow_dispatch with dry_run: true after enabling the workflow to confirm candidate selection before allowing merges.

Note

Left as a draft for review.

@shawnHartsell
shawnHartsell marked this pull request as ready for review August 14, 2026 15:45
Copilot AI balanced review requested due to automatic review settings August 14, 2026 15:45

Copilot AI 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.

Pull request overview

Adds automation to merge current bot-generated OpenAPI updates and close superseded PRs.

Changes:

  • Selects and validates the latest OpenAPI 3.0/3.1 PRs.
  • Scans for potential breaking changes before merging.
  • Pushes merges, closes older PRs, and sends failure alerts.
Show a summary per file
File Description
.github/workflows/auto-merge-openapi-updates.yml Implements the scheduled auto-merge workflow.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 1/1 changed files
  • Comments generated: 7
  • Review effort level: Balanced

Comment on lines +99 to +103
code=$(curl --silent --output /dev/null --write-out '%{http_code}' \
--max-time 20 \
-u "${CHATTERBOX_TOKEN}:" \
"${CHATTERBOX_URL%/}/topics/%23api-platform" \
--data ':white_check_mark: OpenAPI auto-merge preflight: chatterbox route is alive.' \
Comment on lines +169 to +173
superseded=$(jq -r \
--argjson keep30 "${pr_30:-0}" \
--argjson keep31 "${pr_31:-0}" \
'[.[].number | select(. != $keep30 and . != $keep31)] | join(" ")' \
<<<"$open_prs")
# Removed top-level path key, e.g. ` "/repos/{owner}/{repo}":`
paths=$(count '^- "/')
# Removed enum member, e.g. ` - archived`
enums=$(count '^-[[:space:]]+- [A-Za-z0-9_.-]+$')
[ -n "$ref" ] || continue

git fetch --no-tags --filter=blob:none origin "$ref":"refs/remotes/origin/$ref"
diff=$(git diff "$base...origin/$ref" -- "$file" || true)
for pair in "$PR_30:$REF_30" "$PR_31:$REF_31"; do
pr="${pair%%:*}"; ref="${pair#*:}"
[ -n "$pr" ] && [ -n "$ref" ] || continue
git fetch --no-tags origin "$ref":"refs/remotes/origin/$ref" --filter=blob:none
Comment on lines +328 to +330
if: >-
steps.preflight.outcome == 'success' &&
(failure() || steps.breaking.outputs.status == 'breaking')
Comment on lines +25 to +27
permissions:
contents: write
pull-requests: write
@shawnHartsell
shawnHartsell marked this pull request as draft August 14, 2026 16:40
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