Lightning.Projects.Provisioner (Lightning v2.19.0-pre)

View Source

Provides 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

import_document(project, user_or_repo_connection, data, opts \\ [])

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.

parse_document(project, data, user_or_repo_connection \\ nil)

preload_dependencies(project, snapshots \\ nil)

@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_extraneous_params(changeset, opts \\ [])

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.