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

Create notification for existing forks #14

Open
zkamvar opened this issue Jan 23, 2023 · 0 comments
Open

Create notification for existing forks #14

zkamvar opened this issue Jan 23, 2023 · 0 comments

Comments

@zkamvar
Copy link
Contributor

zkamvar commented Jan 23, 2023

When a lesson transitions, forks will no longer be in synch and must be deleted.

Not everyone who has a fork is aware that the lesson transition will happen and it would prevent a lot of chaos if we made them aware of this (note: might be a bit too late for the lessons that are in the beta phase, but there's not much we can do about this now)

There are a few problems to this, however:

  1. not all forks have issues, so we would need to open pull requests to alert the repository owners or use a different means
  2. not everyone who has a fork will remember that they have a fork
  3. some forks are used as a modified version of the lesson and transitioning would break the lesson history.

1 and 2 have good technical solutions (i.e. pull requests will notify the owners well enough and the owners in situation 2 might actually be happy for the reminder). Number 3 is more rare, but definitely a feature of the community.

Process

We can use the GitHub API with @carpentries-bot to deliver the messages. We will do the following:

  1. for each repository in our official lessons, we run GET /repos/{carpentries_org}/{lesson}/pulls to extract all the pull requests
  2. for each pull request, we check the values of has_issues or has_discussions and the decide the next steps from there

Forks with issues

  1. use POST /repos/{carpentries_org}/{lesson}/issues to create an issue linking them to documentation.

Forks without issues

For forks without issues, we need to create a pull request, and to create a pull request, we need to create a fork, but the problem is, you can't have more than one fork at a time, thus, we will need to take a different approach.

I'm not sure if this would work, but it is worth a shot: Instead of creating a separate fork for each fork, create a repository owned by @carpentries-bot (called workbench-transition-helper) and then use the strategy for updating the styles repository:

  1. add the fork as a unique remote in workbench-transition-helper
  2. fetch the default branch into a new ref called ({owner}-{repo})
  3. push that ref up to workbench-transition-helper
  4. use POST /repos/{carpentries_org}/{lesson}/pulls with head = carpentries-bot:{owner}-{repo} to create the pull request.

If this is done with enough time ahead of time, then we can circumvent some chaos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant