Skip to content

Update new project section #57

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

Merged
merged 10 commits into from
Oct 12, 2024
Merged
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
156 changes: 82 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,82 +98,78 @@ Django Commons packages.

## New Project Playbook

1. Check if repository
meets [inbound requirements][3].
2. Confirm who will be the admins and maintainers for the repository
3. PyPI project owner must add you (Django Commons admin) as owner in PyPI
4. (TODO: Determine how this works with transferring out of an org and into the Django Commons org)
5. [Add repository owner to Django Commons as member](#new-member-playbook) (they'll be added
to a team later)
6. Share
link ([https://docs.github.com/en/repositories/creating-and-managing-repositories/transferring-a-repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/transferring-a-repository))
with repo owner to transfer repo
7. Wait for repository transferred in
8. [Make Terraform changes to add new project](#terraform-changes-to-add-a-new-project)
9. Under Actions > General > "Fork pull request workflows from outside collaborators", set "Require approval for
first-time contributors"
10. Have the maintainer push a new tag and walk them through the release process
11. Set a calendar event or reminder for 30 days in the future to remove previous repository owner from team

### Terraform changes to add a new project

#### Using the GitHub UI

1. Transfer the existing repository to the Django Commons organization using the GitHub UI, so old information is
preserved.
2. 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.

#### Locally

Assuming repository name is `repo-name`:

1.

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

```terraform
repositories = {
# ...
"repo-name" = {
description = "repo description"
homepage_url = "" # optional, default is ""
allow_auto_merge = false # optional, default is false
allow_merge_commit = false # optional, default is false
allow_rebase_merge = false # optional, default is false
allow_squash_merge = true # optional, default is true
allow_update_branch = true # optional, default is true
delete_branch_on_merge = true # optional, default is true
has_discussions = true # optional, default is true
has_downloads = true # optional, default is true
has_wiki = false # optional, default is false
is_template = false # optional, default is false
push_allowances = []
template = "" # optional, default is ""
topics = []
visibility = "public" # optional, default is "public"
is_django_commons_repo = optional(bool, false) # Do not create teams for repository
enable_branch_protection = true # optional, default is true
required_status_checks_contexts = [] # optional, default is []
admins = [] # Members of the repository's admin and repository teams. Have admin permissions
committers = [] # Members of the repository's committers and repository teams. Have write permissions
members = [] # Members of the repository team. Have triage permissions
}
}
```
Assuming the repository name is `repo-name`:

2. 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.
3. Merge the pull request. This will trigger terraform to apply the changes in the organization.
### Pre Transfer Steps

The expected changes:
- [ ] Check if the repository meets [inbound requirements][3].
- [ ] Confirm who will be the admins and maintainers for the repository
- [ ] 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.
- [ ] (project owner) PyPI project owner must add the Django Commons PyPI Admins as owners in [PyPI][pypi],
and [test-pypi][test-pypi]
- [ ] [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
information is preserved. See [GitHub docs][gh-docs-transfer-repo].

### Post Transfer Steps

- 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.
- [ ] Terraform changes to add project to organization
- [ ] In [`terraform/production/respositories.tfvars`][2], add the new repository to the `repositories` section:

```terraform
repositories = {
# ...
"repo-name" = {
description = "repo description"
homepage_url = "" # optional, default is ""
allow_auto_merge = false # optional, default is false
allow_merge_commit = false # optional, default is false
allow_rebase_merge = false # optional, default is false
allow_squash_merge = true # optional, default is true
allow_update_branch = true # optional, default is true
delete_branch_on_merge = true # optional, default is true
has_discussions = true # optional, default is true
has_downloads = true # optional, default is true
has_wiki = false # optional, default is false
is_template = false # optional, default is false
push_allowances = []
template = "" # optional, default is ""
topics = []
visibility = "public" # optional, default is "public"
is_django_commons_repo = optional(bool, false) # Do not create teams for repository
enable_branch_protection = true # optional, default is true
required_status_checks_contexts = [] # optional, default is []
admins = [] # Members of the repository's admin and repository teams. Have admin permissions
committers = [] # Members of the repository's committers and repository teams. Have write permissions
members = [] # Members of the repository team. Have triage permissions
}
}
```

- [ ] 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.
- [ ] 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]

- [ ] Repo changes:
- [ ] (project owner) Create/Update the release GitHub workflow in the repository, example can be
found [here][release-gh-workflow]
- [ ] 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]

- [ ] 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)

## Remove Project Playbook

Expand Down Expand Up @@ -208,4 +204,16 @@ The expected changes:

[teams]: https://github.com/orgs/django-commons/teams

[failed-invitations]: https://github.com/orgs/django-commons/people/failed_invitations
[failed-invitations]: https://github.com/orgs/django-commons/people/failed_invitations

[test-pypi]: https://test.pypi.org/manage/project/django-commons/

[pypi]: https://pypi.org/

[gh-docs-transfer-repo]: https://docs.github.com/en/repositories/creating-and-managing-repositories/transferring-a-repository

[release-gh-workflow]: https://github.com/django-commons/django-commons-playground/blob/main/.github/workflows/release.yml

[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