Skip to content

Conversation

petkostas
Copy link
Contributor

@petkostas petkostas commented Aug 23, 2025

Summary

GitHub GraphQL returns zero time (&time.Time{}) for nullable fields, this leads to GORM not properly handling this cases.
This PR:

  • Introduces a new core helper util NilIfZeroTime in order to ensure that *time.Time fields are assigned the nil value.
  • Fixes the relevant cases in both collectors and extractors (as existing entries in the DB should be properly handled as well).

Does this close any open issues?

Closes #8538

Screenshots

⚠️ Screenshots pending, as this PR has not been tested yet.

⚠️ This PR has not been tested yet, I am looking for cases to properly test the fixes ⚠️

@petkostas petkostas self-assigned this Aug 23, 2025
@petkostas petkostas added the pr-type/bug-fix This PR fixes a bug label Aug 23, 2025
@petkostas petkostas force-pushed the fix/issue-8538-fix-github-zero-time branch 2 times, most recently from 2c3a04e to 9ca4162 Compare August 23, 2025 12:31
@petkostas petkostas requested review from klesh and Startrekzky August 23, 2025 18:12
@klesh
Copy link
Contributor

klesh commented Aug 25, 2025

Hi @petkostas, I saw the review request this morning, but since the PR is still in draft, I wasn’t sure if it’s ready for review yet?

@petkostas
Copy link
Contributor Author

Hey @klesh
I need to test this potentially with repo that re-produces the initial problem. I added you in case you wanted to do a first check regarding the approach.
But feel free to ignore until I have tested it and removed the draft.

@klesh
Copy link
Contributor

klesh commented Aug 25, 2025

Hey @klesh I need to test this potentially with repo that re-produces the initial problem. I added you in case you wanted to do a first check regarding the approach. But feel free to ignore until I have tested it and removed the draft.

I see — very thoughtful, thanks for the explanation!

I’d prefer to review after the tests are done, since in most cases the behavior depends more on the 3rd-party implementation (i.e., the actual response from GitHub GraphQL) than on our code, which is relatively straightforward.

In other words, field tests are more critical here than the code review 😂

@petkostas petkostas force-pushed the fix/issue-8538-fix-github-zero-time branch from 9ca4162 to 3e2f5f3 Compare September 8, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-type/bug-fix This PR fixes a bug
Projects
None yet
2 participants