nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: jenkins-x/lighthouse
Pull request #1358 (2021-07-15 13:02:19)

fix: pipeline lint when multiple pipelinerun.spec.workspaces exist

jenkins-x-bot-test: [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 **rawlingsj**
You can assign the PR to them by writing `/assign @rawlingsj` in a comment when ready.

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

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

- **[OWNERS](https://github.com/jenkins-x/lighthouse/blob/main/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":["rawlingsj"]} -->

Patch:
diff --git a/pkg/triggerconfig/inrepo/default_parameters.go b/pkg/triggerconfig/inrepo/default_parameters.go
index 425e1006..e03fce2d 100644
--- a/pkg/triggerconfig/inrepo/default_parameters.go
+++ b/pkg/triggerconfig/inrepo/default_parameters.go
@@ -129,10 +129,12 @@ func DefaultPipelineParameters(prs *v1beta1.PipelineRun) (*v1beta1.PipelineRun,
 
 	// lets avoid missing workspaces causing issues
 	if len(prs.Spec.Workspaces) > 0 {
-		w := &prs.Spec.Workspaces[0]
-		if w.Validate(ctx) != nil {
-			// lets default a workspace
-			w.EmptyDir = &corev1.EmptyDirVolumeSource{}
+		for i, _ := range prs.Spec.Workspaces {
+			w := &prs.Spec.Workspaces[i]
+			if w.Validate(ctx) != nil {
+				// lets default a workspace
+				w.EmptyDir = &corev1.EmptyDirVolumeSource{}
+			}
 		}
 	}
 


Test patch:
diff --git a/pkg/triggerconfig/inrepo/default_parameters_test.go b/pkg/triggerconfig/inrepo/default_parameters_test.go
new file mode 100644
index 00000000..385283d2
--- /dev/null
+++ b/pkg/triggerconfig/inrepo/default_parameters_test.go
@@ -0,0 +1,27 @@
+package inrepo
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+	"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
+)
+
+func TestDefaultWorkspacesEmptyDir(t *testing.T) {
+
+	prs := &v1beta1.PipelineRun{
+		Spec: v1beta1.PipelineRunSpec{
+			PipelineSpec: &v1beta1.PipelineSpec{},
+			Workspaces: []v1beta1.WorkspaceBinding{
+				{Name: "foo"},
+				{Name: "bar"},
+			},
+		},
+	}
+
+	rs, err := DefaultPipelineParameters(prs)
+	assert.NoError(t, err)
+
+	assert.True(t, rs.Spec.Workspaces[0].EmptyDir != nil)
+	assert.True(t, rs.Spec.Workspaces[1].EmptyDir != nil)
+}
Repository: jenkins-x/lighthouse
Pull request #1380 (2021-10-08 13:44:17)

feat: add 'team' label to labels plugin
We are using a general term of 'team' so we would like to leverage the team label in the label plugin

Signed-off-by: Brian Davis <dbrian@vmware.com>


Patch:
diff --git a/pkg/plugins/label/label.go b/pkg/plugins/label/label.go
index 36a3de29..d1e092cd 100644
--- a/pkg/plugins/label/label.go
+++ b/pkg/plugins/label/label.go
@@ -40,7 +40,7 @@ var (
 		ConfigHelpProvider: configHelp,
 		Commands: []plugins.Command{{
 			Prefix: "remove-",
-			Name:   "area|committee|kind|language|priority|sig|triage|wg|label",
+			Name:   "area|committee|kind|language|priority|sig|team|triage|wg|label",
 			Arg: &plugins.CommandArg{
 				Pattern: ".*",
 			},


Test patch:
diff --git a/pkg/plugins/label/label_test.go b/pkg/plugins/label/label_test.go
index a5deb0f4..708613e9 100644
--- a/pkg/plugins/label/label_test.go
+++ b/pkg/plugins/label/label_test.go
@@ -123,6 +123,15 @@ func TestLabel(t *testing.T) {
 			expectedRemovedLabels: []string{},
 			commenter:             orgMember,
 		},
+		{
+			name:                  "Add Single Team Label",
+			body:                  "/team ops",
+			repoLabels:            []string{"area/infra", "team/ops"},
+			issueLabels:           []string{"area/infra"},
+			expectedNewLabels:     formatLabels("team/ops"),
+			expectedRemovedLabels: []string{},
+			commenter:             orgMember,
+		},
 		{
 			name:                  "Add Single Triage Label",
 			body:                  "/triage needs-information",
@@ -341,6 +350,15 @@ func TestLabel(t *testing.T) {
 			expectedRemovedLabels: formatLabels("wg/policy"),
 			commenter:             orgMember,
 		},
+		{
+			name:                  "Remove Team Label",
+			body:                  "/remove-team ops",
+			repoLabels:            []string{"area/infra", "team/ops"},
+			issueLabels:           []string{"area/infra", "team/ops"},
+			expectedNewLabels:     []string{},
+			expectedRemovedLabels: formatLabels("team/ops"),
+			commenter:             orgMember,
+		},
 		{
 			name:                  "Remove Triage Label",
 			body:                  "/remove-triage needs-information",