Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion deploy/repository-rulesets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ Org-wide `OrganizationRuleset` resources live in the sibling
adoption convention and the provider importability matrix.

**One `RepositoryRuleset` per file**, named `<verb>-on-<repo>.yaml` so the rule and its
target repo are clear from the filename. external-name = `<repo>:<id>`.
target repo are clear from the filename. external-name = the **bare numeric ruleset id**
(same as `../organization-rulesets/`; the provider stores `RepositoryRuleset.id`
from-provider). The Terraform `<repo>:<ruleset_id>` form is the *import* id only — using
it as the external-name fails the provider's `strconv.ParseInt` so the resource never
observes.

| File | Repo | Ruleset | Policy |
|---|---|---|---|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Existing repository ruleset, adopted Observe-first (read-only). external-name =
# `<repo>:<ruleset_id>` (cf. the `maintainers:<repo>` convention in
# ../teams/). Identity-only forProvider — see ./README.md for the convention.
# the bare numeric ruleset id — the upjet provider stores RepositoryRuleset `id`
# from-provider, exactly like ../organization-rulesets/. (The Terraform
# `<repo>:<ruleset_id>` form is the *import* id, NOT the stored external-name; a
# `<repo>:`-prefixed value fails the provider's strconv.ParseInt and the resource
# never observes.) Identity-only forProvider — see ./README.md for the convention.
#
# platform's "Require merge queue" rule on the default branch (merge_queue is a
# repo-only rule type; org rulesets cannot carry it).
Expand All @@ -9,7 +12,7 @@ kind: RepositoryRuleset
metadata:
name: platform-require-merge-queue
annotations:
crossplane.io/external-name: "platform:5275020"
crossplane.io/external-name: "5275020" # numeric ruleset id
spec:
managementPolicies: ["Observe"]
forProvider:
Expand Down
9 changes: 6 additions & 3 deletions deploy/repository-rulesets/restrict-deletions-on-ksail.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Existing repository ruleset, adopted Observe-first (read-only). external-name =
# `<repo>:<ruleset_id>` (cf. the `maintainers:<repo>` convention in
# ../teams/). Identity-only forProvider — see ./README.md for the convention.
# the bare numeric ruleset id — the upjet provider stores RepositoryRuleset `id`
# from-provider, exactly like ../organization-rulesets/. (The Terraform
# `<repo>:<ruleset_id>` form is the *import* id, NOT the stored external-name; a
# `<repo>:`-prefixed value fails the provider's strconv.ParseInt and the resource
# never observes.) Identity-only forProvider — see ./README.md for the convention.
#
# ksail's own "Restrict deletions" rule, scoped to refs/heads/benchmark-data (the
# long-lived benchmark-data branch) — narrower than the org-wide rule.
Expand All @@ -9,7 +12,7 @@ kind: RepositoryRuleset
metadata:
name: ksail-restrict-deletions
annotations:
crossplane.io/external-name: "ksail:14699634"
crossplane.io/external-name: "14699634" # numeric ruleset id
spec:
managementPolicies: ["Observe"]
forProvider:
Expand Down