Push from a build

A build can send its source to Atlas itself: after a release build, from a system Atlas cannot reach, or with an index the build made with its own tooling. The NuGet package Curiosity.Atlas.Library does it, signed in with a library token created by a system administrator.

dotnet add package Curiosity.Atlas.Library

It targets .NET Standard 2.0, .NET 8 and later.

Push a folder

using Curiosity.Atlas.Library;

using var atlas = new AtlasClient("https://atlas.example.com", libraryToken);

await atlas.CreateApplicationAsync("Billing", "The legacy billing system.");

var run = await atlas.PushFolderAsync("Billing", "billing", "./src", new BundleOptions
{
    RevisionId = Environment.GetEnvironmentVariable("BUILD_SOURCEVERSION"),
    Branch     = "main",
    Message    = "Release 26.11",
});

run = await atlas.WaitForRunAsync(run.UID);

Console.WriteLine($"{run.State}, {run.ErrorCount} errors");

CreateApplicationAsync creates the application, or updates its description when it exists. The repository is created as a pushed repository the first time. PushFolderAsync leaves version control and dependency folders out of the zip. RevisionId names the revision; pushing the same id again indexes it again.

The run ends as Succeeded, Partial (an indexer failed, its files stayed text only) or Failed.

Method What it does
PushFolderAsync(application, repository, folder, options) Zips the folder with a manifest and pushes it.
PushArchiveAsync(application, repository, zipPath) Pushes a zip you made.
CreateBundle(folder, zipPath, options) Makes the zip PushFolderAsync would send, to push later.
GetRunAsync(runUID), WaitForRunAsync(runUID) Reads an indexing run, or waits until it ends.
PushRecordsAsync(application, source, records, accessGroup) Pushes knowledge records. See Connected knowledge.

A refused call throws AtlasException, with the status code and Atlas's message.

Ship your own index

A build that already makes a SCIP index (with any SCIP indexer, or a compiler plugin) can push it with the source:

var run = await atlas.PushFolderAsync("Billing", "billing", "./src", new BundleOptions
{
    RevisionId    = commit,
    ScipIndexPath = "build/index.scip",
    Indexer       = "scip-java (build)",
});

Atlas reads the shipped index first. The files it covers are precise and credited to Indexer; Atlas's own indexers cover the rest.