Skip to content

Commit

Permalink
fix mapping between Status.Steps and Status.TaskSpec.Steps (#1188) (#…
Browse files Browse the repository at this point in the history
…1203)

* fix mapping between Status.Steps and Status.TaskSpec.Steps (#1188)

* .github: add github-actions to dependabot… (#1194)

* .github: add github-actions to dependabot…

… so that we also get dependabot actions updates. Today, we seems to
be using deprecated actions.

Signed-off-by: Vincent Demeester <[email protected]>

* .github/workflows: update some action versions

Signed-off-by: Vincent Demeester <[email protected]>

---------

Signed-off-by: Vincent Demeester <[email protected]>

---------

Signed-off-by: Vincent Demeester <[email protected]>
Co-authored-by: Vincent Demeester <[email protected]>
  • Loading branch information
jkhelil and vdemeester authored Sep 16, 2024
1 parent 7fd8992 commit f397ed6
Show file tree
Hide file tree
Showing 8 changed files with 555 additions and 27 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,17 @@ updates:
all:
patterns:
- "*"
labels:
- "ok-to-test"
- "dependencies"
- "release-note-none"
- "kind/misc"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "ok-to-test"
- "dependencies"
- "release-note-none"
- "kind/misc"
4 changes: 2 additions & 2 deletions .github/workflows/goclean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
goclean:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # check-out repository
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: '1.22'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: "1.22"

- uses: actions/checkout@v3
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6.1.0
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
Expand Down
22 changes: 4 additions & 18 deletions .github/workflows/reusable-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,12 @@ jobs:
TEKTON_CLI_RELEASE: "0.30.0"

steps:
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
- uses: actions/cache@v2
with:
# In order:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
${{ env.KOCACHE }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x

- uses: imjasonh/setup-ko@v0.6
- uses: ko-build/setup-ko@v0.7
with:
version: tip

Expand All @@ -64,7 +50,7 @@ jobs:
chmod u+x ./tkn
- name: Check out our repo
uses: actions/checkout@v2
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: ./src/github.com/tektoncd/chains

Expand Down Expand Up @@ -140,7 +126,7 @@ jobs:
- name: Collect diagnostics
if: ${{ failure() }}
uses: chainguard-dev/actions/kind-diag@84c993eaf02da1c325854fb272a4df9184bd80fc # main
uses: chainguard-dev/actions/kind-diag@9ba949ac63357c725a9438f3e05a1e33d313498e # main
with:
cluster-resources: nodes
namespace-resources: pods,taskruns,jobs
136 changes: 136 additions & 0 deletions pkg/chains/formats/slsa/testdata/pipeline-v1beta1/taskrun4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
"metadata": {
"name": "mismatch Status.Step.Name and Status.TaskSpec.Step.Name",
"labels": {
"tekton.dev/pipelineTask": "build"
}
},
"spec": {
"params": [
{
"name": "IMAGE",
"value": "test.io/test/image"
},
{
"name": "CHAINS-GIT_COMMIT",
"value": "sha:taskrun"
},
{
"name": "CHAINS-GIT_URL",
"value": "https://git.test.com"
}
],
"taskRef": {
"name": "build",
"kind": "Task"
},
"serviceAccountName": "default"
},
"status": {
"startTime": "2021-03-29T09:50:00Z",
"completionTime": "2021-03-29T09:50:15Z",
"conditions": [
{
"type": "Succeeded",
"status": "True",
"lastTransitionTime": "2021-03-29T09:50:15Z",
"reason": "Succeeded",
"message": "All Steps have completed executing"
}
],
"podName": "test-pod-name",
"steps": [
{
"name": "unnamed-",
"container": "step-step1",
"imageID": "docker-pullable://gcr.io/test7/test7@sha256:d4b63d3e24d6eef04a6dc0795cf8a73470688803d97c52cffa3c8d4efd3397b6"
},
{
"name": "step2",
"container": "step-step2",
"imageID": "docker-pullable://gcr.io/test8/test8@sha256:4d6dd704ef58cb214dd826519929e92a978a57cdee43693006139c0080fd6fac"
},
{
"name": "step3",
"container": "step-step3",
"imageID": "docker-pullable://gcr.io/test9/test9@sha256:f1a8b8549c179f41e27ff3db0fe1a1793e4b109da46586501a8343637b1d0478"
}
],
"taskResults": [
{
"name": "IMAGE_DIGEST",
"value": "sha256:827521c857fdcd4374f4da5442fbae2edb01e7fbae285c3ec15673d4c1daecb7"
},
{
"name": "IMAGE_URL",
"value": "gcr.io/my/image"
}
],
"taskSpec": {
"params": [
{
"name": "IMAGE",
"type": "string"
},
{
"name": "filename",
"type": "string"
},
{
"name": "DOCKERFILE",
"type": "string"
},
{
"name": "CONTEXT",
"type": "string"
},
{
"name": "EXTRA_ARGS",
"type": "string"
},
{
"name": "BUILDER_IMAGE",
"type": "string"
}, {
"name": "CHAINS-GIT_COMMIT",
"type": "string",
"default": "sha:task"
}, {
"name": "CHAINS-GIT_URL",
"type": "string",
"default": "https://defaultgit.test.com"
}
],
"steps": [
{
"name": "step1"
},
{
"name": "step2"
},
{
"name": "step3"
}
],
"results": [
{
"name": "IMAGE_DIGEST",
"description": "Digest of the image just built."
},
{
"name": "filename_DIGEST",
"description": "Digest of the file just built."
}
]
},
"provenance": {
"refSource": {
"uri": "github.com/test",
"digest": {
"sha1": "ab123"
},
"entryPoint": "build.yaml"
}
}
}
}
141 changes: 141 additions & 0 deletions pkg/chains/formats/slsa/testdata/pipeline-v1beta1/taskrun5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
"metadata": {
"name": "mismatch size between Status.Steps and Status.TaskSpec.Steps",
"labels": {
"tekton.dev/pipelineTask": "build"
}
},
"spec": {
"params": [
{
"name": "IMAGE",
"value": "test.io/test/image"
},
{
"name": "CHAINS-GIT_COMMIT",
"value": "sha:taskrun"
},
{
"name": "CHAINS-GIT_URL",
"value": "https://git.test.com"
}
],
"taskRef": {
"name": "build",
"kind": "Task"
},
"serviceAccountName": "default"
},
"status": {
"startTime": "2021-03-29T09:50:00Z",
"completionTime": "2021-03-29T09:50:15Z",
"conditions": [
{
"type": "Succeeded",
"status": "True",
"lastTransitionTime": "2021-03-29T09:50:15Z",
"reason": "Succeeded",
"message": "All Steps have completed executing"
}
],
"podName": "test-pod-name",
"steps": [
{
"name": "step1",
"container": "step-step1",
"imageID": "docker-pullable://gcr.io/test10/test10@sha256:d4b63d3e24d6eef04a6dc0795cf8a73470688803d97c52cffa3c8d4efd3397b6"
},
{
"name": "step2",
"container": "step-step2",
"imageID": "docker-pullable://gcr.io/test11/test11@sha256:4d6dd704ef58cb214dd826519929e92a978a57cdee43693006139c0080fd6fac"
},
{
"name": "step3",
"container": "step-step3",
"imageID": "docker-pullable://gcr.io/test12/test12@sha256:f1a8b8549c179f41e27ff3db0fe1a1793e4b109da46586501a8343637b1d0478"
},
{
"name": "step4",
"container": "step-step3",
"imageID": "docker-pullable://gcr.io/test13/test13@sha256:f1a8b8549c179f41e27ff3db0fe1a1793e4b109da46586501a8343637b1d0478"
}
],
"taskResults": [
{
"name": "IMAGE_DIGEST",
"value": "sha256:827521c857fdcd4374f4da5442fbae2edb01e7fbae285c3ec15673d4c1daecb7"
},
{
"name": "IMAGE_URL",
"value": "gcr.io/my/image"
}
],
"taskSpec": {
"params": [
{
"name": "IMAGE",
"type": "string"
},
{
"name": "filename",
"type": "string"
},
{
"name": "DOCKERFILE",
"type": "string"
},
{
"name": "CONTEXT",
"type": "string"
},
{
"name": "EXTRA_ARGS",
"type": "string"
},
{
"name": "BUILDER_IMAGE",
"type": "string"
}, {
"name": "CHAINS-GIT_COMMIT",
"type": "string",
"default": "sha:task"
}, {
"name": "CHAINS-GIT_URL",
"type": "string",
"default": "https://defaultgit.test.com"
}
],
"steps": [
{
"name": "step1"
},
{
"name": "step2"
},
{
"name": "step3"
}
],
"results": [
{
"name": "IMAGE_DIGEST",
"description": "Digest of the image just built."
},
{
"name": "filename_DIGEST",
"description": "Digest of the file just built."
}
]
},
"provenance": {
"refSource": {
"uri": "github.com/test",
"digest": {
"sha1": "ab123"
},
"entryPoint": "build.yaml"
}
}
}
}
Loading

0 comments on commit f397ed6

Please sign in to comment.