Skip to content

flaps: move Wait to options and support multi-state#210

Merged
dangra merged 3 commits intomainfrom
flaps-wait-options
Mar 16, 2026
Merged

flaps: move Wait to options and support multi-state#210
dangra merged 3 commits intomainfrom
flaps-wait-options

Conversation

@dangra
Copy link
Member

@dangra dangra commented Mar 13, 2026

Summary

  • replace flaps.Client.Wait machine argument with explicit machineID and a functional options API
  • add wait options for state values, timeout, version, and from_event_id, with default/clamped timeout behavior preserved
  • add unit tests for default query params, multi-state encoding, timeout clamping, and pass-through of comma-containing state values

Testing

  • go test ./flaps

@dangra dangra force-pushed the flaps-wait-options branch from a9718a6 to a726c92 Compare March 16, 2026 03:20
dangra added a commit to superfly/flyctl that referenced this pull request Mar 16, 2026
Replace the old Wait(machine *fly.Machine, state string, timeout) signature
with the new options-based API: Wait(machineID string, waitOpts ...WaitOption).

All 11 call sites are updated to use WithWaitStates and WithWaitTimeout.
Mocks, the in-memory test client, and the gomock-generated mock are updated
to match the new interface.
dangra added a commit to superfly/flyctl that referenced this pull request Mar 16, 2026
Replace the old Wait(machine *fly.Machine, state string, timeout) signature
with the new options-based API: Wait(machineID string, waitOpts ...WaitOption).

All 11 call sites are updated to use WithWaitStates and WithWaitTimeout.
Mocks, the in-memory test client, and the gomock-generated mock are updated
to match the new interface.
@dangra dangra merged commit 0bcb397 into main Mar 16, 2026
5 checks passed
@dangra dangra deleted the flaps-wait-options branch March 16, 2026 16:30
dangra added a commit to superfly/flyctl that referenced this pull request Mar 16, 2026
* port to flaps.Wait options API (superfly/fly-go#210)

Replace the old Wait(machine *fly.Machine, state string, timeout) signature
with the new options-based API: Wait(machineID string, waitOpts ...WaitOption).

All 11 call sites are updated to use WithWaitStates and WithWaitTimeout.
Mocks, the in-memory test client, and the gomock-generated mock are updated
to match the new interface.

* upgrade fly-go to v0.4.0
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