-
-
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
Fix create team, update team missing units #5188
Fix create team, update team missing units #5188
Conversation
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.
Please update swagger.
models/unit.go
Outdated
// FindUnitTypes give the unit key name and return unit | ||
func FindUnitTypes(nameKeys ...string) (res []UnitType) { | ||
for t, u := range Units { | ||
if strings.EqualFold(u.NameKey, u.NameKey) { |
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.
This is always true
. You are comparing u.NameKey
with u.NameKey
...
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.
Should we backport this? |
4d5e5bd
to
c4d54c7
Compare
@kolaente I think yes, since v1.6 stable is not released. |
CI still fails, looks like swagger is not right. |
c0e03f8
to
a6411e3
Compare
templates/swagger/v1_json.tmpl
Outdated
@@ -21,7 +21,7 @@ | |||
}, | |||
"version": "1.1.1" | |||
}, | |||
"basePath": "{{AppSubUrl}}/api/v1", |
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.
@lunny the change on this line needs to be reverted for CI to be successful.
a740aa3
to
2f624aa
Compare
Alright this now passes swagger check. @kolaente would you be able to review? |
Blocked by vendor check. |
blocked by go-gitea/go-sdk#127 |
0321ec3
to
5ef2eae
Compare
Codecov Report
@@ Coverage Diff @@
## master #5188 +/- ##
=========================================
Coverage ? 37.37%
=========================================
Files ? 312
Lines ? 46379
Branches ? 0
=========================================
Hits ? 17334
Misses ? 26566
Partials ? 2479
Continue to review full report at Codecov.
|
@techknowlogick CI PASS |
This wont be breaking change? |
@lafriks I think no. Before this PR, the non-owner team you created via API could not visit any repositories since units parameters is missing. After this, you could add units parameters when creating team via API. |
Should fix #5187. Now when you use the API, you have to give the units on the form if the team is not an admin team. The units is an array of string, it could be
repo.code,repo.issues,repo.ext_issues,repo.wiki,repo.pulls,repo.releases,repo.ext_wiki
now.