Repository navigation
Expand file tree
/
Copy pathvariables.tf
More file actions
295 lines (245 loc) · 11.9 KB
/
Copy pathvariables.tf
File metadata and controls
295 lines (245 loc) · 11.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# Enforcement inputs accept disabled, evaluate, or active.
variable "markdown_lint_enforcement" {
description = "Org markdown-lint enforcement. Evaluate reports in Insights without blocking; activate when the fleet is green."
type = string
default = "evaluate"
validation {
condition = contains(["disabled", "evaluate", "active"], var.markdown_lint_enforcement)
error_message = "markdown_lint_enforcement must be one of: disabled, evaluate, active."
}
}
variable "conventions_enforcement" {
description = "Org repo-conventions presence checks: LICENSE, AGENTS.md, Nix dev shell, release-please config. Evaluate reports without blocking; the CONVENTIONS_STRICT repo variable opts a repo into failure."
type = string
default = "evaluate"
validation {
condition = contains(["disabled", "evaluate", "active"], var.conventions_enforcement)
error_message = "conventions_enforcement must be one of: disabled, evaluate, active."
}
}
variable "ai_review_enforcement" {
description = "Org-wide AI review injects .github/ai-review.yml into every repo's PRs and runs PR-Agent on the model router. Evaluate reports without gating; active waits through a router outage, then fails and blocks merges."
type = string
default = "evaluate"
validation {
condition = contains(["disabled", "evaluate", "active"], var.ai_review_enforcement)
error_message = "ai_review_enforcement must be one of: disabled, evaluate, active."
}
}
variable "docs_publisher_enforcement" {
description = "Documentation publisher requires its configured approval count; release and triage apps bypass PRs."
type = string
default = "active"
validation {
condition = contains(["disabled", "evaluate", "active"], var.docs_publisher_enforcement)
error_message = "docs_publisher_enforcement must be one of: disabled, evaluate, active."
}
}
variable "org_branch_protection_enforcement" {
description = "Default-branch rules require signatures, branch-name pattern, Conventional Commit messages, and PR thread resolution; no bypass, including for admins."
type = string
default = "active"
validation {
condition = contains(["disabled", "evaluate", "active"], var.org_branch_protection_enforcement)
error_message = "org_branch_protection_enforcement must be one of: disabled, evaluate, active."
}
}
variable "required_signatures_enforcement" {
description = "Org-wide required-signatures rule covers every branch."
type = string
default = "active"
validation {
condition = contains(["disabled", "evaluate", "active"], var.required_signatures_enforcement)
error_message = "required_signatures_enforcement must be one of: disabled, evaluate, active."
}
}
variable "org_review_gate_enforcement" {
description = "Default-branch gate requires one approval and CODEOWNER review; OrganizationAdmin and release automation bypass in pull_request mode, all others need review."
type = string
default = "disabled"
validation {
condition = contains(["disabled", "evaluate", "active"], var.org_review_gate_enforcement)
error_message = "org_review_gate_enforcement must be one of: disabled, evaluate, active."
}
}
variable "org_gitflow_base_enforcement" {
description = "Git-flow base applies only to local.gitflow_repos: signatures on main and develop."
type = string
default = "active"
validation {
condition = contains(["disabled", "evaluate", "active"], var.org_gitflow_base_enforcement)
error_message = "Enforcement must be one of: disabled, evaluate, active."
}
}
variable "org_gitflow_main_enforcement" {
description = "Git-flow main applies only to local.gitflow_repos: PRs (no direct pushes), merge commits only, thread resolution, and Conventional-Commits-or-merge messages; signatures are enforced by org-gitflow-base and org-wide rulesets."
type = string
default = "active"
validation {
condition = contains(["disabled", "evaluate", "active"], var.org_gitflow_main_enforcement)
error_message = "org_gitflow_main_enforcement must be one of: disabled, evaluate, active."
}
}
variable "org_gitflow_develop_enforcement" {
description = "Git-flow develop applies only to local.gitflow_repos: PRs (no direct pushes), merge methods from config/rulesets-defaults.yml, and the Conventional-Commits-or-merge message pattern; signatures are enforced by org-gitflow-base and org-wide rulesets."
type = string
default = "active"
validation {
condition = contains(["disabled", "evaluate", "active"], var.org_gitflow_develop_enforcement)
error_message = "org_gitflow_develop_enforcement must be one of: disabled, evaluate, active."
}
}
variable "org_release_freeze_enforcement" {
description = "Git-flow repos require the release-freeze status check on develop. Evaluate reports without blocking; activate after every git-flow repo calls the shared status workflow."
type = string
default = "evaluate"
validation {
condition = contains(["disabled", "evaluate", "active"], var.org_release_freeze_enforcement)
error_message = "org_release_freeze_enforcement must be one of: disabled, evaluate, active."
}
}
variable "org_copilot_review_enforcement" {
description = "Pilot targets explicit branches and repos in selected copilot-review.yml, not property matches; expand it there. Paid: AI credits per review, no seats or pooled allowance; review_on_push=false caps about one review per PR."
type = string
default = "active"
validation {
condition = contains(["disabled", "evaluate", "active"], var.org_copilot_review_enforcement)
error_message = "org_copilot_review_enforcement must be one of: disabled, evaluate, active."
}
}
variable "org_push_protection_enforcement" {
description = "Native max_file_size and file_extension_restriction rules cover every repo/ref at the git layer, without workflow runs."
type = string
default = "active"
validation {
condition = contains(["disabled", "evaluate", "active"], var.org_push_protection_enforcement)
error_message = "org_push_protection_enforcement must be one of: disabled, evaluate, active."
}
}
variable "org_code_scanning_enforcement" {
description = "Require CodeQL default-setup results on public repositories' default branch and main before updates. Evaluate reports without blocking until every target repository has a configured CodeQL analysis."
type = string
default = "evaluate"
validation {
condition = contains(["disabled", "evaluate", "active"], var.org_code_scanning_enforcement)
error_message = "org_code_scanning_enforcement must be one of: disabled, evaluate, active."
}
}
variable "unmanaged_repositories" {
description = "Repositories whose labels are not read at plan time; their labels get no import."
type = set(string)
default = []
}
variable "codeql_import_enabled" {
description = "Whether import blocks adopt live repos, org Actions settings, CodeQL setup and the Default runner group."
type = bool
default = true
}
variable "org_merge_gate_enforcement" {
description = "org-merge-gate-* required checks block merges to main; each selected repo needs a live gate context on main before activation or its PRs freeze."
type = string
default = "active"
validation {
condition = contains(["disabled", "evaluate", "active"], var.org_merge_gate_enforcement)
error_message = "org_merge_gate_enforcement must be one of: disabled, evaluate, active."
}
}
variable "merge_gate_strict_enforcement" {
description = "org-merge-gate-strict-* required checks require pull requests to be up to date with their base branch before merging, except for the automation apps in merge-gate-strict.tf. Evaluate reports in Insights without blocking."
type = string
default = "evaluate"
validation {
condition = contains(["disabled", "evaluate", "active"], var.merge_gate_strict_enforcement)
error_message = "merge_gate_strict_enforcement must be one of: disabled, evaluate, active."
}
}
variable "org_upstream_fork_protection_enforcement" {
description = "For upstream_fork=true, default branch requires PRs and merge commits; deletion and force-push are forbidden."
type = string
default = "active"
validation {
condition = contains(["disabled", "evaluate", "active"], var.org_upstream_fork_protection_enforcement)
error_message = "org_upstream_fork_protection_enforcement must be one of: disabled, evaluate, active."
}
}
variable "org_branch_write_restriction_enforcement" {
description = "Org-wide active branch-write restriction blocks actors outside var.automation_bypass_app_ids from creating/updating branches except main."
type = string
default = "active"
validation {
condition = contains(["disabled", "evaluate", "active"], var.org_branch_write_restriction_enforcement)
error_message = "org_branch_write_restriction_enforcement must be one of: disabled, evaluate, active."
}
}
variable "automation_bypass_app_ids" {
description = "Required workspace list with no default: GitHub App IDs allowed to create/update branches covered by the restriction. Non-empty avoids locking out all automation; include every branch-writer (Actions, dependency-update, release, and org apps)."
type = list(number)
validation {
condition = length(var.automation_bypass_app_ids) > 0
error_message = "automation_bypass_app_ids must list at least one GitHub App ID."
}
}
variable "merge_bypass_app_ids" {
description = "GitHub App IDs allowed to update repositories listed in merge-restriction.yml through pull requests."
type = list(number)
default = []
}
# Workspace selectors.
variable "github_owner" {
description = "GitHub org login to manage: 1-39 letters, digits, or hyphens."
type = string
default = "dryvist"
validation {
condition = can(regex("^[A-Za-z0-9-]{1,39}$", var.github_owner))
error_message = "github_owner must contain 1-39 letters, numbers, or hyphens."
}
}
variable "dryvist_org_extras" {
description = "Enable organization-specific opt-in policies."
type = bool
default = true
}
variable "org_automerge_manual_enforcement" {
description = "Enforces automerge=manual review: one approval on main/develop; OrganizationAdmin, configured agent, triage, and release apps bypass."
type = string
default = "active"
validation {
condition = contains(["disabled", "evaluate", "active"], var.org_automerge_manual_enforcement)
error_message = "org_automerge_manual_enforcement must be one of: disabled, evaluate, active."
}
}
# Hermes PR-review webhook sends pull_request events; created only when both
# variables are set.
variable "hermes_webhook_url" {
description = "Hermes PR-review intake URL; empty skips the webhook."
type = string
sensitive = true
default = ""
}
variable "hermes_webhook_secret" {
description = "GitHub HMAC signing secret (X-Hub-Signature-256); empty skips the webhook."
type = string
sensitive = true
default = ""
}
# Event queue intake for check_run and pull_request events. Off until the intake
# records exist in Vault, so the plan never reads absent paths.
variable "event_queue_webhook_enabled" {
description = "Create the event queue org webhook from the intake records in Vault."
type = bool
default = false
}
variable "event_forwarder_enabled" {
description = "Enable the org-wide event-forwarder required workflow."
type = bool
default = false
}
variable "event_forwarder_enforcement" {
description = "Event-forwarder required-workflow enforcement mode."
type = string
default = "evaluate"
validation {
condition = contains(["disabled", "evaluate", "active"], var.event_forwarder_enforcement)
error_message = "Use disabled, evaluate or active."
}
}