Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ga/stepactions #4

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
uses: github/codeql-action/init@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand Down Expand Up @@ -96,4 +96,4 @@ jobs:
make -j 4 all

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
uses: github/codeql-action/analyze@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
uses: github/codeql-action/upload-sarif@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
with:
sarif_file: results.sarif
18 changes: 18 additions & 0 deletions config/300-crds/300-stepaction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,24 @@ spec:
subresources:
status: {}
- name: v1beta1
served: true
storage: false
schema:
openAPIV3Schema:
type: object
# One can use x-kubernetes-preserve-unknown-fields: true
# at the root of the schema (and inside any properties, additionalProperties)
# to get the traditional CRD behaviour that nothing is pruned, despite
# setting spec.preserveUnknownProperties: false.
#
# See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/
# See issue: https://github.com/knative/serving/issues/912
x-kubernetes-preserve-unknown-fields: true
# Opt into the status subresource so metadata.generation
# starts to increment
subresources:
status: {}
- name: v1
served: true
storage: true
schema:
Expand Down
3 changes: 0 additions & 3 deletions config/config-feature-flags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ data:
keep-pod-on-cancel: "false"
# Setting this flag to "true" will enable the CEL evaluation in WhenExpression
enable-cel-in-whenexpression: "false"
# Setting this flag to "true" will enable the use of StepActions in Steps
# This feature is in preview mode and not implemented yet. Please check #7259 for updates.
enable-step-actions: "false"
# Setting this flag to "true" will enable the use of Artifacts in Steps
# This feature is in preview mode and not implemented yet. Please check #7693 for updates.
enable-artifacts: "false"
Expand Down
4 changes: 4 additions & 0 deletions docs/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,10 @@ format. For example, valid values are `1h30m`, `1h`, `1m`, and `60s`.

**Note:** If you do not specify a `Timeout` value, Tekton instead honors the timeout for the [`PipelineRun`](pipelineruns.md#configuring-a-pipelinerun).

**Note:** If the specified `Task` timeout is greater than the Pipeline timeout as configured in the [`PipelineRun`](pipelineruns.md#configuring-a-failure-timeout), the Pipeline will time-out first causing the `Task` to timeout before its configured timeout.
For example, if the `PipelineRun` sets `timeouts.pipeline = 1h` and the `Pipeline` sets `tasks[0].timeout = 3h`, the task will still timeout after `1h`.
See [`PipelineRun - Configuring a failure timeout`](pipelineruns.md#configuring-a-failure-timeout) for details.

In the example below, the `build-the-image` `Task` is configured to time out after 90 seconds:

```yaml
Expand Down
15 changes: 15 additions & 0 deletions docs/stepactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,21 @@ spec:

**Note:** If a `Step` declares `params` for an `inlined Step`, it will also lead to a validation error. This is because an `inlined Step` gets its `params` from the `TaskRun`.

#### Parameter Substitution Precedence

When applying parameters to a StepAction, the substitutions are applied in the following order:

1. TaskRun parameter values in step parameters
2. Parameters from StepAction defaults
3. Parameters from the step (overwriting any defaults)
4. Step result replacements

This order ensures that:
- Step parameters can reference TaskRun parameters
- StepAction defaults provide fallback values
- Step-specific parameters take precedence over defaults
- Step result references are resolved last to allow referencing results from previous steps

### Emitting Results

A `StepAction` also declares the results that it will emit.
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/pipelineruns/alpha/stepaction-params.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: tekton.dev/v1alpha1
apiVersion: tekton.dev/v1
kind: StepAction
metadata:
name: step-action
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/taskruns/alpha/stepaction-when.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
accessModes:
- ReadWriteOnce
---
apiVersion: tekton.dev/v1alpha1
apiVersion: tekton.dev/v1
kind: StepAction
metadata:
name: step-action-when
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/taskruns/beta/stepaction-params.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: StepAction
metadata:
name: step-action
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/taskruns/beta/stepaction-passing-results.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: StepAction
metadata:
name: step-action
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/taskruns/beta/stepaction-results.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: StepAction
metadata:
name: step-action
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/taskruns/beta/stepaction.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: StepAction
metadata:
name: step-action
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/taskruns/beta/stepactions-steptemplate.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: StepAction
metadata:
name: step-action
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/ahmetb/gen-crd-api-reference-docs v0.3.1-0.20220720053627-e327d0730470 // Waiting for https://github.com/ahmetb/gen-crd-api-reference-docs/pull/43/files to merge
github.com/cloudevents/sdk-go/v2 v2.15.2
github.com/containerd/containerd v1.7.25
github.com/go-git/go-git/v5 v5.13.1
github.com/go-git/go-git/v5 v5.13.2
github.com/google/go-cmp v0.6.0
github.com/google/go-containerregistry v0.20.2
github.com/google/uuid v1.6.0
Expand Down Expand Up @@ -57,7 +57,7 @@ require (
)

require (
github.com/ProtonMail/go-crypto v1.1.3 // indirect
github.com/ProtonMail/go-crypto v1.1.5 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.6.2
Expand All @@ -69,7 +69,7 @@ require (
)

require (
cel.dev/expr v0.18.0 // indirect
cel.dev/expr v0.19.0 // indirect
cloud.google.com/go v0.116.0 // indirect
cloud.google.com/go/auth v0.13.0 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect
Expand Down Expand Up @@ -122,7 +122,7 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pjbgf/sha1cd v0.3.2 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.9.0 // indirect
Expand Down Expand Up @@ -240,8 +240,8 @@ require (
golang.org/x/tools v0.23.0 // indirect
google.golang.org/api v0.214.0 // indirect
google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect
google.golang.org/grpc v1.69.4
google.golang.org/protobuf v1.36.3
google.golang.org/grpc v1.70.0
google.golang.org/protobuf v1.36.4
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
32 changes: 16 additions & 16 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading