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

Functionality to cleanup forks after a campaign is complete #6

Open
rnorth opened this issue Apr 7, 2021 · 2 comments
Open

Functionality to cleanup forks after a campaign is complete #6

rnorth opened this issue Apr 7, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@rnorth
Copy link
Collaborator

rnorth commented Apr 7, 2021

As-is, turbolift users will end up with large numbers of forks in their personal org. This is annoying, and cleaning these up is a chore.

We should have a turbolift cleanup feature to delete a user's forks.

We should discuss safety aspects, e.g. should we avoid deleting forks if:

  • the user's PR is still open for this campaign
  • the user has other PRs open from their fork to upstream
  • ... other reasons?

Some combination of warnings/prompts may help.

@rnorth rnorth added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Apr 7, 2021
@janeklb
Copy link

janeklb commented Jul 14, 2021

In the meantime, you can use turbolift foreach in combination with the gh cli tool:
(replace $USER if necessary)
(your github token will need to have delete_repo permissions checked)

turbolift foreach 'gh api -X DELETE repos/$USER/$(basename $(pwd))'

(of course be careful with this in case you have your own repos that you were turbolifting... )

@rnorth
Copy link
Collaborator Author

rnorth commented Jun 8, 2023

@sledigabel's suggestion: add a label to the forked repo indicating that the fork was created for turbolift, and add a new label for each campaign that uses a given fork. Use this to add a safety guard to turbolift cleanup so that we don't accidentally delete forks that are still in use for other purposes.

Another suggestion (in parallel)?

turbolift cleanup list dumps a list of repos that could be cleaned up to a file
User hand-edits the file - potentially an interactive $EDITOR session?
turbolift cleanup apply actually does the deletion

@rnorth rnorth removed the good first issue Good for newcomers label Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants