Skip to content

Take member timeouts as durations and send seconds to the service - #37

Merged
flostadler merged 3 commits into
mainfrom
timeout-durations
Nov 18, 2026
Merged

flostadler merged 3 commits into
mainfrom
timeout-durations

Conversation

@flostadler

@flostadler flostadler commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

A Job took its timeout as a duration string such as "30m". A Stacks entry took it as a number of seconds. The service only applies a timeout that is a number of seconds, so the timeout of a job had no effect: a job always stopped after the 2 hour default.

Both timeouts are now Go duration strings, and the provider converts them to seconds in the declaration that it sends to the service.

  • Conversion. declaration.request (provider/declaration.go) converts the timeout of a Job and of every entry of a Stacks resource. Every declaration goes through it: a registration, a run in Pulumi Cloud and a local run. The resource itself keeps the string the user wrote.
  • Validation. A timeout must be a duration in whole seconds from 5m to 24h, which is the range the service accepts. The check runs with the other input checks, so a wrong value fails at preview. An unknown timeout passes in a preview.
  • Docs and examples. The descriptions, the limits table in the registry guide and examples/basic use the duration form.

Breaking change: the timeout of a Stacks entry changes from an integer to a string. timeout: 1800 becomes timeout: "30m".

A union of number and string would keep existing programs compiling. It is not used, on purpose: Job and Stacks then still read differently, Go would type the field as an untyped input, and .NET would get a union wrapper. The provider has no stable release yet, so one form for both is the better trade. A program that still sends a number keeps working at run time: the provider checks it and passes it on.

Hand-written changes are in provider/ (components.go, construct.go, declaration.go, annotations.go, stacks_test.go), docs/_index.md and examples/basic/index.ts. The schema and the SDKs are regenerated.

Test plan

  • New tests in provider/stacks_test.go: a job with 30m sends 1800, a Stacks entry with 1h sends 3600, an entry without a timeout sends none, the values soon, 90500ms, 4m59s, 24h1s and -10m are rejected, 5m, 24h and 90m are accepted, an unknown timeout passes in a preview, a number stays a number, and a secret timeout stays secret.
  • The provider tests pass, and so do the example tests for Go (with the YAML and HCL previews), Node.js, .NET and Python.
  • Tested against Pulumi Cloud with a local run of a throwaway pipeline, built from this branch. The service reported these timeouts for the members of the run (timeoutSeconds of GetDeliveryMember): a job with timeout: 5m got 300, a job without a timeout got the default 7200, and a Stacks entry with timeout: 1h got 3600. The run succeeded.
  • Numeric timeouts get the same range check as durations (whole seconds from 300 to 86400), with tests for rejected and accepted numbers.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

Does the PR have any schema changes?

Generated by schema-tools v0.8.1.

Found 1 breaking change:

Types

  • 🟡 "delivery:index:StacksEntry":
    • properties:
      • 🟡 "timeout" type changed from "integer" to "string"
        No new resources/functions/types.

Maintainer note: consult the runbook for dealing with any breaking changes.

Base automatically changed from schema-descriptions-public-preview to main November 18, 2026 11:55
@flostadler flostadler self-assigned this Nov 18, 2026
flostadler and others added 2 commits November 18, 2026 12:57
A Job timeout was a duration string and a Stacks entry timeout was an
integer number of seconds. The service reads only a number of seconds, so
the timeout of a job had no effect.

Both timeouts are now Go durations. The provider checks that a timeout is a
duration in whole seconds from 5m to 24h, and converts it to a number of
seconds in the declaration that it sends to the service. The values that the
user wrote stay unchanged in the child resource and the outputs. A timeout
that is unknown in a preview passes the check.

The type of the timeout of a Stacks entry changes from integer to string.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The provider leaves a timeout that is already a number as it is, for
programs written against an older SDK. Such a number skipped the range
check, so a value that the service rejects passed a preview and failed
the update.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@flostadler

Copy link
Copy Markdown
Contributor Author

@pulumi-eon /review

🤖 Claude Code (claude-fable-5-2), on flostadler's behalf

Please review. The hand-written change is in provider/ (components.go, construct.go, declaration.go, annotations.go, stacks_test.go), docs/_index.md and examples/basic/index.ts; the schema and the SDKs are regenerated.

The type of a Stacks entry's timeout changes from integer to string on purpose; the provider has not had a stable release. The conversion to seconds was not tested against the service. It follows what the service reads: a number of seconds in the declaration.

@eon-pulumi-reviewer

This comment has been minimized.

@eon-pulumi-reviewer eon-pulumi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conversion and validation look correct. I traced secret, unknown and null timeouts through validateTimeout and timeoutsInSeconds: secret and dependency flags carry over, unknowns pass, and the component and child keep the duration the user wrote. make generate on this head produces no diff, so the schema and SDKs match a fresh generation, and the provider tests pass locally.

No blocking findings, but I am not approving: StacksEntry.timeout changing from integer to string is a breaking change to the public schema in all five SDKs, which a maintainer should sign off on. The description calls it out. It does not say why a number-or-string union (as schema_refs.go does elsewhere) was not used to keep existing programs compiling, so please add that.

Two test gaps are inline. One further point: provider/provider_test.go has no schema assertion for the changed timeout types, which AGENTS.md asks for when the schema changes (see the first inline comment).

Specialist passes: child sessions

Comment thread provider/stacks_test.go
}
}

func TestMemberTimeoutValidation(t *testing.T) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit — agents-md

The schema changes here (StacksEntry.timeout goes from integer to string), and AGENTS.md says: "When you change the schema, add or update the schema assertions in provider/provider_test.go." The new tests are behavioural and live in stacks_test.go, and no schema assertion covers timeout. Add one next to TestSchemaOfTheTriggersAndTheReleaseNumber that checks both StacksEntry and Job declare timeout as string.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Claude Code (claude-fable-5-2), on flostadler's behalf

Fixed in 4167c1a. TestSchemaOfTheTimeouts in provider/provider_test.go asserts that timeout is a string on Job and on StacksEntry.

Comment thread provider/stacks_test.go Outdated
newFakeService(t)
server := newServer(t)
const message = "timeout must be a duration from 5m to 24h in whole seconds, such as 30m"
for _, timeout := range []string{"soon", "90500ms", "4m59s", "24h1s", "-10m"} {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit — tests

The whole-second check on duration strings is not covered. Deleting || d%time.Second != 0 in validateTimeout leaves the suite green, because "90500ms" is 1m30.5s and the 5m minimum already rejects it. Add a sub-second value above the minimum, such as "10m0.5s", to this list.

Suggested change
for _, timeout := range []string{"soon", "90500ms", "4m59s", "24h1s", "-10m"} {
for _, timeout := range []string{"soon", "90500ms", "10m0.5s", "4m59s", "24h1s", "-10m"} {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Claude Code (claude-fable-5-2), on flostadler's behalf

Fixed in 4167c1a. 10m0.5s is in the list, so the whole-second check has a value that only it rejects.

Comment thread provider/stacks_test.go
require.NoError(t, err)
}

func TestMemberTimeoutKeepsNumbersAndSecrets(t *testing.T) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit — tests

This test only covers a secret timeout on a Job. In timeoutsInSeconds the carry-over of secret and dependency flags on a Stacks entry and on the enclosing stacks map is untested. Dropping .WithSecret(entry.Secret()) or .WithSecret(stacks.Secret()) leaves the suite green, and that is the path that would turn a secret into plaintext in a preview. Add direct timeoutsInSeconds(typeStacks, ...) cases for a secret entry and a secret stacks map. A computed stacks map and a computed entry would also be worth a case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Claude Code (claude-fable-5-2), on flostadler's behalf

Fixed in 4167c1a. The test now calls timeoutsInSeconds(typeStacks, ...) with a secret entry, a secret stacks map, an unknown stacks map and an unknown entry next to a known one.

@eon-pulumi-reviewer eon-pulumi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the context. The only thing that held my earlier review back was the breaking StacksEntry.timeout type change. You have confirmed it is intentional: the job timeout does not work today, and the package is in alpha. That settles the concern, and it is the reason AGENTS.md asks the description to give for a break. The conversion, the validation and the regenerated schema and SDKs were already checked. This is an automated assessment, not a human review.

The three nits in my earlier review still apply (a schema assertion in provider/provider_test.go, a sub-second duration case, and secret carry-over cases for Stacks entries). None of them blocks the merge.

…t tests

Three gaps: no schema assertion for the changed type of a Stacks
entry's timeout, no value that only the whole-second check rejects, and
no test that a Stacks entry or the stacks map keeps its secret flag and
unknown values through the conversion.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@eon-pulumi-reviewer

eon-pulumi-reviewer Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Eon ran into a problem

Execution was stopped

Partial work may exist — see the session log.


View session

@eon-pulumi-reviewer eon-pulumi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review of the changes since my last review. All three earlier nits are fixed, and I read the code at this head to confirm it. TestSchemaOfTheTimeouts asserts that timeout is a string on Job and on StacksEntry. 10m0.5s is in the rejected list, so the whole-second check now has a value that only it rejects. TestMemberTimeoutKeepsNumbersAndSecrets covers a secret entry, a secret stacks map, an unknown stacks map and an unknown entry beside a known one. The incremental diff touches tests only, so there is no behavior change. The provider tests pass locally. The maintainer sign-off on the breaking StacksEntry.timeout type change was settled in the earlier round. I have no new findings. This is an automated assessment, not a human review.

Specialist passes: run directly (the incremental diff is test-only; I checked correctness, security, AGENTS.md compliance and tests myself)

@flostadler
flostadler merged commit 0c7de03 into main Nov 18, 2026
23 checks passed
@flostadler
flostadler deleted the timeout-durations branch November 18, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant