Repository Status
This page documents the status fields that Pipelines-as-Code populates on each Repository CR. Use this reference to understand what information you can query about past PipelineRun executions. The pipelinerun_status field contains an array of RepositoryRunStatus objects, with the most recent runs typically appearing last.
RepositoryRunStatus
Each entry represents the outcome of a single PipelineRun execution.
Identifies the PipelineRun resource by name.
pipelinerun_status:
- pipelineRunName: "my-repo-run-abc123"Records when the PipelineRun started execution. Uses Kubernetes time format (RFC3339).
pipelinerun_status:
- startTime: "2024-03-01T10:30:00Z"Records when the PipelineRun completed execution. Uses Kubernetes time format (RFC3339).
pipelinerun_status:
- completionTime: "2024-03-01T10:45:00Z"Contains the Git commit SHA that Pipelines-as-Code tested in this PipelineRun.
pipelinerun_status:
- sha: "abc123def456"Provides the URL to view the commit SHA in the Git provider UI.
pipelinerun_status:
- sha_url: "https://github.com/owner/repo/commit/abc123"Contains the title of the tested commit (typically the first line of the commit message).
pipelinerun_status:
- title: "Fix authentication bug"Provides the full URL to the logs for this PipelineRun.
pipelinerun_status:
- logurl: "https://tekton.example.com/logs/my-run"Identifies the target branch for this run (for example, the base branch of a pull request).
pipelinerun_status:
- target_branch: "main"Identifies the event type that triggered this run (for example, push or pull_request).
pipelinerun_status:
- event_type: "pull_request"Describes the current state of the PipelineRun. Follows the standard Knative Conditions pattern.
Show Condition Fields
Succeeded for PipelineRun completion status.True, False, or Unknown.pipelinerun_status:
- conditions:
- type: Succeeded
status: "True"
reason: Succeeded
message: "All tasks completed successfully"Contains information about individual tasks, particularly useful for diagnosing failures. Maps task names to their failure details.
Show TaskInfos Fields
pipelinerun_status:
- failure_reason:
build-task:
name: "build-task"
message: "Build failed: compilation error"
log_snippet: "error: undefined reference to 'main'"
reason: "BuildFailed"
display_name: "Build Application"
completion_time: "2024-03-01T10:42:00Z"Complete example
apiVersion: pipelinesascode.tekton.dev/v1alpha1
kind: Repository
metadata:
name: example-repo
namespace: pipelines-as-code
spec:
url: "https://github.com/organization/repository"
pipelinerun_status:
- pipelineRunName: "example-repo-run-xyz789"
startTime: "2024-03-01T10:30:00Z"
completionTime: "2024-03-01T10:45:00Z"
sha: "abc123def456789"
sha_url: "https://github.com/organization/repository/commit/abc123def456789"
title: "Add new feature for user authentication"
logurl: "https://tekton.example.com/namespaces/pipelines-as-code/pipelineruns/example-repo-run-xyz789"
target_branch: "main"
event_type: "pull_request"
conditions:
- type: Succeeded
status: "True"
reason: Succeeded
message: "Tasks Completed: 3 (Failed: 0, Cancelled: 0), Skipped: 0"
lastTransitionTime: "2024-03-01T10:45:00Z"
- pipelineRunName: "example-repo-run-abc456"
startTime: "2024-03-01T09:00:00Z"
completionTime: "2024-03-01T09:10:00Z"
sha: "def456abc789012"
sha_url: "https://github.com/organization/repository/commit/def456abc789012"
title: "Fix build script"
logurl: "https://tekton.example.com/namespaces/pipelines-as-code/pipelineruns/example-repo-run-abc456"
target_branch: "main"
event_type: "push"
conditions:
- type: Succeeded
status: "False"
reason: Failed
message: "TaskRun example-repo-run-abc456-build failed"
lastTransitionTime: "2024-03-01T09:10:00Z"
failure_reason:
build:
name: "build"
message: "Build script failed with exit code 1"
log_snippet: |
+ npm run build
ERROR: Module not found
npm ERR! code 1
reason: "BuildScriptFailed"
display_name: "Build Application"
completion_time: "2024-03-01T09:10:00Z"Accessing status
You can query the status using kubectl:
# Get the full status
kubectl get repository example-repo -o jsonpath='{.pipelinerun_status}' | jq .
# Get the latest run status
kubectl get repository example-repo -o jsonpath='{.pipelinerun_status[-1]}' | jq .
# Get the last run's success status
kubectl get repository example-repo -o jsonpath='{.pipelinerun_status[-1].conditions[?(@.type=="Succeeded")].status}'