-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Fixes #5960 - Adds API Endpoint for Repo Edit #7006
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
Fixes #5960 - Adds API Endpoint for Repo Edit #7006
Conversation
…/gitea into fix-5960-edit-repo-api-endpoint
Codecov Report
@@ Coverage Diff @@
## master #7006 +/- ##
========================================
Coverage ? 41.6%
========================================
Files ? 443
Lines ? 60137
Branches ? 0
========================================
Hits ? 25021
Misses ? 31842
Partials ? 3274
Continue to review full report at Codecov.
|
Made a change to some of the body fields of the JSON for the PATCH endpoint (enable_wiki, enable_issues are has_wiki and has_issues like Github as well as like the repo response object), as well as added these editable fields to the Repository response object so the API can know what was originally set and what is set now. |
Something you've added has caused a deadlock in TestAPIRepoMigrate /go/src/code.gitea.io/gitea/integrations/api_repo_test.go:299 The relevant bit of the stack trace appears to be here:
|
…/gitea into fix-5960-edit-repo-api-endpoint
* Feature - go-gitea#5960 - API Endpoint for Repo Editing * Revert from merge * Adds integration testing * Updates to integration tests * Revert changes * Update year in file header * Misspell fix * XORM = test * XORM = test * revert XORM = file * Makes RepoUnit.ID be pk and autoincr * Fix to units * revert header * Remove print statement * Adds other responses * Improves swagger for creating repo * Fixes import order * Better Unit Type does not exist error * Adds editable repo properties to the response repo structure * Fix to api_repo_edit_test.go * Fixes repo test * Changes per review * Fixes typo and standardizes comments in the EditRepoOption struct for swagger * Fixes typo and standardizes comments in the EditRepoOption struct for swagger * Actually can unarchive through the API * Unlike delete, user doesn't have to be the owner of the org, just admin to the repo * Fix to swagger comments for field name change * Update to swagger docs * Update swagger * Changes allow_pull_requests to has_pull_requests
Fix for #5960
This is to make it so Gitea has the repo Edit API endpoint just like Github. See https://developer.github.com/v3/repos/#edit for what this was to mimic
For the JSON body object, this uses the same names as Github in the JSON binding (one exception: used "webpage" instead of "homepage" since that is what we say in the repo settings page), but uses Gitea property names of the Repository object.
This should be usable for user who has admin privileges to a repo.
All options in the payload for this endpoint are optional, including name (Github says it is required but even for their API it is not and doesn't make sense to be unless your changing the repo name).