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

Update New Project Playbook #61

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 60 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,61 @@ Django Commons packages.

## New Project Playbook

Goal: Publish a new release of the project from django-commons repo to PyPI and Test PyPI, using the release workflow.

Assuming the repository name is `repo-name`:

```terraform
"your-repo-here" = {
description = "Your project's description here"
allow_merge_commit = true # Allow merge commits on pull requests
allow_rebase_merge = true # Allow rebase and merge commits on pull requests
allow_squash_merge = true # Allow squash and merge commits on pull requests - Recommended
allow_update_branch = true # Allow updating source branch on pull requests
has_discussions = false # Enable discussions in project's repository
has_wiki = false # Enable wiki in project's repository
admins = [
# Include people who can release new versions
"your-username-here",
]
committers = [
# Include people who can commit to main / merge changes
]
members = [
# Include people who can assign/triage tickets
]
}
```

### Pre Transfer Steps
cunla marked this conversation as resolved.
Show resolved Hide resolved

- [ ] Check if the repository meets [inbound requirements][3].
cunla marked this conversation as resolved.
Show resolved Hide resolved
- [ ] A PR to add the [release workflow][release-gh-workflow] will be necessary. This can be done either by the repo
owner OR the Django commons org admins, but should be done prior to the video call. The decision is up to the repo
owner.
**The PR should NOT be merged before the video call.**
- [ ] Confirm who will be the admins and maintainers for the repository
Copy link
Member

Choose a reason for hiding this comment

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

Extra thoughts from my notes

  • Consider removing any admins that are no longer active
  • Make sure the current contributors with some form of write access are members of Django Commons. Alternatively, they can apply for membership later and be added to the repository again.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removing admins/collaborators manually no longer needed, it will be done as part of the terraform import process - see this PR: django-commons/membership#98

- [ ] Make sure the there are no teams `{repo-name}`, `{repo-name}-admins` and `{repo-name}-committers` in the Django
Commons organization. Teams can be viewed [here][teams]. The teams will be created by the terraform apply process.
cunla marked this conversation as resolved.
Show resolved Hide resolved
- [ ] (project owner) PyPI project owner must add the Django Commons PyPI Admins (`cunla`, `stormheg`) as owners in [PyPI][pypi],
and [test-pypi][test-pypi]
- [ ] Review with project-owner the newly created teams roles, as documented in [the membership repository][team-roles].
- [ ] [Add repository owner to Django Commons as member](#new-member-playbook) (they'll be added to a team later)
- [ ] (project owner) Transfer the existing repository to the Django Commons organization using the GitHub UI, so old

### Transfer ownership in GitHub, test PyPI and PyPI.

These should be done by the project owner.

- [ ] Transfer the existing repository to the Django Commons organization using the GitHub UI, so old
information is preserved. See [GitHub docs][gh-docs-transfer-repo].
- It takes GitHub a couple minutes to process the move, therefore it is highly recommended to do this step first.
This will ensure enough time can pass before moving to the 'import into terraform' step.
- [ ] (project owner) PyPI project owner must add the Django Commons PyPI Admins (`cunla`, `stormheg`) as owners
cunla marked this conversation as resolved.
Show resolved Hide resolved
in [PyPI][pypi], and [test-pypi][test-pypi]
- [ ] Review with the project owner the PyPI and Test PyPI project maintainers - consider removing any inactive
maintainers from the project.

### Post Transfer Steps
### Make GitHub repository managed by terraform

- [ ] Terraform changes to add project to organization
- [ ] Terraform changes to add project to organization, should be included in the issue opened to transfer the project.
Copy link
Member

Choose a reason for hiding this comment

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

I have written in my notes to discuss our use of Terraform. For example, most changes normally done through the GitHub UI should now be done using Terraform. Adding new members for example.

- [ ] In [`terraform/production/respositories.tfvars`][2], add the new repository to the `repositories` section:

```terraform
Expand Down Expand Up @@ -148,30 +186,37 @@ Assuming the repository name is `repo-name`:
}
}
```

- [ ] Create a pull-request to `main` branch. This will trigger terraform to plan the changes in the organization to
be executed.
Review the changes and make sure they align with the request.
- [ ] Create a pull-request to `main` branch.
This will trigger terraform to plan the changes in the organization to be executed.
Review the changes and make sure they align with the project maintainer expectations.
- [ ] Merge the pull request. This will trigger terraform to apply the changes in the organization.
- The expected changes:
- [ ] New teams `repo-name`, `repo-name-admins`, `repo-name-committers` with the relevant members based on the
repository's description.
- [ ] The repository changes are accepted by the project maintainers.
- [ ] Repository has two environments: `pypi` and `testpypi`, see example [here][playground-environments]

### Create new release workflow

- [ ] Repo changes:
- [ ] (project owner) Create/Update the release GitHub workflow in the repository, example can be
found [here][release-gh-workflow]
- [ ] (project owner) Merge pull-request implementing the release workflow (created in the pre-transfer steps).
- [ ] Under Actions > General > "Fork pull request workflows from outside collaborators", set "Require approval for
first-time contributors"

- [ ] PyPI and Test PyPI changes:
- [ ] Add the release workflow to pypi.org's package publishing (and test.pypi.org's package publishing).
Example can be found [here][pypi-publishing]

### Release a new version

- [ ] Have the maintainer push a new tag and walk them through the release process
- [ ] Set a calendar event or reminder for 30 days in the future to remove the previous repository owner from PyPI
project (if applicable)
- Find the publishing workflow in the Actions tab (Usually `Publish Python 🐍 distribution 📦 to PyPI`/`release.yml`)
- The publishing to pypi job should wait for an approval by a repository admin.

### Follow up

- [ ] Set a calendar event or reminder for 30 days in the future to check in with the project maintainers to see if they
need any help or have any questions.

## Remove Project Playbook

Expand Down Expand Up @@ -219,3 +264,5 @@ The expected changes:
[pypi-publishing]: https://test.pypi.org/manage/project/django-tasks-scheduler/settings/publishing/

[playground-environments]: https://github.com/django-commons/django-commons-playground/settings/environments

[team-roles]: https://github.com/django-commons/membership?tab=readme-ov-file#what-is-each-respository-team-for