REST API: Create private issue & foundational work #168
Labels
No labels
Backlog Status
Needs Review
Backlog Status
Ready
Chore
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
Backlog Status
Needs Review
Backlog Status
Ready
chore
documentation
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
#113 Private Issues
forge/forge
Reference
forge/forge#168
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Story
As a user of Forgejo,
I want to create private issues via the REST API,
so I can work on private issues using the web API.
Acceptance Criteria
Background
XORM maps one type to one database tableXORM can dispatch one type to multiple tables via the Table()/TableName() methods => yet we need two types for public and private issues (the existingIssueis public, the newPrivateIssuewill contain private ones), at least for querying via XORM Engine’s Find() method. However, this throws off many internal mechanisms of XORM (which creates variables of the same type internally when e.g. querying tables but gets things wrong when it comes to columns that need to be set one way or the other for the type to make sense).IsPublicso that it would default tofalseif unset. However, this throws off so much of the existing code base that I suggested the opposite (IsPrivate) because XORM lets us validate or set things on the "load from or store into DB" boundary throughAfterLoad(),BeforeInsert(),BeforeUpdate()methods (and we can easily control this on the boundary where we convert one type into the other). This way we can a) ensure that a private issue is only stored in the DB through thePrivateIssuetype (and letIssuerefuse to do so for variables which represent a private issue and vice versa) and b) setIsPrivateaccordingly when loading so we don’t have to store it in the DB (the fact that an issue is stored in one or the other table is information enough). They asked me to implement unit tests verifying this behavior (to ensure XORM does as it advertises), but I would do that anyway.As discussed, bumping story points because this proved to be more involved than initially estimated.
Implemented in my feature branch, in "feat: Private Issues: Foundational changes" and "feat: Private Issues: Allow creating through API".