gcip2.pipeline_core

Classes

Artifacts(*[, paths, exclude, expose_as, ...])

Create a new model by parsing and validating input data from keyword arguments.

ArtifactsAccess(*values)

ArtifactsReports(*[, accessibility, ...])

Create a new model by parsing and validating input data from keyword arguments.

ArtifactsReportsCoverage(*[, ...])

Create a new model by parsing and validating input data from keyword arguments.

ArtifactsWhen(*values)

BaseInput(*[, type, description, options, ...])

Create a new model by parsing and validating input data from keyword arguments.

BaseInputType(*values)

BaseModel(**extra_data)

Create a new model by parsing and validating input data from keyword arguments.

Default(*[, after_script, artifacts, ...])

Create a new model by parsing and validating input data from keyword arguments.

Docker(*[, platform, user])

Create a new model by parsing and validating input data from keyword arguments.

GlobalVariables(*[, value, expand, ...])

Create a new model by parsing and validating input data from keyword arguments.

IdTokens(*[, aud])

Create a new model by parsing and validating input data from keyword arguments.

Identity(*values)

Image(*[, name, entrypoint])

Create a new model by parsing and validating input data from keyword arguments.

IncludeComponent(*[, inputs, rules, component])

Create a new model by parsing and validating input data from keyword arguments.

IncludeItem(*[, inputs, rules])

Create a new model by parsing and validating input data from keyword arguments.

IncludeLocalItem(*, local, **extra_data)

Create a new model by parsing and validating input data from keyword arguments.

IncludeRule(**extra_data)

Create a new model by parsing and validating input data from keyword arguments.

Job(*[, image, services, before_script, ...])

Create a new model by parsing and validating input data from keyword arguments.

JobBuilder()

JobBuilderImpl(_config, _di)

JobRule(*[, if_, changes, exists, ...])

Create a new model by parsing and validating input data from keyword arguments.

JobTemplate(*[, image, services, ...])

Create a new model by parsing and validating input data from keyword arguments.

JobVariables(*[, value, expand])

Defines default variables for all jobs.

JobWhen(*values)

Kubernetes(*, user, **extra_data)

Create a new model by parsing and validating input data from keyword arguments.

Needs(*[, pipeline, job, project, optional, ...])

Create a new model by parsing and validating input data from keyword arguments.

Parallel(*[, matrix])

Create a new model by parsing and validating input data from keyword arguments.

Pipeline(*[, jobs, workflow, stages, ...])

Create a new model by parsing and validating input data from keyword arguments.

PullPolicy(*values)

Rule(*[, if_, changes, exists, variables])

Create a new model by parsing and validating input data from keyword arguments.

RuleChanges(*[, paths, compare_to])

Create a new model by parsing and validating input data from keyword arguments.

RuleExists(*[, paths, project, ref])

Create a new model by parsing and validating input data from keyword arguments.

RuleVariables(*[, value, expand])

Create a new model by parsing and validating input data from keyword arguments.

Services(*, name[, entrypoint, docker, ...])

Similar to image property, but will link the specified services to the image container.

Stage(*values)

Trigger(*[, project, ref, file, branch, ...])

Trigger allows you to define downstream pipeline trigger.

TriggerForward(*[, yaml_variables, ...])

Create a new model by parsing and validating input data from keyword arguments.

TriggerIncludeArtifact(*[, job, artifact])

Create a new model by parsing and validating input data from keyword arguments.

TriggerIncludeLocal(*[, local])

Create a new model by parsing and validating input data from keyword arguments.

TriggerIncludeTemplate(*[, template])

Create a new model by parsing and validating input data from keyword arguments.

TriggerStrategy(*values)

Workflow(*[, name, auto_cancel, rules])

Create a new model by parsing and validating input data from keyword arguments.

WorkflowAutoCancel(*[, on_job_failure, ...])

Create a new model by parsing and validating input data from keyword arguments.

WorkflowAutoCancelOnJobFailure(*values)

WorkflowAutoCancelOnNewCommit(*values)

WorkflowRule(*[, if_, changes, exists, ...])

Create a new model by parsing and validating input data from keyword arguments.

WorkflowWhen(*values)

class gcip2.pipeline_core.Trigger(*, project=None, ref=None, file=None, branch=None, strategy=None, include=None, forward=None, component=None, remote=None, inputs=None, **extra_data)[source]

Bases: BaseModel

Trigger allows you to define downstream pipeline trigger.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
  • project (str | None)

  • ref (str | None)

  • file (str | None)

  • branch (str | None)

  • strategy (TriggerStrategy | None)

  • include (list[TriggerIncludeArtifact | TriggerIncludeLocal | TriggerIncludeTemplate] | None)

  • forward (TriggerForward | None)

  • component (str | None)

  • remote (str | None)

  • inputs (Any | None)

  • extra_data (Any)

project: str | None

Path to the project, e.g. group/project, or group/sub-group/project.

ref: str | None

Branch/Tag/Commit hash for the target project.

file: str | None

Relative path from repository root (/) to the pipeline configuration YAML file.

branch: str | None

The branch name that a downstream pipeline will use

strategy: TriggerStrategy | None

depend or mirror

Type:

You can mirror or depend on the pipeline status from the triggered pipeline to the source bridge job by using strategy

include: list[TriggerIncludeArtifact | TriggerIncludeLocal | TriggerIncludeTemplate] | None
forward: TriggerForward | None

Specify what to forward to the downstream pipeline.

component: str | None

Local path to component directory or full path to external component directory.

remote: str | None

URL to a yaml/yml template file using HTTP/HTTPS.

inputs: Any | None

Used to pass input values to included templates, components, downstream pipelines, or child pipelines.

class gcip2.pipeline_core.Pipeline(**extra_data)[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
jobs: list[Job | JobBuilderImpl]
workflow: Workflow | None
stages: list[Stage | str] | None

Groups jobs into stages. All jobs in one stage must complete before next stage is executed.

include: list[IncludeComponent]
default: Default | None
variables: dict[str, GlobalVariables] | None
static load_pipeline_default_schema()[source]
Return type:

dict[str, Any]

validate_pipeline()[source]
Parameters:

self (Self)

Return type:

None

class gcip2.pipeline_core.Job(*, image=None, services=None, before_script=None, after_script=None, hooks=None, rules=None, variables=None, cache=None, id_tokens=None, identity=None, inputs=None, secrets=None, script=None, run=None, stage=None, only=None, extends=None, needs=None, except_=None, tags=<factory>, allow_failure=None, timeout=None, when=None, start_in=None, manual_confirmation=None, dependencies=None, artifacts=<factory>, environment=None, release=None, coverage=None, retry=None, parallel=None, interruptible=None, resource_group=None, trigger=None, inherit=None, publish=None, pages=None, name='', **extra_data)[source]

Bases: JobTemplate

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
name: str
class gcip2.pipeline_core.Stage(*values)[source]

Bases: str, Enum

PRE = '.pre'
POST = '.post'
JOBS = 'jobs'
BUILD = 'build'
TEST = 'test'
DEPLOY = 'deploy'
class gcip2.pipeline_core.Image(*, name=None, entrypoint=<factory>, **extra_data)[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
name: str | None
entrypoint: list[str]
class gcip2.pipeline_core.Needs(*, pipeline=None, job=None, project=None, optional=None, artifacts=None, parallel=None, **extra_data)[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
  • pipeline (str | None)

  • job (str | None)

  • project (str | None)

  • optional (bool | None)

  • artifacts (bool | None)

  • parallel (Parallel | int | None)

  • extra_data (Any)

pipeline: str | None
job: str | None
project: str | None
optional: bool | None
artifacts: bool | None
parallel: Parallel | int | None
class gcip2.pipeline_core.Artifacts(*, paths=None, exclude=None, expose_as=None, expire_in=None, name=None, public=None, access=None, reports=None, untracked=None, when=None, **extra_data)[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
  • paths (list[str] | None)

  • exclude (list[str] | None)

  • expose_as (str | None)

  • expire_in (str | None)

  • name (str | None)

  • public (bool | None)

  • access (ArtifactsAccess | None)

  • reports (ArtifactsReports | None)

  • untracked (bool | None)

  • when (ArtifactsWhen | None)

  • extra_data (Any)

paths: list[str] | None

A list of paths to files/folders that should be included in the artifact.

exclude: list[str] | None

A list of paths to files/folders that should be excluded in the artifact.

expose_as: str | None

Can be used to expose job artifacts in the merge request UI. GitLab will add a link <expose_as> to the relevant merge request that points to the artifact.

expire_in: str | None

Use expire_in to specify how long job artifacts are stored before they expire and are deleted.

name: str | None

name keyword to define the name of the created artifacts archive. You can specify a unique name for every archive.

Type:

Use the artifacts

public: bool | None

public to determine whether the job artifacts should be publicly available.

Type:

Use artifacts

access: ArtifactsAccess | None

access to determine who can access the job artifacts from the GitLab UI or API.

Type:

Use artifacts

reports: ArtifactsReports | None
untracked: bool | None

paths).

Type:

Use artifacts

Type:

untracked to add all Git untracked files as artifacts (along with the paths defined in artifacts

when: ArtifactsWhen | None

when to upload artifacts on job failure or despite the failure.

Type:

Use artifacts

class gcip2.pipeline_core.ArtifactsReports(*, accessibility=None, annotations=None, api_fuzzing=None, browser_performance=None, coverage_report=None, codequality=None, container_scanning=None, coverage_fuzzing=None, cyclonedx=None, dast=None, dependency_scanning=None, dotenv=None, junit=None, load_performance=None, metrics=None, requirements=None, sarif=None, sast=None, secret_detection=None, terraform=None, **extra_data)[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
accessibility: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportsaccessibility

Type:

https

annotations: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportsannotations

Type:

https

api_fuzzing: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportsapi_fuzzing

Type:

https

browser_performance: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportsbrowser_performance

Type:

https

coverage_report: ArtifactsReportsCoverage | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportscoverage_report

Type:

https

codequality: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportscodequality

Type:

https

container_scanning: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportscontainer_scanning

Type:

https

coverage_fuzzing: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportscoverage_fuzzing

Type:

https

cyclonedx: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportscyclonedx

Type:

https

dast: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportsdast

Type:

https

dependency_scanning: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportsdependency_scanning

Type:

https

dotenv: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportsdotenv

Type:

https

junit: str | list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportsjunit

Type:

https

load_performance: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportsload_performance

Type:

https

metrics: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportsmetrics

Type:

https

requirements: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportsrequirements

Type:

https

sarif: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportssarif

Type:

https

sast: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportssast

Type:

https

secret_detection: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportssecret_detection

Type:

https

terraform: list[str] | None

//docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportsterraform

Type:

https

class gcip2.pipeline_core.IncludeComponent(*, inputs=None, rules=None, component=None, **extra_data)[source]

Bases: IncludeItem

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
component: str | None

Local path to component directory or full path to external component directory.

class gcip2.pipeline_core.BaseInput(*, type=BaseInputType.STRING, description=None, options=None, regex=None, default=None, **extra_data)[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
  • type (BaseInputType | None)

  • description (str | None)

  • options (list[BaseInputType] | None)

  • regex (str | None)

  • default (Any | None)

  • extra_data (Any)

type: BaseInputType | None

Input type. Defaults to ‘string’ when not specified.

description: str | None

Human-readable explanation of the parameter.

options: list[BaseInputType] | None

List of allowed values for this input.

regex: str | None

Regular expression that string values must match.

default: Any | None

Default value for this input.

class gcip2.pipeline_core.Workflow(*, name=None, auto_cancel=None, rules=None, **extra_data)[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
name: str | None

Defines the pipeline name.

auto_cancel: WorkflowAutoCancel | None

Define the rules for when pipeline should be automatically cancelled.

rules: list[WorkflowRule] | None
class gcip2.pipeline_core.WorkflowAutoCancel(*, on_job_failure=None, on_new_commit=None, **extra_data)[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
on_job_failure: WorkflowAutoCancelOnJobFailure | None

Define which jobs to stop after a job fails.

on_new_commit: WorkflowAutoCancelOnNewCommit | None

Configure the behavior of the auto-cancel redundant pipelines feature.

class gcip2.pipeline_core.Rule(*, if_=None, changes=None, exists=None, variables=None, **extra_data)[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
if_: str | None

Expression to evaluate whether additional attributes should be provided to the job.

changes: RuleChanges | list[str] | None

Additional attributes will be provided to job if any of the provided paths matches a modified file.

exists: RuleExists | list[str] | None

Additional attributes will be provided to job if any of the provided paths matches an existing file in the repository.

variables: dict[str, str] | None

Defines variables for a rule result.

class gcip2.pipeline_core.WorkflowAutoCancelOnJobFailure(*values)[source]

Bases: str, Enum

NONE = 'none'
ALL = 'all'
class gcip2.pipeline_core.RuleChanges(*, paths=<factory>, compare_to=None, **extra_data)[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
paths: list[str]

List of file paths.

compare_to: str | None

Ref for comparing changes.

class gcip2.pipeline_core.WorkflowAutoCancelOnNewCommit(*values)[source]

Bases: str, Enum

NONE = 'none'
CONSERVATIVE = 'conservative'
INTERRUPTIBLE = 'interruptible'
class gcip2.pipeline_core.JobVariables(*, value=None, expand=None, **extra_data)[source]

Bases: BaseModel

Defines default variables for all jobs. Job level property overrides global variables.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
value: str | bool | int | float | None

Default value of the variable. If used with options, value must be included in the array.

expand: bool | None

If the variable is expandable or not.

class gcip2.pipeline_core.GlobalVariables(*, value=None, expand=None, description=None, options=<factory>, **extra_data)[source]

Bases: JobVariables

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
description: str | None

Explains what the variable is used for, what the acceptable values are.

options: list[str | bool | int | float] | None

A list of predefined values that users can select from in the Run pipeline page when running a pipeline manually.

class gcip2.pipeline_core.Default(*, after_script=None, artifacts=None, before_script=None, hooks=None, cache=None, image=None, interruptible=None, id_tokens=None, identity=None, retry=None, services=None, tags=None, timeout=None, **extra_data)[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
  • after_script (str | list[str] | None)

  • artifacts (Artifacts | None)

  • before_script (str | list[str] | None)

  • hooks (Any | None)

  • cache (Any | None)

  • image (Image | None)

  • interruptible (bool | None)

  • id_tokens (IdTokens | None)

  • identity (Identity | None)

  • retry (Any | None)

  • services (Any | None)

  • tags (list[str] | None)

  • timeout (str | None)

  • extra_data (Any)

after_script: str | list[str] | None
artifacts: Artifacts | None
before_script: str | list[str] | None
hooks: Any | None
cache: Any | None
image: Image | None
interruptible: bool | None

Interruptible is used to indicate that a job should be canceled if made redundant by a newer pipeline run.

id_tokens: IdTokens | None

Defines JWTs to be injected as environment variables.

identity: Identity | None

Sets a workload identity (experimental), allowing automatic authentication with the external system.

retry: Any | None

Retry a job if it fails. Can be a simple integer or object definition.

services: Any | None
tags: list[str] | None
timeout: str | None

Allows you to configure a timeout for a specific job (e.g. 1 minute, 1h 30m 12s).