Skip to content

Commit

Permalink
Merge pull request #1076 from morucci/1074
Browse files Browse the repository at this point in the history
Use `committedDate` for ChangeCommitForcePushedEvent's `created_at` field
  • Loading branch information
mergify[bot] authored Oct 31, 2023
2 parents 97e1b77 + cdef28e commit 8e7fb0c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion src/Lentille/GitHub/GraphQLFragments.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,13 @@ fragmentPRData =
}
... on HeadRefForcePushedEvent {
id
createdAt
fpactor: actor {
__typename
login
}
afterCommit {
forcePushCommittedDate: committedDate
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Lentille/GitHub/PullRequests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/Lentille/GitHub/UserPullRequests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 8e7fb0c

Please sign in to comment.