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

docs: new page about Switching bot identity #30445

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
1 change: 1 addition & 0 deletions docs/usage/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ nav:
- 'Self-hosted': 'self-hosted-configuration.md'
- 'Presets': 'config-presets.md'
- 'Validation': 'config-validation.md'
- 'Switching bot identity': 'switching-bot-identity.md'
- ... | key-concepts
- ... | modules
- Language Support:
Expand Down
52 changes: 52 additions & 0 deletions docs/usage/switching-bot-identity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Switching bot identity

Renovate uses its bot identity to know:

- if a PR is authored by Renovate bot
- if you, or some other bot, pushed commits into the PR branch
- Editor note: list other things Renovate uses the bot id for here
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is used to propose updates 😉

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean that Renovate uses its bot identity as identifier to the Git-hosting platform (GitHub, for example) to create a update PR?


## Reasons to switch bot identity

Common reasons to switch bot identity are:

- Migrating from Mend-hosted to self-hosted
HonkingGoose marked this conversation as resolved.
Show resolved Hide resolved
- Renaming the bot (self-hosted)
- Editor note: Maybe there are other reasons too, please comment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be extended later, never had this requirement yet 🙃


### Migrating from Mend-hosted to self-hosted

Most users start with the Mend-hosted bot, and are happy with this.
After a while, some users want to switch to self-hosting, for more control.

When you migrate you must tell your new self-hosted Renovate bot to take over from the old Mend-hosted bot.

### Renaming the bot (self-hosted)

Maybe you started self-hosting Renovate, and called your bot `@old-bot-name`.
But the name no longer fits, so you want to use `@new-bot-name`.

Follow these steps:

1. Start of ordered list with steps
1. Second step
1. Third step, and so on
Comment on lines +31 to +33
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you don't need to do much on a simple account rename. 🤔 maybe check if username is set and replace it with new name 🤷‍♂️

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Start of ordered list with steps
1. Second step
1. Third step, and so on
1. Confirm the _new_ bot user name is set on your Git-hosting platform
1. Replace the old bot username with the _new_ bot username


### Other situations

Editor note: Please comment about other cases where you need to switch bot identity.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♂️

Comment on lines +35 to +37
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Other situations
Editor note: Please comment about other cases where you need to switch bot identity.

If there are no more situations where a user may want/need to switch the Renovate bot ID, we can drop the whole section with this suggestion. 😉


## How to switch bot identity

Looks like the steps are:

1. Put old bot name in the `gitIgnoredAuthors` config option
1. Set `ignorePrAuthor` to `true`
1. Let the "new" bot take over from the "old bot"

## Questions from the editor

- Is the `gitAuthor` field the bot identity?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it's used as git author only

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Is the `gitAuthor` field the bot identity?

- What's `gitIgnoredAuthors` for? It looks like you can ignore commits from the old bot with it?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only for detecting changed PR

- We also have `ignorePrAuthor` which if set to `true` fetches the _whole_ list of PRs, instead of just fetching Renovate PRs. The docs say this is the one to use to ignore old bot names. But the description of `ignorePrAuthor` only mentions the full list fetching, nothing about the name/id of the bot.
- It's easy to confuse `gitIgnoredAuthors` and `ignorePrAuthor` they have similar names, but do different things.
Comment on lines +51 to +52
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default renovate only fetches it's own PR's. so to find the others identity PRs, you need to enable ignore PR author. ignore git author's is used to detect user changes, so add the old git author to the list