@@ -43,7 +43,6 @@ func TestPRReleaseOrchestrator_Execute(t *testing.T) {
4343 // Setup expectations for createReleaseBranch
4444 branchName := "release/v1.1.0"
4545 gitRepo .On ("CreateBranch" , mock .Anything , branchName ).Return (nil ).Once ()
46- gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Once ()
4746 gitRepo .On ("CheckoutBranch" , mock .Anything , branchName ).Return (nil ).Once ()
4847
4948 // Setup expectations for generateChangelog
@@ -59,8 +58,6 @@ func TestPRReleaseOrchestrator_Execute(t *testing.T) {
5958 gitRepo .On ("AddFiles" , mock .Anything , "package-lock.json" ).Return (nil ).Once ()
6059 // tools/* updates removed
6160 gitRepo .On ("Commit" , mock .Anything , "ci(release): prepare release v1.1.0" ).Return (nil ).Once ()
62-
63- // Setup expectations for push and PR creation
6461 gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Once ()
6562 githubRepo .On ("CreateOrUpdatePR" , mock .Anything , branchName , "main" , "ci(release): Release v1.1.0" ,
6663 mock .MatchedBy (func (body string ) bool {
@@ -148,7 +145,6 @@ func TestPRReleaseOrchestrator_Execute(t *testing.T) {
148145 // Setup remaining expectations for forced release
149146 branchName := "release/v1.0.1"
150147 gitRepo .On ("CreateBranch" , mock .Anything , branchName ).Return (nil ).Once ()
151- gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Once ()
152148 gitRepo .On ("CheckoutBranch" , mock .Anything , branchName ).Return (nil ).Once ()
153149
154150 changelog := "## v1.0.1\n \n ### Maintenance\n - Forced release"
@@ -256,7 +252,6 @@ func TestPRReleaseOrchestrator_Execute(t *testing.T) {
256252
257253 branchName := "release/v1.1.0"
258254 gitRepo .On ("CreateBranch" , mock .Anything , branchName ).Return (nil ).Once ()
259- gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Once ()
260255 gitRepo .On ("CheckoutBranch" , mock .Anything , branchName ).Return (nil ).Once ()
261256
262257 // Fail on changelog generation (use mock.Anything for context)
@@ -298,7 +293,6 @@ func TestPRReleaseOrchestrator_Execute(t *testing.T) {
298293
299294 branchName := "release/v1.1.0"
300295 gitRepo .On ("CreateBranch" , mock .Anything , branchName ).Return (nil ).Once ()
301- gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Times (2 ) // Once for branch, once after commit
302296 gitRepo .On ("CheckoutBranch" , mock .Anything , branchName ).Return (nil ).Once ()
303297
304298 changelog := "## v1.1.0\n \n ### Features\n - New feature"
@@ -307,6 +301,7 @@ func TestPRReleaseOrchestrator_Execute(t *testing.T) {
307301 gitRepo .On ("ConfigureUser" , mock .Anything , mock .Anything , mock .Anything ).Return (nil ).Once ()
308302 gitRepo .On ("AddFiles" , mock .Anything , mock .Anything ).Return (nil ).Times (3 )
309303 gitRepo .On ("Commit" , mock .Anything , mock .Anything ).Return (nil ).Once ()
304+ gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Once ()
310305
311306 // Fail on PR creation (use mock.Anything for context)
312307 // Note: The retry might not be happening for non-retryable errors
@@ -347,7 +342,6 @@ func TestPRReleaseOrchestrator_Execute(t *testing.T) {
347342
348343 branchName := "release/v1.1.0"
349344 gitRepo .On ("CreateBranch" , mock .Anything , branchName ).Return (nil ).Once ()
350- gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Times (2 )
351345 gitRepo .On ("CheckoutBranch" , mock .Anything , branchName ).Return (nil ).Once ()
352346
353347 changelog := "## v1.1.0\n \n ### Features\n - New feature"
@@ -356,6 +350,7 @@ func TestPRReleaseOrchestrator_Execute(t *testing.T) {
356350 gitRepo .On ("ConfigureUser" , mock .Anything , mock .Anything , mock .Anything ).Return (nil ).Once ()
357351 gitRepo .On ("AddFiles" , mock .Anything , mock .Anything ).Return (nil ).Times (3 )
358352 gitRepo .On ("Commit" , mock .Anything , mock .Anything ).Return (nil ).Once ()
353+ gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Once ()
359354
360355 orch := NewPRReleaseOrchestrator (gitRepo , githubRepo , fsRepo , cliffSvc , npmSvc )
361356 cfg := PRReleaseConfig {
@@ -435,7 +430,6 @@ func TestPRReleaseOrchestrator_Execute(t *testing.T) {
435430
436431 branchName := "release/v0.1.0"
437432 gitRepo .On ("CreateBranch" , mock .Anything , branchName ).Return (nil ).Once ()
438- gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Times (2 )
439433 gitRepo .On ("CheckoutBranch" , mock .Anything , branchName ).Return (nil ).Once ()
440434
441435 changelog := "## v0.1.0\n \n ### Features\n - Initial release"
@@ -444,6 +438,7 @@ func TestPRReleaseOrchestrator_Execute(t *testing.T) {
444438 gitRepo .On ("ConfigureUser" , mock .Anything , mock .Anything , mock .Anything ).Return (nil ).Once ()
445439 gitRepo .On ("AddFiles" , mock .Anything , mock .Anything ).Return (nil ).Times (3 )
446440 gitRepo .On ("Commit" , mock .Anything , mock .Anything ).Return (nil ).Once ()
441+ gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Once ()
447442 githubRepo .On ("CreateOrUpdatePR" , mock .Anything , mock .Anything , mock .Anything , mock .Anything , mock .Anything , mock .Anything ).
448443 Return (nil ).
449444 Once ()
@@ -518,7 +513,6 @@ func TestPRReleaseOrchestrator_Execute(t *testing.T) {
518513
519514 branchName := "release/v1.1.0"
520515 gitRepo .On ("CreateBranch" , mock .Anything , branchName ).Return (nil ).Once ()
521- gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Once ()
522516 gitRepo .On ("CheckoutBranch" , mock .Anything , branchName ).Return (nil ).Once ()
523517
524518 changelog := "## v1.1.0\n \n ### Features\n - New feature"
@@ -615,7 +609,6 @@ func TestPRReleaseOrchestrator_RollbackOnFailure(t *testing.T) {
615609 gitRepo .On ("ListLocalBranches" , mock .Anything ).Return ([]string {"main" }, nil ).Once ()
616610 // Once for create, once during rollback check
617611 gitRepo .On ("CreateBranch" , mock .Anything , branchName ).Return (nil ).Once ()
618- gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Once ()
619612 gitRepo .On ("CheckoutBranch" , mock .Anything , branchName ).Return (nil ).Once ()
620613
621614 // Setup expectations for updatePackages step - successful
@@ -694,7 +687,6 @@ func TestPRReleaseOrchestrator_RollbackOnFailure(t *testing.T) {
694687 // Mock ListLocalBranches to return branches WITHOUT the target branch (so it gets created)
695688 gitRepo .On ("ListLocalBranches" , mock .Anything ).Return ([]string {"main" }, nil ).Once ()
696689 gitRepo .On ("CreateBranch" , mock .Anything , branchName ).Return (nil ).Once ()
697- gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Times (2 )
698690 gitRepo .On ("CheckoutBranch" , mock .Anything , branchName ).Return (nil ).Once ()
699691
700692 changelog := "## v1.1.0\n \n ### Features\n - New feature"
@@ -706,6 +698,7 @@ func TestPRReleaseOrchestrator_RollbackOnFailure(t *testing.T) {
706698 gitRepo .On ("ConfigureUser" , mock .Anything , mock .Anything , mock .Anything ).Return (nil ).Once ()
707699 gitRepo .On ("AddFiles" , mock .Anything , mock .Anything ).Return (nil ).Times (3 )
708700 gitRepo .On ("Commit" , mock .Anything , mock .Anything ).Return (nil ).Once ()
701+ gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Once ()
709702
710703 // PR creation fails
711704 githubRepo .On ("CreateOrUpdatePR" , mock .Anything , mock .Anything , mock .Anything , mock .Anything , mock .Anything , mock .Anything ).
@@ -793,7 +786,6 @@ func TestPRReleaseOrchestrator_RollbackOnFailure(t *testing.T) {
793786 gitRepo .On ("ListLocalBranches" , mock .Anything ).Return ([]string {"main" }, nil ).Once ()
794787 gitRepo .On ("GetCurrentBranch" , mock .Anything ).Return ("main" , nil ).Once ()
795788 gitRepo .On ("CreateBranch" , mock .Anything , branchName ).Return (nil ).Once ()
796- gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Once ()
797789 gitRepo .On ("CheckoutBranch" , mock .Anything , branchName ).Return (nil ).Once ()
798790
799791 // Fail on changelog generation
@@ -857,7 +849,6 @@ func TestPRReleaseOrchestrator_DisabledRollback(t *testing.T) {
857849
858850 branchName := "release/v1.1.0"
859851 gitRepo .On ("CreateBranch" , mock .Anything , branchName ).Return (nil ).Once ()
860- gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Times (2 )
861852 gitRepo .On ("CheckoutBranch" , mock .Anything , branchName ).Return (nil ).Once ()
862853
863854 changelog := "## v1.1.0\n \n ### Features\n - New feature"
@@ -866,6 +857,7 @@ func TestPRReleaseOrchestrator_DisabledRollback(t *testing.T) {
866857 gitRepo .On ("ConfigureUser" , mock .Anything , mock .Anything , mock .Anything ).Return (nil ).Once ()
867858 gitRepo .On ("AddFiles" , mock .Anything , mock .Anything ).Return (nil ).Times (3 )
868859 gitRepo .On ("Commit" , mock .Anything , mock .Anything ).Return (nil ).Once ()
860+ gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Once ()
869861
870862 githubRepo .On ("CreateOrUpdatePR" , mock .Anything , mock .Anything , mock .Anything , mock .Anything , mock .Anything , mock .Anything ).
871863 Return (nil ).
@@ -906,7 +898,6 @@ func TestPRReleaseOrchestrator_DisabledRollback(t *testing.T) {
906898
907899 branchName := "release/v1.1.0"
908900 gitRepo .On ("CreateBranch" , mock .Anything , branchName ).Return (nil ).Once ()
909- gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Once ()
910901 gitRepo .On ("CheckoutBranch" , mock .Anything , branchName ).Return (nil ).Once ()
911902
912903 // Fail on changelog generation
@@ -945,7 +936,6 @@ func TestPRReleaseOrchestrator_prepareRelease(t *testing.T) {
945936 // Setup branch creation expectations (use mock.Anything for context)
946937 branchName := "release/v1.0.0"
947938 gitRepo .On ("CreateBranch" , mock .Anything , branchName ).Return (nil ).Once ()
948- gitRepo .On ("PushBranch" , mock .Anything , branchName ).Return (nil ).Once ()
949939 gitRepo .On ("CheckoutBranch" , mock .Anything , branchName ).Return (nil ).Once ()
950940
951941 orch := NewPRReleaseOrchestrator (gitRepo , githubRepo , fsRepo , cliffSvc , npmSvc )
0 commit comments