Skip to content

fix(presets): migrate extends before calling resolveConfigPresets #39898

@jamietanna

Description

@jamietanna

Describe the proposed change(s).

As noted in #39659, if a repo's extends need a migration, for instance if it's a string, resolveConfigPresets errors in an unexpected way:

DEBUG: Repository config
{
  "fileName": "renovate.json",
  "config": {
    "extends": "config:recommended"
  }
}

DEBUG: migrateAndValidate()
DEBUG: No config migration necessary
WARN: Using npm packages for Renovate presets is now deprecated. Please migrate to repository-based presets instead.
{
  "registryUrl": "https://registry.npmjs.org",
  "pkg": "renovate-config-c"
}

We should - at a minimum - make sure that the extends key is migrated before we start to map it, as that then iterates over the array.

Reproduction: https://github.com/piotar/renovate-reproductions-39659

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority-3-mediumDefault priority, "should be done" but isn't prioritised ahead of others

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions