forgejo/routers/api/v1/repo
oliverpool cee2aae4ca
Some checks are pending
testing-integration / test-sqlite (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
/ release (push) Waiting to run
testing-integration / test-unit (push) Waiting to run
fix: corrupted wiki unit default permission (#8234 follow-up) (#8258)
Closes #8119, follow-up of #8234

#8234 "only" fixed the case when a new wiki setting was applied.

However it lacked 2 aspects:
- fixing the already corrupted unit permission in the database (required a migration)
- fixing the API route

Both aspects should now be covered.

Additionally, I commented out the unused `UnitAccessMode` and indicated that they are only used for the wiki-unit (hopefully saving some time to future code-readers).

### Testing

- go to a commit before #8234 (e.g. 285f66b782)
- create 3 repositories
  - save the wiki settings of the second, without any change
  - set the wiki of the third to be globally writable
- verify the `default_permissions` column in the database, of the unit `5`: 0, 2, 3
- stop Forgejo, switch to this PR and start Forgejo
- verify that the logs writes `Migration[35]: Fix wiki unit default permission`
- verify the `default_permissions` column in the database, of the unit `5`: 0, 0, 3

Before:

![2025-06-23-150055.png](/attachments/1eb92507-b8b4-422c-921c-4296a91172e7)

After:

![2025-06-23-150853.png](/attachments/c7b53397-54fe-487d-89da-e10b26538cde)

- [x] I did not document these changes and I do not expect someone else to do it.
- [x] I do not want this change to show in the release notes.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8258
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2025-07-07 18:04:00 +02:00
..
action.go bug: unify RepoActionRun and ActionRun structs (#8250) 2025-06-23 07:54:32 +02:00
avatar.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
blob.go feat: API GET /repos/{owner}/{repo}/git/blobs 2025-06-13 13:52:56 +02:00
branch.go chore: Refactor Is{Reference,Branch}Exist (#8425) 2025-07-06 07:16:43 +02:00
collaborators.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
commits.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
compare.go fix: make API /repos/{owner}/{repo}/compare/{basehead} work with forks (#8326) 2025-06-28 23:28:12 +02:00
download.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
file.go API: enforce sha requirement on POST /repos/{owner}/{repo}/contents (#8139) 2025-06-12 00:13:39 +02:00
flags.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
fork.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
git_hook.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
git_ref.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
hook.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
hook_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
issue.go feat: show more relevant results for 'dependencies' dropdown (#8003) 2025-06-26 20:06:21 +02:00
issue_attachment.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_comment.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_comment_attachment.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_dependency.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
issue_label.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
issue_pin.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_reaction.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_stopwatch.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_subscription.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_tracked_time.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
key.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
label.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
language.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
main_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
migrate.go fix: do not fail when release or wiki is set in /repos/migrate API (#8155) 2025-06-12 11:12:58 +02:00
milestone.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
mirror.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
notes.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
patch.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
pull.go feat: make API pull and compare endpoint references to head more robust 2025-06-28 23:30:26 +02:00
pull_review.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
release.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
release_attachment.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
release_tags.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo.go fix: corrupted wiki unit default permission (#8234 follow-up) (#8258) 2025-07-07 18:04:00 +02:00
repo_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
star.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
status.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
subscriber.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
sync_fork.go feat: sync forks (#2364) 2025-04-07 07:00:38 +00:00
tag.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
teams.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
topic.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
transfer.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
tree.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
wiki.go git/blob: GetContentBase64 with fewer allocations and no goroutine (#8297) 2025-06-27 11:22:10 +02:00