Skip to content

Conversation

@bjhham
Copy link
Contributor

@bjhham bjhham commented Sep 16, 2025

This should map patches to release and others to main.

@bjhham bjhham requested a review from osipxd September 16, 2025 09:06
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 16, 2025

Walkthrough

Adds top-level baseBranchPatterns to renovate.json with main and a regex for release/*; splits the previous non-major automerge rule into two rules (patch for main, minor/major for release/*) and scopes the test/infrastructure automerge rule to the release regex.

Changes

Cohort / File(s) Summary
Renovate configuration
renovate.json
- Added top-level baseBranchPatterns: ["main", "/^release\\/.*/"].
- Replaced the previous combined non-major automerge packageRule with two rules:
- description: "Ignore patch updates for main branch", matchUpdateTypes: ["patch"], matchBaseBranches: ["main"], enabled: false.
- description: "Ignore major/minor for release branches", matchUpdateTypes: ["minor","major"], matchBaseBranches: ["release/*"], enabled: false.
- Updated "Automerge test and infrastructure dependencies" packageRule to include matchBaseBranches: ["/^release\\/.*/"].

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description does not adhere to the repository’s template and is missing the Subsystem, Motivation, and Solution sections, providing only a single-line note without context or detail. It fails to describe the affected components, the problem being solved, and how the changes implement the solution. Please expand the description using the provided template by adding a Subsystem field, a Motivation section that explains the problem with any related ticket or bug reference, and a Solution section detailing how the renovate.json changes achieve the desired branch mapping.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Direct renovate to the appropriate branches” succinctly summarizes the primary change of updating Renovate’s branch routing behavior and clearly refers to the tool and its intended effect. It is concise, specific, and directly related to the core modification in the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bjhham/renovate-base-branches

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
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

🧹 Nitpick comments (3)
renovate.json (3)

70-74: Automerge patch to release looks good; disable patch on main to avoid duplicate PRs

As written, patches will still open on main (not automerged). If you want patches exclusively on release, add a rule to disable patch updates on main.

     {
       "description": "Patch updates go to release branch",
       "matchUpdateTypes": ["patch"],
       "matchBaseBranches": ["release"],
       "automerge": true
     },
+    {
+      "description": "Disable patch updates on main",
+      "matchUpdateTypes": ["patch"],
+      "matchBaseBranches": ["main"],
+      "enabled": false
+    },

75-79: Minor-on-main is fine; consider disabling minor/major on release to match the PR goal

To fully achieve “others to main,” explicitly disable minor and major updates on release. Otherwise Renovate will still raise those on release (not automerged).

     {
       "description": "Minor updates go to main branch",
       "matchUpdateTypes": ["minor"],
       "matchBaseBranches": ["main"],
       "automerge": true
     },
+    {
+      "description": "Disable minor updates on release",
+      "matchUpdateTypes": ["minor"],
+      "matchBaseBranches": ["release"],
+      "enabled": false
+    },
+    {
+      "description": "Disable major updates on release",
+      "matchUpdateTypes": ["major"],
+      "matchBaseBranches": ["release"],
+      "enabled": false
+    },

9-9: Renovate baseBranches verified — both 'main' and 'release' exist on origin

git ls-remote returned refs/heads/main and refs/heads/release, so Renovate will open PRs against both branches; if your intent is "patches only to release, others to main" add rules to disable the opposite branch-target combos.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9650f18 and 79ff26f.

