Skip to content

fix: auto-merge Splunk version bump PR as patch release#223

Open
mkolasinski-splunk wants to merge 3 commits into
mainfrom
feat/addon-89092-auto-merge-splunk-version
Open

fix: auto-merge Splunk version bump PR as patch release#223
mkolasinski-splunk wants to merge 3 commits into
mainfrom
feat/addon-89092-auto-merge-splunk-version

Conversation

@mkolasinski-splunk

Copy link
Copy Markdown
Contributor

Summary

ADDON-89092: the weekly update_deps.yml splunk job already opens a "fix: bump Splunk version" PR but leaves it for a human to merge. This adds an auto-merge step that squash-merges that PR (a fix: commit → patch release via semantic-release), or cleanly no-ops when there is no new Splunk version that week.

Why no branch-protection change

The splunk job runs as GH_TOKEN_ADMIN (identity srv-rr-github-token), which is already listed in this branch's bypass_pull_request_allowances, and the branch has no required status checks. Verified live on 2026-07-17 that this identity can merge without review; the probe artifacts were fully cleaned up afterward. No branch-protection or ruleset change is required.

Scope

  • Only the splunk job in update_deps.yml is touched; the sc4s job is unchanged.
  • Uses the existing GH_TOKEN_ADMIN secret; no new secrets.
  • Merge via the REST merge API (merge_method=squash), with a short retry loop to absorb the just-created-PR mergeable-state race. delete_branch_on_merge: true handles branch cleanup.

JIRA: https://splunk.atlassian.net/browse/ADDON-89092

@mkolasinski-splunk
mkolasinski-splunk requested a review from a team as a code owner July 18, 2026 06:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 160b0ca51c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/update_deps.yml Outdated
--base main \
--state open \
--json number \
--jq '.[0].number')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Return empty when no PR is found

In the no-new-version path, gh pr list returns an empty JSON array; the gh manual says --jq uses jq query syntax, and this filter evaluates to the literal null for [] rather than an empty string. That makes [ -z "$PR_NUMBER" ] false, so the workflow calls /pulls/null/merge and fails after retries instead of no-oping. Use .[0].number // empty or iterate .[] here so an empty list produces an empty value.

Useful? React with 👍 / 👎.

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.

Fixed in 6614e0e — using .[0].number // empty so an empty PR list yields an empty value instead of the literal string null, letting the no-op path ([ -z "$PR_NUMBER" ]) actually trigger.

@mkolasinski-splunk

Copy link
Copy Markdown
Contributor Author

gh pr list --jq '.[0].number' on an empty result returns the literal
string "null", not empty, so [ -z "$PR_NUMBER" ] was false and the
workflow called /pulls/null/merge and failed after retries instead of
exiting cleanly.

Co-Authored-By: Claude <noreply@anthropic.com>
@mkolasinski-splunk

Copy link
Copy Markdown
Contributor Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 6614e0e9ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…o-merge (ADDON-89092)

CI on this repo is minimal and update_deps has been stable; the
PR-then-poll-and-merge round trip added latency and a merge-retry loop
for no real safety benefit. GH_TOKEN_ADMIN is already the one identity
branch protection exempts from the required PR review, so pushing the
signed commit straight to main is equivalent in practice and simpler.

Co-Authored-By: Claude <noreply@anthropic.com>
@mkolasinski-splunk

Copy link
Copy Markdown
Contributor Author

Redesigned in fc04388: pushing the version-bump commit directly to main instead of open-PR-then-poll-and-merge. CI here is minimal/stable and GH_TOKEN_ADMIN is already the identity branch protection exempts from required PR review, so the PR+auto-merge round trip wasn't adding real safety — just latency and a merge-retry loop. Simpler and equivalent in practice.

@mkolasinski-splunk mkolasinski-splunk changed the title feat: auto-merge Splunk version bump PR as patch release fix: auto-merge Splunk version bump PR as patch release Jul 20, 2026
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