Skip to content

composition: a typed refusal detail for ApplyManifest (withdrawn binding, stale generation) #2

Open

Description

@antoinetoussaint-byte

What we are trying to do

A native codefly run must tell a person what to do when the host refuses a module because it still holds that binding's withdrawal (core solutionhost.ErrWithdrawn, which is terminal while the host holds it). The CLI cannot do that reliably today, because codefly.dev/composition gives no typed signal for this refusal.

The gap

CompositionService.ApplyManifest refuses through plugins/authority Status(). That maps state.ErrStale, which wraps core's ErrWithdrawn, to a plain codes.FailedPrecondition whose message is err.Error(). No status detail is attached, and host/composition/v1 defines no refusal message. host/authority/v1 does carry typed details for other refusals (ApprovalRequiredV1).

As a stopgap, codefly-dev/cli#1158 recognizes the refusal by matching the text of solutionhost.ErrWithdrawn inside the status message (pkg/gitops/composition_delivery.go refusal). If the wording changes on either side, the CLI silently drops back to a generic refusal and loses the actionable advice.

Ask

Attach a typed detail to ApplyManifest refusals, for example a CompositionRefusalV1 { reason: WITHDRAWN | STALE_GENERATION | ... ; binding; generation } in host/composition/v1, sent with status.WithDetails from Status(). Once it is released, the CLI will match on the detail and delete the text match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions