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

Forking mode: support multiple baseBranches #28700

Open
rarkins opened this issue Apr 27, 2024 · 2 comments
Open

Forking mode: support multiple baseBranches #28700

rarkins opened this issue Apr 27, 2024 · 2 comments
Labels
platform:github GitHub Platform priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Apr 27, 2024

Describe the proposed change(s).

Today, forking mode only supports the default branch as base branch, and baseBranches does not work.

This is because:

  • Each base branch needs to be force updated to match the upstream repo's SHA
  • Such updating is done during initRepo using GitHub's API:
    // This is a lovely "hack" by GitHub that lets us force update our fork's default branch
    // with the base commit from the parent repository
    const url = `repos/${config.repository}/git/refs/heads/${config.defaultBranch}`;
    const sha = repo.defaultBranchRef.target.oid;
    try {
    logger.debug(
    `Updating forked repository default sha ${sha} to match upstream`,
    );
    await githubApi.patchJson(url, {
    body: {
    sha,
    force: true,
    },
    token: coerceString(forkToken, opts.token),
    });
  • During initRepo, Renovate doesn't know what baseBranches there will be

This base branch sync'ing logic should be switched to the git layer, which would also be one less reason stopping support for forking mode in alternative platforms too.

@rarkins rarkins added type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others platform:github GitHub Platform labels Apr 27, 2024
@rarkins
Copy link
Collaborator Author

rarkins commented Apr 27, 2024

Previous attempt: #13808

@HonkingGoose
Copy link
Collaborator

When you add support for multiple baseBranches you should also update the docs.

Currently the Renovate docs, Forking Renovate app drawbacks section says:

Drawbacks

If you use Forking Renovate, you'll miss out on these features of the regular Renovate app:

  • Automerge
  • The baseBranches config option

The baseBranches config options docs mention Forking Renovate in a note admonition:

Do not use the baseBranches config option when you've set a forkToken. You may need a forkToken when you're using the Forking Renovate app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:github GitHub Platform 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