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

Add example and docs for array param with defaults 📜 #4518

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

bobcatfish
Copy link
Collaborator

Changes

While working on (finally) updating the array result and object
param/result TEPs (tektoncd/community#479
tektoncd/community#477) I realized I hadn't
included an example of how to specify defaults for the new format, so I
looked for an example of how we currently do this for arrays, but we had
none! Hopefully now we do :D

/kind documentation

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs included if any changes are user facing
  • [n/a] Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been filled in or deleted (only if no user facing changes)

Release Notes

NONE

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/documentation Categorizes issue or PR as related to documentation. labels Jan 26, 2022
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 26, 2022
@bobcatfish bobcatfish force-pushed the document_array_defaults branch 2 times, most recently from 8de5615 to 442cca5 Compare January 26, 2022 23:54
docs/tasks.md Outdated

```yaml
params:
- name: flags
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example is a bit confusing; I would expect most people to want to use only one parameter for flags and to supply some default values for that parameter (am I misunderstanding the example?). Also, could you provide slightly more realistic default values for flags? e.g. the example above has "arg1=foo" and "--randomflag".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point - ill update this

docs/tasks.md Outdated
@@ -502,6 +502,23 @@ spec:
value: "http://google.com"
```

Parameter declarations include default values which will be used if the parameter is not specified, for example to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this sentence talking about default values for string and array parameters that are provided by Tekton or supplied by the user?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supplied by the author of the Task/Pipeline - ill add a bit more text to try to make it more clear

default: "baz"
steps:
- name: build
image: bash:3.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: IMO, adding a comment that documents the fully-resolved echo that will be executed by the task post-parameter-resolution will clarify the example.

@afrittoli
Copy link
Member

@bobcatfish it looks like this might not make it for v0.33.0 - is that ok for you?

While working on (finally) updating the array result and object
param/result TEPs (tektoncd/community#479
tektoncd/community#477) I realized I hadn't
included an example of how to specify defaults for the new format, so I
looked for an example of how we currently do this for arrays, but we had
none! Hopefully now we do :D
@bobcatfish
Copy link
Collaborator Author

Finally responded to feedback from @bendory and @lbernick - PTAL

@bobcatfish
Copy link
Collaborator Author

hm seems like something went pretty dramatically wrong, many tests failing with:

Error from server (InternalError): error when creating "STDIN": Internal error occurred: failed calling webhook "validation.webhook.pipeline.tekton.dev": Post "https://tekton-pipelines-webhook.tekton-pipelines.svc:443/resource-validation?timeout=10s": no endpoints available for service "tekton-pipelines-webhook"

/test pull-tekton-pipeline-alpha-integration-tests

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 21, 2022
Copy link
Member

@jerop jerop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 23, 2022
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jerop, vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jerop
Copy link
Member

jerop commented Mar 23, 2022

workspace-in-sidecar is a known flake: #4169

/test pull-tekton-pipeline-alpha-integration-tests
/test pull-tekton-pipeline-integration-tests

@jerop
Copy link
Member

jerop commented Mar 23, 2022

workspace-in-sidecar is a known flake: #4169

/test pull-tekton-pipeline-integration-tests

@tekton-robot tekton-robot merged commit 4c45dbd into tektoncd:main Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/documentation Categorizes issue or PR as related to documentation. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants