Skip to content

Conversation

@ethantkoenig
Copy link
Member

@ethantkoenig ethantkoenig commented Jun 23, 2017

Fix bug in NewLabels(..) where the ID field for the labels were not populated. This caused a problem in the POST /repos/:user/:repo/labels API endpoint, where the response label would have an "id" attribute of 0.

Also update the unit test to check that ID has been populated.

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 x.Insert(labels...)?

Copy link
Member

Choose a reason for hiding this comment

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

And of course, a transaction is needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

x.Insert(labels...) doesn't compile, since labels is of type []*Label, and the argument to x.Insert(..) has to be of type []interface{}.

I don't understand why is a transaction needed? From what I can tell, the call to x.Insert(..)will just generate one INSERT command.

Copy link
Member

Choose a reason for hiding this comment

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

x.Insert(slice) is one INSERT command, x.Insert(slice...) will generate N INSERT command. A transaction for a better performance.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I see. Updated to use a transaction.

@lunny lunny added the type/bug label Jun 24, 2017
@lunny lunny added this to the 1.2.0 milestone Jun 24, 2017
@lafriks
Copy link
Member

lafriks commented Jun 24, 2017

LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jun 24, 2017
@ethantkoenig
Copy link
Member Author

Rebased to run CI again

@lunny
Copy link
Member

lunny commented Jun 25, 2017

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 Jun 25, 2017
@lunny lunny merged commit 2559a34 into go-gitea:master Jun 25, 2017
@ethantkoenig ethantkoenig deleted the fix/new_labels branch June 26, 2017 14:54
@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/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants