From 117042ccaf92ae89f0e0f5617cd2a530082c6893 Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Mon, 29 Jan 2024 14:14:38 +0000 Subject: [PATCH] Add missing EErrorDoc to AllEventTypes This fixes an issue reported here: https://github.com/change-metrics/monocle/issues/1084 monocle: esAdvance: Original error was: Error in $.hits.hits[2905]['_source']: parsing Monocle.Backend.Janitor.EChangeEventAuthors(EChangeEventAuthors) failed, key "id" not found Error parse failure was: Error in $: key "status" not found, req: "FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFkJtNFFLQW82UjhDR21YRVRpTnNuVXcAAAAAAAAA8xZmMDFyRzVFeVJjR2VVUFVZMGNxZ0t, resp: {"_scroll_id":"FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFkJtNFFLQW82UjhDR21YRVRpTnNuVXcAAAAAAAAA8xZmMDFyRzVFeVJjR, tb: [("throwError",SrcLoc {srcLocPackage = "monocle-1.11.0-2ShLfwfFjyo1H0paLD2SMi", srcLocModule = "Monocle.Effects", srcLocFile = "src/Monocle/Effects.hs", srcLocStartLine = 403, srcLocStartCol = 15, srcLocEndLine = 403, srcLocEndCol = 27}),("runBHIOSafe",SrcLoc {srcLocPackage = "monocle-1.11.0-2ShLfwfFjyo1H0paLD2SMi", srcLocModule = "Monocle.Effects", srcLocFile = "src/Monocle/Effects.hs", srcLocStartLine = 445, srcLocStartCol = 3, srcLocEndLine = 445, srcLocEndCol = 14})] CallStack (from HasCallStack): error, called at src/Relude/Debug.hs:289:11 in relude-1.2.0.0-Jiwa4gfuZvkK1snRof3V:Relude.Debug error, called at src/Monocle/Effects.hs:420:7 in monocle-1.11.0-2ShLfwfFjyo1H0paLD2SMi:Monocle.Effects --- CHANGELOG.md | 2 ++ src/Monocle/Backend/Documents.hs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85d7e81d8..e295aa8a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ All notable changes to this project will be documented in this file. ### Removed ### Fixed +- [janitor] `update-idents` unables to process when some Error docs are in the index. + ## [1.11.0] - 2024-01-12 ### Added diff --git a/src/Monocle/Backend/Documents.hs b/src/Monocle/Backend/Documents.hs index 393f7022c..3c557b7dc 100644 --- a/src/Monocle/Backend/Documents.hs +++ b/src/Monocle/Backend/Documents.hs @@ -319,6 +319,7 @@ instance FromJSON EChangeState where ) -- | When adding new document type, update the `instance FromJSON EDocType` too. +-- | and please make sure to update `allEventTypes` accordingly data EDocType = EChangeCreatedEvent | EChangeMergedEvent @@ -339,7 +340,7 @@ data EDocType allEventTypes :: [EDocType] allEventTypes = - filter (`notElem` [EChangeDoc, EOrphanTaskData, ECachedAuthor]) [minBound .. maxBound] + filter (`notElem` [EChangeDoc, EOrphanTaskData, ECachedAuthor, EErrorDoc]) [minBound .. maxBound] instance From EDocType Text where from = \case