From 943ff75233dfa854e2864467e7e6b88a0420c359 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Tue, 24 Mar 2026 16:13:08 -0400 Subject: [PATCH] Require additional user confirmation for making repo private (#36959) To align with how GitHub requires additional explicit user interaction to make a repo private, including informing them of implications on what happens if they do. --------- Co-authored-by: wxiaoguang --- modules/test/utils.go | 8 + options/locale/locale_en-US.json | 9 +- routers/web/repo/setting/setting.go | 28 ++-- services/repository/repository.go | 93 ++++-------- services/repository/repository_test.go | 4 +- templates/repo/migrate/migrating.tmpl | 6 +- templates/repo/settings/options.tmpl | 137 ++++++------------ .../settings/repo_name_confirm_fields.tmpl | 10 ++ tests/integration/repo_visibility_test.go | 59 ++++++++ 9 files changed, 173 insertions(+), 181 deletions(-) create mode 100644 templates/repo/settings/repo_name_confirm_fields.tmpl create mode 100644 tests/integration/repo_visibility_test.go diff --git a/modules/test/utils.go b/modules/test/utils.go index 4996f5a13b..458cf547d5 100644 --- a/modules/test/utils.go +++ b/modules/test/utils.go @@ -45,6 +45,14 @@ func ParseJSONError(buf []byte) (ret struct { return ret } +func ParseJSONRedirect(buf []byte) (ret struct { + Redirect string `json:"redirect"` +}, +) { + _ = json.Unmarshal(buf, &ret) + return ret +} + func IsNormalPageCompleted(s string) bool { return strings.Contains(s, `