diff --git a/internal/bootstrap/onboard.go b/internal/bootstrap/onboard.go index 0c5f02f..02d1123 100644 --- a/internal/bootstrap/onboard.go +++ b/internal/bootstrap/onboard.go @@ -20,8 +20,6 @@ type onboardingRepoManager interface { EnsureProtectedBranch(string, string) error PublishDeliveryBranch(string, string, string, string, func(string) error) (bool, error) EnsurePullRequest(string, string, string, string) error - HasOpenPullRequest(string, string) (bool, error) - MergePullRequest(string, string) error PublishRepositoryPullRequest(string, string, string, string, func(string) error) (bool, error) EnsureWebhook(string, string, string) error TriggerWebhookTest(string, string, string) error @@ -80,13 +78,6 @@ func OnboardApp(cfg config.Config, sourceDir string) error { return err } } - if open, err := sourceManager.HasOpenPullRequest(repository, deliveryBranch); err != nil { - return err - } else if open { - if err := sourceManager.MergePullRequest(repository, deliveryBranch); err != nil { - return err - } - } registrationBranch := "maidn/register-" + resolved.Delivery.AppName clusterManager := newOnboardingRepoManager(resolved.Git.BaseURL, resolved.Git.Token, resolved.Git.Owner, resolved.Git.Username, "", "", resolved.Flux.Branch, "") diff --git a/internal/bootstrap/onboard_test.go b/internal/bootstrap/onboard_test.go index d3dd84c..d51ce62 100644 --- a/internal/bootstrap/onboard_test.go +++ b/internal/bootstrap/onboard_test.go @@ -311,12 +311,14 @@ func TestOnboardAppUsesCanonicalSourceAndExecutionClusterManagers(t *testing.T) "remote https://git.example.test/Maidn/maidn-e2e-web.git:production", "protect Maidn/maidn-e2e-web:production", "delivery https://git.example.test/Maidn/maidn-e2e-web.git:maidn/delivery-web-ui", - "open-pr Maidn/maidn-e2e-web:maidn/delivery-web-ui", } { if !strings.Contains(sourceCalls, want) { t.Fatalf("source manager calls = %q, missing %q", sourceCalls, want) } } + if strings.Contains(sourceCalls, "merge-pr") { + t.Fatalf("source delivery PR was merged without review: %q", sourceCalls) + } if got := strings.Join(clusterManager.calls, "\n"); got != "register test-org-2/cluster:maidn/register-web-ui" { t.Fatalf("cluster manager calls = %q", got) }