Lightning.Projects.Provisioner (Lightning v2.19.0-pre)
View SourceProvides functions for importing projects. This module is used by the provisioning HTTP API.
When providing a project to import, all records must have an id field.
It's up to the caller to ensure that the id is unique and generated
ahead of time in the case of new records.
Summary
Functions
Import a project document into the database.
Preload all dependencies for a project.
Validate that there are no extraneous parameters in the changeset.
Functions
@spec import_document( Lightning.Projects.Project.t() | nil, Lightning.Accounts.User.t() | Lightning.VersionControl.ProjectRepoConnection.t(), map(), keyword() ) :: {:error, Ecto.Changeset.t(Lightning.Projects.Project.t()) | Lightning.Extensions.UsageLimiting.message()} | {:ok, Lightning.Projects.Project.t()}
Import a project document into the database.
Upserts the project and the associations carried in the document (workflows, project credentials, collections) inside a single transaction, then fires audit, version-bump, and snapshot side effects.
Generic pipeline shared by YAML provisioning, CLI deploys, GitHub syncs,
and sandbox merges. It only acts on what the document contains —
sandbox-specific behaviours (credential cloning, dataclip copying,
collection name sync) are composed around this call in
Lightning.Projects.Sandboxes.
Options
:allow_stale- If true, allows stale operations during import (useful for merge operations where concurrent modifications are expected). Defaults to false.
@spec parse_document( Lightning.Projects.Project.t(), map(), Lightning.Accounts.User.t() | Lightning.VersionControl.ProjectRepoConnection.t() | nil ) :: Ecto.Changeset.t(Lightning.Projects.Project.t())
@spec preload_dependencies(Lightning.Projects.Project.t(), nil | [Ecto.UUID.t(), ...]) :: Lightning.Projects.Project.t()
Preload all dependencies for a project.
Exclude deleted workflows.
Validate that there are no extraneous parameters in the changeset.
For all params in the changeset, ensure that the param is in the list of known fields in the schema.