Skip to content

fix(api): enforce mustNotBeArchived on repo topics routes - #39260

Open
rathinadev wants to merge 1 commit into
go-gitea:mainfrom
rathinadev:fix/api-topics-archived
Open

fix(api): enforce mustNotBeArchived on repo topics routes#39260
rathinadev wants to merge 1 commit into
go-gitea:mainfrom
rathinadev:fix/api-topics-archived

Conversation

@rathinadev

Copy link
Copy Markdown

Add mustNotBeArchived to the API repo-topics write routes.

They lacked the archived-repo guard the web UI and sibling API write groups
(branches/tags/wiki) enforce, so PUT/DELETE /repos/{owner}/{repo}/topics
succeeded on an archived repo, mutating metadata that should be read-only.
Now returns 423 Locked; reads (GET) unchanged.

Adds an integration test covering the archived case.

UpdateTopics/AddTopic/DeleteTopic lacked the archived guard the web routes
and sibling API write groups enforce, so topics were mutable on an archived
repo. Add the guard; reads stay allowed.
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 7, 2026
@github-actions github-actions Bot added topic/api Concerns mainly the API type/bug labels Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. topic/api Concerns mainly the API type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants