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

add api for user to create org #5268

Merged
merged 9 commits into from Nov 20, 2018

Conversation

lunny
Copy link
Member

@lunny lunny commented Nov 4, 2018

This will fix #5260. And github API v3 doesn't implement this route.

@lunny lunny added type/feature Completely new functionality. Can only be merged if feature freeze is not active. modifies/api This PR adds API routes or modifies them labels Nov 4, 2018
@lunny lunny added this to the 1.7.0 milestone Nov 4, 2018
@zeripath
Copy link
Contributor

zeripath commented Nov 5, 2018

@lunny this appears to be failing to build because there's a newline at the end of the committed templates/swagger/v1_json.tmpl - I think if you just run: make swagger-generate and commit that it should fix it.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 5, 2018
@bkcsoft bkcsoft 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 Nov 6, 2018
@lunny
Copy link
Member Author

lunny commented Nov 6, 2018

@zeripath the newline at the end of v1_json.tmpl is generated by make swagger-generate. I have fixed it.

@sapk
Copy link
Member

sapk commented Nov 6, 2018

@lunny CI failed (401 Unauthorized)

@lunny lunny force-pushed the lunny/api_create_org branch 2 times, most recently from a1263e3 to 150ef64 Compare November 9, 2018 12:48
@codecov-io
Copy link

codecov-io commented Nov 9, 2018

Codecov Report

Merging #5268 into master will increase coverage by 0.04%.
The diff coverage is 71.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5268      +/-   ##
==========================================
+ Coverage   37.37%   37.42%   +0.04%     
==========================================
  Files         312      312              
  Lines       46399    46444      +45     
==========================================
+ Hits        17341    17380      +39     
- Misses      26574    26576       +2     
- Partials     2484     2488       +4
Impacted Files Coverage Δ
routers/api/v1/api.go 74.26% <100%> (+0.05%) ⬆️
routers/api/v1/org/org.go 23.66% <70.45%> (+23.66%) ⬆️
modules/process/manager.go 76.81% <0%> (-4.35%) ⬇️
models/repo_list.go 63.29% <0%> (-1.27%) ⬇️
models/user.go 44.84% <0%> (+0.19%) ⬆️
routers/api/v1/convert/convert.go 77.48% <0%> (+6.62%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7278372...3fd636b. Read the comment docs.

@lunny
Copy link
Member Author

lunny commented Nov 9, 2018

@sapk fixed.

@bkcsoft bkcsoft 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 Nov 9, 2018
@@ -62,6 +62,56 @@ func ListUserOrgs(ctx *context.APIContext) {
listUserOrgs(ctx, u, false)
}

// Create api for create organization
Copy link
Member

Choose a reason for hiding this comment

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

Can you add Gitea copyright to header of this file?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ugh sorry @techknowlogick forgot to look for that!

Copy link
Member

Choose a reason for hiding this comment

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

@zeripath it's ok. It's something that is missed a lot, and we thankfully have git so if we do miss in one PR it we can just look at the history of the repo and add the appropriate dates when fixing.

@@ -578,6 +578,7 @@ func RegisterRoutes(m *macaron.Macaron) {
// Organizations
m.Get("/user/orgs", reqToken(), org.ListMyOrgs)
m.Get("/users/:username/orgs", org.ListUserOrgs)
m.Post("/orgs", reqToken(), bind(api.CreateOrgOption{}), org.Create)
Copy link
Member

Choose a reason for hiding this comment

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

Can you add Gitea copyright to header of this file?

@lunny
Copy link
Member Author

lunny commented Nov 11, 2018

@techknowlogick done.

@lunny
Copy link
Member Author

lunny commented Nov 20, 2018

@techknowlogick need your approval.

Copy link
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

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

@lunny thanks for reminder 😄 LGTM

@techknowlogick techknowlogick merged commit 8ef177f into go-gitea:master Nov 20, 2018
@lunny lunny deleted the lunny/api_create_org branch November 21, 2018 01:21
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 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. modifies/api This PR adds API routes or modifies them 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.

API endpoint for organization creation
8 participants