Skip to content

Commit

Permalink
cla: Switch over to EasyCLA
Browse files Browse the repository at this point in the history
This makes the required changes needed to support EasyCLA
after it has been fully migrated:

* Change the context checked from cla/linuxfoundation to EasyCLA
* Update tests to reflect the changed context
* Change prow config to not treat EasyCLA as an optional context
  anymore

Signed-off-by: Madhav Jivrajani <[email protected]>
  • Loading branch information
MadhavJivrajani committed Jan 12, 2022
1 parent cd3e975 commit ab0d6d3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 42 deletions.
11 changes: 0 additions & 11 deletions config/prow/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -666,20 +666,9 @@ tide:
context_options:
orgs:
kubernetes:
optional-contexts:
- "EasyCLA" # NOTE(cblecker): This is temporary until we fully roll out EasyCLA
repos:
dashboard:
from-branch-protection: true
kubernetes-client:
optional-contexts:
- "EasyCLA" # NOTE(mrbobbytables): This is temporary until we fully roll out EasyCLA
kubernetes-csi:
optional-contexts:
- "EasyCLA" # NOTE(mrbobbytables): This is temporary until we fully roll out EasyCLA
kubernetes-sigs:
optional-contexts:
- "EasyCLA" # NOTE(mrbobbytables): This is temporary until we fully roll out EasyCLA
batch_size_limit:
"kubernetes/kubernetes": 15
priority:
Expand Down
2 changes: 1 addition & 1 deletion prow/plugins/cla/cla.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (

const (
pluginName = "cla"
claContextName = "cla/linuxfoundation"
claContextName = "EasyCLA"
cncfclaNotFoundMessage = `Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: **Please follow instructions at <https://git.k8s.io/community/CLA.md#the-contributor-license-agreement> to sign the CLA.**
Expand Down
60 changes: 30 additions & 30 deletions prow/plugins/cla/cla_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ func TestCLALabels(t *testing.T) {
removedLabels: nil,
},
{
name: "cla/linuxfoundation status pending has no effect",
context: "cla/linuxfoundation",
name: "EasyCLA status pending has no effect",
context: "EasyCLA",
state: "pending",
addedLabels: nil,
removedLabels: nil,
},
{
name: "cla/linuxfoundation status success does not add/remove labels " +
name: "EasyCLA status success does not add/remove labels " +
"when not the head commit in a PR",
context: "cla/linuxfoundation",
context: "EasyCLA",
state: "success",
statusSHA: "a",
issues: []github.Issue{
Expand All @@ -70,9 +70,9 @@ func TestCLALabels(t *testing.T) {
removedLabels: nil,
},
{
name: "cla/linuxfoundation status failure does not add/remove labels " +
name: "EasyCLA status failure does not add/remove labels " +
"when not the head commit in a PR",
context: "cla/linuxfoundation",
context: "EasyCLA",
state: "failure",
statusSHA: "a",
issues: []github.Issue{
Expand All @@ -85,8 +85,8 @@ func TestCLALabels(t *testing.T) {
removedLabels: nil,
},
{
name: "cla/linuxfoundation status on head commit of PR adds the cla-yes label when its state is \"success\"",
context: "cla/linuxfoundation",
name: "EasyCLA status on head commit of PR adds the cla-yes label when its state is \"success\"",
context: "EasyCLA",
state: "success",
statusSHA: "a",
issues: []github.Issue{
Expand All @@ -99,8 +99,8 @@ func TestCLALabels(t *testing.T) {
removedLabels: nil,
},
{
name: "cla/linuxfoundation status on head commit of PR does nothing when pending",
context: "cla/linuxfoundation",
name: "EasyCLA status on head commit of PR does nothing when pending",
context: "EasyCLA",
state: "pending",
statusSHA: "a",
issues: []github.Issue{
Expand All @@ -113,8 +113,8 @@ func TestCLALabels(t *testing.T) {
removedLabels: nil,
},
{
name: "cla/linuxfoundation status success removes \"cncf-cla: no\" label",
context: "cla/linuxfoundation",
name: "EasyCLA status success removes \"cncf-cla: no\" label",
context: "EasyCLA",
state: "success",
statusSHA: "a",
issues: []github.Issue{
Expand All @@ -127,8 +127,8 @@ func TestCLALabels(t *testing.T) {
removedLabels: []string{fmt.Sprintf("/#3:%s", labels.ClaNo)},
},
{
name: "cla/linuxfoundation status failure removes \"cncf-cla: yes\" label",
context: "cla/linuxfoundation",
name: "EasyCLA status failure removes \"cncf-cla: yes\" label",
context: "EasyCLA",
state: "failure",
statusSHA: "a",
issues: []github.Issue{
Expand Down Expand Up @@ -195,7 +195,7 @@ func TestCheckCLA(t *testing.T) {
removedLabel string
}{
{
name: "ignore non cla/linuxfoundation context",
name: "ignore non EasyCLA context",
context: "random/context",
state: "success",
issueState: "open",
Expand All @@ -208,7 +208,7 @@ func TestCheckCLA(t *testing.T) {
},
{
name: "ignore non open PRs",
context: "cla/linuxfoundation",
context: "EasyCLA",
state: "success",
issueState: "closed",
SHA: "sha",
Expand All @@ -220,7 +220,7 @@ func TestCheckCLA(t *testing.T) {
},
{
name: "ignore non /check-cla comments",
context: "cla/linuxfoundation",
context: "EasyCLA",
state: "success",
issueState: "open",
SHA: "sha",
Expand All @@ -232,7 +232,7 @@ func TestCheckCLA(t *testing.T) {
},
{
name: "do nothing on when status state is \"pending\"",
context: "cla/linuxfoundation",
context: "EasyCLA",
state: "pending",
issueState: "open",
SHA: "sha",
Expand All @@ -243,8 +243,8 @@ func TestCheckCLA(t *testing.T) {
},
},
{
name: "cla/linuxfoundation status adds the cla-yes label when its state is \"success\"",
context: "cla/linuxfoundation",
name: "EasyCLA status adds the cla-yes label when its state is \"success\"",
context: "EasyCLA",
state: "success",
issueState: "open",
SHA: "sha",
Expand All @@ -257,8 +257,8 @@ func TestCheckCLA(t *testing.T) {
addedLabel: fmt.Sprintf("/#3:%s", labels.ClaYes),
},
{
name: "cla/linuxfoundation status adds the cla-yes label and removes cla-no label when its state is \"success\"",
context: "cla/linuxfoundation",
name: "EasyCLA status adds the cla-yes label and removes cla-no label when its state is \"success\"",
context: "EasyCLA",
state: "success",
issueState: "open",
SHA: "sha",
Expand All @@ -273,8 +273,8 @@ func TestCheckCLA(t *testing.T) {
removedLabel: fmt.Sprintf("/#3:%s", labels.ClaNo),
},
{
name: "cla/linuxfoundation status adds the cla-no label when its state is \"failure\"",
context: "cla/linuxfoundation",
name: "EasyCLA status adds the cla-no label when its state is \"failure\"",
context: "EasyCLA",
state: "failure",
issueState: "open",
SHA: "sha",
Expand All @@ -287,8 +287,8 @@ func TestCheckCLA(t *testing.T) {
addedLabel: fmt.Sprintf("/#3:%s", labels.ClaNo),
},
{
name: "cla/linuxfoundation status adds the cla-no label and removes cla-yes label when its state is \"failure\"",
context: "cla/linuxfoundation",
name: "EasyCLA status adds the cla-no label and removes cla-yes label when its state is \"failure\"",
context: "EasyCLA",
state: "failure",
issueState: "open",
SHA: "sha",
Expand All @@ -303,8 +303,8 @@ func TestCheckCLA(t *testing.T) {
removedLabel: fmt.Sprintf("/#3:%s", labels.ClaYes),
},
{
name: "cla/linuxfoundation status retains the cla-yes label and removes cla-no label when its state is \"success\"",
context: "cla/linuxfoundation",
name: "EasyCLA status retains the cla-yes label and removes cla-no label when its state is \"success\"",
context: "EasyCLA",
state: "success",
issueState: "open",
SHA: "sha",
Expand All @@ -319,8 +319,8 @@ func TestCheckCLA(t *testing.T) {
removedLabel: fmt.Sprintf("/#3:%s", labels.ClaNo),
},
{
name: "cla/linuxfoundation status retains the cla-no label and removes cla-yes label when its state is \"failure\"",
context: "cla/linuxfoundation",
name: "EasyCLA status retains the cla-no label and removes cla-yes label when its state is \"failure\"",
context: "EasyCLA",
state: "failure",
issueState: "open",
SHA: "sha",
Expand Down

0 comments on commit ab0d6d3

Please sign in to comment.