Private Issues: Refactor sql.NullInt64 to optional.Option #583

Closed
opened 2026-05-19 15:37:47 +00:00 by nphilipp · 2 comments
Member

Story

As a developer in the Forgejo codebase,
I want that optional struct fields are implemented consistently,
so that I don’t have to keep mental models in my head unnecessarily.

Acceptance Criteria

  • The current way of using sql.NullInt64 types for these fields is replaced by optional.Option[…].
  • Users of these fields are updated accordingly.
  • Unit tests pass (make … test-backend)
  • Integration tests pass (make … test-sqlite)
  • Changes are integrated with our previous commits that they change

Background

Upstream prefers using optional.Option[…] over sql.NullInt64, it’s got some (better?) testing coverage.

# Story As a developer in the Forgejo codebase, I want that optional struct fields are implemented consistently, so that I don’t have to keep mental models in my head unnecessarily. # Acceptance Criteria - [x] The current way of using `sql.NullInt64` types for these fields is replaced by `optional.Option[…]`. - [x] Users of these fields are updated accordingly. - [x] Unit tests pass (`make … test-backend`) - [x] Integration tests pass (`make … test-sqlite`) - [x] Changes are integrated with our previous commits that they change # Background Upstream [prefers](https://codeberg.org/forgejo/design/issues/2#issuecomment-14633643) using `optional.Option[…]` over `sql.NullInt64`, it’s got some (better?) testing coverage.
nphilipp added this to the Sprint 21 project 2026-05-19 15:37:48 +00:00
nphilipp changed title from Private Issues: Refactor sql.NullInt64 to optional.Optional to Private Issues: Refactor sql.NullInt64 to optional.Option 2026-05-19 15:39:11 +00:00
Author
Member

Bumping SPs, as it proved to be more involved than I initially thought.

Bumping SPs, as it proved to be more involved than I initially thought.
Author
Member

The changes are in the fedora fork, in these branches:

The changes are in the `fedora` fork, in these branches: - [private-issues-backend](https://codeberg.org/fedora/forgejo/src/branch/private-issues-backend) - [private-issues](https://codeberg.org/fedora/forgejo/src/branch/private-issues)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
forge/forge#583
No description provided.