Explore backend implementation options and decide upon one #135

Closed
opened 2025-08-06 09:22:22 +00:00 by nilsph · 2 comments
nilsph commented 2025-08-06 09:22:22 +00:00 (Migrated from codeberg.org)

User Story

As a developer implementing private issues,
I want to reuse existing code as much as possible,
to avoid duplicated structures which can get out of sync.

Acceptance Criteria

  • A viable way is found to implement private issues being separate in the database while sharing much code with public issues.
# User Story As a developer implementing private issues, I want to reuse existing code as much as possible, to avoid duplicated structures which can get out of sync. # Acceptance Criteria - [ ] A viable way is found to implement private issues being separate in the database while sharing much code with public issues.
nilsph commented 2025-08-14 11:44:59 +00:00 (Migrated from codeberg.org)

[Not working] Writable DB views – while seemingly being supported by SQLite, PostgreSQL, MySQL, MariaDB (in one way or another), XORM doesn’t know about views at all.

\[Not working\] Writable DB views – while seemingly being supported by SQLite, PostgreSQL, MySQL, MariaDB (in one way or another), XORM doesn’t know about views at all.
nilsph commented 2025-09-04 12:11:18 +00:00 (Migrated from codeberg.org)

@ryanlerch this should have stayed on the Forgejo project, right? I wondered why I couldn’t find it on the board…

Anyway, to me, the most feasible way to implement this is:

  • Introduce a new type PrivateIssue, compatible with/derived from Issue, along with a new interface AnyIssue which wraps both types.
  • Adapt type methods and low-level functions to work with both types.
  • Special-case private issues in high(er)-level code, this probably requires a method of some sort on the AnyIssue interface to check if the current user is allowed to see the issue (private or public).

It gets hazier the more higher-level we get, so I’ll leave it at that for now.

@ryanlerch this should have stayed on the Forgejo project, right? I wondered why I couldn’t find it on the board… Anyway, to me, the most feasible way to implement this is: - Introduce a new type `PrivateIssue`, compatible with/derived from `Issue`, along with a new interface `AnyIssue` which wraps both types. - Adapt type methods and low-level functions to work with both types. - Special-case private issues in high(er)-level code, this probably requires a method of some sort on the `AnyIssue` interface to check if the current user is allowed to see the issue (private or public). It gets hazier the more higher-level we get, so I’ll leave it at that for now.
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.

Blocks
Reference
forge/forge#135
No description provided.