Skip to content

Merge repositories when in config.js and CLI arguments #41551

@jamietanna

Description

@jamietanna

When a config.js specifies a repositories array (for instance to override configuration on a per-repository basis), but we specify the repository/repositories to run against on the CLI, the repositories array is overridden.

For instance:

module.exports = {
  "repositoryCache": "enabled",
  "repositories": [
    {
      "repository": "JamieTanna-Mend-testing/elastic-poetry-2-cortado",
      "repositoryCache": "disabled",
    }
  ],
}

Then, when we run:

env LOG_LEVEL=debug node ~/workspaces/renovate/lib/renovate.ts --token $(gh auth token) --dry-run=extract JamieTanna-Mend-testing/elastic-poetry-2-cortado

We can see:

DEBUG: File config
       "config": {
         "repositoryCache": "enabled",
         "repositories": [
           {
             "repository": "JamieTanna-Mend-testing/elastic-poetry-2-cortado",
             "repositoryCache": "disabled"
           }
         ]
       }
DEBUG: Additional file config
       "config": {}
DEBUG: CLI config
       "config": {
         "repositories": ["JamieTanna-Mend-testing/elastic-poetry-2-cortado"],
         "dryRun": "extract",
         "token": "***********"
       }
DEBUG: Env config
       "config": {
         "hostRules": [
           {"hostType": "github", "matchHost": "github.com", "token": "***********"}
         ],
         "repositoryCache": "enabled",
         "cacheDir": "/tmp/renovate-cache-final"
       }
DEBUG: Resolved global extends
       "config": undefined
DEBUG: Combined config
       "config": {
         "repositoryCache": "enabled",
         "repositories": ["JamieTanna-Mend-testing/elastic-poetry-2-cortado"],
         "hostRules": [
           {"hostType": "github", "matchHost": "github.com", "token": "***********"}
         ],
         "cacheDir": "/tmp/renovate-cache-final",
         "dryRun": "extract",
         "token": "***********"
       }

We should merge these.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    mend:customer-requestIssues requested on behalf of a Mend customerpriority-2-highBugs impacting wide number of users or very important features

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions