Lightning.VersionControl.ProjectRepoConnection (Lightning v2.20.1)

Copy Markdown View Source

Ecto model for project repo connections

Summary

Functions

Returns true when any other connection already binds the given (repo, branch) to the same project tree (identified by root_project_id). Excludes the row identified by self_id so that updates to an existing connection don't conflict with themselves.

True if the given changeset's insert/update failed on the tree-uniqueness index. Used to translate a constraint violation back into the :branch_used_in_project_tree atom error at the boundary.

A file inside the CLI workspace (v2), relative to the repo root

The CLI workspace (v2), relative to the repo root

Types

t()

@type t() :: %Lightning.VersionControl.ProjectRepoConnection{
  __meta__: Ecto.Schema.Metadata.t(),
  accept: term(),
  access_token: term(),
  branch: String.t() | nil,
  config_path: term(),
  github_installation_id: String.t() | nil,
  id: Ecto.UUID.t() | nil,
  inserted_at: term(),
  local_alias: term(),
  project: nil | Lightning.Projects.Project.t() | Ecto.Association.NotLoaded,
  project_id: term(),
  repo: String.t() | nil,
  root_project_id: Ecto.UUID.t() | nil,
  sync_direction: term(),
  sync_version: term(),
  updated_at: term(),
  workspace_path: term()
}

Functions

changeset(project_repo_connection, attrs)

config_path(repo_connection)

configure_changeset(project_repo_connection, attrs)

create_changeset(project_repo_connection, attrs)

reconfigure_changeset(project_repo_connection, attrs)

tree_branch_conflict?(root_project_id, repo, branch, self_id \\ nil)

@spec tree_branch_conflict?(
  Ecto.UUID.t(),
  String.t(),
  String.t(),
  Ecto.UUID.t() | nil
) :: boolean()

Returns true when any other connection already binds the given (repo, branch) to the same project tree (identified by root_project_id). Excludes the row identified by self_id so that updates to an existing connection don't conflict with themselves.

tree_unique_violation?(changeset)

@spec tree_unique_violation?(Ecto.Changeset.t()) :: boolean()

True if the given changeset's insert/update failed on the tree-uniqueness index. Used to translate a constraint violation back into the :branch_used_in_project_tree atom error at the boundary.

workspace_file(repo_connection, path)

A file inside the CLI workspace (v2), relative to the repo root

workspace_path(repo_connection)

The CLI workspace (v2), relative to the repo root