Solution (kind: solution)
The bootstrap document — strata.yaml at the solution root. Marks “a strata solution starts
here” and supplies the minimum needed to find everything else: discovery rules and remotes live
downstream of it, never inside it. Found by walking up from any path (like go.mod/package.json),
not by discovery itself.
Schema
spec.configuration— relative path to this solution’sconfiguration.yaml(adjacent by convention)spec.discovery.exclude— glob patterns excluded from document discovery, additive to the loader’s built-in ignores (.git,build,.strata, tool caches). Each root applies them relative to itselfspec.discovery.remotes—pathremotes whose checkouts are scanned for documents too; see Documents in other repositoriesspec.remotes[]— named external artifact sources, each:name— referenced elsewhere as@<name>/<path>type—local,git,oci, orhelmurl— the source location; must not embed a password or token (use an integration for credentials)reference— the branch, tag or commit SHA the remote is taken at. Agitremote needs this orpath, never bothpath—gitonly: where a pipeline or developer already checked the repository out. Relative to the solution root (the folder holdingstrata.yaml),..allowed, or absolute. Strata reads it there and never clones it; see A repository your pipeline checked outfetch—strata(strata materializes it) orexternal(already placed by CI/elsewhere).pathimpliesexternalintegration— optional name of an integration providing credentials; it must exist and declare thesourcescapability, or validation fails. Not valid fortype: local. See integrations/git.md for a private git remote and integrations/chart-registries.md for ahelm/ociregistrydescription— optional, human-readable
Example
apiVersion: strata.huybrechts.xyz/v2
kind: solution
meta:
name: example
annotations:
description: "Example solution used to exercise the discovery loader and the full strata build run pipeline end to end"
spec:
configuration: configuration.yaml
discovery:
exclude:
- "templates/**"
remotes:
- name: infra
type: local
url: vendor/infra
- name: charts
type: helm
url: https://charts.example.io
- name: bundled
type: local
url: modules
A repository your pipeline checked out
When CI clones a repository itself (for example an Azure DevOps resources.repositories checkout),
the pipeline has to state the ref, because it does so before strata runs. There are two ways to tell
strata where that checkout is:
path(recommended). The pipeline owns the ref; strata only reads the folder.remotes: - name: iac type: git url: https://github.com/org/iac.git path: ../iac # a checkout beside the solution, in CI and on a workstation
pathis resolved from the solution root, not from the directory strata was started in, so the samestrata.yamlmeans the same folder wherever it is run. Use the layout your pipeline and your workstations share:Beside the solution (
../iac): an Azure DevOps pipeline with severalcheckout:steps puts each repository in its own folder next to the others, which is also how developers usually clone them.Inside the solution (
repos/iac): exclude that folder from discovery (discovery.exclude: ["repos/**"]) so its YAML is not read as strata documents.Absolute: used as it is. It only helps where every machine has the same layout.
A path that does not exist fails
build runwith an error naming the remote and the folder it looked in.build runrecords the checkout’s commit inresolved.yaml, and whether the files it took had uncommitted changes. The deploy’s audit manifest copies both underartifacts.repositories.<name>. The folder must be a git checkout itself, not a plain folder inside another repository. See Which commits were deployed.requires(optional) states which versions of the repository this solution accepts, as a range over the tag the checkout is on:remotes: - name: iac type: git url: https://github.com/org/iac.git path: ../iac requires: ">=1.4.0 <2.0.0" # also ">=1.4.0, <2.0.0" or "~> 1.4"
validate, and sobuild runanddeploy, fail withremote_requires_unmetwhen the checkout is on a version tag outside the range, or on a tag that is not a version. Avprefix is fine, and a prerelease counts as its version (v1.5.0-rc1is in the range above,v2.0.0-rc1is not). On a branch or a bare commit, such as a sandbox followingdev, the range is not checked and an info finding says so (remote_requires_unchecked), sovalidate --strictstill passes. A checkout that is not there is not checked. The pipeline must fetch tags (Azure DevOps:fetchTags: true).referencewithfetch: external. Strata expects the checkout at.strata/remotes/<name>/<reference>, so the pipeline must repeat the ref and place or link its checkout there.
A path remote cannot be pinned by a version document or take an integration: those need strata to
own the clone and the ref. An audit sink and a GitOps step can write to one. Strata then commits in the
pipeline’s checkout and pushes with the pipeline’s credentials; see
Audit files in a repository your pipeline checked out.
A GitOps step (argocd, flux) on a path remote names the branch it pushes to, because the remote has no
reference:
# workspace
provisioners:
- name: forge_sync
tool: argocd
gitops:
remote: gitops-config # path: repos/gitops-config
output_file: apps/forge/values.yaml
branch: main # the branch pushed to
action: push # the default; commit or none stop earlier
It works as the audit sink does. Strata writes output_file in the checkout, commits only that file, and pushes
with a rebase and retry when the branch moved. As for the sink, the pipeline must check out branch: commits
strata did not make are never pushed. A destroy commits and pushes the file’s removal. deploy plan
compares with the file as the pipeline checked it out. With action: commit or none a later pipeline step
pushes, and deploy run reports gitops_not_pushed (information). strata validate reports:
Finding |
Cause |
|---|---|
|
A |
|
|
|
|
|
|
Documents in other repositories
A solution can read documents from other repositories, for example one repository per hub zone, while the shared
bases stay in the solution. List the zone checkouts as path remotes and name them in discovery.remotes:
spec:
remotes:
- name: config-zone01
type: git
url: https://git.example.com/org/config-zone01.git
path: ../config-zone01 # beside the solution, in CI and on a workstation
- name: config-zone02
type: git
url: https://git.example.com/org/config-zone02.git
path: ../config-zone02
discovery:
remotes: [config-zone01, config-zone02]
Each listed checkout is scanned like the solution root:
One namespace. Its documents join the solution’s index, so
validate,graph --unreferenced,promote statusanddeploy listsee every zone at once. A build or deploy of one deployment checks only what it needs; see Checking one deployment. A zone document canextendsa base in the solution, and a name defined in two roots is the usualduplicate_documenterror, naming both files.Paths keep their meaning. A path inside a document, such as an asset’s
source_path, is still relative to the solution root. To take a file from the zone’s own repository, name it:remote: config-zone01.excludeapplies inside each root, relative to that root. A folder with its ownstrata.yamldeeper in a checkout is a boundary, as in the solution.Every listed remote must be checked out. A pipeline that deploys one zone still checks out every zone listed, or every command fails with
document_remote_missing, naming the remote and the folder. A checkout may sit inside the solution root (repos/config-zone01); it is then scanned once, as its own root.Errors. Only a
gitremote with apathcan be listed, because documents are read before anything is cloned. A checkout with its ownstrata.yamlat its top fails withdocument_remote_has_manifest: it is a solution, not a document remote. A checkout that holds the solution root or another listed checkout fails withdocument_remote_overlaps.Provenance.
build runrecords each listed checkout’s commit inresolved.yaml, and the audit manifest copies it; see Which commits were deployed. The whole checkout counts, so any uncommitted change there makes the recorddirty.Writes. A command that edits a document, such as
promote apply, writes the file where it was found, which can be a zone checkout. Commit it there. A new document (version new) goes to the solution root unless you pass a path.Path conventions (
configuration.spec.paths) judge a document by its path relative to the root it was found in, asexcludedoes. A zone leaf atrepos/config-zone01/deploy/hubs/zone01/...is judged asdeploy/hubs/zone01/..., so write the conventions asdeploy/hubs/{hub}/...and they hold wherever the pipeline checks the zone out. A deployment whoselayers.followsnames a convention its file is outside of, or that another convention matches instead, islayers_follows_unmatched, so a misplaced leaf never passes silently.
In VS Code, open the solution and the zone checkouts as one multi-root workspace. .vscode/settings.json in the
solution maps the schemas for the solution’s folder only, so map them for every folder in the .code-workspace
file. Check that the schema path resolves in your setup; the YAML extension’s handling of a relative path there
may differ between versions:
{
"folders": [{ "path": "platform-config" }, { "path": "config-zone01" }],
"settings": {
"yaml.schemas": { "./platform-config/.strata/schemas/strata.json": ["**/*.yaml", "**/*.yml"] }
}
}
Whether to split a solution at all is a separate question. If the reason is different reviewers per zone,
CODEOWNERS on each zone folder is much cheaper than separate repositories.
Checking one deployment
Hubs and spokes rarely move to a new platform version together. Until every spoke has moved, some spoke does not validate against the platform the others use. So a command that acts on one deployment checks only what that deployment needs:
build run, everydeploysubcommand, thevaluescommands,policy, andintegrationwhen given a deployment;strata validate --deployment NAME, which can be repeated:--deployment spoke-a --deployment spoke-b.
What a deployment needs is everything it reaches: its extends bases, workspace, tenant, environments and the
bases they extend, version documents, parameter sets, and every document those name in turn, including through
${value:} tokens. The solution-wide documents count for every deployment: the configuration, provider and
topology configs, integrations and attribute configs.
An error or warning in another document is not reported. One info line counts them and names the files:
info 3 findings in 2 files outside the scope of deployment 'spoke-a' were not reported, including 1 file that
failed to load: deploy/hubs/zone02/spoke-b/deployment.yaml, deploy/hubs/zone02/spoke-b/environment.yaml.
[outside_scope]
A document the deployment needs that fails to load fails the run with its own error, not with the
unknown_referenceit would cause. A name defined twice fails the run when the deployment uses it, since strata cannot tell which copy is meant.A file strata cannot judge (YAML that does not parse, a document without a readable kind or name) is a warning, so
validate --strictstill stops on it.Matching is per file. A broken document in the same file as one the deployment needs still fails the run.
A problem one deployment’s values cause in a shared document belongs to that deployment. A base that both spokes extend can pick an environment by parameter (
"ring-profile-${param:ring.profile}-env"). When spoke B’s profile exists only on a newer platform, the error is written against the base, but only spoke B fails, and the info line names spoke B’s file. The same goes for a${var:}in a shared module or workspace that only spoke B’s environment doesn’t declare. An error the base has for every spoke, such as an environment name it writes without a parameter, still fails every spoke that extends it.Information findings about other documents (
document_unreferenced, for example) are left out.strata validatewithout--deploymentchecks everything, as before. Run it in the pipeline that merges changes, so a broken spoke is still caught, just not by another spoke’s build.
build run records the scope in resolved.yaml, and the deploy’s audit manifest records its own; see
Which commits were deployed. The checkout is not touched, so the
commit record stays clean: there’s no need to delete the other spokes’ folders before a build.
Notes
Scope discipline: this document answers “what/where is this solution”, never “what rules govern it” — platform policy (provider/topology registries) stays in
Configuration.Remotes supply artifacts (Terraform modules, charts, copied files), not strata documents — except a
pathremote listed inspec.discovery.remotes, whose checkout is a discovery root of its own.No lock file:
reference(a remote’s pinned ref, see version.md) is declared here or overridden by aversiondocument; the checkout location is a CLI convention, not a second recorded fact.