gunk-dev/the-valley

protected.cue

sourceccb7354855a5main's published tip history
1.3 KiB
1// The host the flake's protect-e2e check drives: the four states a
2// project's refs can be in. "sealed" is the norm — protected, with no
3// writer, so nothing pushes to it and changes land by integration.
4// "guarded" declares the writers exception over the default protected set,
5// "released" names a wildcard pattern beside it and grants release tags to
6// the principal that cuts them, and "open" declares no protection at all,
7// so it protects no ref and every other rule of the push policy still
8// applies to it.
9//
10// Which keys act as the "integrator" principal is machine integration
11// (services.valley.authorizedKeys), not declared here — the name is what
12// the identity registry will bind, and this declaration is what names it.
13package valley
14
15projects: {
16 "sealed": protection: refs: ["refs/heads/main"]
17
18 // sealed keeps every change record: no push deletes one.
19 "sealed": retainChangeRecords: true
20
21 "guarded": protection: writers: ["integrator"]
22
23 // released's protection also covers its integration requests, so a
24 // request there needs both a declared writer and the request grant.
25 "released": protection: {
26 refs: ["refs/heads/main", "refs/heads/release/*", "refs/the-valley/integration-requests/*"]
27 writers: ["integrator"]
28 }
29 "released": grants: "release-tags": {
30 refs: ["refs/tags/release/*"]
31 writers: ["integrator"]
32 }
33
34 "open": {}
35}