Skip to content

Commit

Permalink
Merge pull request #1066 from morucci/fix-1065
Browse files Browse the repository at this point in the history
crawler: Fix target branch field not set on ChangeEvent Docs
  • Loading branch information
mergify[bot] authored Sep 29, 2023
2 parents 39c57c2 + a1448ef commit ce0028f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
### Fixed

- [crawler] Correctly handle errors and do not commit new changes.
- [crawler] Change target branch not field not set on ChangeEvent documents.

## [1.9.0] - 2023-09-16

Expand Down
1 change: 1 addition & 0 deletions src/Monocle/Backend/Documents.hs
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ data EChangeEvent = EChangeEvent
, echangeeventOnAuthor :: Author
, echangeeventSelfMerged :: Maybe Bool
, echangeeventBranch :: LText
, echangeeventTargetBranch :: LText
, -- Set labels as a Maybe type because existing indexes do not have the event docs with labels
-- TODO: implement a migration procedure in the Janitor and remove the 'Maybe' from this value
echangeeventLabels :: Maybe [LText]
Expand Down
1 change: 1 addition & 0 deletions src/Monocle/Backend/Index.hs
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ toEChangeEvent ChangePB.ChangeEvent {..} =
EChangeMergedEvent -> Just $ onAuthor == author
_ -> Nothing
, echangeeventBranch = changeEventBranch
, echangeeventTargetBranch = changeEventTargetBranch
, echangeeventLabels = Just . toList $ changeEventLabels
, echangeeventCreatedAt = T.toUTCTime $ fromMaybe (error "changeEventCreatedAt field is mandatory") changeEventCreatedAt
, echangeeventOnCreatedAt = T.toUTCTime $ fromMaybe (error "changeEventOnCreatedAt field is mandatory") changeEventOnCreatedAt
Expand Down
1 change: 1 addition & 0 deletions src/Monocle/Backend/Provisioner.hs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ fakeChangeEvent from' to = do
echangeeventAuthor = Nothing
echangeeventSelfMerged = Nothing
echangeeventBranch = ""
echangeeventTargetBranch = "main"
echangeeventApproval = Nothing
echangeeventTasksData = Nothing
echangeeventLabels = Just []
Expand Down
1 change: 1 addition & 0 deletions src/Monocle/Backend/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,7 @@ emptyEvent = EChangeEvent {..}
echangeeventAuthor = Just fakeAuthor
echangeeventOnAuthor = fakeAuthor
echangeeventBranch = mempty
echangeeventTargetBranch = "main"
echangeeventSelfMerged = Nothing
echangeeventCreatedAt = fakeDate
echangeeventOnCreatedAt = fakeDate
Expand Down

0 comments on commit ce0028f

Please sign in to comment.