Repository navigation
http rule: the success expression is CEL; tighten and document the rule - #40
flostadler wants to merge 6 commits into
Conversation
… headersEnvironment interval is at most 1h and defaults to 1m, timeout defaults to 10s, and method is an enum (GET, POST, PUT, PATCH, HEAD) that defaults to GET. Invoke applies the defaults; literal rules keep empty values. BREAKING: headersEnvironment is removed from the http rule because the service never supported it. The repo keeps no changelog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The successExpression descriptions named JMESPath and the http function example used status as a string. The expression is CEL, status is the HTTP status code, and body and headers are available. Describe the expression, the url, header and body limits and the gate behavior in the schema, add an HTTP gates section to the guide, use valid expressions in tests, and regenerate the schema and SDKs. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Does the PR have any schema changes?Generated by schema-tools v0.8.1. Found 4 breaking changes: Functions
Types
New types: 1Maintainer note: consult the runbook for dealing with any breaking changes. |
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
timeout is now how long the gate may wait in total (1m to 168h, default 24h, at least the interval); the run fails when it passes without a check passing. The time allowed for one request is requestTimeout (1s to 20s, default 10s). Update descriptions, validation, tests and the guide, and regenerate the schema and SDKs. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
@pulumi-eon /review
|
1 similar comment
|
@pulumi-eon /review
|
Review Verdict: Comment OnlyHIGH risk: Public schema and all five SDKs change, with breaking changes (headersEnvironment removed, timeout changes meaning, Python SDK floor bump) and release gated on service support. That is a one-way door a person should own. The code is correct and tests pass; only three nits. View session · Was this review helpful? Yes · No |
There was a problem hiding this comment.
I read the full diff (provider, docs, schema, tests), ran go test ./... in provider/ (passes), and checked that the typed (validateRule) and raw (validateRuleValue) validators agree on method, interval, requestTimeout, timeout and the timeout-versus-interval rule. The logic is sound and the new tests cover the limits well. The breaking changes (headersEnvironment removed, timeout changes meaning, method becomes an enum, a Python SDK floor bump) are called out in the description as AGENTS.md asks. I found no blocking issues, only three nits.
I am not approving. This changes the public schema and all five SDKs, which a person should sign off on. The docs also state service-side limits (https only, public addresses, header and body sizes, the CEL subset, the 24h default wait) that nothing in this repository enforces, and the description says the change must not be released before Pulumi Cloud accepts http rules. A maintainer should confirm those claims and the release timing against the service. I did not regenerate the SDKs to confirm they match a fresh make generate; CI checks that.
Specialist passes: child sessions
| request.Dependencies = nil | ||
| request.Inputs = request.Inputs.Set("environment", property.New(property.NewMap(map[string]property.Value{ | ||
| "A": property.New("x").WithDependencies([]resource.URN{other}), | ||
| "A": property.New("status == 200").WithDependencies([]resource.URN{other}), |
There was a problem hiding this comment.
Nit — tests
This test builds a Job environment map to check where property dependencies attach. No http rule is involved, so changing "x" to "status == 200" looks like a stray find-and-replace (the sibling value "y" was left alone).
| "A": property.New("status == 200").WithDependencies([]resource.URN{other}), | |
| "A": property.New("x").WithDependencies([]resource.URN{other}), |
There was a problem hiding this comment.
🤖 Claude Code (claude-fable-5-2), on flostadler's behalf
Fixed in 2fc0532.
| a := req.Input | ||
| method, interval, requestTimeout, timeout := a.Method, a.Interval, a.RequestTimeout, a.Timeout | ||
| if method == nil { | ||
| method = &defaultHTTPMethod |
There was a problem hiding this comment.
Nit — bug
&defaultHTTPMethod hands every http() result a pointer to one package-level variable. A later write through *rule.Method would change the default for every rule. Copy the value instead.
| method = &defaultHTTPMethod | |
| m := defaultHTTPMethod | |
| method = &m |
There was a problem hiding this comment.
🤖 Claude Code (claude-fable-5-2), on flostadler's behalf
Fixed in 2fc0532.
| {name: "interval 60s", interval: "60s"}, | ||
| {name: "interval 1h", interval: "1h"}, | ||
| {name: "interval 61m", interval: "61m", wantErr: "at most 1 hour"}, | ||
| {name: "interval 90s.5", interval: "90.5s", wantErr: "whole-second"}, |
There was a problem hiding this comment.
Nit — tests
The subtest name interval 90s.5 does not match its input 90.5s.
| {name: "interval 90s.5", interval: "90.5s", wantErr: "whole-second"}, | |
| {name: "interval 90.5s", interval: "90.5s", wantErr: "whole-second"}, |
There was a problem hiding this comment.
🤖 Claude Code (claude-fable-5-2), on flostadler's behalf
Fixed in 2fc0532.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
What the http rule does
delivery.http(...)anddelivery.httpOutput(...)build awhenrule for a Stage. Pulumi Cloud calls a URL on an interval, and the gate passes whensuccessExpressionis true. A request error or a check that does not pass never fails the run by itself; the gate keeps waiting until a check passes or the timeout (24h by default) ends the run.What was wrong
successExpressionis JMESPath. It is a CEL expression (https://cel.dev).httpfunction description,status == 'ok', was wrong:statusis the HTTP status code.headersEnvironment, which the service refuses.What changes
methodis an enum (GET, POST, PUT, PATCH, HEAD, default GET),intervalis at most 1h with default 1m,timeoutdefaults to 10s, andheadersEnvironmentis removed. Its generated files conflicted with the current layout, so they are regenerated rather than merged.successExpressiondescription now says CEL, names the variablesstatus,headersandbody, and shows a valid example. Theurl,headers,body,nameand rule descriptions state the limits and the behavior above.docs/_index.mdgets an "HTTP gates" section with an example, the inputs, the variables, and lists of supported and unsupported CEL operations.timeout: how long the gate may wait in total, counted from when the gate opens for a run (1m to 168h, default 24h, at leastinterval). When it passes without a check passing, the run fails and the message names the rule and the timeout. A request error or a check that does not pass still never fails the run by itself. The time allowed for one request is nowrequestTimeout(1s to 20s, default 10s).schema.jsonand all five SDKs are regenerated withmake generate.Breaking change
Anyone who set
headersEnvironmentloses the input. It never worked, because the service refuses a rule that sets it; use secret headers. Thetimeoutof an http rule changes meaning: it was the time allowed for one request, and is now the total wait, so a value below 1m is refused. UserequestTimeoutfor the request. The syntax ofsuccessExpressionis CEL, not what the old description named.Generated SDK note
The Python SDK's minimum
pulumiversion goes from 3.231.0 to 3.269.0. That is not part of the http change: the SDKs onmainwere last generated before the repository pinned its Pulumi version, and regenerating with the pinned version (3.276.0) sets this floor. The other SDK manifests do not change.Release note
Merge and release only once Pulumi Cloud accepts http rules; until then the service refuses the rule at registration.
Test plan
make generate, thengit statusshows only intended changes.make test_providerpasses.make build(provider and Go, Node.js, Python, .NET and Java SDKs) passes.make TESTTAGS=go test: Go compile and preview and YAML preview pass. The HCL preview passes only withPULUMI_IGNORE_AMBIENT_PLUGINS=true, because a locally installed HCL plugin shadows the pinned one.make lintreports the same findings as onmain.🤖 Generated with Claude Code