Private Issues: Research questions about public/private comment split #602
Labels
No labels
ai-review-please
Org/Team Modification
Private Issues
Runner Request
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
1 participant
Notifications
Due date
No due date set.
Blocks
#113 Private Issues
forge/forge
#594 Private Issues: “Privatize” Comments
forge/forge
Reference
forge/forge#602
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?
Summary
Research ways to point to comments within an issue/PR page when their IDs alone don’t guarantee uniqueness.
Background
The
IDfield of aCommentis used in constructing anchors pointing directly to the respective comment. If there are both public and private comments in their own tables, their ID fields alone aren’t suitable to uniquely identify them.Currently,
Commentgenerates hash tags for comments in the form ofissuecomment-{ID}, see here inmodels/issues/comment.go):In order for these IDs to be stable – so that links they are referenced by don’t break – the portion of the hash-tag before the ID must be different for comments originating as private comments, e.g.
privateissuecomment-{ID}, and whatever the hash tag is must survive conversion from public to private or vice versa (see #603). This doesn’t have to be implemented fully yet from the get-go, but the distinction must be made so that hash tags of either type of comment are guaranteed to be unique should they end up being mixed up when conversion between public and private issues (and their comments) becomes a thing.Turns out that there are more methods affected by public/private comment IDs not being unique:
APIURL()resolves to…/issues/comments/{ID}beneath the repoCommentHashTag()⇐HashTag(), as mentionedEventTag()resolves toevent-{ID}, used as element ID inside a pageOther methods exist which delegate to
HashTag()some way or other:Link()⇒hashLink()⇒HashTag()CodeCommentLink()⇒HashTag()CodeCommentLink()⇒Link()⇒ …RefCommentLink()(⇒RefIssueLink()) ⇒Link()⇒ …RefIssueLink()⇒Link()⇒ …As a result:
APIURL()andCommentHashTag()⇒HashTag()must be distinctive between public and private comments, such as prefixing the respective private comment ID contained with e.g. a "P" character for distinction.