Table of Contents

Interface IArtifactProvider

Namespace
Invex.Atom.Build.Artifacts
Assembly
Invex.Atom.Build.dll

Defines a provider for storing and retrieving build artifacts.

public interface IArtifactProvider

Remarks

Implementations of this interface abstract the underlying storage mechanism, allowing for different backends such as cloud storage or local file systems. The Atom framework uses these providers to manage artifacts for targets like IStoreArtifact and IRetrieveArtifact.

Properties

OptionalParams

Gets a list of parameter names the artifact provider may use but does not always require.

IReadOnlyList<string> OptionalParams { get; }

Property Value

IReadOnlyList<string>

Remarks

These are declared as used (not required) parameters of the artifact targets, so that secrets among them are prefetched and injected into generated workflows. Use this for alternatives, such as a connection string or an account URL with a credential, where the provider validates the combination itself.

RequiredParams

Gets a list of parameter names required by the artifact provider to function correctly.

IReadOnlyList<string> RequiredParams { get; }

Property Value

IReadOnlyList<string>

Remarks

These parameters typically include configuration settings or credentials needed to access the artifact storage.

Methods

Cleanup(IEnumerable<string>, CancellationToken)

Deletes all artifacts associated with the specified build run identifiers.

Task Cleanup(IEnumerable<string> runIdentifiers, CancellationToken cancellationToken = default)

Parameters

runIdentifiers IEnumerable<string>

A list of build run identifiers whose artifacts should be deleted.

cancellationToken CancellationToken

A cancellation token to observe while waiting for the task to complete.

Returns

Task

A System.Threading.Tasks.Task representing the asynchronous cleanup operation.

Remarks

This is useful for managing storage by removing old or temporary artifacts.

GetStoredRunIdentifiers(string?, string?, CancellationToken)

Retrieves a list of all stored run identifiers from the artifact storage.

Task<IReadOnlyList<string>> GetStoredRunIdentifiers(string? artifactName = null, string? buildSlice = null, CancellationToken cancellationToken = default)

Parameters

artifactName string

An optional artifact name to filter the run identifiers by.

buildSlice string

An optional build slice to filter the run identifiers by.

cancellationToken CancellationToken

A cancellation token to observe while waiting for the task to complete.

Returns

Task<IReadOnlyList<string>>

A System.Threading.Tasks.Task<TResult> that completes with a read-only list of stored run identifiers.

Remarks

This method can be used to list available builds for retrieval or cleanup.

RetrieveArtifacts(IEnumerable<string>, string?, string?, CancellationToken)

Downloads one or more build artifacts from the configured storage.

Task RetrieveArtifacts(IEnumerable<string> artifactNames, string? buildId = null, string? buildSlice = null, CancellationToken cancellationToken = default)

Parameters

artifactNames IEnumerable<string>

A list of artifact names to download.

buildId string

The unique identifier of the build from which to retrieve artifacts. If null, the provider may assume the current run or retrieve the latest version.

buildSlice string

An optional identifier for a specific build variation to retrieve artifacts from.

cancellationToken CancellationToken

A cancellation token to observe while waiting for the task to complete.

Returns

Task

A System.Threading.Tasks.Task representing the asynchronous download operation.

StoreArtifacts(IEnumerable<string>, string?, string?, CancellationToken)

Uploads one or more build artifacts to the configured storage.

Task StoreArtifacts(IEnumerable<string> artifactNames, string? buildId = null, string? buildSlice = null, CancellationToken cancellationToken = default)

Parameters

artifactNames IEnumerable<string>

A list of artifact names to upload. Each name typically corresponds to a file or directory.

buildId string

The unique identifier for the current build. If null, the provider may use a default or environment-provided ID.

buildSlice string

An optional identifier for a specific build variation (e.g., in a matrix build) to associate the artifacts with.

cancellationToken CancellationToken

A cancellation token to observe while waiting for the task to complete.

Returns

Task

A System.Threading.Tasks.Task representing the asynchronous upload operation.