Skip to content

Commit

Permalink
chore: remove ActionReadyForReview keep only ActionConvertedToDraft
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanGoasdoue committed Feb 2, 2024
1 parent 2d26a1e commit 3bd5ef5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 66 deletions.
4 changes: 2 additions & 2 deletions pkg/plugins/trigger/pull-request.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func handlePR(c Client, trigger *plugins.Trigger, pr scm.PullRequestHook) error
}
case scm.ActionReopen, scm.ActionSync:
return buildAllIfTrustedOrDraft(c, trigger, pr)
case scm.ActionReadyForReview, scm.ActionConvertedToDraft:
case scm.ActionConvertedToDraft:
if trigger.SkipDraftPR {
return buildAllIfTrustedOrDraft(c, trigger, pr)
}
Expand Down Expand Up @@ -250,7 +250,7 @@ func welcomeMsgForDraftPR(spc scmProviderClient, trigger *plugins.Trigger, pr sc
if trigger.IgnoreOkToTest {
comment += "Draft PRs cannot trigger pipelines with `/ok-to-test` in this repo. Collaborators can still trigger pipelines on the Draft PR using `/test all`."
} else {
comment += "To trigger pipelines on this draft PR, please mark it as ready for review by removing the draft status if you are trusted. Collaborators can also trigger tests on draft PRs using `/ok-to-test`."
comment += "To trigger pipelines on this draft PR (or even when the PR will be `ready for review` by removing the draft status), wait for collaborators to comment `/ok-to-test`."

if err := spc.AddLabel(org, repo, pr.Number, labels.NeedsOkToTest, true); err != nil {
errors = append(errors, err)
Expand Down
64 changes: 0 additions & 64 deletions pkg/plugins/trigger/pull-request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,70 +635,6 @@ func TestHandlePullRequest(t *testing.T) {
isDraftPR: true,
prAction: scm.ActionConvertedToDraft,
},
{
name: "Trusted user convert draft PR to ready for review with SkipDraftPR with ok-to-test should build",

Author: "t",
ShouldBuild: true,
HasOkToTest: true,
skipDraftPR: true,
prAction: scm.ActionReadyForReview,
},
{
name: "Trusted user convert draft PR to ready for review with SkipDraftPR without ok-to-test should build",

Author: "t",
ShouldBuild: true,
skipDraftPR: true,
prAction: scm.ActionReadyForReview,
},
{
name: "Trusted user convert draft PR to ready for review without SkipDraftPR with ok-to-test should not build",

Author: "t",
ShouldBuild: false,
HasOkToTest: true,
prAction: scm.ActionReadyForReview,
},
{
name: "Trusted user convert draft PR to ready for review without SkipDraftPR without ok-to-test should not build",

Author: "t",
ShouldBuild: false,
prAction: scm.ActionReadyForReview,
},
{
name: "Untrusted user convert draft PR to ready for review with SkipDraftPR with ok-to-test should build",

Author: "u",
ShouldBuild: true,
HasOkToTest: true,
skipDraftPR: true,
prAction: scm.ActionReadyForReview,
},
{
name: "Untrusted user convert draft PR to ready for review with SkipDraftPR without ok-to-test should not build",

Author: "u",
ShouldBuild: false,
skipDraftPR: true,
prAction: scm.ActionReadyForReview,
},
{
name: "Untrusted user convert draft PR to ready for review without SkipDraftPR with ok-to-test should not build",

Author: "u",
ShouldBuild: false,
HasOkToTest: true,
prAction: scm.ActionReadyForReview,
},
{
name: "Untrusted user convert draft PR to ready for review without SkipDraftPR without ok-to-test should not build",

Author: "u",
ShouldBuild: false,
prAction: scm.ActionReadyForReview,
},
}
for _, tc := range testcases {
t.Logf("running scenario %q", tc.name)
Expand Down

0 comments on commit 3bd5ef5

Please sign in to comment.