autoflowutils

package
v1.130.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package autoflowutils holds what the `glab autoflow workflow` commands share.

Index

Constants

View Source
const CallTimeout = 30 * time.Second

CallTimeout bounds a single RPC to the AutoFlow service.

Variables

This section is empty.

Functions

func GetWorkflow

GetWorkflow reads the workflow req addresses.

func NewChannelTokenFlag

func NewChannelTokenFlag(cmd *cobra.Command) *cmdutils.SecretFile

NewChannelTokenFlag registers --channel-token-file on cmd.

func NewTokenBindingFlag

func NewTokenBindingFlag(cmd *cobra.Command) *cmdutils.SecretFile

NewTokenBindingFlag registers --token-binding-file on cmd.

func NewWorkflowTokenFlag

func NewWorkflowTokenFlag(cmd *cobra.Command) *cmdutils.SecretFile

NewWorkflowTokenFlag registers --workflow-token-file on cmd.

func State

State returns the name of s without its enum prefix, as the commands print it.

Types

type Connection

type Connection struct {

	// NamespaceID is the parsed --namespace-id, set by Complete, or the
	// organization of the AutoFlow token, set by Dial.
	NamespaceID uuid.UUID
	// contains filtered or unexported fields
}

Connection is the set of flags that addresses the AutoFlow service and a namespace in it.

func (*Connection) AddFlags

func (c *Connection) AddFlags(cmd *cobra.Command)

AddFlags registers the connection flags on cmd.

func (*Connection) Complete

func (c *Connection) Complete() error

Complete parses and validates the connection flags.

func (*Connection) Dial

func (c *Connection) Dial(ctx context.Context, ios *iostreams.IOStreams, apiClient func(repoHost string) (*api.Client, error)) (autoflowrpcv1.AutoFlowServiceClient, io.Closer, error)

Dial connects to the AutoFlow service with a token exchanged on the GitLab instance and sets NamespaceID to the token's organization unless --namespace-id is set. The caller must close the returned connection.

type Wait

type Wait struct {
	Enabled bool
	// contains filtered or unexported fields
}

Wait is the set of flags that makes a command poll a workflow until it has finished.

func (*Wait) AddFlags

func (w *Wait) AddFlags(cmd *cobra.Command)

AddFlags registers --wait and --poll-interval on cmd.

func (*Wait) Until

Until reads the workflow req addresses every poll interval until it has finished. It keeps polling through up to maxTransientFailures consecutive failures that a retry can fix, such as a restarting Relay.

func (*Wait) Validate

func (w *Wait) Validate() error

Validate checks the poll interval.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL