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

feat(dashboard): on demand config migration #31129

Merged
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f5db234
init
RahulGautamSingh Aug 21, 2024
6cadf70
add checkbox code
RahulGautamSingh Aug 23, 2024
e7c182f
update dashboard text
RahulGautamSingh Aug 28, 2024
aca2d94
refactor
RahulGautamSingh Aug 28, 2024
cc9c35c
add tests
RahulGautamSingh Aug 29, 2024
5325b73
more tests
RahulGautamSingh Aug 30, 2024
a1bbfb9
cleanup
RahulGautamSingh Aug 30, 2024
e6aba4b
fix closed pr logic
RahulGautamSingh Aug 31, 2024
575216f
fix failing tests
RahulGautamSingh Aug 31, 2024
2616fc6
update docs
RahulGautamSingh Sep 3, 2024
c82eab0
update docs
RahulGautamSingh Sep 3, 2024
6a6b658
Apply suggestions from code review
RahulGautamSingh Sep 5, 2024
713684c
update docs
RahulGautamSingh Sep 5, 2024
21e75ff
apply suggestions
RahulGautamSingh Sep 5, 2024
3d49fd1
end with full-stop
RahulGautamSingh Sep 5, 2024
6d400d9
fix lint issues
RahulGautamSingh Sep 5, 2024
f2d2787
Apply suggestions from code review
RahulGautamSingh Sep 9, 2024
1cbeaff
Merge branch 'main' into feat/on-demand-config-migration
rarkins Sep 10, 2024
ba213f3
Update config-migration.md
rarkins Sep 10, 2024
1300605
Apply suggestions from code review
RahulGautamSingh Sep 17, 2024
ce1cf42
Merge branch 'main' into feat/on-demand-config-migration
RahulGautamSingh Sep 17, 2024
09b19d5
apply suggestions and refactor logic
RahulGautamSingh Sep 17, 2024
dfdf99d
add message for modified migration branch
RahulGautamSingh Sep 18, 2024
315a9fd
refactor: tidyting up
RahulGautamSingh Sep 20, 2024
2ffb2f5
Apply suggestions from code review
RahulGautamSingh Sep 23, 2024
edb48c3
apply suggestions
RahulGautamSingh Sep 23, 2024
f0e56c4
docs: apply suggestions
RahulGautamSingh Sep 23, 2024
8af5234
Update docs/usage/config-migration.md
RahulGautamSingh Sep 25, 2024
084513f
apply suggestions
RahulGautamSingh Sep 30, 2024
9cf67ca
Apply suggestions from code review
rarkins Oct 9, 2024
d2b3427
Apply suggestions from code review
RahulGautamSingh Oct 9, 2024
836a7a8
Merge branch 'main' into feat/on-demand-config-migration
rarkins Oct 11, 2024
7ac39a3
Update lib/workers/repository/config-migration/index.ts
rarkins Oct 11, 2024
a4cedd8
Merge branch 'main' into feat/on-demand-config-migration
RahulGautamSingh Oct 15, 2024
6ebbfe9
use comment as anchor
RahulGautamSingh Oct 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions docs/usage/config-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Config Migration

Renovate maintainers often need to rename, remove or combine configuration options to improve the user experience and mature the product.
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved

When they do so, "config migration" code is added at the same time so that any "legacy" config from users continues to work.
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved
Config migration works by migrating legacy config internally before the config is used.
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved
If done right, it "just works" silently and legacy configs continue working indefinitely.
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved
The only sign when this is necessary is a debug message in logs noting the old and newly migrated configs.
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved

By default, none of these changes are applied to Renovate config files (e.g. `renovate.json`)
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved
rarkins marked this conversation as resolved.
Show resolved Hide resolved

## Enabling config migration pull requests

Although legacy config should continue to "just work", it's better for users if their config file uses the latest/correct configuration names.
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved
Using the latest names makes it easier to understand the config and look up documentation for it.
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved

Renovate can create a config migration pull request, that migrates legacy config in your configuration file.
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved
To get config migration pull requests from Renovate: set the [`configMigration`](./configuration-options.md#configmigration) config option to `true`.
rarkins marked this conversation as resolved.
Show resolved Hide resolved

Config migration PRs are disabled by default.
But we _strongly_ recommend you enable config migration PRs, because:
rarkins marked this conversation as resolved.
Show resolved Hide resolved

- the config migration PR "tells" you something changed
- up-to-date terms help you search the Renovate documentation
- up-to-date terms help you, and us, debug problems quicker

## Config migration scenarios

The scenarios for config migration are:

- No config migration needed
- Config migration needed, and enabled
- Config migration needed, but disabled
- Config migration needed, but there is a previously closed migration PR

### No config migration needed

Renovate takes no action.

### Config migration needed, and enabled

Renovate will:

1. Create a Config Migration PR
1. If the Dependency Dashboard issue is enabled then Renovate puts a link to the Config Migration PR on the dashboard
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved

### Config migration needed, but disabled

If config migration is needed, but disabled then Renovate adds a checkbox to the Dependency Dashboard if one exists.
rarkins marked this conversation as resolved.
Show resolved Hide resolved
This is known as "on-demand" config migration because migration PRs are only created at the request of the user by ticking the checkbox.
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved

The checkbox looks like this:

```
- [ ] Select this checkbox to let Renovate create an automated Config Migration PR.
```

When you select the checkbox:

Renovate creates a config migration PR.
Renovate replaces the checkbox with a link to the Config Migration PR.
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved

For example:

```
See Config Migration PR: #1.
```

### Config migration needed, but there is a closed migration PR

In this case, it does not matter if Config Migration is enabled, or not.
Renovate will:

- Add a checkbox to the Dependency Dashboard issue (if enabled)
- When you select the checkbox on the dashboard, Renovate will:
1. Delete the _old_ config migration branch
1. Create a _new_ config migration PR
rarkins marked this conversation as resolved.
Show resolved Hide resolved
1. Replace the checkbox with a link to the _new_ PR in the Dependency Dashboard issue
6 changes: 1 addition & 5 deletions docs/usage/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -578,11 +578,7 @@ After we changed the [`baseBranches`](#basebranches) feature, the Renovate confi
When downgrading JSON5 to JSON Renovate may also remove the JSON5 comments.
This can happen because Renovate wrongly converts JSON5 to JSON, thus removing the comments.

<!-- prettier-ignore -->
!!! note
When you close a config migration PR, Renovate ignores it forever.
This also means that Renovate won't create a config migration PR in future.
If you closed the PR by accident, find the closed PR and re-name the PR title to get a new PR.
For more details, read the [config migration documentation](./config-migration.md).

## configWarningReuseIssue

Expand Down
Loading