diff --git a/pkg/plugins/trigger/pull-request.go b/pkg/plugins/trigger/pull-request.go index 32d443f9e..5b72d09c3 100644 --- a/pkg/plugins/trigger/pull-request.go +++ b/pkg/plugins/trigger/pull-request.go @@ -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) } @@ -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) diff --git a/pkg/plugins/trigger/pull-request_test.go b/pkg/plugins/trigger/pull-request_test.go index 363c51226..3de74e1a6 100644 --- a/pkg/plugins/trigger/pull-request_test.go +++ b/pkg/plugins/trigger/pull-request_test.go @@ -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)