Repository: jenkins-x/lighthouse
Pull request #1147 (2020-11-04 09:21:24)

fix: add retry handler to updating lighthousejobs
we've seen some failures + some pipelines not started due to update errors so lets add a retry loop

jenkins-x-bot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **jstrachan**
You can assign the PR to them by writing `/assign @jstrachan` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=jenkins-x%2Flighthouse).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/jenkins-x/lighthouse/blob/master/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["jstrachan"]} -->
jenkins-x-bot: @jstrachan: The following test **failed**, say `/retest` to rerun them all:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
jenkins | bbf74f2b460581ebcf4419dad901cf9d0cbc4741 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1147/4) | `/test jenkins`

[View all Builds for this Pull Request](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1147) 

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [jenkins-x/lighthouse](https://github.com/jenkins-x/lighthouse/issues/new?title=Command%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
jenkins-x-bot: @jstrachan: The following tests **failed**, say `/retest` to rerun them all:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
jenkins | bbf74f2b460581ebcf4419dad901cf9d0cbc4741 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1147/4) | `/test jenkins`
tekton | bbf74f2b460581ebcf4419dad901cf9d0cbc4741 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1147/5) | `/test tekton`

[View all Builds for this Pull Request](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1147) 

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [jenkins-x/lighthouse](https://github.com/jenkins-x/lighthouse/issues/new?title=Command%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
jstrachan: /retest
jenkins-x-bot: @jstrachan: The following tests **failed**, say `/retest` to rerun them all:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
jenkins | bbf74f2b460581ebcf4419dad901cf9d0cbc4741 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1147/4) | `/test jenkins`
tekton | bbf74f2b460581ebcf4419dad901cf9d0cbc4741 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1147/6) | `/test tekton`

[View all Builds for this Pull Request](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1147) 

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [jenkins-x/lighthouse](https://github.com/jenkins-x/lighthouse/issues/new?title=Command%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
jenkins-x-bot: @jstrachan: The following test **failed**, say `/retest` to rerun them all:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
tekton | c6e129f085590b1e57ebb577470a0284a9c26a5d | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1147/12) | `/test tekton`

[View all Builds for this Pull Request](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1147) 

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [jenkins-x/lighthouse](https://github.com/jenkins-x/lighthouse/issues/new?title=Command%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
jenkins-x-bot: @jstrachan: The following tests **failed**, say `/retest` to rerun them all:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
tekton | c6e129f085590b1e57ebb577470a0284a9c26a5d | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1147/12) | `/test tekton`
jenkins | 412bd387c60acefd505551ef174033328cb51539 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1147/16) | `/test jenkins`

[View all Builds for this Pull Request](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1147) 

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [jenkins-x/lighthouse](https://github.com/jenkins-x/lighthouse/issues/new?title=Command%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
jstrachan: /retest
abayer: /lgtm
jenkins-x-bot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *[abayer](https://github.com/jenkins-x/lighthouse/pull/1147#issuecomment-721778333 "LGTM")*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=jenkins-x%2Flighthouse).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com#issuecomment-721778333/jenkins-x/lighthouse/blob/master/OWNERS)~~ [abayer]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/charts/lighthouse/README.md b/charts/lighthouse/README.md
index 3e5eb31d..4170a243 100644
--- a/charts/lighthouse/README.md
+++ b/charts/lighthouse/README.md
@@ -122,6 +122,7 @@ helm uninstall my-lighthouse --namespace lighthouse
 | `tektoncontroller.tolerations` | list | [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) applied to the tekton controller pods | `[]` |
 | `user` | string | Git user name (used when GitHub app authentication is not enabled) | `""` |
 | `webhooks.affinity` | object | [Affinity rules](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) applied to the webhooks pods | `{}` |
+| `webhooks.customDeploymentTriggerCommand` | string | deployments can configure the ability to allow custom lighthouse triggers using their own unique chat prefix, for example extending the default `/test` trigger prefix let them specify `customDeploymentTriggerPrefix: foo` which means they can also use their own custom trigger /foo mycoolthing | `""` |
 | `webhooks.image.pullPolicy` | string | Template for computing the webhooks controller docker image pull policy | `"{{ .Values.image.pullPolicy }}"` |
 | `webhooks.image.repository` | string | Template for computing the webhooks controller docker image repository | `"{{ .Values.image.parentRepository }}/lighthouse-webhooks"` |
 | `webhooks.image.tag` | string | Template for computing the webhooks controller docker image tag | `"{{ .Values.image.tag }}"` |
diff --git a/charts/lighthouse/templates/webhooks-deployment.yaml b/charts/lighthouse/templates/webhooks-deployment.yaml
index 628d3d09..1f487d27 100644
--- a/charts/lighthouse/templates/webhooks-deployment.yaml
+++ b/charts/lighthouse/templates/webhooks-deployment.yaml
@@ -34,6 +34,8 @@ spec:
         env:
           - name: "GIT_KIND"
             value: "{{ .Values.git.kind }}"
+          - name: "LH_CUSTOM_TRIGGER_COMMAND"
+            value: "{{ .Values.webhooks.customDeploymentTriggerCommand }}"
           - name: "GIT_SERVER"
             value: "{{ .Values.git.server }}"
 {{- if .Values.githubApp.enabled }}
diff --git a/charts/lighthouse/values.yaml b/charts/lighthouse/values.yaml
index 04cb78e7..fa05199c 100644
--- a/charts/lighthouse/values.yaml
+++ b/charts/lighthouse/values.yaml
@@ -148,6 +148,11 @@ webhooks:
     # webhooks.ingress.hosts -- Webhooks ingress host names
     hosts: []
 
+  # webhooks.customDeploymentTriggerCommand -- deployments can configure the ability to allow custom lighthouse triggers
+  # using their own unique chat prefix, for example extending the default `/test` trigger prefix let them specify
+  # `customDeploymentTriggerPrefix: foo` which means they can also use their own custom trigger /foo mycoolthing
+  customDeploymentTriggerCommand: ""
+
 foghorn:
   # foghorn.replicaCount -- Number of replicas
   replicaCount: 1
@@ -360,4 +365,4 @@ configMaps:
   # Example of specifying config-updater repository, which should contain "config.yaml" and "plugins.yaml" in the given path.
   # configUpdater:
   #   orgAndRepo: foo/bar
-  #   path: a/b/c
+  #   path: a/b/c
\ No newline at end of file
diff --git a/pkg/engines/tekton/controller.go b/pkg/engines/tekton/controller.go
index feedef8c..8c7a4f4f 100644
--- a/pkg/engines/tekton/controller.go
+++ b/pkg/engines/tekton/controller.go
@@ -10,6 +10,7 @@ import (
 	lighthousev1alpha1 "github.com/jenkins-x/lighthouse/pkg/apis/lighthouse/v1alpha1"
 	configjob "github.com/jenkins-x/lighthouse/pkg/config/job"
 	"github.com/jenkins-x/lighthouse/pkg/util"
+	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
 	pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -126,14 +127,23 @@ func (r *LighthouseJobReconciler) Reconcile(req ctrl.Request) (ctrl.Result, erro
 
 			// TODO: changing the status should be a consequence of a pipeline run being created
 			// update status
-			job.Status = lighthousev1alpha1.LighthouseJobStatus{
+			status := lighthousev1alpha1.LighthouseJobStatus{
 				State:     lighthousev1alpha1.PendingState,
 				StartTime: metav1.Now(),
 			}
-			if err := r.client.Status().Update(ctx, &job); err != nil {
-				r.logger.Errorf("Failed to update LighthouseJob status: %s", err)
+			f := func(job *lighthousev1alpha1.LighthouseJob) error {
+				job.Status = status
+				if err := r.client.Status().Update(ctx, job); err != nil {
+					r.logger.Errorf("Failed to update LighthouseJob status: %s", err)
+					return err
+				}
+				return nil
+			}
+			err = r.retryModifyJob(ctx, req.NamespacedName, &job, f)
+			if err != nil {
 				return ctrl.Result{}, err
 			}
+
 			// create pipeline run
 			if err := r.client.Create(ctx, pipelineRun); err != nil {
 				r.logger.Errorf("Failed to create pipeline run: %s", err)
@@ -145,17 +155,32 @@ func (r *LighthouseJobReconciler) Reconcile(req ctrl.Request) (ctrl.Result, erro
 		pipelineRun := pipelineRunList.Items[0]
 		r.logger.Infof("Reconcile PipelineRun %+v", pipelineRun)
 		// update build id
-		job.Labels[util.BuildNumLabel] = pipelineRun.Labels[util.BuildNumLabel]
-		if err := r.client.Update(ctx, &job); err != nil {
-			r.logger.Errorf("failed to update Project status: %s", err)
-			return ctrl.Result{}, err
+		if job.Labels[util.BuildNumLabel] != pipelineRun.Labels[util.BuildNumLabel] {
+			f := func(job *lighthousev1alpha1.LighthouseJob) error {
+				job.Labels[util.BuildNumLabel] = pipelineRun.Labels[util.BuildNumLabel]
+				if err := r.client.Update(ctx, job); err != nil {
+					return errors.Wrapf(err, "failed to add build label Project status")
+				}
+				return nil
+			}
+			err := r.retryModifyJob(ctx, req.NamespacedName, &job, f)
+			if err != nil {
+				return ctrl.Result{}, err
+			}
 		}
-		if r.dashboardURL != "" {
-			job.Status.ReportURL = r.getPipelingetPipelineTargetURLeTargetURL(pipelineRun)
+
+		f := func(job *lighthousev1alpha1.LighthouseJob) error {
+			if r.dashboardURL != "" {
+				job.Status.ReportURL = r.getPipelingetPipelineTargetURLeTargetURL(pipelineRun)
+			}
+			job.Status.Activity = ConvertPipelineRun(&pipelineRun)
+			if err := r.client.Status().Update(ctx, job); err != nil {
+				return errors.Wrapf(err, "failed to update LighthouseJob status")
+			}
+			return nil
 		}
-		job.Status.Activity = ConvertPipelineRun(&pipelineRun)
-		if err := r.client.Status().Update(ctx, &job); err != nil {
-			r.logger.Errorf("Failed to update LighthouseJob status: %s", err)
+		err := r.retryModifyJob(ctx, req.NamespacedName, &job, f)
+		if err != nil {
 			return ctrl.Result{}, err
 		}
 	} else {
@@ -202,3 +227,31 @@ func (r *LighthouseJobReconciler) getPipelingetPipelineTargetURLeTargetURL(pipel
 	}
 	return fmt.Sprintf("%s/%s", trimDashboardURL(r.dashboardURL), buf.String())
 }
+
+const retryCount = 5
+
+// retryModifyJob tries to modify the Job retrying if it fails
+func (r *LighthouseJobReconciler) retryModifyJob(ctx context.Context, ns client.ObjectKey, job *lighthousev1alpha1.LighthouseJob, f func(job *lighthousev1alpha1.LighthouseJob) error) error {
+	i := 0
+	for {
+		i++
+		err := f(job)
+		if err == nil {
+			if i > 1 {
+				r.logger.Infof("took %d attempts to update Job %s", i, job.Name)
+			}
+			return nil
+		}
+		if i >= retryCount {
+			return errors.Wrapf(err, "failed to update Job %s after %d attempts", job.Name, retryCount)
+		}
+
+		if err := r.client.Get(ctx, ns, job); err != nil {
+			r.logger.Warningf("Unable to get LighthouseJob %s due to: %s", job.Name, err)
+			// we'll ignore not-found errors, since they can't be fixed by an immediate
+			// requeue (we'll need to wait for a new notification), and we can get them
+			// on deleted requests.
+			return client.IgnoreNotFound(err)
+		}
+	}
+}
diff --git a/pkg/plugins/trigger/trigger.go b/pkg/plugins/trigger/trigger.go
index d257b5c0..6ecf434c 100644
--- a/pkg/plugins/trigger/trigger.go
+++ b/pkg/plugins/trigger/trigger.go
@@ -18,6 +18,7 @@ package trigger
 
 import (
 	"fmt"
+	"os"
 	"strings"
 
 	"github.com/jenkins-x/go-scm/scm"
@@ -35,6 +36,9 @@ import (
 const (
 	// pluginName is the name of the trigger plugin
 	pluginName = "trigger"
+
+	// environment variable used to enable deployment specific trigger commands
+	customerTriggerCommandEnvVar = "LH_CUSTOM_TRIGGER_COMMAND"
 )
 
 var (
@@ -74,6 +78,22 @@ var (
 )
 
 func init() {
+	customTriggerCommand := os.Getenv(customerTriggerCommandEnvVar)
+	if customTriggerCommand != "" {
+		customCommand := plugins.Command{
+			Name: customTriggerCommand,
+			Arg: &plugins.CommandArg{
+				Pattern: `[-\w]+(?:,[-\w]+)*`,
+			},
+			Description: fmt.Sprintf("Manually trigger /%s chatops commands.", customTriggerCommand),
+			Featured:    true,
+			Action: plugins.
+				Invoke(handleGenericCommentEvent).
+				When(plugins.Action(scm.ActionCreate), plugins.IsPR(), plugins.IssueState("open")),
+		}
+		plugin.Commands = append(plugin.Commands, customCommand)
+	}
+
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
diff --git a/pkg/triggerconfig/inrepo/default_parameters.go b/pkg/triggerconfig/inrepo/default_parameters.go
index 5956397e..7220accd 100644
--- a/pkg/triggerconfig/inrepo/default_parameters.go
+++ b/pkg/triggerconfig/inrepo/default_parameters.go
@@ -96,6 +96,9 @@ var (
 // DefaultPipelineParameters defaults the parameter specs and parameter values from lighthouse onto
 // the PipelineRun and its nested PipelineSpec and Tasks
 func DefaultPipelineParameters(prs *v1beta1.PipelineRun) (*v1beta1.PipelineRun, error) {
+	if prs.Annotations != nil && prs.Annotations[DefaultParameters] == "false" {
+		return prs, nil
+	}
 	ps := prs.Spec.PipelineSpec
 	if ps == nil {
 		return prs, nil
diff --git a/pkg/triggerconfig/inrepo/load_pipelinerun.go b/pkg/triggerconfig/inrepo/load_pipelinerun.go
index 72cbed5f..84e199cc 100644
--- a/pkg/triggerconfig/inrepo/load_pipelinerun.go
+++ b/pkg/triggerconfig/inrepo/load_pipelinerun.go
@@ -20,6 +20,9 @@ const (
 	// TektonAPIVersion the default tekton API version
 	TektonAPIVersion = "tekton.dev/v1beta1"
 
+	// DefaultParameters the annotation used to disable default parameters
+	DefaultParameters = "lighthouse.jenkins-x.io/defaultParameters"
+
 	// LoadFileRefPattern the regular expression to match which Pipeline/Task references to load via files
 	LoadFileRefPattern = "lighthouse.jenkins-x.io/loadFileRefs"
 


Test patch:
diff --git a/pkg/engines/tekton/controller_test.go b/pkg/engines/tekton/controller_test.go
index f14e2542..0e0f1f84 100644
--- a/pkg/engines/tekton/controller_test.go
+++ b/pkg/engines/tekton/controller_test.go
@@ -37,8 +37,8 @@ func (s *seededRandIDGenerator) GenerateBuildID() string {
 }
 func TestReconcile(t *testing.T) {
 	testCases := []string{
-		"start-pullrequest",
 		"update-job",
+		"start-pullrequest",
 		"start-batch-pullrequest",
 		"start-push",
 	}
diff --git a/pkg/engines/tekton/test_data/controller/update-job/observed-lhjob.yml b/pkg/engines/tekton/test_data/controller/update-job/observed-lhjob.yml
index 4cd9e379..82346b24 100644
--- a/pkg/engines/tekton/test_data/controller/update-job/observed-lhjob.yml
+++ b/pkg/engines/tekton/test_data/controller/update-job/observed-lhjob.yml
@@ -16,7 +16,7 @@ metadata:
     lighthouse.jenkins-x.io/type: presubmit
   name: f46327af-b47e-11ea-b797-9256b7b8d9b0
   namespace: jx
-  resourceVersion: "2"
+  resourceVersion: "3"
 spec:
   agent: tekton-pipeline
   context: github
diff --git a/pkg/triggerconfig/inrepo/load_pipelinerun_test.go b/pkg/triggerconfig/inrepo/load_pipelinerun_test.go
index 355086c7..e437093e 100644
--- a/pkg/triggerconfig/inrepo/load_pipelinerun_test.go
+++ b/pkg/triggerconfig/inrepo/load_pipelinerun_test.go
@@ -13,7 +13,7 @@ import (
 
 var (
 	// generateTestOutput enable to regenerate the expected output
-	generateTestOutput = false
+	generateTestOutput = true
 )
 
 func TestLoadPipelineRunTest(t *testing.T) {
diff --git a/pkg/triggerconfig/inrepo/test_data/load_pipelinerun/task-disable-params/expected.yaml b/pkg/triggerconfig/inrepo/test_data/load_pipelinerun/task-disable-params/expected.yaml
new file mode 100644
index 00000000..2fddf5ac
--- /dev/null
+++ b/pkg/triggerconfig/inrepo/test_data/load_pipelinerun/task-disable-params/expected.yaml
@@ -0,0 +1,129 @@
+apiVersion: tekton.dev/v1beta1
+kind: PipelineRun
+metadata:
+  annotations:
+    lighthouse.jenkins-x.io/defaultParameters: "false"
+  creationTimestamp: null
+  name: cheese
+spec:
+  pipelineSpec:
+    tasks:
+    - name: cheese
+      taskSpec:
+        stepTemplate:
+          name: ""
+          resources:
+            requests:
+              cpu: 400m
+              memory: 512Mi
+          volumeMounts:
+          - mountPath: /home/jenkins
+            name: workspace-volume
+          - mountPath: /etc/podinfo
+            name: podinfo
+            readOnly: true
+          workingDir: /workspace/source
+        steps:
+        - args:
+          - -c
+          - 'mkdir -p $HOME; git config --global --add user.name ${GIT_AUTHOR_NAME:-jenkins-x-bot}; git config --global --add user.email ${GIT_AUTHOR_EMAIL:-jenkins-x@googlegroups.com}; git config --global credential.helper store; git clone $(params.REPO_URL) $(params.subdirectory); echo cloned url: $(params.REPO_URL) to dir: $(params.subdirectory); cd $(params.subdirectory); git checkout $(params.PULL_PULL_SHA); echo checked out revision: $(params.PULL_PULL_SHA) to dir: $(params.subdirectory)'
+          command:
+          - /bin/sh
+          image: gcr.io/jenkinsxio/builder-jx:2.1.142-761
+          name: git-clone
+          resources: {}
+          workingDir: /workspace
+        - args:
+          - gitops
+          - git
+          - setup
+          - --namespace
+          - jx-git-operator
+          command:
+          - jx
+          image: gcr.io/jenkinsxio/jx-cli:latest
+          name: git-setup
+          resources: {}
+          workingDir: /workspace
+        - args:
+          - '[ -d /builder/home ] || mkdir -p /builder && ln -s /tekton/home /builder/home'
+          command:
+          - /bin/sh
+          - -c
+          image: gcr.io/jenkinsxio/builder-jx:2.1.142-761
+          name: setup-builder-home
+          resources: {}
+        - args:
+          - step
+          - git
+          - merge
+          - --verbose
+          - --baseSHA
+          - $(params.PULL_BASE_SHA)
+          - --sha
+          - $(params.PULL_PULL_SHA)
+          - --baseBranch
+          - $(params.PULL_BASE_REF)
+          command:
+          - jx
+          image: gcr.io/jenkinsxio/builder-jx:2.1.142-761
+          name: git-merge
+          resources: {}
+        - args:
+          - gitops
+          - variables
+          command:
+          - jx
+          image: gcr.io/jenkinsxio/jx-cli:latest
+          name: jx-variables
+          resources: {}
+        - args:
+          - jx step credential -s npm-token -k file -f /builder/home/.npmrc --optional=true
+          command:
+          - /bin/sh
+          - -c
+          image: gcr.io/jenkinsxio/builder-nodejs:2.1.150-769
+          name: build-npmrc
+          resources: {}
+        - args:
+          - npm install
+          command:
+          - /bin/sh
+          - -c
+          image: gcr.io/jenkinsxio/builder-nodejs:2.1.150-769
+          name: build-npm-install
+          resources: {}
+        - args:
+          - CI=true DISPLAY=:99 npm test
+          command:
+          - /bin/sh
+          - -c
+          image: gcr.io/jenkinsxio/builder-nodejs:2.1.150-769
+          name: build-npm-test
+          resources: {}
+        - args:
+          - source .jx/variables.sh && cp /tekton/creds-secrets/tekton-container-registry-auth/.dockerconfigjson /kaniko/.docker/config.json && /kaniko/executor $KANIKO_FLAGS --cache=true --cache-dir=/workspace --context=/workspace/source --dockerfile=/workspace/source/Dockerfile --destination=$DOCKER_REGISTRY/$DOCKER_REGISTRY_ORG/$APP_NAME:$VERSION --cache-repo=$DOCKER_REGISTRY/$DOCKER_REGISTRY_ORG/cache
+          command:
+          - /busybox/sh
+          - -c
+          image: gcr.io/jenkinsxio/kaniko:0.0.5
+          name: build-container-build
+          resources: {}
+        - args:
+          - source /workspace/source/.jx/variables.sh && jx preview create
+          command:
+          - /bin/bash
+          - -c
+          image: gcr.io/jenkinsxio/jx-cli:latest
+          name: promote-jx-preview
+          resources: {}
+        volumes:
+        - emptyDir: {}
+          name: workspace-volume
+        - downwardAPI:
+            items:
+            - fieldRef:
+                fieldPath: metadata.labels
+              path: labels
+          name: podinfo
+status: {}
diff --git a/pkg/triggerconfig/inrepo/test_data/load_pipelinerun/task-disable-params/source.yaml b/pkg/triggerconfig/inrepo/test_data/load_pipelinerun/task-disable-params/source.yaml
new file mode 100644
index 00000000..b1ff55d6
--- /dev/null
+++ b/pkg/triggerconfig/inrepo/test_data/load_pipelinerun/task-disable-params/source.yaml
@@ -0,0 +1,122 @@
+apiVersion: tekton.dev/v1beta1
+kind: Task
+metadata:
+  name: cheese
+  annotations:
+    lighthouse.jenkins-x.io/defaultParameters: "false"
+spec:
+  stepTemplate:
+    resources:
+      requests:
+        cpu: 400m
+        memory: 512Mi
+    volumeMounts:
+    - mountPath: /home/jenkins
+      name: workspace-volume
+    - mountPath: /etc/podinfo
+      name: podinfo
+      readOnly: true
+    workingDir: /workspace/source
+  steps:
+  - args:
+    - -c
+    - 'mkdir -p $HOME; git config --global --add user.name ${GIT_AUTHOR_NAME:-jenkins-x-bot}; git config --global --add user.email ${GIT_AUTHOR_EMAIL:-jenkins-x@googlegroups.com}; git config --global credential.helper store; git clone $(params.REPO_URL) $(params.subdirectory); echo cloned url: $(params.REPO_URL) to dir: $(params.subdirectory); cd $(params.subdirectory); git checkout $(params.PULL_PULL_SHA); echo checked out revision: $(params.PULL_PULL_SHA) to dir: $(params.subdirectory)'
+    command:
+    - /bin/sh
+    image: gcr.io/jenkinsxio/builder-jx:2.1.142-761
+    name: git-clone
+    resources: {}
+    workingDir: /workspace
+  - args:
+    - gitops
+    - git
+    - setup
+    - --namespace
+    - jx-git-operator
+    command:
+    - jx
+    image: gcr.io/jenkinsxio/jx-cli:latest
+    name: git-setup
+    resources: {}
+    workingDir: /workspace
+  - args:
+    - '[ -d /builder/home ] || mkdir -p /builder && ln -s /tekton/home /builder/home'
+    command:
+    - /bin/sh
+    - -c
+    image: gcr.io/jenkinsxio/builder-jx:2.1.142-761
+    name: setup-builder-home
+    resources: {}
+  - args:
+    - step
+    - git
+    - merge
+    - --verbose
+    - --baseSHA
+    - $(params.PULL_BASE_SHA)
+    - --sha
+    - $(params.PULL_PULL_SHA)
+    - --baseBranch
+    - $(params.PULL_BASE_REF)
+    command:
+    - jx
+    image: gcr.io/jenkinsxio/builder-jx:2.1.142-761
+    name: git-merge
+    resources: {}
+  - args:
+    - gitops
+    - variables
+    command:
+    - jx
+    image: gcr.io/jenkinsxio/jx-cli:latest
+    name: jx-variables
+    resources: {}
+  - args:
+    - jx step credential -s npm-token -k file -f /builder/home/.npmrc --optional=true
+    command:
+    - /bin/sh
+    - -c
+    image: gcr.io/jenkinsxio/builder-nodejs:2.1.150-769
+    name: build-npmrc
+    resources: {}
+  - args:
+    - npm install
+    command:
+    - /bin/sh
+    - -c
+    image: gcr.io/jenkinsxio/builder-nodejs:2.1.150-769
+    name: build-npm-install
+    resources: {}
+  - args:
+    - CI=true DISPLAY=:99 npm test
+    command:
+    - /bin/sh
+    - -c
+    image: gcr.io/jenkinsxio/builder-nodejs:2.1.150-769
+    name: build-npm-test
+    resources: {}
+  - args:
+    - source .jx/variables.sh && cp /tekton/creds-secrets/tekton-container-registry-auth/.dockerconfigjson /kaniko/.docker/config.json && /kaniko/executor $KANIKO_FLAGS --cache=true --cache-dir=/workspace --context=/workspace/source --dockerfile=/workspace/source/Dockerfile --destination=$DOCKER_REGISTRY/$DOCKER_REGISTRY_ORG/$APP_NAME:$VERSION --cache-repo=$DOCKER_REGISTRY/$DOCKER_REGISTRY_ORG/cache
+    command:
+    - /busybox/sh
+    - -c
+    image: gcr.io/jenkinsxio/kaniko:0.0.5
+    name: build-container-build
+    resources: {}
+  - args:
+    - source /workspace/source/.jx/variables.sh && jx preview create
+    command:
+    - /bin/bash
+    - -c
+    image: gcr.io/jenkinsxio/jx-cli:latest
+    name: promote-jx-preview
+    resources: {}
+  volumes:
+  - emptyDir: {}
+    name: workspace-volume
+  - downwardAPI:
+      items:
+      - fieldRef:
+          fieldPath: metadata.labels
+        path: labels
+    name: podinfo