diff --git a/CHANGELOG.md b/CHANGELOG.md index 902476ff7..b85fd754d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ All notable changes to this project will be documented in this file. ### Changed - `workspaceName` is typed as `IndexName`, which respect ElasticSearch constraints +- [crawler] `ChangeCommitPushedEvent` and `ChangeCommitForcePushedEvent` events date (`created_at`) is the commit date of the + related commit. ### Removed diff --git a/src/Lentille/GitHub/GraphQLFragments.hs b/src/Lentille/GitHub/GraphQLFragments.hs index e53822bd1..0f1245a2f 100644 --- a/src/Lentille/GitHub/GraphQLFragments.hs +++ b/src/Lentille/GitHub/GraphQLFragments.hs @@ -109,11 +109,13 @@ fragmentPRData = } ... on HeadRefForcePushedEvent { id - createdAt fpactor: actor { __typename login } + afterCommit { + forcePushCommittedDate: committedDate + } } } } diff --git a/src/Lentille/GitHub/PullRequests.hs b/src/Lentille/GitHub/PullRequests.hs index 706425592..94a5a76d2 100644 --- a/src/Lentille/GitHub/PullRequests.hs +++ b/src/Lentille/GitHub/PullRequests.hs @@ -191,8 +191,8 @@ transformResponse host identCB result = do ( GetProjectPullRequestsRepositoryPullRequestsNodesTimelineItemsNodesHeadRefForcePushedEvent _ eId - createdAt (Just (GetProjectPullRequestsRepositoryPullRequestsNodesTimelineItemsNodesFpactor _ actor)) + (Just (GetProjectPullRequestsRepositoryPullRequestsNodesTimelineItemsNodesAfterCommit createdAt)) ) -> toMaybeForcePushedEvent change eId getIdent actor createdAt _ -> Nothing diff --git a/src/Lentille/GitHub/UserPullRequests.hs b/src/Lentille/GitHub/UserPullRequests.hs index 14cd25ad2..f4aef734a 100644 --- a/src/Lentille/GitHub/UserPullRequests.hs +++ b/src/Lentille/GitHub/UserPullRequests.hs @@ -188,9 +188,9 @@ transformResponse host identCB result = do ( GetUserPullRequestsUserPullRequestsNodesTimelineItemsNodesHeadRefForcePushedEvent _ eId - createdAt (Just (GetUserPullRequestsUserPullRequestsNodesTimelineItemsNodesFpactor _ actor)) - ) -> toMaybeForcePushedEvent change eId getIdent actor createdAt + (Just (GetUserPullRequestsUserPullRequestsNodesTimelineItemsNodesAfterCommit createdAt')) + ) -> toMaybeForcePushedEvent change eId getIdent actor createdAt' _ -> Nothing getCommitEvents :: Change -> GetUserPullRequestsUserPullRequestsNodesCommits -> [ChangeEvent]