acoustic-carpenter-78188
05/13/2026, 8:12 AMState{Phase, PhaseVersion, ResourceMeta, ...} struct — is already a de-facto public contract. Out-of-tree consumers that read plugin state from storage (for example, the dataproxy connector-log path in Union Cloud) have to redeclare its shape locally just to gob-decode it, because the canonical type lives in pluginmachinery/internal/webapi/ and is unimportable.
That mirror-struct workaround is fragile: if the upstream State ever changes shape, every external decoder silently breaks. Promoting State and Phase to the public pluginmachinery/webapi/ package makes the contract explicit and lets consumers import the real type.
What changes were proposed in this pull request?
• Move state.go, state_test.go, and phase_enumer.go from flyteplugins/go/tasks/pluginmachinery/internal/webapi/ to flyteplugins/go/tasks/pluginmachinery/webapi/.
• Drop the now-unnecessary self-import in state.go (webapi.ResourceMeta becomes a same-package reference).
• Update the four internal callers (cache.go, monitor.go, allocation_token.go, launcher.go, core.go) and the corresponding _test.go files to import State / Phase / PhaseXxx from the public package via the existing pluginmachinery/webapi import they already had.
No wire-format change: gob keys structs by struct name (not package path) and the ResourceMeta interface field still decodes via the same separately-registered wrapper types (gob.Register(ResourceMetaWrapper{}) in each plugin's init).
How was this patch tested?
• go build ./... in flyteplugins/ is clean.
• All tests under pluginmachinery/webapi/... and pluginmachinery/internal/webapi/... pass locally.
• Wire compatibility was exercised by an external consumer that gob-encodes webapi.State{ResourceMeta: ResourceMetaWrapper{...}} and decodes back into the moved webapi.State — round-trips cleanly.
Labels
• changed: existing internal types are now exported from the public package.
Setup process
N/A
Screenshots
N/A
Check all the applicable boxes
• I updated the documentation accordingly.
• All new and existing tests passed.
• All commits are signed-off.
Related PRs
N/A
Stack
Docs link
N/A
flyteorg/flyteacoustic-carpenter-78188
05/13/2026, 8:56 AM