Documentation
¶
Index ¶
- Constants
- func ValidatePerRepoPostInstall(ctx context.Context, client forge.Client, org, repo string) error
- type CLIRunnerFunc
- type Driver
- type MintURLProvider
- type PerRepoState
- func (s *PerRepoState) AgentArtifactName() string
- func (s *PerRepoState) AgentWorkflowFile() string
- func (s *PerRepoState) ConfigOwner() string
- func (s *PerRepoState) ConfigPathPrefix() string
- func (s *PerRepoState) ConfigRepo() string
- func (s *PerRepoState) MintURL() string
- func (s *PerRepoState) Mode() string
- func (s *PerRepoState) TestRepo() string
- func (s *PerRepoState) TriageWorkflowFile() string
- func (s *PerRepoState) TriageWorkflowRepo() string
- type RepoEnsurer
- type SettleFunc
- type State
Constants ¶
const ( // PerRepoTestRepo is the pre-existing repo used for per-repo install. PerRepoTestRepo = "test-repo" // PerRepoTriageWorkflow is the workflow path for per-repo triage. PerRepoTriageWorkflow = "fullsend.yaml" // PerRepoAgentWorkflow is the reusable workflow for the triage agent. PerRepoAgentWorkflow = "reusable-triage.yml" // PerRepoAgentArtifact is the upload-artifact name for triage output. PerRepoAgentArtifact = "fullsend-triage" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CLIRunnerFunc ¶ added in v0.33.0
CLIRunnerFunc is the signature for running a fullsend CLI command. The default implementation is e2etest.TryRunCLI. Inject a custom function in tests to avoid shelling out.
type Driver ¶
type Driver interface {
Install(ctx context.Context, org string) (State, error)
Teardown(ctx context.Context, org string, state State) error
}
Driver provisions and tears down fullsend in an acquired pool org. Driver is used only during suite setup (single-threaded) and is not shared across concurrent scenarios.
type MintURLProvider ¶ added in v0.36.0
type MintURLProvider interface {
MintURL() string
}
MintURLProvider is optionally implemented by State values that carry the effective mint URL. The suite uses this to thread the mint URL from the install driver to the RepoEnsurer.
type PerRepoState ¶ added in v0.36.0
type PerRepoState struct {
// contains filtered or unexported fields
}
PerRepoState is the read-only install state for per-repo mode. All fields are set at construction and never modified. Sharing a single instance across goroutines is safe by design.
func NewPerRepoState ¶ added in v0.36.0
func NewPerRepoState(org, repo, mintURL string) *PerRepoState
NewPerRepoState constructs a PerRepoState. Used by sub-package drivers.
func (*PerRepoState) AgentArtifactName ¶ added in v0.36.0
func (s *PerRepoState) AgentArtifactName() string
func (*PerRepoState) AgentWorkflowFile ¶ added in v0.36.0
func (s *PerRepoState) AgentWorkflowFile() string
func (*PerRepoState) ConfigOwner ¶ added in v0.36.0
func (s *PerRepoState) ConfigOwner() string
func (*PerRepoState) ConfigPathPrefix ¶ added in v0.36.0
func (s *PerRepoState) ConfigPathPrefix() string
func (*PerRepoState) ConfigRepo ¶ added in v0.36.0
func (s *PerRepoState) ConfigRepo() string
func (*PerRepoState) MintURL ¶ added in v0.36.0
func (s *PerRepoState) MintURL() string
MintURL returns the mint URL used during install.
func (*PerRepoState) Mode ¶ added in v0.36.0
func (s *PerRepoState) Mode() string
func (*PerRepoState) TestRepo ¶ added in v0.36.0
func (s *PerRepoState) TestRepo() string
func (*PerRepoState) TriageWorkflowFile ¶ added in v0.36.0
func (s *PerRepoState) TriageWorkflowFile() string
func (*PerRepoState) TriageWorkflowRepo ¶ added in v0.36.0
func (s *PerRepoState) TriageWorkflowRepo() string
type RepoEnsurer ¶ added in v0.33.0
type RepoEnsurer interface {
// EnsureRepo guarantees org/repoName exists and has fullsend installed.
// If the repo does not exist it is created (the forge's auto_init
// provides the initial commit). If fullsend is not installed (per
// post-install validation) it runs the per-repo install flow
// (inference provision + github setup).
EnsureRepo(ctx context.Context, org, repoName string) (State, error)
}
RepoEnsurer lazily creates and installs repos on demand for behaviour scenarios. Results are cached by org/repo key so that a second scenario leasing the same name within a suite run skips redundant work.
Thread safety: EnsureRepo is safe for concurrent callers. A singleflight.Group serializes in-flight ensures per key so that concurrent first-calls for the same repo only perform create+install once; other callers wait and share the result.
func NewRepoEnsurer ¶ added in v0.33.0
func NewRepoEnsurer( e2eCfg e2etest.EnvConfig, client forge.Client, token, binary string, logf func(string, ...any), ) RepoEnsurer
NewRepoEnsurer returns a RepoEnsurer backed by the given forge client and CLI binary. The ensurer shares the same credentials and configuration as the per-repo install driver.
type SettleFunc ¶ added in v0.33.0
type SettleFunc func(ctx context.Context, client forge.Client, org, repo, workflowFile string, logf func(string, ...any)) error
SettleFunc is called after a repo is freshly created or installed to wait until GitHub Actions recognises the workflow file. The default implementation polls GetWorkflow; tests inject a no-op.
type State ¶
type State interface {
Mode() string
TestRepo() string
// ConfigOwner and ConfigRepo locate commits for behaviour scripts and config reads.
ConfigOwner() string
ConfigRepo() string
// ConfigPathPrefix is "" for per-org (.fullsend repo root) or ".fullsend" for per-repo.
ConfigPathPrefix() string
// TriageWorkflowRepo is the repository polled for triage workflow runs.
TriageWorkflowRepo() string
// TriageWorkflowFile is the workflow path passed to ListWorkflowRuns.
TriageWorkflowFile() string
// AgentWorkflowFile is the reusable workflow that runs the agent and uploads artifacts.
AgentWorkflowFile() string
// AgentArtifactName is the upload-artifact name for triage agent output.
AgentArtifactName() string
}
State describes where behaviour tests find fullsend configuration after install.
Concurrency: the PerRepoState implementation is a read-only snapshot whose fields (org, repo, mintURL) are set at construction and never modified. All accessor methods return derived constants. Sharing a single State across goroutines via World.Clone is safe by design for GODOG_CONCURRENCY>1. TestConcurrentStateAccess in this package exercises concurrent reads under -race.
If a future implementation adds mutable state, it must synchronize access or be deep-copied per scenario in World.Clone.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cfmint implements an install.Driver that deploys a temporary Cloudflare Worker preview mint for behaviour tests.
|
Package cfmint implements an install.Driver that deploys a temporary Cloudflare Worker preview mint for behaviour tests. |
|
Package legacy implements an install.Driver that uses a pre-configured mint URL for per-repo install.
|
Package legacy implements an install.Driver that uses a pre-configured mint URL for per-repo install. |