diff options
author | Alexander Foremny <aforemny@posteo.de> | 2024-03-21 05:35:00 +0100 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2024-03-25 07:45:59 +0100 |
commit | f83b424bf70b7b14b0268aeeafe1b3483fced49f (patch) | |
tree | 348a60e815f4bee492f58dea903ebc380029d61f /app/History/IssueEvents.hs | |
parent | fc0afaaa273f5b5d3696df87d70d5347a13bb9ac (diff) |
chore: Git -> Backend
Diffstat (limited to 'app/History/IssueEvents.hs')
-rw-r--r-- | app/History/IssueEvents.hs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/app/History/IssueEvents.hs b/app/History/IssueEvents.hs index 176d660..fc7bdcf 100644 --- a/app/History/IssueEvents.hs +++ b/app/History/IssueEvents.hs @@ -3,6 +3,7 @@ module History.IssueEvents ) where +import Backend qualified import Data.Binary (Binary) import Data.Function (on) import Data.List @@ -12,7 +13,6 @@ import Data.Maybe (fromMaybe) import Data.Ord (comparing) import Data.Proxy (Proxy) import GHC.Generics (Generic) -import Git qualified import History.Plan (Id, Planable, Proto, assume, propagate, protoOf) import History.Scramble (Scramble (..), getIssuesOfFile) import Issue (Issue (..)) @@ -20,17 +20,17 @@ import IssueEvent (IssueEvent (..)) import IssueEvent qualified as E data IssueEvents = IssueEvents - { commitHash :: Git.CommitHash, + { commitHash :: Backend.CommitHash, issueEvents :: [E.IssueEvent] } deriving (Show, Generic, Binary) instance Planable IssueEvents where - type Id IssueEvents = Git.CommitHash + type Id IssueEvents = Backend.CommitHash type Proto IssueEvents = Scramble - protoOf :: Proxy IssueEvents -> Git.CommitHash -> IO Scramble - protoOf _ commitHash@Git.WorkingTree = do - filesChanged <- Git.getFilesOf commitHash + protoOf :: Proxy IssueEvents -> Backend.CommitHash -> IO Scramble + protoOf _ commitHash@Backend.WorkingTree = do + filesChanged <- Backend.getFilesOf commitHash issues <- concat <$> mapM (getIssuesOfFile commitHash) filesChanged pure $ Scramble @@ -40,8 +40,8 @@ instance Planable IssueEvents where ], .. } - protoOf _ commitHash@(Git.Commit _) = do - filesChanged <- Git.getChangedFilesOf commitHash + protoOf _ commitHash@(Backend.Commit _) = do + filesChanged <- Backend.getChangedFilesOf commitHash issues <- concat <$> mapM (getIssuesOfFile commitHash) filesChanged pure $ Scramble @@ -63,7 +63,7 @@ instance Planable IssueEvents where } propagate :: - [Git.CommitHash] -> + [Backend.CommitHash] -> IssueEvents -> Scramble -> IssueEvents @@ -96,7 +96,7 @@ instance Planable IssueEvents where -- So, in the case `issue-1` has been re-opened, we cannot track its deletion at `commit-b`, because whether it was re-opened or originally created at `commit-b` depends on whether `issue-1` is present in the bottom `commit-a`, that we process only later. Thus, the scramble of commit `commit-b` cannot safely advance the issue's original commit, and we use this information to track re-opening of commits at later commits. -- -- Note that in the whole process, issue change events and issue deletion events can never be bottom-most/latest events, as they would depend on information not yet known, ie. the first commit can neither change nor delete an issue. -propagateIssueEvents :: [Git.CommitHash] -> IssueEvents -> Scramble -> IssueEvents +propagateIssueEvents :: [Backend.CommitHash] -> IssueEvents -> Scramble -> IssueEvents propagateIssueEvents log topIssueEvents bottomScramble = IssueEvents { commitHash = bottomScramble.commitHash, |