Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crawler: Fix target branch field not set on ChangeEvent Docs #1066

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading