-
Story
-
Resolution: Done
-
Normal
-
None
Description
As a user, while I'm crafting my Pipeline, I would like to get some assistance configuring my parameters against known variables.
Acceptance Criteria
- Add wording to inform the user that they can activate code assistance
- Add the shortcuts section in the header
- Make the header sticky so they will always be able to see it
- Add the wording under the Params header
- Support the type detection of "$(" to trigger the auto complete & keyboard shortcut (CTRL + Space – YAML editor keybinding)
- Suggestion: CTRL + Space adds "$(" at cursor and triggers the auto complete dropdown
- Compile a list of auto complete values:
- Pipeline Parameters
- List all parameters from the Pipeline "Parameters" section (params.<param-name>)
- eg: $(params.my-pipeline-param)
- Pipeline Workspaces
- List all workspaces from the Pipeline "Workspaces" section (workspaces.<workspace name>.bound)
- eg $(workspaces.workspace-name.bound)
- Context-based values
- The PipelineRun Name (context.pipelineRun.name)
- The PipelineRun Namespace (context.pipelineRun.namespace)
- The PipelineRun UID (context.pipelineRun.uid)
- The Pipeline Name (context.pipeline.name)
- Task Statuses (only for Finally tasks based on non-Finally tasks)
- The status of another task (tasks.<Pipeline taskName>.status)
- eg $(tasks.first-add.status)
- Task Results (all tasks that are not in a runAfter path of this Task or this Task itself)
- List all task result names associated with the task (excluding own results)
- tasks.<Pipeline taskName>.results.<resultName inside Task>
- eg: $(tasks.first-add.results.sum)
- Pipeline Parameters
- Support auto complete assistance/trimming
- Split on "." and left-match text, show all that match
- eg "$(par" will find all Parameters as well as any "dot" section that starts with "par"
- eg "$(name" will find "params.name-of-repo", "context.pipelineRun.name", "context.pipelineRun.namespace", "tasks.first-add.results.name", etc
- On selection, replace the "$(", and whatever they typed after to filter*, with "$(...their selected value...)"
- * Break on the first space
- Concern around replacement (do extra testing to make sure we can smoothly drop in the param)
Details:
Variable documentation: https://tekton.dev/docs/pipelines/variables/
Final UX Design: https://docs.google.com/document/d/1sXWl6roQdsgjzG8op_MrX9QK3tdXQ-bE62mPXw6xI2M/edit