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

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

Open
mmn0o7 opened this issue Jul 24, 2023 · 0 comments
Open

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

mmn0o7 opened this issue Jul 24, 2023 · 0 comments

Comments

@mmn0o7
Copy link

mmn0o7 commented Jul 24, 2023

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: {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant