jenkins-x/jx

Results passed between tasks disappear when using a "uses" step

mmn0o7 opened this issue · 0 comments

mmn0o7 commented

Expected Behavior
When there is a "uses" step in a task the params that have task results in them disappear.
uses task:

    - image: uses:jenkins-x/jx3-pipeline-catalog/tasks/git-clone/git-clone.yaml@versionStream
      name: ""
      resources: {}

Actual Behavior
results passed should work regardless of uses task like previous versions.

Steps to Reproduce the Problem
create a pipeline run with a task that returns a result
create a second task with a param that receives the result
create a step in the second task with a "uses"
4 create a second step in the second task that prints the result
uses:
- image: uses:jenkins-x/jx3-pipeline-catalog/tasks/git-clone/git-clone.yaml@versionStream
name: ""
resources: {}
Additional Info
Kubernetes version:

Output of kubectl version:

Minor:"26", GitVersion:"v1.26.5-gke.1200
Tekton Pipeline version:

Output of tkn version or kubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'

Client version: 0.31.1
Pipeline version: v0.42.0

apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
creationTimestamp: null
name: preview-env
spec:
workspaces:

  • name: frontend
    volumeClaimTemplate:
    spec:
    accessModes:
    - ReadWriteOnce
    resources:
    requests:
    storage: 4Gi
  • name: wrangler
    volumeClaimTemplate:
    spec:
    accessModes:
    - ReadWriteOnce
    resources:
    requests:
    storage: 4Gi
  • name: git-clone
    volumeClaimTemplate:
    spec:
    accessModes:
    - ReadWriteOnce
    resources:
    requests:
    storage: 1Gi
    pipelineSpec:
    workspaces:
    • name: frontend

    • name: git-clone

    • name: wrangler
      results:

    • name: version
      description: version
      value: $(tasks.version.results.version)
      tasks:

    • name: version
      params:

      • name: workdir
        value: $(workspaces.git-clone.path)
        workspaces:
      • name: git-clone
        workspace: git-clone
        retries: 1
        resources: {}
        taskSpec:
        params:
        • name: workdir
          type: string
          workspaces:
        • name: git-clone
          results:
        • name: version
          description: result to store the version
        • name: commithash
          description: commit hash
        • name: pr-author
          description: author of the pr
        • name: donotrun
          description: donotrun
        • name: pr-number
          description: pr-number
        • name: skipbuilds
          description: skipbuilds
          metadata: {}
          stepTemplate:
          image: uses:jenkins-x/jx3-pipeline-catalog/tasks/javascript/pullrequest.yaml@versionStream
          name: ""
          resources:

          override limits for all containers here

          requests:
          cpu: 100m
          memory: 256Mi
          workingDir: $(params.workdir)/source
          steps:
      • image: bash:latest
        name: build-docker-sse
        resources: {}
        script: |
        echo crazy | tee $(results.version.path)
    • name: build-frontend
      workspaces:

      • name: frontend
        workspace: frontend
        retries: 1
        params:
      • name: version
        value: $(tasks.version.results.version)
      • name: workdir
        value: $(workspaces.frontend.path)
      • name: testparam
        value: testvalue
        runAfter:
        • version
          resources: {}
          taskSpec:
          workspaces:
          • name: frontend
            params:
        • name: version
          type: string
          description: docker registry to push docker to
          default: eu.gcr.io/filedriver-291811
        • name: workdir
          type: string
          metadata: {}
          stepTemplate:
          env:
          • name: VERSION
            value: "$(tasks.version.results.version)"
            name: ""
            resources:

            override limits for all containers here

            requests:
            cpu: 200m
            memory: 256Mi
            workingDir: $(params.workdir)/source
            steps:
        • image: uses:.lighthouse/jenkins-x/tasks/git-clone-pr.yaml
          name: ""
          resources: {}
        • image: bash:latest
          name: test
          resources: {}
          script: |
          echo "the version is $VERSION"
          echo "the params version is $(params.version)"
          echo "the testparam is $(params.testparam)"

podTemplate:
nodeSelector:
node: pipeline
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node
operator: In
values:
- pipeline
tolerations:
- key: "node"
operator: "Equal"
value: "pipeline"
effect: "NoSchedule"
serviceAccountName: tekton-bot
timeout: 30m
status: {}