Skip to content

Commit

Permalink
Fix unintegration of other PRs upon PR closure
Browse files Browse the repository at this point in the history
Before an early PR closure (or new commit) had the power to unintegrate PRs in
the train, regardless if this PR was integrated or not!  The unintegration of
later PRs should only happen when the PR being closed has been integrated and
thus is the base for these following PRs.
  • Loading branch information
rudymatela committed Aug 24, 2022
1 parent 06dc0a5 commit 1d90bc9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Logic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,10 @@ handlePullRequestClosed closingReason pr state = do
-- actually delete the pull request
pure . Pr.deletePullRequest pr
$ case Pr.lookupPullRequest pr state of
Just (Pr.PullRequest{Pr.integrationStatus = Promoted}) -> state
-- we unintegrate PRs after it if it has not been promoted to master
_ -> unintegrateAfter pr $ state
-- we unintegrate PRs after if it has been integrated without promotion
-- as everything that was built on top of it needs to be rebuilt
Just (Pr.PullRequest{Pr.integrationStatus = Integrated _ _}) -> unintegrateAfter pr state
_ -> state

handlePullRequestEdited :: PullRequestId -> Text -> BaseBranch -> ProjectState -> Action ProjectState
handlePullRequestEdited prId newTitle newBaseBranch state =
Expand Down

0 comments on commit 1d90bc9

Please sign in to comment.