Skip to content

Commit 4af1aff

Browse files
devantlerclaude
andauthored
feat(rulesets): raise the probe's merge-queue timeout to 90 minutes and pin its id (#317)
Step 4 of the platform#3097 probe: change checkResponseTimeoutMinutes through Update and confirm the admin bypass survives. Also pins the probe's external-name, which the provider never wrote back without LateInitialize. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 26e36c8 commit 4af1aff

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

‎deploy/repository-rulesets/README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ observes.
2424
Most files here are Observe-first imports of a ruleset created out of band, so they carry a
2525
numeric `crossplane.io/external-name`. A **net-new** ruleset is the exception: it has no
2626
external-name and is managed (never `Delete`, except the disposable probe above), so Crossplane
27-
creates it on first reconcile.
27+
creates it on first reconcile. Keep `LateInitialize` on a net-new ruleset: without it the
28+
provider never writes the created id back as the external-name, so a provider restart would
29+
create a second copy. The disposable probe has no `LateInitialize`, so its id is pinned by hand.
2830
`../organization-rulesets/protect-release-tags.yaml` is the org-level precedent for that shape.

‎deploy/repository-rulesets/probe-bypass-roundtrip-on-platform-template.yaml‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,19 @@
2727
# 3. The ruleset's `updated_at` does not move across several reconcile
2828
# intervals (no re-apply loop from an actorId diff).
2929
# 4. A follow-up change to checkResponseTimeoutMinutes lands through Update
30-
# and the bypass actor survives it.
30+
# and the bypass actor survives it. (Step 4 is this file at 90 minutes.)
31+
#
32+
# The external-name is pinned to the id the first reconcile created. Without
33+
# LateInitialize the provider never wrote that id back onto the resource, so a
34+
# provider restart would have lost track of it and created a second probe. The
35+
# real promotion keeps its imported external-name, so pinning here also makes
36+
# the probe match it.
3137
apiVersion: repo.github.m.upbound.io/v1alpha1
3238
kind: RepositoryRuleset
3339
metadata:
3440
name: platform-template-probe-bypass-roundtrip
41+
annotations:
42+
crossplane.io/external-name: "24193850"
3543
spec:
3644
managementPolicies:
3745
- Observe
@@ -59,7 +67,7 @@ spec:
5967
update: false
6068
updateAllowsFetchAndMerge: false
6169
mergeQueue:
62-
- checkResponseTimeoutMinutes: 60
70+
- checkResponseTimeoutMinutes: 90
6371
groupingStrategy: ALLGREEN
6472
maxEntriesToBuild: 1
6573
maxEntriesToMerge: 1

‎tests/bypass-roundtrip-probe-ruleset.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ assert_json() {
4646
assert_value "enforcement" "disabled" '.spec.forProvider.enforcement'
4747
assert_value "target repository" "platform-template" '.spec.forProvider.repository'
4848
assert_value "target" "branch" '.spec.forProvider.target'
49-
assert_value "external-name" "null" '.metadata.annotations."crossplane.io/external-name"'
49+
assert_value "external-name" "24193850" '.metadata.annotations."crossplane.io/external-name"'
5050
# Observe + Create + Update mirrors the planned promotion; Delete lets removing the
5151
# file clean the probe up. LateInitialize would copy observed values into spec and
5252
# hide exactly the round-trip this probe measures.
@@ -55,7 +55,7 @@ assert_json "management policy" '["Observe","Create","Update","Delete"]' '.spec.
5555
assert_json "bypass actors" '[{"actorType":"OrganizationAdmin","bypassMode":"always"}]' '.spec.forProvider.bypassActors'
5656
assert_json "target branch" '["~DEFAULT_BRANCH"]' '.spec.forProvider.conditions[0].refName[0].include'
5757
assert_value "rule count" "1" '.spec.forProvider.rules | length'
58-
assert_json "merge queue" '[{"checkResponseTimeoutMinutes":60,"groupingStrategy":"ALLGREEN","maxEntriesToBuild":1,"maxEntriesToMerge":1,"mergeMethod":"SQUASH","minEntriesToMerge":1,"minEntriesToMergeWaitMinutes":5}]' '.spec.forProvider.rules[0].mergeQueue'
58+
assert_json "merge queue" '[{"checkResponseTimeoutMinutes":90,"groupingStrategy":"ALLGREEN","maxEntriesToBuild":1,"maxEntriesToMerge":1,"mergeMethod":"SQUASH","minEntriesToMerge":1,"minEntriesToMergeWaitMinutes":5}]' '.spec.forProvider.rules[0].mergeQueue'
5959

6060
# The probe must not be mistaken for the production gate's promotion.
6161
gate='select(.kind == "RepositoryRuleset" and .metadata.name == "platform-require-merge-queue")'

0 commit comments

Comments
 (0)