@@ -112,39 +112,68 @@ Django Commons packages.
112
112
113
113
### Terraform changes to add a new project
114
114
115
+ #### Using the GitHub UI
116
+
117
+ 1 . Transfer the existing repository to the Django Commons organization using the GitHub UI, so old information is
118
+ preserved.
119
+ 2 . Make sure the there are no teams ` repo-name ` , ` repo-name-admins ` and ` repo-name-committers ` in the Django Commons
120
+ organization. Teams can be viewed [ here] ( https://github.com/orgs/django-commons/teams ) . The teams will be created by
121
+ the terraform apply process.
122
+
123
+ #### Locally
124
+
115
125
Assuming repository name is ` repo-name ` :
116
126
117
- 1 . In [ ` terraform/production/respositories.tfvars ` ] ( https://github.com/django-commons/controls/blob/main/terraform/production/respositories.tfvars ) ,
118
- add the new repository to the ` repositories ` section:
127
+ 1 .
128
+ In [ ` terraform/production/respositories.tfvars ` ] ( https://github.com/django-commons/controls/blob/main/terraform/production/respositories.tfvars ) ,
129
+ add the new repository to the ` repositories ` section:
119
130
120
131
``` terraform
121
132
repositories = {
122
- # ...
123
- "repo-name" = {
124
- description = "repo description"
125
- allow_auto_merge = false # optional, default is false
126
- allow_merge_commit = false # optional, default is false
127
- allow_rebase_merge = false # optional, default is false
128
- allow_squash_merge = false # optional, default is false
129
- allow_update_branch = false # optional, default is false
130
- enable_branch_protection = true # optional, default is true
131
- has_discussions = true # optional, default is true
132
- has_downloads = true # optional, default is true
133
- has_wiki = false # optional, default is false
134
- is_template = false # optional, default is false
135
- push_allowances = []
136
- required_status_checks_contexts = [] # optional, default is []
137
- template = "" # optional, default is ""
138
- topics = []
139
- visibility = "public" # optional, default is "public"
140
- skip_team_creation = false # Optional, default is false => create 3 teams for the repository
141
- admins = [] # Members of the repository's admin and repository teams. Have admin permissions
142
- committers = [] # Members of the repository's committers and repository teams. Have write permissions
143
- members = [] # Members of the repository team. Have triage permissions
144
- }
133
+ # ...
134
+ "repo-name" = {
135
+ description = "repo description"
136
+ homepage_url = "" # optional, default is ""
137
+ allow_auto_merge = false # optional, default is false
138
+ allow_merge_commit = false # optional, default is false
139
+ allow_rebase_merge = false # optional, default is false
140
+ allow_squash_merge = true # optional, default is true
141
+ allow_update_branch = true # optional, default is true
142
+ delete_branch_on_merge = true # optional, default is true
143
+ has_discussions = true # optional, default is true
144
+ has_downloads = true # optional, default is true
145
+ has_wiki = false # optional, default is false
146
+ is_template = false # optional, default is false
147
+ push_allowances = []
148
+ template = "" # optional, default is ""
149
+ topics = []
150
+ visibility = "public" # optional, default is "public"
151
+ skip_team_creation = optional(bool, false) # Do not create teams for repository
152
+ enable_branch_protection = true # optional, default is true
153
+ required_status_checks_contexts = [] # optional, default is []
154
+ admins = [] # Members of the repository's admin and repository teams. Have admin permissions
155
+ committers = [] # Members of the repository's committers and repository teams. Have write permissions
156
+ members = [] # Members of the repository team. Have triage permissions
157
+ }
145
158
}
146
159
```
147
160
161
+ 2 . Import the repository into the terraform state by
162
+ running ` terraform import -var-file=production/org.tfvars -var-file=production/repositories.tfvars -var github_token=... 'github_repository.this["repo-name"]' repo-name `
163
+ 3 . Run ` terraform plan -var-file=production/org.tfvars -var-file=production/repositories.tfvars -var github_token=... `
164
+ to see the changes that will be made.
165
+
166
+ 4 . Create a pull-request to ` main ` branch. This will trigger terraform to plan the changes in the organization to be
167
+ executed.
168
+ Review the changes and make sure they align with the request.
169
+ 5 . Merge the pull request. This will trigger terraform to apply the changes in the organization.
170
+
171
+ The expected changes:
172
+
173
+ - New teams ` repo-name ` , ` repo-name-admins ` , ` repo-name-committers ` with the relevant members based on the
174
+ repository's description.
175
+ - The repository changes are accepted by the project maintainers.
176
+
148
177
## Remove Project Playbook
149
178
150
179
1 . Confirm there's agreement amongst current project maintainers to move project out of Django Commons
@@ -158,10 +187,12 @@ repositories = {
158
187
159
188
1 . Remove the repository from the ` repositories ` section
160
189
in [ ` terraform/production/respositories.tfvars ` ] ( https://github.com/django-commons/controls/blob/main/terraform/production/respositories.tfvars )
161
- 2 . Remove the parent team and child teams for the repository from the ` teams_repositories `
162
- and ` teams_repositories_privileged ` sections in
163
- [ ` terraform/production/teams.tfvars ` ] ( https://github.com/django-commons/controls/blob/main/terraform/production/teams.tfvars )
164
- 3 . Create a pull-request to ` main ` branch. This will trigger terraform to plan the changes in the organization to be
190
+ 2 . Create a pull-request to ` main ` branch. This will trigger terraform to plan the changes in the organization to be
165
191
executed.
166
192
Review the changes and make sure they align with the request.
167
- 4 . Merge the pull request. This will trigger terraform to apply the changes in the organization.
193
+ 3 . Merge the pull request. This will trigger terraform to apply the changes in the organization.
194
+
195
+ The expected changes:
196
+
197
+ - The repository will be removed from the organization.
198
+ - The repository's teams will be removed from the organization.
0 commit comments