Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: migrate users old config to new config with a Renovatebot PR #8235

Closed
HonkingGoose opened this issue Jan 10, 2021 · 5 comments
Closed
Labels
duplicate This issue is closed as a duplicate of another issue priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@HonkingGoose
Copy link
Collaborator

HonkingGoose commented Jan 10, 2021

Introduction

I saw that a user had a problem with masterIssue not passing the Renovate validation properly.
Well of course it does not pass the validation, because it was the wrong term, they should have used masterIssueApproval... 😄

But then I wondered, how do we handle masterIssueApproval?

So I set up a reproduction repo to test what the bot does now.
You can find my repo here: https://github.com/HonkingGoose/validate-masterIssueApproval-migration

What would you like Renovate to be able to do?

To the best of my knowledge, the bot silently migrates the "bad config" to a "good config" behind the scenes.

I was thinking it would be nice if the Renovate bot opens a PR to migrate old terms to new terms.
Something like: "migrate masterIssueApproval to dependencyDashboardApproval".
This way the user is always using current and supported terms in their config.

Relevant snippet of log

The bot already knows that some config migration is necessary.
It also seems to silently migrate/massage the config into the right shape.

{
  "renovateVersion": "24.12.4"
}
DEBUG: Found .github/renovate.json5 config file
DEBUG: Repository config
{
  "fileName": ".github/renovate.json5",
  "config": {
    "extends": [
      "config:base"
    ],
    "masterIssueApproval": true
  }
}
DEBUG: migrateAndValidate()
DEBUG: Config migration necessary
{
  "oldConfig": {
    "extends": [
      "github>whitesource/merge-confidence:beta",
      "config:base"
    ],
    "masterIssueApproval": true
  },
  "newConfig": {
    "extends": [
      "github>whitesource/merge-confidence:beta",
      "config:base"
    ],
    "dependencyDashboardApproval": true
  }
}
DEBUG: massaged config
{
  "config": {
    "extends": [
      "github>whitesource/merge-confidence:beta",
      "config:base"
    ],
    "dependencyDashboardApproval": true
  }
}
DEBUG: migrated config
{
  "config": {
    "extends": [
      "github>whitesource/merge-confidence:beta",
      "config:base"
    ],
    "dependencyDashboardApproval": true
  }
}

Did you already have any implementation ideas?

Maybe we can use the migrated config from the DEBUG log in some way?

@HonkingGoose HonkingGoose added priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:feature Feature (new functionality) labels Jan 10, 2021
@rarkins rarkins added priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:ready and removed priority-4-low Low priority, unlikely to be done unless it becomes important to more people labels Jan 12, 2021
@rarkins
Copy link
Collaborator

rarkins commented Jan 12, 2021

I thought we had an existing issue for this but can't find it. It should be the migrated config we use.

@HonkingGoose
Copy link
Collaborator Author

HonkingGoose commented Jan 12, 2021

Turns out none of these issues are related... 😄


@rarkins are you thinking of this one? #7572

Issue #1647 seems like it might be related as well.

@rarkins
Copy link
Collaborator

rarkins commented Jan 12, 2021

No, neither of them are the same

@HonkingGoose
Copy link
Collaborator Author

I thought we had an existing issue for this but can't find it.

@rarkins I think I found the earlier issue: #1502

Do you want me to mark my newer issue (#8235) as a duplicate of the earlier one?

@rarkins
Copy link
Collaborator

rarkins commented May 10, 2021

Duplicate of #1502

@rarkins rarkins marked this as a duplicate of #1502 May 10, 2021
@rarkins rarkins closed this as completed May 10, 2021
@rarkins rarkins added the duplicate This issue is closed as a duplicate of another issue label May 10, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue is closed as a duplicate of another issue priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

2 participants