Graphql API - contributionsCollection and strange datetime related behavior
#121029
Replies: 2 comments 1 reply
-
|
Hmm, my first thought was that there was a fixed offset in the way PR dates were stored vs queried. But I tried to bisect some times that would return that PR vs not return it and found that crossing day boundaries gave false positives, but there's also a false negative in the time range. Here's my results: I'll look into this more, it's an interesting puzzle 🕵️ |
Beta Was this translation helpful? Give feedback.
-
|
I'm experiencing a similar problem with Output: {
"data": {
"viewer": {
"contributionsCollection": {
"startedAt": "2025-03-25T00:00:00Z",
"endedAt": "2025-03-25T03:59:59Z",
"commitContributionsByRepository": [
{
"repository": {
"nameWithOwner": "jwodder/life"
},
"contributions": {
"totalCount": 1,
"nodes": [
{
"occurredAt": "2025-03-25T07:00:00Z"
}
]
}
}
]
}
}
}
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Body
I want to fetch contributions of a user in a datetime range.
Output:
{ "data": { "user": { "contributionsCollection": { "startedAt": "2024-04-07T00:00:00Z", "endedAt": "2024-04-08T00:00:00Z", "pullRequestContributionsByRepository": [ { "contributions": { "nodes": [ { "pullRequest": { "createdAt": "2024-04-07T21:45:34Z" } } ] } } ] } } } }This is good. There's only 1 PR available and its creation time fits in the given datetime range.
Problem 1
Now, change the
tovalue to 1 second before:Output:
{ "data": { "user": { "contributionsCollection": { "startedAt": "2024-04-07T00:00:00Z", "endedAt": "2024-04-07T23:59:59Z", "pullRequestContributionsByRepository": [] } } } }No PRs found! PR's creation datetime is in the given range though!
Problem 2
Change the
fromto some datetime after the PR creation date:Output:
{ "data": { "user": { "contributionsCollection": { "startedAt": "2024-04-08T00:00:00Z", "endedAt": "2024-04-09T00:00:00Z", "pullRequestContributionsByRepository": [ { "contributions": { "nodes": [ { "pullRequest": { "createdAt": "2024-04-07T21:45:34Z" } } ] } } ] } } } }That PR is still found, even though its creation date is not in the given range.
Beta Was this translation helpful? Give feedback.
All reactions