Skip to content

ROX-34007: Auto-merge MintMaker updates#19944

Open
tommartensen wants to merge 4 commits intomasterfrom
tm/ROX-34007-auto-merge-mintmaker
Open

ROX-34007: Auto-merge MintMaker updates#19944
tommartensen wants to merge 4 commits intomasterfrom
tm/ROX-34007-auto-merge-mintmaker

Conversation

@tommartensen
Copy link
Copy Markdown
Contributor

@tommartensen tommartensen commented Apr 10, 2026

Description

Companion for stackrox/actions#91

TODO before merge:

  • merge companion and update the actions digest

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

See companion.

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 10, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The DRY_RUN environment variable is set in both jobs but never used; consider removing it or wiring it into the action if it's meant to affect behavior to avoid confusion.
  • The workflow now uses stackrox/actions/automerge@tm/ROX-34007-automerge-configurability instead of a pinned commit SHA; consider pinning to a specific revision (as before) to keep the workflow deterministic and auditable.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `DRY_RUN` environment variable is set in both jobs but never used; consider removing it or wiring it into the action if it's meant to affect behavior to avoid confusion.
- The workflow now uses `stackrox/actions/automerge@tm/ROX-34007-automerge-configurability` instead of a pinned commit SHA; consider pinning to a specific revision (as before) to keep the workflow deterministic and auditable.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@tommartensen
Copy link
Copy Markdown
Contributor Author

The DRY_RUN environment variable is set in both jobs but never used; consider removing it or wiring it into the action if it's meant to affect behavior to avoid confusion.

Addressed.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.56%. Comparing base (0f13ca6) to head (220e41b).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19944   +/-   ##
=======================================
  Coverage   49.56%   49.56%           
=======================================
  Files        2764     2764           
  Lines      208357   208357           
=======================================
  Hits       103269   103269           
  Misses      97436    97436           
  Partials     7652     7652           
Flag Coverage Δ
go-unit-tests 49.56% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

🚀 Build Images Ready

Images are ready for commit 220e41b. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.11.x-626-g220e41b021

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Added dry-run mode for automated merge operations
    • Separated handling of dependency updates and build automation PRs with distinct merge policies
    • Automated labeling for build automation tool-generated pull requests

Walkthrough

Adds a boolean dry-run input to workflow_dispatch, updates the workflow run-name to reflect dry-run status, removes the workflow-level permissions block, splits one auto-merge job into two jobs (auto-merge-dependabot, auto-merge-mintmaker) that run only when github.repository_owner == 'stackrox', and adds a Renovate config label mintmaker.

Changes

Cohort / File(s) Summary
Workflow Auto-Merge Configuration
​.github/workflows/auto-merge.yml
Added on.workflow_dispatch.inputs.dry-run (boolean) and a dynamic run-name using github.event.inputs.dry-run. Removed workflow-level permissions. Replaced previous auto-merge job with two jobs: auto-merge-dependabot and auto-merge-mintmaker, both conditioned on github.repository_owner == 'stackrox', calling stackrox/actions/automerge@tm/ROX-34007-automerge-configurability, and passing dry-run and secrets.RHACS_BOT_GITHUB_TOKEN. auto-merge-mintmaker adds gating parameters: allowed-base-branches: 'master', labels: 'konflux-build', required-checks: '^(?!.*conforma)Red Hat Konflux', and allowed-authors: 'app/red-hat-konflux'.
Renovate / MintMaker Labeling
​.github/renovate.json5
Added top-level labels: ["mintmaker"] so Renovate/MintMaker-created PRs receive the mintmaker label.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description follows the template structure but has incomplete content: the main Description section contains only a reference to a companion PR with a TODO checklist; validation details are deferred to the companion. Provide a detailed explanation of the changes (what was modified and why) directly in this PR's Description section, rather than deferring to the companion PR.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'ROX-34007: Auto-merge MintMaker updates' clearly and specifically describes the main change: configuring auto-merge functionality for MintMaker-created pull requests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tm/ROX-34007-auto-merge-mintmaker

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/auto-merge.yml:
- Line 32: The workflow currently references the mutable ref
"stackrox/actions/automerge@tm/ROX-34007-automerge-configurability"; replace
that branch ref with the corresponding immutable commit SHA (e.g.,
"stackrox/actions/automerge@<commit-sha>") to pin the action, and update all
occurrences of that ref in the workflow (the two uses of
stackrox/actions/automerge) so both are locked to the same commit SHA.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 25b3bd90-0fdb-4885-940e-369548c36b10

📥 Commits

Reviewing files that changed from the base of the PR and between 0f13ca6 and 20fa651.

📒 Files selected for processing (1)
  • .github/workflows/auto-merge.yml

- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- name: Run auto-merge action
uses: stackrox/actions/automerge@tm/ROX-34007-automerge-configurability
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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

ref='tm/ROX-34007-automerge-configurability'
repo='stackrox/actions'

echo "Resolved SHA for $repo@$ref:"
gh api "repos/$repo/commits/$ref" --jq '.sha'

echo "Current automerge references in workflow:"
rg -n 'stackrox/actions/automerge@' .github/workflows/auto-merge.yml

Repository: stackrox/stackrox

Length of output: 295


🏁 Script executed:

cat -n .github/workflows/auto-merge.yml | head -50

Repository: stackrox/stackrox

Length of output: 1882


🏁 Script executed:

rg -n 'stackrox/actions/automerge@' .github/workflows/auto-merge.yml

Repository: stackrox/stackrox

Length of output: 226


Pin stackrox/actions/automerge to an immutable commit SHA.

Lines 32 and 43 use the mutable branch ref tm/ROX-34007-automerge-configurability, which is a supply-chain and reproducibility risk. Branch refs can be force-pushed, causing workflows to unexpectedly execute different code without updates to the workflow file itself. These should be pinned to specific commit SHAs.

