-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add API routes to lock and unlock issues #34165
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
Conversation
Do you know if there's a GitHub API for these routes? |
Ah, found it: So let's use exactly the same structure as those API routes. |
Also closes: #20012 |
Why not just accept any "reason" message? TBH I do not think the legacy design is right: the "reasons" in the config could be candidates, but end users (repo writer/admin) should have the chance to use any reason they like. The real problems of the legacy design (strict reason check) are:
(The legacy design is not like GitHub, GitHub doesn't support changing the "reasons" by config file) So to make things easier and clearer, my proposal is: drop the "valid reason check", use caller's reason as-is. Web UI could still be kept as-is at the moment since it is not in this PR's scope. |
@YaFou What do you think about my proposal #34165 (comment) ? It will resolve the concerns above and make code simpler and more flexible. |
Sorry for the late response. I totally agree to your point of view. I removed all lock reason checks. |
Made some changes in f7959bc:
|
* giteaofficial/main: Add API routes to lock and unlock issues (go-gitea#34165) Make ROOT_URL support using request Host header (go-gitea#32564) Valid email address should only start with alphanumeric (go-gitea#28174) Fix notify watch failure when the content is too long (go-gitea#34233) Add "--fullname" arg to gitea admin user create (go-gitea#34241) Fix various UI problems (go-gitea#34243) markup: improve code block readability and isolate copy button (go-gitea#34009) Don't assume the default wiki branch is master in the wiki API (go-gitea#34244) [skip ci] Updated translations via Crowdin Optimize the calling code of queryElems (go-gitea#34235) Actions Runner rest api (go-gitea#33873) Fix some trivial problems (go-gitea#34237) Swift files can be passed either as file or as form value (go-gitea#34068) # Conflicts: # templates/repo/wiki/revision.tmpl
This pull request adds a GitHub-compatible API endpoint to lock and unlock an issue.
The following routes exist now:
PUT /api/v1/repos/{owner}/{repo}/issues/{id}/lock
to lock an issueDELETE /api/v1/repos/{owner}/{repo}/issues/{id}/lock
to unlock an issueFixes #33677
Fixes #20012