Skip to content

Commit

Permalink
remove use of getIntegrationCandidate
Browse files Browse the repository at this point in the history
... in actual code.

It is now only used in tests.
  • Loading branch information
rudymatela committed Jul 19, 2022
1 parent edcc752 commit 7cc7fe8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Logic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -580,14 +580,13 @@ synchronizeState stateInitial =
proceed :: ProjectState -> Action ProjectState
proceed state = do
state' <- provideFeedback state
case Pr.getIntegrationCandidate state' of
Just candidate -> proceedCandidate candidate state'
-- No current integration candidate, find the next one.
Nothing -> case Pr.candidatePullRequests state' of
-- No pull requests eligible, do nothing.
[] -> return state'
-- Found a new candidate, try to integrate it.
pr : _ -> tryIntegratePullRequest pr state'
case (Pr.getIntegrationCandidates state', Pr.candidatePullRequests state') of
-- Proceed with an already integrated candidate
(candidate:_, _) -> proceedCandidate candidate state'
-- Found a new candidate, try to integrate it.
(_, pr:_) -> tryIntegratePullRequest pr state'
-- No pull requests eligible, do nothing.
(_, _) -> return state'

-- TODO: Get rid of the tuple; just pass the ID and do the lookup with fromJust.
proceedCandidate :: (PullRequestId, PullRequest) -> ProjectState -> Action ProjectState
Expand Down
1 change: 1 addition & 0 deletions src/Project.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module Project
emptyProjectState,
existsPullRequest,
getIntegrationCandidate,
getIntegrationCandidates,
getQueuePosition,
insertPullRequest,
loadProjectState,
Expand Down

0 comments on commit 7cc7fe8

Please sign in to comment.