🧰 Tools
🪛 GitHub Check: style-check

[failure] 32-32: Ratchet - Unpinned Reference
.github/workflows/auto-merge.yml:32:15: The reference stackrox/actions/automerge@tm/ROX-34007-automerge-configurability is unpinned. Either pin the reference to a SHA or mark the line with ratchet:exclude.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/auto-merge.yml at line 32, The workflow currently
references the mutable ref
"stackrox/actions/automerge@tm/ROX-34007-automerge-configurability"; replace
that branch ref with the corresponding immutable commit SHA (e.g.,
"stackrox/actions/automerge@<commit-sha>") to pin the action, and update all
occurrences of that ref in the workflow (the two uses of
stackrox/actions/automerge) so both are locked to the same commit SHA.

@tommartensen tommartensen requested review from a team and msugakov April 10, 2026 13:29
@tommartensen tommartensen marked this pull request as ready for review April 10, 2026 13:29
@tommartensen tommartensen requested a review from a team as a code owner April 10, 2026 13:29
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The workflow now references stackrox/actions/automerge@tm/ROX-34007-automerge-configurability; before merging, consider pinning this to a specific commit SHA (as was done previously) rather than a branch for reproducibility and supply-chain safety.
  • The two jobs (auto-merge-dependabot and auto-merge-mintmaker) share most of their configuration; consider using a strategy matrix or a reusable workflow to reduce duplication and make future changes to the auto-merge logic easier to keep consistent.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The workflow now references `stackrox/actions/automerge@tm/ROX-34007-automerge-configurability`; before merging, consider pinning this to a specific commit SHA (as was done previously) rather than a branch for reproducibility and supply-chain safety.
- The two jobs (`auto-merge-dependabot` and `auto-merge-mintmaker`) share most of their configuration; consider using a strategy matrix or a reusable workflow to reduce duplication and make future changes to the auto-merge logic easier to keep consistent.

## Individual Comments

### Comment 1
<location path=".github/workflows/auto-merge.yml" line_range="18-21" />
<code_context>
   group: auto-merge
   cancel-in-progress: false

+run-name: >-
+  ${{
+    format('auto-merge {0}',
+      fromJSON('[" (dry-run)", ""]')[github.event.inputs.dry-run != 'true']
+    )
+  }}
</code_context>
<issue_to_address>
**issue:** Array indexing with a boolean expression in `run-name` may not be reliable in GitHub Expressions.

Here the index `github.event.inputs.dry-run != 'true'` is a boolean. GitHub expressions expect a numeric or string index, so relying on implicit bool → index coercion is brittle and may break with engine changes. Prefer explicitly mapping to 0/1 (e.g. `... [condition && 0 || 1]`) or replace the array with a more direct conditional expression to select the suffix.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +18 to +21
run-name: >-
${{
format('auto-merge {0}',
fromJSON('[" (dry-run)", ""]')[github.event.inputs.dry-run != 'true']
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.

issue: Array indexing with a boolean expression in run-name may not be reliable in GitHub Expressions.

Here the index github.event.inputs.dry-run != 'true' is a boolean. GitHub expressions expect a numeric or string index, so relying on implicit bool → index coercion is brittle and may break with engine changes. Prefer explicitly mapping to 0/1 (e.g. ... [condition && 0 || 1]) or replace the array with a more direct conditional expression to select the suffix.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
.github/workflows/auto-merge.yml (1)

32-32: ⚠️ Potential issue | 🟠 Major

Pin stackrox/actions/automerge to an immutable SHA.

Both jobs still reference the action via the mutable branch tm/ROX-34007-automerge-configurability. That keeps the workflow non-reproducible and leaves the Ratchet failure unresolved. Please pin both occurrences to the same commit SHA instead.

#!/bin/bash
set -euo pipefail

echo "Current automerge references in the workflow:"
rg -n 'stackrox/actions/automerge@' .github/workflows/auto-merge.yml

echo
echo "Resolved commit for stackrox/actions@tm/ROX-34007-automerge-configurability:"
gh api repos/stackrox/actions/commits/tm/ROX-34007-automerge-configurability --jq '.sha'

echo
echo "Expected: both workflow lines use the same 40-character SHA."

Also applies to: 43-43

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/auto-merge.yml at line 32, Replace the mutable branch
reference "uses:
stackrox/actions/automerge@tm/ROX-34007-automerge-configurability" with a fixed
40-character commit SHA for both occurrences in the workflow (the two lines
currently using that branch); obtain the correct SHA by querying the repo branch
commit (e.g., gh api
repos/stackrox/actions/commits/tm/ROX-34007-automerge-configurability --jq
'.sha') and update both "uses: stackrox/actions/automerge@..." entries to use
the same immutable SHA string so the workflow is reproducible and Ratchet will
pass.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/auto-merge.yml:
- Line 32: Replace the mutable branch reference "uses:
stackrox/actions/automerge@tm/ROX-34007-automerge-configurability" with a fixed
40-character commit SHA for both occurrences in the workflow (the two lines
currently using that branch); obtain the correct SHA by querying the repo branch
commit (e.g., gh api
repos/stackrox/actions/commits/tm/ROX-34007-automerge-configurability --jq
'.sha') and update both "uses: stackrox/actions/automerge@..." entries to use
the same immutable SHA string so the workflow is reproducible and Ratchet will
pass.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 3df7c0ad-699d-473c-9c52-3acf1f8431cc

📥 Commits

Reviewing files that changed from the base of the PR and between 20fa651 and 220e41b.

📒 Files selected for processing (2)
  • .github/renovate.json5
  • .github/workflows/auto-merge.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/renovate.json5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant