Skip to content

Add a "cleanup Renovate" setting #41426

@jamietanna

Description

@jamietanna

There are times when you "offboard" / "uninstall" Renovate from a repository.

A couple of cases:

  • Renovate's access (i.e. GitHub App, GitLab PAT) is removed
  • The repository had accidentally been onboarded (and may have been activated), but no longer wants to use Renovate
  • The repository had started onboarding, but the onboarding PR was closed due to age (onboardingAutoCloseAge)

In these cases, there may be a number of artifacts that are left behind by Renovate, which it does not / cannot remove:

  • issues raised by Renovate
  • PRs/MRs raised by Renovate
  • branches created by Renovate

To handle this in the past, I've hand-crafted a script with the gh CLI and gone through to perform some of this cleanup.

Due to the nature of Renovate's configurability, there might be repo-specific configuration that was used that may mean these are named in a non-standard way, or that aren't as straightforward to detect.

To handle this, we should instead add a global self-hosted configuration option, which will:

  • be a self-hosted configuration option
  • be environment-variable (or config-file) only (not cli: true)
  • be marked as experimental
  • run the repo in a new mode (maybe called uninstall)
    • find and close issues raised by Renovate
      • adding a note for why
    • find and close PRs/MRs raised by Renovate
      • adding a note for why
    • find and delete branches created by Renovate
    • default to the authenticated user, but also provide a means to look up a different user
  • exit with a non-zero status code
    • to prevent it running multiple times, and to indicate it's not expected to be used often

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions