groups:
  - id: registry.cicd.pipeline
    type: attribute_group
    display_name: CI/CD Pipeline Attributes
    brief: >
      This group describes attributes specific to pipelines within a Continuous
      Integration and Continuous Deployment (CI/CD) system. A
      [pipeline](https://wikipedia.org/wiki/Pipeline_(computing)) in this
      case is a series of steps that are performed in order to deliver a new
      version of software. This aligns with the
      [Britannica](https://www.britannica.com/dictionary/pipeline) definition
      of a pipeline where a **pipeline** is the system for developing and
      producing something. In the context of CI/CD, a pipeline produces or
      delivers software.
    attributes:
      - id: cicd.pipeline.name
        type: string
        stability: development
        brief: >
          The human readable name of the pipeline within a CI/CD system.
        examples:
          [
            "Build and Test",
            "Lint",
            "Deploy Go Project",
            "deploy_to_environment",
          ]
      - id: cicd.pipeline.run.id
        type: string
        stability: development
        brief: >
          The unique identifier of a pipeline run within a CI/CD system.
        examples: ["120912"]
      - id: cicd.pipeline.run.url.full
        type: string
        stability: development
        brief: >
          The [URL](https://wikipedia.org/wiki/URL) of the pipeline run,
          providing the complete address in order to locate and identify the pipeline run.
        examples:
          [
            "https://github.com/open-telemetry/semantic-conventions/actions/runs/9753949763?pr=1075",
          ]
      - id: cicd.pipeline.run.state
        type:
          members:
            - id: pending
              value: pending
              brief: >
                The run pending state spans from the event triggering the pipeline run until the execution of the run starts (eg. time spent in a queue, provisioning agents, creating run resources).
              stability: development
            - id: executing
              value: executing
              brief: The executing state spans the execution of any run tasks (eg. build, test).
              stability: development
            - id: finalizing
              value: finalizing
              brief: The finalizing state spans from when the run has finished executing (eg. cleanup of run resources).
              stability: development
        stability: development
        brief: >
          The pipeline run goes through these states during its lifecycle.
        examples: ["pending", "executing", "finalizing"]
      - id: cicd.pipeline.task.name
        type: string
        stability: development
        brief: >
          The human readable name of a task within a pipeline. Task here most
          closely aligns with a [computing process](https://wikipedia.org/wiki/Pipeline_(computing))
          in a pipeline. Other terms for tasks include commands, steps, and
          procedures.
        examples: ["Run GoLang Linter", "Go Build", "go-test", "deploy_binary"]
      - id: cicd.pipeline.task.run.id
        type: string
        stability: development
        brief: >
          The unique identifier of a task run within a pipeline.
        examples: ["12097"]
      - id: cicd.pipeline.task.run.url.full
        type: string
        stability: development
        brief: >
          The [URL](https://wikipedia.org/wiki/URL) of the pipeline task run,
          providing the complete address in order to locate and identify the pipeline task run.
        examples:
          [
            "https://github.com/open-telemetry/semantic-conventions/actions/runs/9753949763/job/26920038674?pr=1075",
          ]
      - id: cicd.pipeline.task.run.result
        type:
          members:
            - id: success
              value: success
              brief: "The task run finished successfully."
              stability: development
            - id: failure
              value: failure
              brief: >-
                The task run did not finish successfully, eg. due to a compile error or a failing test.
                Such failures are usually detected by non-zero exit codes of the tools executed in the task run.
              stability: development
            - id: error
              value: error
              brief: >-
                The task run failed due to an error in the CICD system, eg. due to the worker being killed.
              stability: development
            - id: timeout
              value: timeout
              brief: "A timeout caused the task run to be interrupted."
              stability: development
            - id: cancellation
              value: cancellation
              brief: "The task run was cancelled, eg. by a user manually cancelling the task run."
              stability: development
            - id: skip
              value: skip
              brief: "The task run was skipped, eg. due to a precondition not being met."
              stability: development
        stability: development
        brief: >
          The result of a task run.
        examples: ["success", "failure", "timeout", "skipped"]
      - id: cicd.pipeline.task.type
        type:
          members:
            - id: build
              value: build
              brief: build
              stability: development
            - id: test
              value: test
              brief: test
              stability: development
            - id: deploy
              value: deploy
              brief: deploy
              stability: development
        stability: development
        brief: >
          The type of the task within a pipeline.
        examples: ["build", "test", "deploy"]
      - id: cicd.pipeline.result
        type:
          members:
            - id: success
              value: success
              brief: "The pipeline run finished successfully."
              stability: development
            - id: failure
              value: failure
              brief: >-
                The pipeline run did not finish successfully, eg. due to a compile error or a failing test.
                Such failures are usually detected by non-zero exit codes of the tools executed in the pipeline run.
              stability: development
            - id: error
              value: error
              brief: >-
                The pipeline run failed due to an error in the CICD system, eg. due to the worker being killed.
              stability: development
            - id: timeout
              value: timeout
              brief: "A timeout caused the pipeline run to be interrupted."
              stability: development
            - id: cancellation
              value: cancellation
              brief: "The pipeline run was cancelled, eg. by a user manually cancelling the pipeline run."
              stability: development
            - id: skip
              value: skip
              brief: "The pipeline run was skipped, eg. due to a precondition not being met."
              stability: development
        stability: development
        brief: >
          The result of a pipeline run.
        examples: ["success", "failure", "timeout", "skipped"]
      - id: cicd.pipeline.action.name
        type:
          members:
            - id: build
              value: BUILD
              brief: The pipeline run is executing a build.
              stability: development
            - id: run
              value: RUN
              brief: The pipeline run is executing.
              stability: development
            - id: sync
              value: SYNC
              brief: The pipeline run is executing a sync.
              stability: development
        stability: development
        brief: >
          The kind of action a pipeline run is performing.
        examples: ["BUILD", "RUN", "SYNC"]
      - id: cicd.worker.id
        type: string
        stability: development
        brief: The unique identifier of a worker within a CICD system.
        examples:
          [
            "abc123",
            "10.0.1.2",
            "controller",
          ]
      - id: cicd.worker.name
        type: string
        stability: development
        brief: The name of a worker within a CICD system.
        examples:
          [
            "agent-abc",
            "controller",
            "Ubuntu LTS"
          ]
      - id: cicd.worker.url.full
        type: string
        stability: development
        brief: The [URL](https://wikipedia.org/wiki/URL) of the worker,
          providing the complete address in order to locate and identify the worker.
        examples:
          [
            "https://cicd.example.org/worker/abc123",
          ]
      - id: cicd.worker.state
        type:
          members:
            - id: available
              value: available
              brief: >-
                The worker is not performing work for the CICD system.
                It is available to the CICD system to perform work on (online / idle).
              note: "Pipelines might have conditions on which workers they are able to run so not every worker might be available to every pipeline."
              stability: development
            - id: busy
              value: busy
              brief: "The worker is performing work for the CICD system."
              stability: development
            - id: offline
              value: offline
              brief: "The worker is not available to the CICD system (disconnected / down)."
              stability: development
        stability: development
        brief: >
          The state of a CICD worker / agent.
        examples: ["idle", "busy", "down"]
      - id: cicd.system.component
        type: string
        stability: development
        brief: The name of a component of the CICD system.
        examples:
          [
            "controller",
            "scheduler",
            "agent",
          ]
