Skip to content

Commit

Permalink
skip "testing" branch preemptive deletion
Browse files Browse the repository at this point in the history
In #134, we transitioned from testing on `testing/<id>` instead of just
`testing`.  In order to maintain backwards compatibility, we had to delete
`testing` every time we created a new `testing/<id>` branch.

That has been a month ago, and most projects that use Hoff should have had at
least one PR triggering the deletion of `testing`.  So we should remove this
code that tries deletion every time.

We currently see the following in the logs every time we merge:

```haskell
Aug 18 13:37:12 hoff hoff[4321]: [Warn] error: git push -d failed. Reason: error: unable to delete 'testing': remote ref does not exist
Aug 18 13:37:29 hoff hoff[4321]: error: failed to push some refs to '[email protected]:<org>/<repo>.git'
```

This should get rid of entries like the above.
  • Loading branch information
rudymatela committed Aug 23, 2022
1 parent 9003116 commit 7d58a61
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/Logic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,6 @@ runAction config = foldFree $ \case
TryIntegrate message (pr, ref, sha) train alwaysAddMergeCommit cont -> do
doGit $ ensureCloned config

-- Needed for backwards compatibility with existing repositories
-- as we now test at testing/<pr_id> instead of testing.
-- When no repositories have a testing branch, this can safely be removed.
_ <- doGit $ Git.deleteRemoteBranch $ Git.Branch $ Config.testBranch config

let targetBranch = fromMaybe (Git.Branch $ Config.branch config) (trainBranch train)

shaOrFailed <- doGit $ Git.tryIntegrate
Expand Down

0 comments on commit 7d58a61

Please sign in to comment.