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(github): forkOrgs, forkCreate #18770

Merged
merged 17 commits into from Jun 19, 2023
Merged

feat(github): forkOrgs, forkCreate #18770

merged 17 commits into from Jun 19, 2023

Conversation

rarkins
Copy link
Collaborator

@rarkins rarkins commented Nov 4, 2022

Changes

Adds new options forkOrgs and forkCreate

Context

These features will be used by me in the Forking Renovate app a part of some necessary migrations.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

commit a4832b2
Author: Rhys Arkins <rhys@arkins.net>
Date:   Fri Nov 4 14:50:22 2022 +0100

    feat(github): forkOrgs, forkCreate
# Conflicts:
#	lib/modules/platform/github/index.spec.ts
#	lib/modules/platform/github/index.ts
@rarkins
Copy link
Collaborator Author

rarkins commented Nov 4, 2022

My goals are to:

  • migrate the forking renovate app from using github.com/renovate-bot for all its forks and instead to an open source org (forkOrgs=[new, existing])
  • use dual app tokens for both original and forked repos instead of a PAT, and therefore skip actual forking within the Renovate logic itself (forkCreate=false)

@viceice
Copy link
Member

viceice commented Nov 4, 2022

sounds good

@viceice
Copy link
Member

viceice commented Nov 4, 2022

btw: if you fork to an org, the original repo maintainer can no longer update renovate branches in the fork by default. you would need to add them with write access to the fork to get it working.

Base automatically changed from feat/refactor-fork-mode to main November 5, 2022 07:25
# Conflicts:
#	lib/modules/platform/github/index.spec.ts
#	lib/modules/platform/github/index.ts
@rarkins rarkins marked this pull request as ready for review November 6, 2022 07:05
@rarkins
Copy link
Collaborator Author

rarkins commented Nov 6, 2022

btw: if you fork to an org, the original repo maintainer can no longer update renovate branches in the fork by default. you would need to add them with write access to the fork to get it working.

The challenge is:

  • I need to use app tokens instead of PAT
  • App token with permissions to create a PR in the parent repo wouldn't have permissions to enable "maintainers can modify" in the forked repo anyway

I'll still have a PAT on the backend (for doing the forking out of band) so maybe I could add a scheduled background process which detects maintainer in the parent repo and invites them to the forked repos. They may need to accept that invite though (which isn't necessary for maintainers can modify).

https://github.com/orgs/community/discussions/5634

@rarkins rarkins enabled auto-merge (squash) November 6, 2022 07:44
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

otherwise LGTM

docs/usage/self-hosted-configuration.md Outdated Show resolved Hide resolved
docs/usage/self-hosted-configuration.md Outdated Show resolved Hide resolved
docs/usage/self-hosted-configuration.md Outdated Show resolved Hide resolved
lib/config/options/index.ts Outdated Show resolved Hide resolved
lib/config/options/index.ts Outdated Show resolved Hide resolved
rarkins and others added 4 commits November 7, 2022 09:38
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
auto-merge was automatically disabled February 10, 2023 18:03

Merge queue setting changed

@rarkins rarkins marked this pull request as draft March 4, 2023 11:06
# Conflicts:
#	lib/modules/platform/github/index.ts
@viceice
Copy link
Member

viceice commented Jun 18, 2023

@zharinov can we detect a comment to force a test run? so we don't need to move out of draft mode?

@rarkins rarkins marked this pull request as ready for review June 18, 2023 19:02
@zharinov
Copy link
Collaborator

I don't think there is an easy way to do it. Seems like you either have permissions to re-run jobs, or you're not.

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

just a docs question, otherwise LGTM

docs/usage/self-hosted-configuration.md Show resolved Hide resolved
@JamieMagee JamieMagee added this pull request to the merge queue Jun 19, 2023
Merged via the queue into main with commit 2f77695 Jun 19, 2023
36 checks passed
@JamieMagee JamieMagee deleted the feat/fork-orgs-create branch June 19, 2023 03:40
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 35.132.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

rarkins added a commit that referenced this pull request Jun 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants