steps

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package steps provides pipeline step factories for the DigitalOcean plugin.

Each step factory implements sdk.StepProvider.CreateStep and returns an sdk.StepInstance. Steps are wired into doIaCServer.stepRouter so the gRPC PluginService surface (GetStepTypes / CreateStep / ExecuteStep / DestroyStep) can dispatch them.

Migration note: step.iac_logs replaces the removed step.do_logs from workflow core (deleted in commit 589ef78e, issue #617). Behavioral differences from the old step.do_logs:

  • Config key is "module" (infra.container_service name) not "app".
  • Adds log_type, component_name, and tail_lines knobs.
  • AppLogs.LiveURL is returned in output but the step does NOT stream live log output — it fetches HistoricURLs only (same limitation as the troubleshoot path in app_platform.go).
  • No deployment ID routing: step.iac_logs fetches runtime or build logs at the app level (latest deployment). If a specific deployment ID is needed, use a future step.iac_logs_deployment (not yet implemented).

Package steps contains pipeline step implementations for the workflow-plugin-digitalocean external plugin. Each step provides a named pipeline step type (e.g. step.iac_scale) that operators reference in their workflow YAML configs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIaCScaleStep

func NewIaCScaleStep(name string, client AppsScaleClient) sdk.StepInstance

NewIaCScaleStep creates a step.iac_scale instance backed by the provided AppsScaleClient. The production path injects the real godo Apps client; tests inject a fake.

Types

type AppsScaleClient

type AppsScaleClient interface {
	Get(ctx context.Context, appID string) (*godo.App, *godo.Response, error)
	Update(ctx context.Context, appID string, req *godo.AppUpdateRequest) (*godo.App, *godo.Response, error)
}

AppsScaleClient is the subset of the godo Apps service used by IaCScaleStep. Injecting this interface allows tests to provide a fake without starting a real godo client.

type IaCLogsClient

type IaCLogsClient interface {
	List(ctx context.Context, opts *godo.ListOptions) ([]*godo.App, *godo.Response, error)
	GetLogs(ctx context.Context, appID, deploymentID, component string, logType godo.AppLogType, follow bool, tailLines int) (*godo.AppLogs, *godo.Response, error)
}

IaCLogsClient is the minimal godo App API surface consumed by step.iac_logs. It is satisfied by *godo.AppsServiceOp (the real godo client) and by test fakes. Only List and GetLogs are needed — no Create/Update/Delete.

type IaCLogsFactory

type IaCLogsFactory struct {
	// contains filtered or unexported fields
}

IaCLogsFactory is the sdk.StepProvider factory for "step.iac_logs". client is the godo Apps client from the initialized DO provider. When client is nil (provider not yet initialized) the step's Execute returns an error.

func NewIaCLogsFactory

func NewIaCLogsFactory(client IaCLogsClient) *IaCLogsFactory

NewIaCLogsFactory returns the step factory for step.iac_logs. client must be the same IaCLogsClient used by the provider at execution time. Pass nil only in tests that want to verify the not-initialized error path.

func (*IaCLogsFactory) CreateStep

func (f *IaCLogsFactory) CreateStep(typeName, _ string, config map[string]any) (sdk.StepInstance, error)

CreateStep implements sdk.StepProvider.

Jump to

Keyboard shortcuts

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