Uploaded image for project: 'OpenShift Dev Console'
  1. OpenShift Dev Console
  2. ODC-4277

Code assistance for referencing params in pipeline builder

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Normal Normal
    • openshift-4.8
    • None
    • UI
    • ODC Sprint 200

      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

      1. 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
      2. 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
      3. Compile a list of auto complete values:
        1. Pipeline Parameters
          • List all parameters from the Pipeline "Parameters" section (params.<param-name>)
          • eg: $(params.my-pipeline-param)
        2. Pipeline Workspaces
          • List all workspaces from the Pipeline "Workspaces" section (workspaces.<workspace name>.bound)
          • eg $(workspaces.workspace-name.bound)
        3. 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)
        4. 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)
        5. 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)
      4. 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
      5. 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

              aballantyne Andrew Ballantyne
              rh-ee-ssadeghi Siamak Sadeghianfar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: