Skip to content

Use /orgs instead of /org to match GitHub v3 API #2639

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

Closed
wants to merge 4 commits into from
Closed

Use /orgs instead of /org to match GitHub v3 API #2639

wants to merge 4 commits into from

Conversation

raphink
Copy link

@raphink raphink commented Oct 2, 2017

@codecov-io
Copy link

codecov-io commented Oct 2, 2017

Codecov Report

Merging #2639 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2639      +/-   ##
==========================================
+ Coverage   27.11%   27.12%   +0.01%     
==========================================
  Files          86       86              
  Lines       17064    17064              
==========================================
+ Hits         4627     4629       +2     
+ Misses      11759    11757       -2     
  Partials      678      678
Impacted Files Coverage Δ
models/repo_unit.go 8% <0%> (ø) ⬆️
models/repo.go 13.14% <0%> (+0.01%) ⬆️
models/user.go 18.24% <0%> (+0.17%) ⬆️

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 a8717e5...e7bb20b. Read the comment docs.

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 2, 2017
@@ -173,7 +173,7 @@ func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) {
// 403: forbidden
// 500: error
Copy link
Member

@sapk sapk Oct 2, 2017

Choose a reason for hiding this comment

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

You need to update the swagger:route (the url part) also. You can even edit {org} since in url params in swagger are not yet configured.

@sapk
Copy link
Member

sapk commented Oct 2, 2017

The cherry on the cake would be to keep the old url available and mark it as deprecated in swagger.

  • Keeping the old m.Post("/org/:orgname/repos", reqToken(), bind(api.CreateRepoOption{}), repo.CreateOrgRepo)
  • Add an other (duplicate) swagger comment with deprected tag inside CreateOrgRepo.

@strk
Copy link
Member

strk commented Oct 2, 2017

But you're doing this under the /v1/ group, shouldn't it go to /v3/ group instead ?
Those versions are there for a reason...

@lafriks
Copy link
Member

lafriks commented Oct 2, 2017

I agree with @strk that v1 route should be left as it is and note added in swagger docs that it is deprecated and new one should be created under v3 that would be with GitHub compatible route

@raphink
Copy link
Author

raphink commented Oct 3, 2017

@lafriks @strk Agreed, but I don't see a v3 in routers/api. Am I missing something?

@lafriks
Copy link
Member

lafriks commented Oct 3, 2017

@raphink no currently there is no such route. But you can add it ;)

@@ -159,7 +159,7 @@ func Create(ctx *context.APIContext, opt api.CreateRepoOption) {

// CreateOrgRepo create one repository of the organization
func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) {
// swagger:route POST /org/{org}/repos organization createOrgRepo
// swagger:route POST /org/{orgname}/repos organization createOrgRepo
Copy link
Member

Choose a reason for hiding this comment

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

/orgs/{orgname}/repos

Copy link
Author

Choose a reason for hiding this comment

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

Ah, thanks!

Copy link
Member

@jonasfranz jonasfranz left a comment

Choose a reason for hiding this comment

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

I think this PR needs the BREAKING label since it changes the API urls.

@lafriks
Copy link
Member

lafriks commented Oct 5, 2017

@JonasFranzDEV that's why I think this should be done as new /v3 route and current marked as deprecated not to break existing API

@strk
Copy link
Member

strk commented Oct 5, 2017

Didn't we say that a new endpoint should have been added (/v3/) instead of changing any of the existing ones ?

@lunny lunny added the pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! label Oct 7, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Oct 10, 2017

Since we're not compatible with GitHub v3 we shouldn't put things under /v3/ until we are.

@raphink
Copy link
Author

raphink commented Oct 11, 2017

Currently, my issue is to be able to use the Terraform github provider with gitea, which is currently not possible when creating repositories (due to that difference in paths).

@strk
Copy link
Member

strk commented Oct 11, 2017 via email

@lunny
Copy link
Member

lunny commented Oct 12, 2017

Put the routers to /api/v3 and keep old router?

@daviian
Copy link
Member

daviian commented Oct 12, 2017

I guess implementing v3 isn't done in a single PR. So if nobody starts with it, we will never implemented it.

@lunny
Copy link
Member

lunny commented Oct 12, 2017

Or keep both routers for compatibility since there are no conflicts between them.

@daviian
Copy link
Member

daviian commented Oct 12, 2017

Wasn't against that suggestion. We should keep both and after v3 is finished we should fix an end date of v1 support

@bkcsoft
Copy link
Member

bkcsoft commented Oct 15, 2017

The current API uses v1, adding a v3-router is out or scope for this PR. (But please feel free to create a new one)

@stale
Copy link

stale bot commented Jan 5, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions.

@stale stale bot added the issue/stale label Jan 5, 2019
@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 Jan 5, 2019
@stale stale bot removed issue/stale labels Jan 5, 2019
@techknowlogick
Copy link
Member

Closing per above discussion. Once we get a /v3/ route for API that is compatible with GitHub, then we can re-open this PR.

Thanks for contribution.

@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/need 1 This PR needs approval from one additional maintainer to be merged. pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it!
Projects
None yet
Development

Successfully merging this pull request may close these issues.