Skip to content

Conversation

@Zokormazo
Copy link
Contributor

Changes

Add --repository option for renovate-config-validator to simulate Renovate's repository configuration merging during validation. When specified, the validator applies the same config merging logic as runtime, using matching entries from the global repositories array.

Context

This addresses a specific validation issue with matchBaseBranches rules when global configuration provides branch context. In some self-hosted setups, the global config contains a repositories array where each entry can specify baseBranches or baseBranchPatterns for that repository. When a repository config uses matchBaseBranches in its packageRules, the validator needs access to this global branch context to properly validate the rule. Without the --repository option, the validator only sees the repository config in isolation and incorrectly reports that baseBranchPatterns must be configured. With this option, the validator replicates Renovate's runtime behavior by merging the appropriate global repository entry with the repository config, providing the necessary branch context for validation.

Please select one of the following:

  • This closes an existing Issue, Closes: #
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

This PR used Claude Code to assist identifying the runtime behaviour of renovate and the key function we could reuse on the validator to achieve the same merging logic

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests, but ran on a real repository, or
  • Both unit tests + ran on a real repository
  • Tested with multiple config.js and renovate.json variants wih and without repositories block

Add --repository option to simulate Renovate's repository configuration
merging during validation. When specified, the validator applies the
same config merging logic as runtime, using matching entries from the
global repositories array.

Signed-off-by: Julen Landa Alustiza <jlanda@redhat.com>
@jamietanna jamietanna self-requested a review January 28, 2026 09:15
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