Skip to content
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

Merged
merged 3 commits into from
Feb 3, 2017
Merged

Conversation

lunny
Copy link
Member

@lunny lunny commented Feb 1, 2017

untitled

@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Feb 1, 2017
@lunny lunny added this to the 1.1.0 milestone Feb 1, 2017
@@ -40,6 +40,8 @@ const (
CommentTypeLabel
// Milestone changed
CommentTypeMilestone
// Assignees changed
CommentTypeAssignees
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

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
Copy link
Member

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 😄

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough

// LoadAssignees if comment.Type is CommentTypeAssignees, then load assignees
func (c *Comment) LoadAssignees() error {
if c.OldAssigneeID > 0 {
var oldAssignee User
Copy link
Member

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)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

}

if c.AssigneeID > 0 {
var assignee User
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@appleboy
Copy link
Member

appleboy commented Feb 3, 2017

LGTM

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 3, 2017
@appleboy
Copy link
Member

appleboy commented Feb 3, 2017

Let L-G-T-M work

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 3, 2017
@lunny
Copy link
Member Author

lunny commented Feb 3, 2017

@ethantkoenig please confirm.

@ethantkoenig
Copy link
Member

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 3, 2017
@lunny lunny merged commit 3e0525b into go-gitea:master Feb 3, 2017
@lunny
Copy link
Member Author

lunny commented Feb 5, 2017

resolved #789

@lunny lunny deleted the lunny/track_assignee_issue branch April 19, 2017 05:45
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants