From fcecafe8234d4fc3a6e713d96b593032dd438bd3 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 12 Jun 2025 08:07:37 +0200 Subject: [PATCH 1/4] Update dependency minimatch to v10.0.2 (forgejo) (#8159) Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8159 Reviewed-by: Michael Kriese Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- package-lock.json | 31 ++++++++++++++++++++++++++----- package.json | 2 +- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 473a334c25..b73bc9099b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "katex": "0.16.22", "mermaid": "11.6.0", "mini-css-extract-plugin": "2.9.2", - "minimatch": "10.0.1", + "minimatch": "10.0.2", "monaco-editor": "0.52.2", "monaco-editor-webpack-plugin": "7.1.0", "pdfobject": "2.3.0", @@ -11012,12 +11012,12 @@ } }, "node_modules/minimatch": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.2.tgz", + "integrity": "sha512-+9TJCIYXgZ2Dm5LxVCFsa8jOm+evMwXHFI0JM1XROmkfkpz8/iLLDh+TwSmyIBrs6C6Xu9294/fq8cBA+P6AqA==", "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^4.0.1" }, "engines": { "node": "20 || >=22" @@ -11026,6 +11026,27 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/minimatch/node_modules/balanced-match": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-3.0.1.tgz", + "integrity": "sha512-vjtV3hiLqYDNRoiAv0zC4QaGAMPomEoq83PRmYIofPswwZurCeWR5LByXm7SyoL0Zh5+2z0+HC7jG8gSZJUh0w==", + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/minimatch/node_modules/brace-expansion": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-4.0.1.tgz", + "integrity": "sha512-YClrbvTCXGe70pU2JiEiPLYXO9gQkyxYeKpJIQHVS/gOs6EWMQP2RYBwjFLNT322Ji8TOC3IMPfsYCedNpzKfA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^3.0.0" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/minimist": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", diff --git a/package.json b/package.json index 1ab46d0a45..d602a2613c 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "katex": "0.16.22", "mermaid": "11.6.0", "mini-css-extract-plugin": "2.9.2", - "minimatch": "10.0.1", + "minimatch": "10.0.2", "monaco-editor": "0.52.2", "monaco-editor-webpack-plugin": "7.1.0", "pdfobject": "2.3.0", From 7ec014cba88cbffd937dc3e3c49a76856da54365 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 12 Jun 2025 11:12:58 +0200 Subject: [PATCH 2/4] fix: do not fail when release or wiki is set in `/repos/migrate` API (#8155) * convert updateRepoUnits to not rely on ctx to retrieve the repo * Add integration test * do not activate releases if `wiki: true`. This is unexpected and there is no evidence it is necessary. Refs https://codeberg.org/forgejo/forgejo/issues/8082 --- The test is minimal for the sake of backporting. It is verified to reproduce the bug if the fix is not present. ```sh $ make TAGS='sqlite sqlite_unlock_notify' 'test-sqlite#TestAPIRepoMigrate' ... === TestAPIRepoMigrate (tests/integration/api_repo_test.go:388) --- FAIL: TestAPIRepoMigrate (1.12s) testlogger.go:411: 2025/06/11 17:38:22 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/earl-warren/software/forgejo/tests/gitea-lfs-meta testlogger.go:411: 2025/06/11 17:38:22 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user/login for test-mock:12345, 200 OK in 2.1ms @ auth/auth.go:145(auth.SignIn) testlogger.go:411: 2025/06/11 17:38:22 ...eb/routing/logger.go:102:func1() [I] router: completed POST /user/login for test-mock:12345, 303 See Other in 2.1ms @ auth/auth.go:179(auth.SignInPost) testlogger.go:411: 2025/06/11 17:38:22 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user/settings/applications for test-mock:12345, 200 OK in 3.8ms @ setting/applications.go:25(setting.Applications) testlogger.go:411: 2025/06/11 17:38:22 ...eb/routing/logger.go:102:func1() [I] router: completed POST /user/settings/applications for test-mock:12345, 303 See Other in 5.1ms @ setting/applications.go:35(setting.ApplicationsPost) testlogger.go:411: 2025/06/11 17:38:22 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user/settings/applications for test-mock:12345, 200 OK in 2.9ms @ setting/applications.go:25(setting.Applications) testlogger.go:411: 2025/06/11 17:38:23 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/v1/repos/migrate for test-mock:12345, 0 in 992.0ms @ repo/migrate.go:38(repo.Migrate) api_repo_test.go:400: Error Trace: /home/earl-warren/software/forgejo/tests/integration/api_repo_test.go:400 Error: Not equal: expected: 201 actual : 200 Test: TestAPIRepoMigrate api_repo_test.go:402: Error Trace: /home/earl-warren/software/forgejo/tests/integration/integration_test.go:649 /home/earl-warren/software/forgejo/tests/integration/api_repo_test.go:402 Error: Received unexpected error: EOF Test: TestAPIRepoMigrate ``` ## Checklist The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org). ### Tests - I added test coverage for Go changes... - [ ] in their respective `*_test.go` for unit tests. - [x] in the `tests/integration` directory if it involves interactions with a live Forgejo server. - I added test coverage for JavaScript changes... - [ ] in `web_src/js/*.test.js` if it can be unit tested. - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)). ### Documentation - [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. - [x] I did not document these changes and I do not expect someone else to do it. ### Release notes - [ ] I do not want this change to show in the release notes. - [x] I want the title to show in the release notes with a link to this pull request. - [ ] I want the content of the `release-notes/.md` to be be used for the release notes instead of the title. ## Release notes - Bug fixes - [PR](https://codeberg.org/forgejo/forgejo/pulls/8155): do not fail when release or wiki is set in `/repos/migrate` API Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8155 Reviewed-by: Lucas Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- routers/api/v1/repo/migrate.go | 5 ++--- routers/api/v1/repo/repo.go | 9 +++------ tests/integration/api_repo_test.go | 1 + 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/routers/api/v1/repo/migrate.go b/routers/api/v1/repo/migrate.go index 4ee7aa58e4..a848a950db 100644 --- a/routers/api/v1/repo/migrate.go +++ b/routers/api/v1/repo/migrate.go @@ -224,9 +224,8 @@ func Migrate(ctx *context.APIContext) { HasWiki: &opts.Wiki, } - // only enabling wiki could return an error - if err = updateRepoUnits(ctx, repoOpt); err != nil { - log.Error("Failed to enable wiki on %s/%s repo. %w", repoOwner.Name, form.RepoName, err) + if err = updateRepoUnits(ctx, repoOwner.Name, repo, repoOpt); err != nil { + log.Error("Failed to update units on %s/%s repo. %w", repoOwner.Name, form.RepoName, err) } } diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index 63100bca06..3d6a40e9ab 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -647,7 +647,7 @@ func Edit(ctx *context.APIContext) { return } - if err := updateRepoUnits(ctx, opts); err != nil { + if err := updateRepoUnits(ctx, ctx.Repo.Owner.Name, ctx.Repo.Repository, opts); err != nil { return } @@ -779,10 +779,7 @@ func updateBasicProperties(ctx *context.APIContext, opts api.EditRepoOption) err } // updateRepoUnits updates repo units: Issue settings, Wiki settings, PR settings -func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error { - owner := ctx.Repo.Owner - repo := ctx.Repo.Repository - +func updateRepoUnits(ctx *context.APIContext, owner string, repo *repo_model.Repository, opts api.EditRepoOption) error { var units []repo_model.RepoUnit var deleteUnitTypes []unit_model.Type @@ -1045,7 +1042,7 @@ func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error { } } - log.Trace("Repository advanced settings updated: %s/%s", owner.Name, repo.Name) + log.Trace("Repository advanced settings updated: %s/%s", owner, repo.Name) return nil } diff --git a/tests/integration/api_repo_test.go b/tests/integration/api_repo_test.go index 1c64cc642e..fd62670eb3 100644 --- a/tests/integration/api_repo_test.go +++ b/tests/integration/api_repo_test.go @@ -394,6 +394,7 @@ func TestAPIRepoMigrate(t *testing.T) { CloneAddr: testCase.cloneURL, RepoOwnerID: testCase.userID, RepoName: testCase.repoName, + Wiki: true, }).AddTokenAuth(token) resp := MakeRequest(t, req, NoExpectedStatus) require.Equalf(t, testCase.expectedStatus, resp.Code, "unexpected status (may be due to throttling): '%v' on url '%s'", resp.Body.String(), testCase.cloneURL) From 90d67cf421960f7a9c3b92463b4ac51cf83ef13a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 12 Jun 2025 11:38:25 +0200 Subject: [PATCH 3/4] Update module gitlab.com/gitlab-org/api/client-go to v0.130.1 (forgejo) (#8163) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [gitlab.com/gitlab-org/api/client-go](https://gitlab.com/gitlab-org/api/client-go) | require | minor | `v0.129.0` -> `v0.130.1` | --- ### Release Notes
gitlab-org/api/client-go (gitlab.com/gitlab-org/api/client-go) ### [`v0.130.1`](https://gitlab.com/gitlab-org/api/client-go/tags/v0.130.1) [Compare Source](https://gitlab.com/gitlab-org/api/client-go/compare/v0.130.0...v0.130.1) #### [0.130.1](https://gitlab.com/gitlab-org/api/client-go/compare/v0.130.0...v0.130.1) (2025-06-11) ##### Bug Fixes * add missing nil check on create group with avatar ([3298a05](https://gitlab.com/gitlab-org/api/client-go/commit/3298a058f36962a86dea31587956863cd1ed7624)) ### [`v0.130.0`](https://gitlab.com/gitlab-org/api/client-go/tags/v0.130.0) [Compare Source](https://gitlab.com/gitlab-org/api/client-go/compare/v0.129.0...v0.130.0) ### [0.130.0](https://gitlab.com/gitlab-org/api/client-go/compare/v0.129.0...v0.130.0) (2025-06-11) ##### Bug Fixes * **workflow:** the `release.config.mjs` file mustn't be hidden ([5d423a5](https://gitlab.com/gitlab-org/api/client-go/commit/5d423a55d5b577ebff50dc1a0905c6511b5a4d6f)) ##### Features * add "emoji_events" support to group hooks ([c6b770f](https://gitlab.com/gitlab-org/api/client-go/commit/c6b770f350b11e1c9a7c4702ab25b865624b0d47)) * Add `active` to ListProjects ([7818155](https://gitlab.com/gitlab-org/api/client-go/commit/78181558db20647c22e7fed23e749ecafedad27b)) * add generated_file field for MergeRequestDiff ([4b95dac](https://gitlab.com/gitlab-org/api/client-go/commit/4b95dac3ef2b5aabe3040f592ba6378d081d7642)) * add support for `administrator` to Group `project_creation_level` enums ([664bbd7](https://gitlab.com/gitlab-org/api/client-go/commit/664bbd7e3c955c8068b895b1cf1540054ebc13c1)) * add the `WithTokenSource` client option ([6ccfcf8](https://gitlab.com/gitlab-org/api/client-go/commit/6ccfcf857a0a4a850168ecf9317e2e0b8a532173)) * add url field to MergeCommentEvent.merge_request ([bd639d8](https://gitlab.com/gitlab-org/api/client-go/commit/bd639d811c8e7965f426c2deccee84a12d32920f)) * implement a specialized `TokenSource` interface ([83c2e06](https://gitlab.com/gitlab-org/api/client-go/commit/83c2e06cbe76b5268e55589e8bc580582e65bb22)) * **projects:** add ci_push_repository_for_job_token_allowed parameter ([3d539f6](https://gitlab.com/gitlab-org/api/client-go/commit/3d539f66fd63ce4fec6fa7e4e546c9d2acd018f0)) * **terraform-states:** add Terraform States API ([082b81c](https://gitlab.com/gitlab-org/api/client-go/commit/082b81cd456d4b8020f6542daeb3f47c80ba38d0))
--- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Co-authored-by: Earl Warren Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8163 Reviewed-by: Earl Warren Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- go.mod | 2 +- go.sum | 4 ++-- services/migrations/gitlab.go | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 0eca1be551..c067228d75 100644 --- a/go.mod +++ b/go.mod @@ -98,7 +98,7 @@ require ( github.com/yohcop/openid-go v1.0.1 github.com/yuin/goldmark v1.7.12 github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc - gitlab.com/gitlab-org/api/client-go v0.129.0 + gitlab.com/gitlab-org/api/client-go v0.130.1 go.uber.org/mock v0.5.2 golang.org/x/crypto v0.39.0 golang.org/x/image v0.27.0 diff --git a/go.sum b/go.sum index 18e37ae5f6..92d7dfabf6 100644 --- a/go.sum +++ b/go.sum @@ -560,8 +560,8 @@ github.com/zeebo/blake3 v0.2.4 h1:KYQPkhpRtcqh0ssGYcKLG1JYvddkEA8QwCM/yBqhaZI= github.com/zeebo/blake3 v0.2.4/go.mod h1:7eeQ6d2iXWRGF6npfaxl2CU+xy2Fjo2gxeyZGCRUjcE= github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo= github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= -gitlab.com/gitlab-org/api/client-go v0.129.0 h1:o9KLn6fezmxBQWYnQrnilwyuOjlx4206KP0bUn3HuBE= -gitlab.com/gitlab-org/api/client-go v0.129.0/go.mod h1:ZhSxLAWadqP6J9lMh40IAZOlOxBLPRh7yFOXR/bMJWM= +gitlab.com/gitlab-org/api/client-go v0.130.1 h1:1xF5C5Zq3sFeNg3PzS2z63oqrxifne3n/OnbI7nptRc= +gitlab.com/gitlab-org/api/client-go v0.130.1/go.mod h1:ZhSxLAWadqP6J9lMh40IAZOlOxBLPRh7yFOXR/bMJWM= go.etcd.io/bbolt v1.4.0 h1:TU77id3TnN/zKr7CO/uk+fBCwF2jGcMuw2B/FMAzYIk= go.etcd.io/bbolt v1.4.0/go.mod h1:AsD+OCi/qPN1giOX1aiLAha3o1U8rAz65bvN4j0sRuk= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= diff --git a/services/migrations/gitlab.go b/services/migrations/gitlab.go index c4014c903f..f54f682c47 100644 --- a/services/migrations/gitlab.go +++ b/services/migrations/gitlab.go @@ -99,6 +99,7 @@ func NewGitlabDownloader(ctx context.Context, baseURL, repoPath, username, passw // Only use basic auth if token is blank and password is NOT // Basic auth will fail with empty strings, but empty token will allow anonymous public API usage if token == "" && password != "" { + //nolint // SA1019 gitlab.NewBasicAuthClient is deprecated: GitLab recommends against using this authentication method gitlabClient, err = gitlab.NewBasicAuthClient(username, password, gitlab.WithBaseURL(baseURL), gitlab.WithHTTPClient(NewMigrationHTTPClient())) } From a3703a71cabf3f790e184b0ec3766a579853d53f Mon Sep 17 00:00:00 2001 From: David Rotermund Date: Thu, 12 Jun 2025 12:54:55 +0200 Subject: [PATCH 4/4] Modified tests/e2e/declare_repos_test.go: Filename: README.md -> Filename: UPLOAD_TEST.md due to the error a SHA or commit ID must be provided when updating a file --- tests/e2e/declare_repos_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/declare_repos_test.go b/tests/e2e/declare_repos_test.go index 239a686f00..0ccb776ff7 100644 --- a/tests/e2e/declare_repos_test.go +++ b/tests/e2e/declare_repos_test.go @@ -54,7 +54,7 @@ func DeclareGitRepos(t *testing.T) func() { }, }), newRepo(t, 2, "file-uploads", []FileChanges{{ - Filename: "README.md", + Filename: "UPLOAD_TEST.md", Versions: []string{"# File upload test\nUse this repo to test various file upload features in new branches."}, }}), newRepo(t, 2, "unicode-escaping", []FileChanges{{