-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track assignee for issue #808
Conversation
lunny
commented
Feb 1, 2017
@@ -40,6 +40,8 @@ const ( | |||
CommentTypeLabel | |||
// Milestone changed | |||
CommentTypeMilestone | |||
// Assignees changed | |||
CommentTypeAssignees |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why plural? I would prefer singular for consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because currently Gitea only supports one assignee, but github support many. I think Gitea could support many in future. So I keep it plural for the next PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay
MilestoneID int64 | ||
OldMilestone *Milestone `xorm:"-"` | ||
Milestone *Milestone `xorm:"-"` | ||
OldAssigneeID int64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we didn't have to have both OldMilestoneID
/MilestoneID
and OldAssigneeID
/AssigneeID
, since at most one of them will be relevant for any particular issue.
Would it make sense to simply have OldElementID
and ElementID
fields? If Type==CommentTypeAssignees
then OldElementID
and ElementID
are assignee IDs, if Type==CommentTypeMilestone
they are milestone IDs, etc. I see pros and cons, interested to hear your thoughts 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's a good idea. The names should have meaning for easy maintaining. The memory usage is not very different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough
models/issue_comment.go
Outdated
// LoadAssignees if comment.Type is CommentTypeAssignees, then load assignees | ||
func (c *Comment) LoadAssignees() error { | ||
if c.OldAssigneeID > 0 { | ||
var oldAssignee User |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use GetUserByID(c.OldAssigneeID)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
models/issue_comment.go
Outdated
} | ||
|
||
if c.AssigneeID > 0 { | ||
var assignee User |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
LGTM |
Let L-G-T-M work |
@ethantkoenig please confirm. |
LGTM |
resolved #789 |