📒 Files selected for processing (1)
  • renovate.json (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{json,yml,yaml}

📄 CodeRabbit inference engine (CLAUDE.md)

Indent JSON and YAML with 2 spaces

Files:

  • renovate.json

Copy link
Member

@osipxd osipxd left a comment

Choose a reason for hiding this comment

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

How will we sync patch updates between these two branches? Merge release into main every week?

renovate.json Outdated
},
{
"description": "Minor updates go to main branch",
"matchUpdateTypes": ["minor"],
Copy link
Member

Choose a reason for hiding this comment

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

And major?

@bjhham bjhham force-pushed the bjhham/renovate-base-branches branch from 79ff26f to 6ecb416 Compare September 17, 2025 09:45
Copy link
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: 2

♻️ Duplicate comments (2)
renovate.json (2)

94-94: Scope infra/test automerge to both main and release branches

This now applies only to release branches, regressing prior behavior that included main. If that narrowing wasn’t intended, include both branches (and fix the pattern).

Apply this diff:

-      "matchBaseBranches": ["release/*"],
+      "matchBaseBranches": ["main", "/^release\\/.*/"],

75-79: Avoid duplicate patch PRs to main (add an explicit disable rule)

With both main and release/* as base branches, patch updates will still be proposed to main unless explicitly disabled. Add a rule to turn off patch PRs to main, keeping patches confined to release branches as intended.

Proposed addition (insert near these rules):

+    {
+      "description": "Don't create PRs to main branch for patch updates",
+      "matchUpdateTypes": ["patch"],
+      "matchBaseBranches": ["main"],
+      "enabled": false
+    },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 79ff26f and 6ecb416.

📒 Files selected for processing (1)
  • renovate.json (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{json,yml,yaml}

📄 CodeRabbit inference engine (CLAUDE.md)

Indent JSON and YAML with 2 spaces

Files:

  • renovate.json

@bjhham bjhham force-pushed the bjhham/renovate-base-branches branch from 2e8f2e7 to f8542d1 Compare September 17, 2025 10:43
Comment on lines 75 to 80
{
"description": "Minor/major updates go to main branch",
"matchUpdateTypes": ["minor", "major"],
"matchBaseBranches": ["main"],
"automerge": true
},
Copy link
Member

Choose a reason for hiding this comment

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

I think this rule should also be converted to something with enabled: false. If I understand it correctly, match* properties just match dependencies and then we can change their options. This rule probably just enables automerge for minor and major versions targeted to main

@bjhham bjhham force-pushed the bjhham/renovate-base-branches branch from f8542d1 to 00c9b46 Compare September 17, 2025 18:34
Copy link
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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ecb416 and 00c9b46.

📒 Files selected for processing (1)
  • renovate.json (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{json,yml,yaml}

📄 CodeRabbit inference engine (CLAUDE.md)

Indent JSON and YAML with 2 spaces

Files:

  • renovate.json
🔇 Additional comments (3)
renovate.json (3)

9-9: Correct use of baseBranchPatterns (regex for release/*) — LGTM

Regex is valid here and will pick up all release/* branches as intended. Note: enabling release branches means all existing rules now apply to them unless scoped. Consider scoping the EAP automerge rule (Lines 13–27) to main only if you don’t want EAPs on release branches.

Reference: baseBranchPatterns supports exact and regex; matchBaseBranches supports regex within packageRules. (docs.renovatebot.com)

Example scope for the EAP rule (apply inside that rule):

"matchBaseBranches": ["main"]

70-74: Patches disabled on main — aligns with goal

This cleanly routes patch updates away from main.


94-94: Rule now applies only to release/ — confirm intent*

If you also want these test/infra deps to automerge on main, include it explicitly.

Optional tweak:

-      "matchBaseBranches": ["/^release\\/.*/"],
+      "matchBaseBranches": ["main", "/^release\\/.*/"],

renovate.json Outdated
Comment on lines 75 to 79
{
"description": "Minor/major updates go to main branch",
"matchUpdateTypes": ["minor", "major"],
"matchBaseBranches": ["main"],
"automerge": true
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Avoid automerging major updates; also block minor/major on release branches

Automerge of majors on main is high‑risk. Recommend: automerge only minor on main; keep majors manual. Also explicitly disable minor/major on release/* to ensure “others → main” is enforced.

Apply within this rule:

-      "description": "Minor/major updates go to main branch",
-      "matchUpdateTypes": ["minor", "major"],
+      "description": "Minor updates go to main branch (automerge)",
+      "matchUpdateTypes": ["minor"],

Add these additional rules nearby:

{
  "description": "Major updates go to main branch (no automerge)",
  "matchUpdateTypes": ["major"],
  "matchBaseBranches": ["main"],
  "automerge": false
},
{
  "description": "Disable minor/major updates on release branches",
  "matchUpdateTypes": ["minor", "major"],
  "matchBaseBranches": ["/^release\\/.*/"],
  "enabled": false
}
🤖 Prompt for AI Agents
In renovate.json around lines 75-79 the rule currently automerges both minor and
major updates to main; change it to only matchUpdateTypes ["minor"] with
automerge true, then add two new rules nearby: one matching ["major"] on
["main"] with automerge false, and another matching ["minor","major"] on base
branch pattern /^release\/.*/ with "enabled": false to disable those updates on
release branches.

@bjhham
Copy link
Contributor Author

bjhham commented Sep 19, 2025

How will we sync patch updates between these two branches? Merge release into main every week?

Yes, every week or two. We could automate creating a PR or even doing the merge.

I was also thinking we could include a tag for PRs into main that will automatically cherry-pick to release for any bug fixes that are targeted to main, wdyt?

@bjhham bjhham force-pushed the bjhham/renovate-base-branches branch from 2221945 to 826401e Compare September 19, 2025 12:16
@bjhham bjhham force-pushed the bjhham/renovate-base-branches branch from 826401e to ec4a2e7 Compare October 3, 2025 10:49
Copy link
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: 0

♻️ Duplicate comments (1)
renovate.json (1)

76-80: Fix branch matcher: use regex for release/*

"release/*" isn’t valid for matchBaseBranches; use a regex so the rule actually applies.

Apply:

-      "matchBaseBranches": ["release/*"],
+      "matchBaseBranches": ["/^release\\/.*/"],
🧹 Nitpick comments (1)
renovate.json (1)

94-94: Scope check: infra/test automerge now only on release branches

Adding matchBaseBranches limits automerge to release/*; main no longer matches. If that’s intended, ignore. If you want both, include main.

Optional diff:

-      "matchBaseBranches": ["/^release\\/.*/"],
+      "matchBaseBranches": ["main", "/^release\\/.*/"],
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 826401e and ec4a2e7.

📒 Files selected for processing (1)
  • renovate.json (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{json,yml,yaml}

📄 CodeRabbit inference engine (CLAUDE.md)

Indent JSON and YAML with 2 spaces

Files:

  • renovate.json
🔇 Additional comments (2)
renovate.json (2)

70-74: LGTM: disables patch updates on main as intended

Matches the “patches → release” goal. Renovate won’t create patch PRs to main.


9-9: No changes needed: baseBranchPatterns is supported
Renovate accepts exact names and regexes in baseBranchPatterns, so the current config is correct.

Likely an incorrect or invalid review comment.

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.

3 participants