Repository navigation
Conversation
…thods Live-caught on `kubernetes-caddy`'s `isPulumiOutputSet` predicate (ee4afc8, merged with #563): `pulumi.StringOutput`'s `ElementType()` is a value method returning a constant, so it answers identically on a zero-value struct and a fully-resolved one. The predicate was unconditionally true; the GKE-only branch always won; `caddyfilePrefix` + `trustedProxies` were accepted, validated and silently discarded on every non-GKE cluster. The generalisation past `isXSet`: `pulumi.StringOutput` is `struct{ *OutputState }`, and any value method on a struct-with-embedded- pointer has this property. The rule that catches the whole class is "the only field that distinguishes a zero Output is the embedded pointer — test `out.OutputState != nil`, never a method". Also include the preferred shape: check the SOURCE value, not the Output derived from it, when the source is in scope at the call site (`if record.Value != "" { ... }`). Comes from the `scCoreRegistrar. NewRecord` fix in sc-plugin-gcp 2026-11-08 where the source string was in scope and the predicate on it is both clearer and immune to this failure mode. Section 6.7 of the Gotchas chapter. Placement matches the other "this was live-caught in prod" gotchas — brief, with the anti- pattern code first, correct pattern second, source-preferred form third, and the incident citation last so a reader diagnosing a similar shape can jump straight to the fix. Signed-off-by: Ilya Sadykov <smecsia@gmail.com>
smecsia
requested review from
Cre-eD,
Laboratory and
universe-ops
as code owners
November 8, 2026 17:23
Semgrep Scan ResultsRepository:
Scanned at 2026-11-08 18:21 UTC |
Security Scan ResultsRepository:
Scanned at 2026-11-08 18:23 UTC |
universe-ops
previously approved these changes
Nov 8, 2026
universe-ops
enabled auto-merge (squash)
November 8, 2026 18:14
baasforger
previously approved these changes
Nov 8, 2026
…ives up the resource graph
Sibling trap to §6.7 (just added in this PR). Different shape, same
class — a surface that looks like it carries intent, but the intent
never reaches the engine.
A helper that mutates state inside a bare `sdk.All(...).ApplyT(...)`
side effect — no `RegisterResource` — is outside the Pulumi graph.
Any `ResourceOption` it accepts goes nowhere. `sdk.DependsOn` on the
call site is documentation-only.
The two-second check: `grep -n '<field>' <file>` returning only the
declaration. The decl without a read is the whole fingerprint.
Live-caught on the sc-ru-clouds session's Caddy-edge batch commits
1-2 (2026-11-08): `PatchDeployment`'s `Opts []sdk.ResourceOption`
was dead for a year. A Caddy pod rolled 9 s before the Service
annotation it was rolled for landed (pod template 16:16:30,
annotation 16:16:39) — the `sdk.DependsOn([]sdk.Resource{svc})` two
call sites passed through was ignored. Fix was to compute the hash
from the Service's applied annotation so `sdk.ToStringMapOutput`'s
own output dependency provides the ordering.
Credit: sc-ru-clouds found the root cause + generalised the trap
("a helper that bypasses the framework gives up the resource graph").
This section is their framing, verbatim where it matters.
Section layout matches §6.7: anti-pattern + correct-shape-depends-on-
what-the-helper-does + incident citation. Rule at the end states the
generalisable form so a future reader diagnosing a similar shape
knows what to look for.
Signed-off-by: Ilya Sadykov <smecsia@gmail.com>
universe-ops
dismissed stale reviews from baasforger and themself
via
November 8, 2026 18:20
57e5470
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add gotcha §6.7 to the plugin-authoring guide:
pulumi.StringOutput'svalue methods like
ElementType()return a constant on both thezero-value struct and a fully-resolved one. Any
isXSet-style predicatethat calls a value method is unconditionally true.
Why
Live-caught on
kubernetes-caddy(ee4afc8, merged with #563): avalue-method predicate silently discarded
caddyfilePrefix+trustedProxieson every non-GKE cluster. The generalisation pastisXSet:pulumi.StringOutputisstruct{ *OutputState }, and ANYvalue method on a struct-with-embedded-pointer has this property. The
rule that catches the whole class:
What
out.OutputState != nil)Output — immune to this failure mode. Comes from the
scCoreRegistrar.NewRecordfix in sc-plugin-gcp 2026-11-08 wherethe source string was in scope and
record.Value != \"\"is bothclearer and correct.
shape can jump straight to the fix.
Credit
Peer flagged + handed off during sc-plugin-gcp phase-5 session
2026-11-08; the generalisation above "predicate on an Output" to "any
value method on struct-with-embedded-pointer" is their framing.
Test plan
TOC unchanged since mdbook doesn't auto-TOC headings here)