You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(proxy_record): symmetric domain normalisation, util test helpers
Two follow-ups on top of @JulienJBO's #74:
* Domain normalisation was applied on the write side
(BuildCreateRequest -> normalizeProxyRecordDomain) but not on plan, so a
user config of `Example.COM.` would plan as `Example.COM.` while state
ended up at the API's canonical form `example.com`. This trips the
framework's "Provider produced inconsistent result after apply" check on
first apply, and triggers a permanent RequiresReplace loop on every
subsequent plan. Added a stringplanmodifier
(normalizeProxyRecordDomainPlanModifier) that runs the existing
normaliser on the planned value so plan and state stay symmetric.
Covered with a table-driven unit test for the modifier itself, plus a
bumped assertion in TestProxyRecordResourceNameAndSchema for the new
modifier slot.
* Local stringPtr / int64Ptr test helpers in both proxy_record test files
replaced with util.StringPtr / util.Int64Ptr now that #83 has landed
the centralised helpers; resource also uses util.PtrToInt64 in place of
the inline nil-check for resp.CreatedBy.
Also: drop the `2026-04-21` date from the design note observation about
the retry endpoint — date-stamped probes age badly, so generalise to
"at the time of writing".
Copy file name to clipboardExpand all lines: docs/notes/proxy-record-design.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ Recommended lifecycle behavior:
56
56
-`Delete`: delete the record and rely on `404` handling for any later refresh.
57
57
58
58
`retry` should not be part of the declarative CRUD contract. It is an operational remediation endpoint to be used after the user fixes DNS, not a stable desired-state transition.
59
-
The live API probe on `2026-04-21` also showed that `POST /retry/` returns `403 permission_denied` when called with a Personal API Key, so it cannot be a reliable part of provider CRUD with the current authentication model.
59
+
At the time of writing, `POST /retry/`also returns `403 permission_denied` when called with a Personal API Key, which rules it out of provider CRUD with the current authentication model.
-`domain` (String) The custom domain to provision in PostHog.
33
+
-`domain` (String) The custom domain to provision in PostHog. Configured values are normalised to lowercase with no trailing dot, so `Example.COM.` and `example.com` plan as the same value.
MarkdownDescription: "The custom domain to provision in PostHog.",
53
+
MarkdownDescription: "The custom domain to provision in PostHog. Configured values are normalised to lowercase with no trailing dot, so `Example.COM.` and `example.com` plan as the same value.",
53
54
PlanModifiers: []planmodifier.String{
54
55
stringplanmodifier.RequiresReplace(),
56
+
normalizeProxyRecordDomainPlanModifier{},
55
57
},
56
58
},
57
59
"target_cname": proxyRecordComputedStringAttribute("The PostHog-managed CNAME target that your DNS record must point to."),
0 commit comments