Skip to content

Commit 3ad16be

Browse files
committed
Bump integrations/github to v6
Remove use of deprecated github_repository attributes: - default_branch - ignore_vulnerability_alerts_during_read - private Ignore has_discussions for stackhpc/ansible-collection-cephadm. Change push_restrictions to restrict_pushes.
1 parent 6799817 commit 3ad16be

4 files changed

Lines changed: 113 additions & 59 deletions

File tree

.github/workflows/terraform-github.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
- name: Terraform Init
3636
id: init
37-
run: terraform init
37+
run: terraform init -upgrade
3838

3939
- name: Terraform Validate
4040
id: validate

terraform/github/branches.tf

Lines changed: 109 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ resource "github_branch_protection" "ansible_branch_protection" {
1818
# being able to merge. Also this should prevent outsiders from pushing to the protected branch,
1919
# however, whilst they can open a pull request they shoud not be able to merge that would be
2020
# upto the reviewers or codeowners.
21-
push_restrictions = [
22-
resource.github_team.organisation_teams["Developers"].node_id
23-
]
21+
restrict_pushes {
22+
blocks_creations = false
23+
push_allowances = [
24+
resource.github_team.organisation_teams["Developers"].node_id
25+
]
26+
}
2427

2528
required_status_checks {
2629
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default
@@ -47,13 +50,21 @@ resource "github_branch_protection" "batch_branch_protection" {
4750
required_approving_review_count = 1
4851
}
4952

50-
push_restrictions = [
51-
resource.github_team.organisation_teams["Developers"].node_id
52-
]
53+
restrict_pushes {
54+
blocks_creations = false
55+
push_allowances = [
56+
resource.github_team.organisation_teams["Developers"].node_id
57+
]
58+
}
5359

5460
required_status_checks {
55-
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default
56-
strict = false
61+
contexts = lookup(var.required_status_checks, each.key, {
62+
"default" : [
63+
"Test deployment and reimage on OpenStack / openstack-ci (RL8)",
64+
"Test deployment and reimage on OpenStack / openstack-ci (RL9)",
65+
]
66+
}).default
67+
strict = false
5768
}
5869

5970
lifecycle {
@@ -80,9 +91,12 @@ resource "github_branch_protection" "kayobe_branch_protection_py_3-6" {
8091
required_approving_review_count = 1
8192
}
8293

83-
push_restrictions = [
84-
resource.github_team.organisation_teams["Developers"].node_id
85-
]
94+
restrict_pushes {
95+
blocks_creations = false
96+
push_allowances = [
97+
resource.github_team.organisation_teams["Developers"].node_id
98+
]
99+
}
86100

87101
required_status_checks {
88102
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/[vwxy]*", lookup(var.required_status_checks, each.key, {
@@ -114,9 +128,12 @@ resource "github_branch_protection" "kayobe_branch_protection_zed" {
114128
required_approving_review_count = 1
115129
}
116130

117-
push_restrictions = [
118-
resource.github_team.organisation_teams["Developers"].node_id
119-
]
131+
restrict_pushes {
132+
blocks_creations = false
133+
push_allowances = [
134+
resource.github_team.organisation_teams["Developers"].node_id
135+
]
136+
}
120137

121138
required_status_checks {
122139
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/zed", lookup(var.required_status_checks, each.key, {
@@ -149,9 +166,12 @@ resource "github_branch_protection" "kayobe_branch_protection_antelope" {
149166
required_approving_review_count = 1
150167
}
151168

152-
push_restrictions = [
153-
resource.github_team.organisation_teams["Developers"].node_id
154-
]
169+
restrict_pushes {
170+
blocks_creations = false
171+
push_allowances = [
172+
resource.github_team.organisation_teams["Developers"].node_id
173+
]
174+
}
155175

156176
required_status_checks {
157177
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/2023.1", lookup(var.required_status_checks, each.key, {
@@ -184,9 +204,12 @@ resource "github_branch_protection" "kayobe_branch_protection_caracal" {
184204
required_approving_review_count = 1
185205
}
186206

187-
push_restrictions = [
188-
resource.github_team.organisation_teams["Developers"].node_id
189-
]
207+
restrict_pushes {
208+
blocks_creations = false
209+
push_allowances = [
210+
resource.github_team.organisation_teams["Developers"].node_id
211+
]
212+
}
190213

191214
required_status_checks {
192215
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/2024.1", lookup(var.required_status_checks, each.key, {
@@ -218,9 +241,12 @@ resource "github_branch_protection" "kayobe_branch_protection_epoxy" {
218241
required_approving_review_count = 1
219242
}
220243

221-
push_restrictions = [
222-
resource.github_team.organisation_teams["Developers"].node_id
223-
]
244+
restrict_pushes {
245+
blocks_creations = false
246+
push_allowances = [
247+
resource.github_team.organisation_teams["Developers"].node_id
248+
]
249+
}
224250

225251
required_status_checks {
226252
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/2025.1", lookup(var.required_status_checks, each.key, {
@@ -254,9 +280,12 @@ resource "github_branch_protection" "kayobe_branch_protection_master" {
254280
required_approving_review_count = 1
255281
}
256282

257-
push_restrictions = [
258-
resource.github_team.organisation_teams["Developers"].node_id
259-
]
283+
restrict_pushes {
284+
blocks_creations = false
285+
push_allowances = [
286+
resource.github_team.organisation_teams["Developers"].node_id
287+
]
288+
}
260289

261290
required_status_checks {
262291
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/master", lookup(var.required_status_checks, each.key, {
@@ -286,9 +315,12 @@ resource "github_branch_protection" "openstack_branch_protection_py_3-6" {
286315
allows_deletions = false
287316
allows_force_pushes = false
288317

289-
push_restrictions = [
290-
resource.github_team.organisation_teams["Developers"].node_id
291-
]
318+
restrict_pushes {
319+
blocks_creations = false
320+
push_allowances = [
321+
resource.github_team.organisation_teams["Developers"].node_id
322+
]
323+
}
292324

293325
required_pull_request_reviews {
294326
dismiss_stale_reviews = true
@@ -319,9 +351,12 @@ resource "github_branch_protection" "openstack_branch_protection_zed" {
319351
allows_deletions = false
320352
allows_force_pushes = false
321353

322-
push_restrictions = [
323-
resource.github_team.organisation_teams["Developers"].node_id
324-
]
354+
restrict_pushes {
355+
blocks_creations = false
356+
push_allowances = [
357+
resource.github_team.organisation_teams["Developers"].node_id
358+
]
359+
}
325360

326361
required_pull_request_reviews {
327362
dismiss_stale_reviews = true
@@ -354,9 +389,12 @@ resource "github_branch_protection" "openstack_branch_protection_antelope" {
354389
allows_deletions = false
355390
allows_force_pushes = false
356391

357-
push_restrictions = [
358-
resource.github_team.organisation_teams["Developers"].node_id
359-
]
392+
restrict_pushes {
393+
blocks_creations = false
394+
push_allowances = [
395+
resource.github_team.organisation_teams["Developers"].node_id
396+
]
397+
}
360398

361399
required_pull_request_reviews {
362400
dismiss_stale_reviews = true
@@ -389,9 +427,12 @@ resource "github_branch_protection" "openstack_branch_protection_caracal" {
389427
allows_deletions = false
390428
allows_force_pushes = false
391429

392-
push_restrictions = [
393-
resource.github_team.organisation_teams["Developers"].node_id
394-
]
430+
restrict_pushes {
431+
blocks_creations = false
432+
push_allowances = [
433+
resource.github_team.organisation_teams["Developers"].node_id
434+
]
435+
}
395436

396437
required_pull_request_reviews {
397438
dismiss_stale_reviews = true
@@ -423,9 +464,12 @@ resource "github_branch_protection" "openstack_branch_protection_epoxy" {
423464
allows_deletions = false
424465
allows_force_pushes = false
425466

426-
push_restrictions = [
427-
resource.github_team.organisation_teams["Developers"].node_id
428-
]
467+
restrict_pushes {
468+
blocks_creations = false
469+
push_allowances = [
470+
resource.github_team.organisation_teams["Developers"].node_id
471+
]
472+
}
429473

430474
required_pull_request_reviews {
431475
dismiss_stale_reviews = true
@@ -458,9 +502,12 @@ resource "github_branch_protection" "openstack_branch_protection_master" {
458502
allows_deletions = false
459503
allows_force_pushes = false
460504

461-
push_restrictions = [
462-
resource.github_team.organisation_teams["Developers"].node_id
463-
]
505+
restrict_pushes {
506+
blocks_creations = false
507+
push_allowances = [
508+
resource.github_team.organisation_teams["Developers"].node_id
509+
]
510+
}
464511

465512
required_pull_request_reviews {
466513
dismiss_stale_reviews = true
@@ -499,9 +546,12 @@ resource "github_branch_protection" "platform_branch_protection" {
499546
required_approving_review_count = 1
500547
}
501548

502-
push_restrictions = [
503-
resource.github_team.organisation_teams["Developers"].node_id
504-
]
549+
restrict_pushes {
550+
blocks_creations = false
551+
push_allowances = [
552+
resource.github_team.organisation_teams["Developers"].node_id
553+
]
554+
}
505555

506556
required_status_checks {
507557
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default
@@ -528,9 +578,12 @@ resource "github_branch_protection" "releasetrain_branch_protection" {
528578
required_approving_review_count = 1
529579
}
530580

531-
push_restrictions = [
532-
resource.github_team.organisation_teams["Developers"].node_id
533-
]
581+
restrict_pushes {
582+
blocks_creations = false
583+
push_allowances = [
584+
resource.github_team.organisation_teams["Developers"].node_id
585+
]
586+
}
534587

535588
required_status_checks {
536589
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default
@@ -557,9 +610,12 @@ resource "github_branch_protection" "smslab_branch_protection" {
557610
required_approving_review_count = 1
558611
}
559612

560-
push_restrictions = [
561-
resource.github_team.organisation_teams["Developers"].node_id
562-
]
613+
restrict_pushes {
614+
blocks_creations = false
615+
push_allowances = [
616+
resource.github_team.organisation_teams["Developers"].node_id
617+
]
618+
}
563619

564620
required_status_checks {
565621
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default

terraform/github/provider.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
github = {
44
source = "integrations/github"
5-
version = "4.28.0"
5+
version = "6.11.1"
66
}
77
}
88
cloud {
@@ -27,4 +27,4 @@ provider "github" {
2727
# provider "github" {
2828
# owner = var.owner
2929
# token = var.GITHUB_TOKEN
30-
# }
30+
# }

terraform/github/repositories.tf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ resource "github_repository" "repositories" {
1010
ignore_changes = [
1111
description,
1212
homepage_url,
13-
private,
1413
visibility,
14+
has_discussions,
1515
has_issues,
1616
has_projects,
1717
has_wiki,
@@ -20,14 +20,12 @@ resource "github_repository" "repositories" {
2020
auto_init,
2121
gitignore_template,
2222
license_template,
23-
default_branch,
2423
archived,
2524
archive_on_destroy,
2625
pages,
2726
topics,
2827
template,
2928
vulnerability_alerts,
30-
ignore_vulnerability_alerts_during_read
3129
]
3230
prevent_destroy = true
3331
}

0 commit comments

Comments
 (0)