Compare commits

...

166 commits

Author SHA1 Message Date
Gusted
0a7e438e43 feat: simplify GetPullRequestFiles (#9740)
`GetPullRequestFiles` is the API route handler to get the files that are changed in a pull request, it has to know the start commit and end commit to diff for (so it can gather the changed file and other information). The end commit is clear, the pr ref (`ref/pull/xxx/head`). However the start commit has to be computed, it is the merge base commit between the base branch and pr ref. However if the pr was merged, then we should use the `pr.MergeBase` as it's possible the `pr.BaseBranch` no longer exists.

Instead of doing this computation via `GetCompareInfo` that also does some other computations, compute the merge base directly ourselves in this function, if no merge base exists then fallback to the base reference (this is the same behavior as in `GetCompareInfo`). The only difference is that in the case of the fallback we don't convert the base ref to a commit ID, this is not necessary as the call to `git-diff` will accept any valid reference. So technically we could drop the call to `baseGitRepo.GetRefCommitID()` as well, but that's left for another time to keep the change minimal.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9740
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-10-18 08:03:47 +02:00
Gusted
6726861e49 feat: dont set merge-base on pull request creation (#9734)
This will be computed by [`NewPullrequest` via `testPatch`](3f1731a765/services/pull/pull.go (L40-L46)) before the pull request is inserted into the database: 4adec07103/services/pull/patch.go (L169-L177)
The AGit codepath already didn't set the mergebase.

Tests are added to confirm that merge-base is still indeed set upon pull request creation via the web route and API route.

There's no immediate benefit, this is in preparation of trying to do less `git` commands on certain web/API routes. The enhancement thus here being `compareInfo` is not used from `parseCompareInfo` and could potentially in the future no longer have to be computed or could be skipped to compute for this API route, similar for removing a dependency on `ci.CompareInfo`. The `compareInfo` is relatively _heavy_ to compute and is not used in all codepaths.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9734
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-10-18 08:03:29 +02:00
Mathieu Fenniak
c54cfa3af8 chore(deps): upgrade xorm to remove access to unsafe BufferSize() (#9744)
Ensuring that we don't have access to the unsafe `bufferIterate` in xorm, which was removed in xorm 1.3.9-forgejo.3 (https://code.forgejo.org/xorm/xorm/pulls/39).  This isn't used, so this isn't a functional change; just a protective upgrade.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9744
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-18 07:43:32 +02:00
Mathieu Fenniak
3f5a01e42b feat: add foreign keys to table collaboration (#9724)
This appears to be as easy as a foreign-key addition possibly could be; no automated tests required adjustments.

Manual testing conducted:
- Added collaborator to a repo
- Removed collaborator from a repo
- Deleted a repo with a collaborator on it
- Deleted a user that is a collaborator
- Verified database definitions to ensure foreign keys are present.

## 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.
  - [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9724): <!--number 9724 --><!--line 0 --><!--description YWRkIGZvcmVpZ24ga2V5cyB0byB0YWJsZSBjb2xsYWJvcmF0aW9u-->add foreign keys to table collaboration<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9724
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-18 02:50:50 +02:00
forgejo-release-manager
3f1731a765 chore(release-notes): Forgejo v13.0.1 (#9732)
https://codeberg.org/forgejo/forgejo/milestone/29090
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9732
Co-authored-by: forgejo-release-manager <contact-forgejo-release-manager@forgejo.org>
Co-committed-by: forgejo-release-manager <contact-forgejo-release-manager@forgejo.org>
2025-10-17 19:51:30 +02:00
Laxystem
c22ec65856 feat: Prioritize Noto Sans over Roboto and Noto Sans Hebrew over Arial (#6931)
## 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.
  - [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6931
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Laxystem <the@laxla.quest>
Co-committed-by: Laxystem <the@laxla.quest>
2025-10-17 14:40:51 +02:00
Earl Warren
bc0568b3ee chore(release-notes): Forgejo v13.0.0 (followup 1) (#9722)
Resolves forgejo/forgejo#9718

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9722
Reviewed-by: Robert Wolff <mahlzahn@posteo.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-10-16 19:31:21 +02:00
Dirk
e20c674560 fix; replace Gitea -> Forgejo in app.example.ini where easily possible (#9721)
This PR changes the mentions of *Gitea* to *Forgejo* in the `app.example.ini` file if it is easily possible, like where the application itself is named, or where the binary is referenced. Corresponding issue: https://codeberg.org/forgejo/forgejo/issues/9715

Things that are explicitly not changed and are not in the scope of this PR:

* URLs where there is no equivalent for Forgejo
* Names of variables
* Default values of variables

## Checklist

### Tests

- No testable code was changed

### Documentation

- No user-facing documentation was changed

### Release notes

* *Is it worth mentioning? I don’t know, I leave this up to the release team.*

- [ ] I do not want this change to show in the release notes.
- [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9721
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Dirk <dirk@0x7be.de>
Co-committed-by: Dirk <dirk@0x7be.de>
2025-10-16 18:44:13 +02:00
VewDev
5b13c6e024 fix: release email links (#9690)
Use correct links (instance.com/owner/repo/archive/tag.extension) links in release emails, instead of the (/owner/repo) incomplete links.

Fixes #9482

## 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.
  - [ ] 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)).

#### Manual test screenshots

![image](/attachments/f00fb1f9-17f2-4df8-bc0d-3e8f215020cb)

### 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9690
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: VewDev <vewdev@noreply.codeberg.org>
Co-committed-by: VewDev <vewdev@noreply.codeberg.org>
2025-10-16 16:12:32 +02:00
Mathieu Fenniak
fe4a2ae7c1 fix: empty DBs create tables in an ungoverned order resulting in future foreign key errors (#9709)
Discovered while testing #9708:

Fresh install databases, which is also a process used by the integration tests, create tables by using `SyncAllTables`.  The order that tables are created is ungoverned -- it occurs based upon the order that Go calls each module's `init` to register their schema models.  With the current foreign keys in the database, this does not yet cause an error.  But it will shortly.

I've manually tested this fix in this way:
- The correct order to create tables is that indicated by `foreignKeySortInsert`.  This creates tables that are *referenced* by foreign keys before creating tables that do the referencing (eg. `user` before `tracked_time`).
- If I modify this PR and sort the keys the opposite way `foreignKeySortDelete`, then integration tests fail:

```
??? [TestLogger] 2025/10/15 22:37:58 models/db/engine.go:270:InitEngineWithMigration() [E] [Error SQL Query] CREATE TABLE IF NOT EXISTS "gtestschema"."tracked_time" ("id" BIGSERIAL PRIMARY KEY  NOT NULL, "issue_id" BIGINT NULL, "user_id" BIGINT NULL, "created_unix" BIGINT NULL, "time" BIGINT NOT NULL, "deleted" BOOL DEFAULT false NOT NULL, CONSTRAINT "tracked_time_issue_id_fkey" FOREIGN KEY ("issue_id") REFERENCES "gtestschema"."issue" ("id"), CONSTRAINT "tracked_time_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "gtestschema"."user" ("id"));  [] - pq: relation "gtestschema.issue" does not exist
??? [TestLogger] 2025/10/15 22:37:58 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed.
```

Therefore this PR which doesn't appear to fix anything today fixes a latent bug that will occur shortly (possibly in #9397, possibly when another foreign key is added, possibly if Go changes the order in which `init` functions are invoked).

## 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.
  - [ ] 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

- [x] I do not want this change to show in the release notes.
- [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9709
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-16 16:02:49 +02:00
Mathieu Fenniak
affadc359e fix: integration tests & empty DB creation will fail as soon as forgejo_migrations accesses an existing table (#9708)
Integration tests and new Forgejo installations work in a manner that I didn't expect, and didn't come up during testing of #9561.
- They run the migrations (gitea migrations -> forgejo migrations legacy -> forgejo migrations).
- The gitea & forgejo migrations detect if the `version` and `forgejo_version` table are **empty**, because they are on an empty DB and the tables were just created
- When they hit this case, they pretend all the migrations are applied by setting the version to the highest version number
- And then they rely on the DB engine executing `SyncAllTables` to actually create the schema.

The new `forgejo_migrations` module was not doing this.  So, it would attempt to execute migrations and find that dependent database tables didn't exist, causing unexpected errors in running the integration tests (or starting forgejo on an empty database): https://codeberg.org/forgejo/forgejo/pulls/9397#issuecomment-7745969

This fixes the issue by following the same pattern in `forgejo_migrations`; relying on `SyncAllTables` for initial schema creation.

## 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...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] 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

- [x] I do not want this change to show in the release notes.
- [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9708
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-16 16:02:30 +02:00
Bojidar Marinov
8ed95dc4c6 fix: use scrollHeight for rendered iframe if offsetHeight is unavailable (#9508)
Fixes #9421.

Added integration test.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9508
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Bojidar Marinov <bojidar.marinov.bg@gmail.com>
Co-committed-by: Bojidar Marinov <bojidar.marinov.bg@gmail.com>
2025-10-16 15:51:57 +02:00
forgejo-release-manager
e56fdf1ec5 chore(release-notes): Forgejo v13.0.0 (#9442)
https://codeberg.org/forgejo/forgejo/milestone/21377
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9442
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-release-manager <contact-forgejo-release-manager@forgejo.org>
Co-committed-by: forgejo-release-manager <contact-forgejo-release-manager@forgejo.org>
2025-10-16 15:40:05 +02:00
Leni Kadali
52454651ea fix: Repo migrate API endpoint returning 200 when it crashes (#9435)
Fixes #8158

Make the repo migrate API to return a 500 error when a panic occurs.

## Testing
1. Add a panic line as shown at 560da47efc/routers/api/v1/repo/migrate.go (L224-L225).
2. Attempt the migrate action via the API. It should throw a 500 error instead of a 200.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9435
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Leni Kadali <lenikadali@noreply.codeberg.org>
Co-committed-by: Leni Kadali <lenikadali@noreply.codeberg.org>
2025-10-15 23:23:18 +02:00
Renovate Bot
4d7b59a9f9 Update x/tools to v0.38.0 (forgejo) (#9702)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-15 22:51:29 +02:00
Mathieu Fenniak
ee7a4a827a fix: OpenGraph cards for some issues show wrong timestamp (#9705)
Fixes #9693.

Image contents are not part of automated testing, so I manually tested this by:
- Mutating the `created` field to `NULL` for a target card, verifying image generated without a cache
- Double-checking by mutating the `created_unix` field for a target card, verifying image generated to correct updated date (checking my cache busting)

## 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.
  - [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9705
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Robert Wolff <mahlzahn@posteo.de>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-15 21:38:51 +02:00
Mathieu Fenniak
6db2e23078 test: introduce TruncateBeansCascade test helper to support data cleanup of foreign-key referenced tables (#9684)
Noted in #9557 -- as more foreign keys are added, a couple test locations (`reverseproxy_test.go` and `cmd_admin_test.go`) that truncate fixture data have a growing list of impacted tables.  This PR introduces a new `TruncateBeansCascade` which can be used for tests, as well as enhancing some helper functions that I expect will be used later to support automatic operation ordering.

## 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...
  - [x] in their respective `*_test.go` for unit tests.  (**Implicitly tested** by virtue of usage in a test.)
  - [ ] 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

- [x] I do not want this change to show in the release notes.
- [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9684
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-15 20:26:41 +02:00
Renovate Bot
46e491f05e Update go-openapi packages (forgejo) (#9701)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9701
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-15 17:47:44 +02:00
Renovate Bot
d2604ab313 Update https://data.forgejo.org/actions/setup-node action to v6 (forgejo) (#9704)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9704
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-15 17:41:12 +02:00
Renovate Bot
ad70b09eea Update dependency happy-dom to v20 (forgejo) (#9703)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-15 17:38:53 +02:00
Renovate Bot
c5b292b635 Update module github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker to v3.4.1 (forgejo) (#9700)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-15 17:37:30 +02:00
Renovate Bot
b818a028a1 Update linters (forgejo) (#9699)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-15 17:37:21 +02:00
Renovate Bot
87380722b5 Update module github.com/dsoprea/go-exif/v3 to v3.0.1 (forgejo) (#9682)
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [github.com/dsoprea/go-exif/v3](https://github.com/dsoprea/go-exif) | `v3.0.0-20210625224831-a6301f85c82b` -> `v3.0.1` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fdsoprea%2fgo-exif%2fv3/v3.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fdsoprea%2fgo-exif%2fv3/v3.0.0-20210625224831-a6301f85c82b/v3.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### 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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDYuMCIsInVwZGF0ZWRJblZlciI6IjQxLjE0Ni4wIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9682
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-15 17:29:45 +02:00
Renovate Bot
e777b59673 Update https://data.forgejo.org/tj-actions/changed-files action to v47 (forgejo) (#9616)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9616
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-15 15:30:32 +02:00
Earl Warren
d2d388bdcd i18n: update of translations from Codeberg Translate (#9597)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9597
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-10-15 11:57:29 +02:00
Codeberg Translate
5494d8b3cd
i18n: update of translations from Codeberg Translate
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: Juno Takano <jutty@noreply.codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@noreply.codeberg.org>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: Wuzzy <wuzzy@disroot.org>
Co-authored-by: anorprogrammer <anorprogrammer@noreply.codeberg.org>
Co-authored-by: artnay <artnay@noreply.codeberg.org>
Co-authored-by: bespinas <bespinas@noreply.codeberg.org>
Co-authored-by: butterflyoffire <butterflyoffire@noreply.codeberg.org>
Co-authored-by: emansije <emansije@noreply.codeberg.org>
Co-authored-by: nykula <nykula@noreply.codeberg.org>
Co-authored-by: pgmtx <pgmtx@noreply.codeberg.org>
Co-authored-by: victordargallo <victordargallo@noreply.codeberg.org>
Co-authored-by: xtex <xtexchooser@duck.com>
Co-authored-by: yeager <yeager@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/ca/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/eo/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pt_BR/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pt_PT/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/ru/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/sv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/uz/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/zh_Hans/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/ca/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/eo/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fi/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/kab/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/nds/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/zh_Hans/
Translation: Forgejo/forgejo
Translation: Forgejo/forgejo-next
2025-10-15 09:09:35 +00:00
Earl Warren
ed0bec9aa9 refactor: developer-friendly database schema migration registration (#9561)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9561
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Lucas <sclu1034@noreply.codeberg.org>
2025-10-15 10:54:20 +02:00
Mathieu Fenniak
1c7e189dd0 chore(e2e): address another flakey failure in webauthn.test.e2e.ts (#9688)
Had another random failure in `webauthn.test.e2e.ts`:

```
Retry #1 ───────────────────────────────────────────────────────────────────────────────────────
TimeoutError: locator.click: Timeout 3000ms exceeded.
Call log:
  - waiting for getByText('Sign out')
    - waiting for" http://localhost:3003/user/settings/security" navigation to finish...
    - navigated to "http://localhost:3003/user/settings/security"
    - locator resolved to <a href="" tabindex="-1" role="menuitem" id="_aria_auto_id_10" data-url="/user/logout" class="item link-action">…</a>
  - attempting click action
    2 × waiting for element to be visible, enabled and stable
      - element is not visible
    - retrying click action
    - waiting 20ms
    2 × waiting for element to be visible, enabled and stable
      - element is not visible
    - retrying click action
      - waiting 100ms
    6 × waiting for element to be visible, enabled and stable
      - element is not visible
    - retrying click action
      - waiting 500ms
  41 |   // Logout.
  42 |   await page.locator('div[aria-label="Profile and settings…"]').click();
> 43 |   await page.getByText('Sign out').click();
      |                                    ^
  44 |   await expect(async () => {
  45 |     await page.waitForURL(`${workerInfo.project.use.baseURL}/`);
  46 |   }).toPass();
    at /workspace/forgejo/forgejo/tests/e2e/webauthn.test.e2e.ts:43:36
```

While attempting to click `Sign out`, playwright waited for page navigation to `http://localhost:3003/user/settings/security` to complete, and then the `Sign out` button never became visible.  This suggests to me that the test:
- Clicked `Add security key`
- There was a race between the browser, which began reloading `/user/settings/security`...
- And the test clicked on `Profile and settings…` immediately *before* the new page loaded, since that was visible and available on the old page
- Therefore `Sign out` never appeared on the new page to be clicked

This PR addresses the race by ensuring that after the security key is added, the page with the security key added is visible (specifically the Remove button).  This should prevent the click on "Profile and settings" and "Sign out" from potentially occurring on different pages (as would happen if the reload occurred between the two clicks).

I have not been able to reproduce this exact failure locally, but I have tricked my e2e testing situation into reproducing other errors in this test by introducing a synthetic 100ms wait on every web request in the gitea server.  After adding this fix, the test does not fail in that scenario. (🤷  Probably good, but no guarantee that we're not going to see another issue.)

## 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.
  - [ ] 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.
  - [x] 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

- [x] I do not want this change to show in the release notes.
- [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9688
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-15 09:50:53 +02:00
Ryan Lerch
626ff29545 feat: Add support for administrators to set email visibility on user accounts (#9668)
feat: Add support for administrators to set email visibility on user accounts
This feature allows administrators to control user email privacy settings
through both the API and web interface.

**note: This was originally part of #9594 but is now split out into it's own PR**

## 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/<pull request number>.md` to be be used for the release notes instead of the title.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9668): <!--number 9668 --><!--line 0 --><!--description QWRkIHN1cHBvcnQgZm9yIGFkbWluaXN0cmF0b3JzIHRvIHNldCBlbWFpbCB2aXNpYmlsaXR5IG9uIHVzZXIgYWNjb3VudHM=-->Add support for administrators to set email visibility on user accounts<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9668
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: Ryan Lerch <rlerch@redhat.com>
Co-committed-by: Ryan Lerch <rlerch@redhat.com>
2025-10-15 03:21:15 +02:00
Mathieu Fenniak
558e9bdf5f
feat: developer friendly migration registration 2025-10-14 14:51:50 -06:00
Renovate Bot
c3d64da23c Update module github.com/mholt/archives to v0.1.5 (forgejo) (#9683)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9683
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-14 22:46:18 +02:00
Mathieu Fenniak
709c315bc4
chore: add new functions to container.Set 2025-10-14 14:40:49 -06:00
Mathieu Fenniak
49bcd792cd
chore: rename 'forgejo_migrations' to 'forgejo_migrations_legacy' 2025-10-14 14:40:49 -06:00
Mathieu Fenniak
a0be0f22fc
chore: rename 'migrations' to 'gitea_migrations' 2025-10-14 14:40:49 -06:00
Gusted
56d9b4b14d chore: make renovate work on v13 forgejo (#9679)
v13 is going to be released soon, v12 is EOL in a few days.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9679
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-10-14 10:43:22 +02:00
Mathieu Fenniak
82ad5189fe feat: add foreign keys to the access table (#9557)
Adds two foreign keys:
- `access.user_id` -> `user`
- `access.repo_id` -> `repository`

Testing:
- Existing automated test suite
    - Minor adjustments required to `reverseproxy_test.go`
    - Test failures caused a reorganization of delete operations in `DeleteRepositoryDirectly`
- Manually tested
    - On "user" and "repo" Collaborator page, added, removed, and changed the access-level of collaborators

## 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.
  - [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9557): <!--number 9557 --><!--line 0 --><!--description YWRkIGZvcmVpZ24ga2V5cyB0byB0aGUgYGFjY2Vzc2AgdGFibGU=-->add foreign keys to the `access` table<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9557
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-14 05:39:47 +02:00
Renovate Bot
adc01a086a Update dependency chart.js to v4.5.1 (forgejo) (#9677)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9677
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-14 03:31:05 +02:00
Gabor Pihaj
67a9b80c51 feat: include non-conventional headers in payload for git signatures (#9558)
This patch is meant to fix #8255, by adding all (even unknown) git commit headers to the payload.

Unit test is added.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9558
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Gabor Pihaj <gabor.pihaj@gmail.com>
Co-committed-by: Gabor Pihaj <gabor.pihaj@gmail.com>
2025-10-14 02:18:01 +02:00
Renovate Bot
c009f450a6 Update dependency go to v1.25.3 (forgejo) (#9676)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9676
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-14 02:12:45 +02:00
Mathieu Fenniak
906e2e7c4a fix: false error logging "Render JSON failed" from workflow dispatch via API (#9675)
When making a `POST` to start a workflow dispatch, and not specifying the option `"return_run_info": true`, the API handler attempts to render a `nil` as a JSON body to a `204 No Content` response.  This results in an error being logged to the console, as this status code does not permit a body.
```
Render JSON failed: http: request method or response status code does not allow body
```

There is no functional impact except for a false error log, as `ctx.JSON` just logs a `Render JSON failed` error if it fails.

I could not find any existing code which allows integration tests to intercept or inspect log output, which would be required for an automated test verifying this is fixed.  If anyone could advise an existing test that performs log interception, or any hints on how such a mechanism would be created, I don't mind adding it... but it may not be warranted for such a tiny bug either.

## 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.
  - [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9675
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-14 02:10:46 +02:00
Mathieu Fenniak
78d92aafd7 feat: strip EXIF information from uploaded avatars (#9638)
Strips EXIF information from uploaded avatars (excluding the orientation tag), affecting both user & repo avatars.  Adds a new subcommand `forgejo admin avatar-strip-exif` to perform a retroactive update of avatar files.

Fixes #9608.

## 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...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] 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.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [x] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9638): <!--number 9638 --><!--line 0 --><!--description VXBsb2FkZWQgYXZhdGFyIGltYWdlcyBjYW4gc29tZXRpbWVzIGNvbnRhaW4gdW5leHBlY3RlZCBtZXRhZGF0YSBzdWNoIGFzIHRoZSBsb2NhdGlvbiB3aGVyZSB0aGUgaW1hZ2Ugd2FzIGNyZWF0ZWQsIG9yIHRoZSBkZXZpY2UgdGhlIGltYWdlIHdhcyBjcmVhdGVkIHdpdGgsIHN0b3JlZCBpbiBhIGZvcm1hdCBjYWxsZWQgRVhJRi4gRm9yZ2VqbyBub3cgcmVtb3ZlcyBFWElGIGRhdGEgd2hlbiBjdXN0b20gdXNlciBhbmQgcmVwb3NpdG9yeSBpbWFnZXMgYXJlIHVwbG9hZGVkIGluIG9yZGVyIHRvIHJlZHVjZSB0aGUgcmlzayBvZiBwZXJzb25hbGx5IGlkZW50aWZpYWJsZSBpbmZvcm1hdGlvbiBiZWluZyBsZWFrZWQgdW5leHBlY3RlZGx5LiBBIG5ldyBDTEkgc3ViY29tbWFuZCBgZm9yZ2VqbyBkb2N0b3IgYXZhdGFyLXN0cmlwLWV4aWZgIGNhbiBiZSB1c2VkIHRvIHN0cmlwIEVYSUYgaW5mb3JtYXRpb24gZnJvbSBhbGwgZXhpc3RpbmcgYXZhdGFyczsgd2UgcmVjb21tZW5kIHRoYXQgYWRtaW5pc3RyYXRvcnMgcnVuIHRoaXMgY29tbWFuZCBvbmNlIGFmdGVyIHVwZ3JhZGUgaW4gb3JkZXIgdG8gbWluaW1pemUgdGhpcyByaXNrIGZvciBleGlzdGluZyBzdG9yZWQgZmlsZXMu-->Uploaded avatar images can sometimes contain unexpected metadata such as the location where the image was created, or the device the image was created with, stored in a format called EXIF. Forgejo now removes EXIF data when custom user and repository images are uploaded in order to reduce the risk of personally identifiable information being leaked unexpectedly. A new CLI subcommand `forgejo doctor avatar-strip-exif` can be used to strip EXIF information from all existing avatars; we recommend that administrators run this command once after upgrade in order to minimize this risk for existing stored files.<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9638
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-13 23:16:17 +02:00
Gusted
8eb8f49581 feat: move more modals to native dialogs (#9636)
Follow up of forgejo/forgejo#8859

Move the following modals to native dialogs:
- Admin notice.
- Edit label.
- New label.
- Update email in admin's email list.

Each has a E2E test to screenshot the modal and test functionality.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9636
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-10-13 17:48:49 +02:00
Gusted
d0a6f93f9e fix: avoid jumping to begin of page on edit comment action (#9645)
When you edit a comment and the comment already has a markdown editor,
then the code will click on the 'Write' tab, in case you canceled
editting the comment when you were at the 'Preview' tab. In
forgejo/forgejo#2681 I added `href="#"` to the tab items, this causes
that when the 'Write' tab is being clicked by the code the page is
jumped the beginning of the page.

Instead of being clever and trying to make this item interactive via
another way or via javascript avoid this jumping, we do better and make
this element a button. This item is not a link, it's a button that will
perform a action. This entirely avoids the issue of jumping and it's
still interactive.

Resolves forgejo/forgejo#9542

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9645
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-10-13 17:46:35 +02:00
Renovate Bot
0a8b6a9429 Lock file maintenance (forgejo) (#9666)
This PR contains the following updates:

| Update | Change |
|---|---|
| lockFileMaintenance | All locks refreshed |

🔧 This Pull Request updates lock files to use the latest dependency versions.

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (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.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDYuMCIsInVwZGF0ZWRJblZlciI6IjQxLjE0Ni4wIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9666
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-13 08:49:53 +02:00
Mathieu Fenniak
92684b6208 chore(e2e): test flakiness in issue-comment-dropzone.test.e2e.ts (#9660)
Flaky e2e test failure:
```
  1) [Mobile Chrome] › tests/e2e/issue-comment-dropzone.test.e2e.ts:74:1 › Re-add images to dropzone on edit
    Error: expect(locator).toHaveCount(expected) failed
    Locator:  locator('.dropzone').locator('.dz-preview')
    Expected: 1
    Received: 0
    Timeout:  3000ms
    Call log:
      - Expect "toHaveCount" with timeout 3000ms
      - waiting for locator('.dropzone').locator('.dz-preview')
        7 × locator resolved to 0 elements
          - unexpected value "0"
      87 |   await expect(dropzone.locator('.files').first()).toHaveCount(1);
      88 |   const preview = dropzone.locator('.dz-preview');
    > 89 |   await expect(preview).toHaveCount(1);
         |                         ^
      90 |   await expect(preview.locator('.dz-filename')).toHaveText('foo.png');
      91 |   await expect(preview.locator('.octicon-copy')).toBeVisible();
      92 |   await assertCopy(page, workerInfo, '![foo](');
        at /workspace/forgejo/forgejo/tests/e2e/issue-comment-dropzone.test.e2e.ts:89:25
```

Observed on chromium and Mobile Chrome.

I haven't been able to reproduce this test failure in local testing, but in examining the playwright test artifacts I noted that the browser is getting a `404 Not Found` error attempting to load a URL `(test server url)/uploading...` (where `...` is literally present in the URL).  My theory is that the test is firing the paste event in `pasteImage` and not waiting for the XMLHttpRequest to complete the upload, and then saving the issue comment with the placeholder URL `uploading...` in the Markdown, causing a later failure.  This patch adds two `waitForResponse` calls -- one when pasting the image to wait for the upload to complete, and one which is probably redundant which waits for the `/attachments` GET while editing the comment.

If this test continues to be flaky, it may at least have a different error revealing more about its cause.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9660
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-13 08:43:29 +02:00
Renovate Bot
15cb5cc6c1 Update dependency katex to v0.16.24 (forgejo) (#9665)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9665
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-13 03:12:19 +02:00
Renovate Bot
19c9f6194b Update renovate to v41.146.0 (forgejo) (#9664)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-13 03:03:00 +02:00
Mathieu Fenniak
a80f8f9d01 chore(e2e): test flakiness in webauthn.test.e2e.ts (#9662)
Test failure:
```
  1) [chromium] › tests/e2e/webauthn.test.e2e.ts:14:1 › WebAuthn register & login flow ─────────────
    Error: page.goto: Navigation to "http://localhost:3003/user/login" is interrupted by another navigation to "http://localhost:3003/"
    Call log:
      - navigating to "http://localhost:3003/user/login", waiting until "load"
      46 |
      47 |   // Login.
    > 48 |   response = await page.goto('/user/login');
         |                         ^
      49 |   expect(response?.status()).toBe(200);
      50 |
      51 |   await page.getByLabel('Username or email address').fill(username);
        at /workspace/forgejo/forgejo/tests/e2e/webauthn.test.e2e.ts:48:25
```

I have not been able to reproduce this locally.

What seems to be happening is that the current code is clicking the "Sign out" menu option, and then while the browser is busy (navigating to `/logout`, redirecting to `/`), the test attempts to navigate directly to `/user/login`.  The two navigations are racey, depending on how fast they work they may result in this error.  The proposed fix is to wait for the sign-out operation to complete by waiting for the URL to land on `/`, before then proceeding with the rest of the test with the second login.

Normally this would be *just* a `waitForURL` call.  But because of the redirect on logout, I've encountered the below error if the code is just invoking `waitForURL`.  So I put the `waitForURL` invocation into an `expect(...).toPass()`.  This isn't technically the correct usage of `toPass` which is intended for *assertions* which will eventually become successful, whereas this is attempting to retry a wait... but... a wait shouldn't need a retry.  (I'd argue this is a Playwright bug.)
```
Error: page.waitForURL: net::ERR_ABORTED; maybe frame was detached?
```

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9662
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-13 01:01:42 +02:00
Renovate Bot
1a93e211e4 Update dependency asciinema-player to v3.12.1 (forgejo) (#9647)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9647
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-12 23:54:50 +02:00
Mathieu Fenniak
79f6f8e508 fix: db.Iterate can miss records, can return records twice (#9657)
Fixes #9644.

Rewrites `db.Iterate` so that it performs DB queries in this format:
- First: `SELECT ...columns... FROM table ORDER BY id LIMIT ...buffer-size...`
- Subsequent buffer fills: adding a `WHERE id > ...last-id-from-previous...`

This approach:
- Prevents records from being missed or returned twice
- Returns records in a predictable order
- Should be faster, by virtue of using database indexes on the primary key to perform the query
- Doesn't rely on any unpredictable database behaviour when using `LIMIT` and `OFFSET` without an `ORDER BY`
- (Downside: does require reflection to read field values off Go structures for the primary key value)

Expands the automated tests to include the predicted failure case identified in #9644, which verified the previous broken behaviour, as well as verifying that the `cond` parameter is applied which was previously not covered by test automation.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9657
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-12 21:47:26 +02:00
Renovate Bot
ee34e3a317 Update github.com/rhysd/actionlint (indirect) to v1.7.8 (forgejo) (#9655)
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [github.com/rhysd/actionlint](https://github.com/rhysd/actionlint) | `v1.7.7` -> `v1.7.8` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2frhysd%2factionlint/v1.7.8?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2frhysd%2factionlint/v1.7.7/v1.7.8?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>rhysd/actionlint (github.com/rhysd/actionlint)</summary>

### [`v1.7.8`](https://github.com/rhysd/actionlint/blob/HEAD/CHANGELOG.md#v178---2025-10-11)

[Compare Source](https://github.com/rhysd/actionlint/compare/v1.7.7...v1.7.8)

- Support `models` permission in `permissions` section. ([#&#8203;531](https://github.com/rhysd/actionlint/issues/531), thanks [@&#8203;muzimuzhi](https://github.com/muzimuzhi))
- Support `job.check_run_id` property. ([#&#8203;576](https://github.com/rhysd/actionlint/issues/576), thanks [@&#8203;muzimuzhi](https://github.com/muzimuzhi) for fixing the type at [#&#8203;577](https://github.com/rhysd/actionlint/issues/577))
- Support `node24` runtime at `using` section in action metadata. ([#&#8203;561](https://github.com/rhysd/actionlint/issues/561), thanks [@&#8203;salmanmkc](https://github.com/salmanmkc))
- Add support for the following runner labels
  - [`macos-26` and `macos-26-large`](https://github.blog/changelog/2025-09-11-actions-macos-26-image-now-in-public-preview/) ([#&#8203;572](https://github.com/rhysd/actionlint/issues/572), thanks [@&#8203;muzimuzhi](https://github.com/muzimuzhi))
  - [`macos-15`](https://github.blog/changelog/2025-09-19-github-actions-macos-13-runner-image-is-closing-down/#what-you-need-to-do) ([#&#8203;572](https://github.com/rhysd/actionlint/issues/572), thanks [@&#8203;muzimuzhi](https://github.com/muzimuzhi))
- Drop support for the following runner labels.
  - [`ubuntu-20.04`](https://github.com/actions/runner-images/issues/11101) ([#&#8203;534](https://github.com/rhysd/actionlint/issues/534), thanks [@&#8203;shogo82148](https://github.com/shogo82148))
  - [`windows-2019`](https://github.blog/changelog/2025-04-15-upcoming-breaking-changes-and-releases-for-github-actions/#windows-server-2019-is-closing-down) ([#&#8203;572](https://github.com/rhysd/actionlint/issues/572), thanks [@&#8203;muzimuzhi](https://github.com/muzimuzhi))
- Support [`deprecationMessage`](https://docs.github.com/en/actions/reference/workflows-and-actions/metadata-syntax#inputsinput_iddeprecationmessage) in action inputs. ([#&#8203;540](https://github.com/rhysd/actionlint/issues/540), thanks [@&#8203;saansh45](https://github.com/saansh45))
- Support [`windows-11-arm` runner](https://github.blog/changelog/2025-04-14-windows-arm64-hosted-runners-now-available-in-public-preview/). ([#&#8203;542](https://github.com/rhysd/actionlint/issues/542), thanks [@&#8203;trim21](https://github.com/trim21))
- Handle `ubuntu-latest` runner label as `ubuntu-24.04` and `macos-latest` runner label as `macos-15`.
- Report mixing Intel Mac labels and Arm Mac labels as error.
- Add new types to `issues` and `pull_request_target` webhooks.
- Update the popular actions data set to the latest and add more actions to it (thanks [@&#8203;sethvargo](https://github.com/sethvargo) for fixing the `go generate` scripts)
  - `actions/create-github-app-token`
  - `actions/attest-sbom`
  - `actions/ai-inference`
  - `peter-evans/create-or-update-comment`
  - `release-drafter/release-drafter`
  - `SamKirkland/FTP-Deploy-Action`
- Fix the version value in `actionlint -version` can be empty.
- Fix outdated URL links in some error messages and documents.
- [Homebrew formula in this repository](https://github.com/rhysd/actionlint/blob/main/HomebrewFormula/actionlint.rb) is deprecated and [Homebrew cask](https://github.com/rhysd/actionlint/blob/main/Casks/actionlint.rb) is newly added instead because [GoReleaser no longer supports Homebrew formula update](https://goreleaser.com/deprecations/#brews). Note that Homebrew's official `actionlint` formula is still maintained. Please read the [documentation](https://github.com/rhysd/actionlint/blob/main/docs/install.md#homebrew) for more details.
- Drop support for Go 1.23 and earlier because they are no longer maintained officially. Go 1.24 and later are supported to build actionlint.
- Replace [`go-yaml/yaml@v3`](https://github.com/go-yaml/yaml) package with [`yaml/go-yaml@v4`](https://github.com/yaml/go-yaml) package. `go-yaml/yaml` was used for parsing workflow files however it was unmaintained. `yaml/go-yaml` is a successor of the library officially maintained by YAML organization. ([#&#8203;575](https://github.com/rhysd/actionlint/issues/575))
- Improve error messages on parsing workflow and action metadata files.

\[Changes]\[v1.7.8]

<a id="v1.7.7"></a>

</details>

---

### 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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzUuNSIsInVwZGF0ZWRJblZlciI6IjQxLjEzNS41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9655
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-12 14:50:03 +02:00
0ko
f200d53eb1 refactor(ui): re-implement icon colors but for all thin elements (#9643)
Followup to https://codeberg.org/forgejo/forgejo/pulls/3702.

* replace `--color-icon-*` with `--color-thin-*`
* use proper fallbacks instead of variables just referencing other variables
* Forgejo dark:
    * fix contrast of red and green texts (also purple if they exist)
    * improve contrast of orange texts
    * normalize chroma/lightness properties of all colors with `oklch`

Diff stats
B: https://codeberg.org/attachments/76c54dda-a6ac-4d87-b174-54eb97a71643
A: https://codeberg.org/attachments/7852d2f2-7db1-4480-91b1-ca809ffcd03e

Repo activity
B: https://codeberg.org/attachments/beb6ab5b-bcdb-464f-8d7d-038c1a082492
A: https://codeberg.org/attachments/b12be151-4ab3-4471-b6fb-ea60653580a5

Due date
B: https://codeberg.org/attachments/cdffc5bc-3379-451d-b99f-587d56821a26
A: https://codeberg.org/attachments/cf610300-f7aa-4c4f-ba11-0cd973ef8c94

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9643
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-10-12 10:01:24 +02:00
0ko
e9528ec4a8 chore(e2e): disable webkit/safari in some tests (#9642)
Followup to https://codeberg.org/forgejo/forgejo/pulls/9599#issuecomment-7670890.

I analyzed a bunch more recent runs and adding skipping for ones that fail very often. Coincidentally all of the most failing tests were already skipped for either Webkit or Safari, just not for both.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9642
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
2025-10-11 16:08:23 +02:00
Renovate Bot
e972a5bf49 Update module golang.org/x/image to v0.32.0 (forgejo) (#9605)
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [golang.org/x/image](https://pkg.go.dev/golang.org/x/image) | [`v0.31.0` -> `v0.32.0`](https://cs.opensource.google/go/x/image/+/refs/tags/v0.31.0...refs/tags/v0.32.0) | [![age](https://developer.mend.io/api/mc/badges/age/go/golang.org%2fx%2fimage/v0.32.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/golang.org%2fx%2fimage/v0.31.0/v0.32.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### 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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzUuNSIsInVwZGF0ZWRJblZlciI6IjQxLjEzNS41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9605
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-11 14:06:42 +02:00
0ko
e13da8aae3 chore: remove branding from application run helper (#9640)
Rel: https://codeberg.org/forgejo/forgejo/pulls/9628.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9640
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-10-11 12:14:13 +02:00
Renovate Bot
e588a8642b Update module golang.org/x/net to v0.46.0 (forgejo) (#9606)
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [golang.org/x/net](https://pkg.go.dev/golang.org/x/net) | [`v0.45.0` -> `v0.46.0`](https://cs.opensource.google/go/x/net/+/refs/tags/v0.45.0...refs/tags/v0.46.0) | [![age](https://developer.mend.io/api/mc/badges/age/go/golang.org%2fx%2fnet/v0.46.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/golang.org%2fx%2fnet/v0.45.0/v0.46.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### 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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzUuNSIsInVwZGF0ZWRJblZlciI6IjQxLjEzNS41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9606
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-11 11:20:39 +02:00
Cyborus
079c73635c fix(ui): add markup class to project descriptions (#9634)
Fixes #9630

### Project page
Before
![project-page-before](/attachments/1a6b15e6-6959-4ec2-978b-241a31958f1c)
After
![project-page-after](/attachments/50fe81a7-6c29-49e5-8336-a8261171c77c)

### Projects list
Before
![project-list-before](/attachments/ec92a7f5-de76-4c36-90b4-4f8951ad14b7)
After
![project-list-after](/attachments/f1d82688-3030-45d6-8ca5-6d601f5cbc8f)

---

### Tests

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [ ] 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)).

I'm unsure if this change is substantial enough to warrant that?

### 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/<pull request number>.md` to be be used for the release notes instead of the title.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- User Interface bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9634): <!--number 9634 --><!--line 0 --><!--description Zml4KHVpKTogYWRkIGBtYXJrdXBgIGNsYXNzIHRvIHByb2plY3QgZGVzY3JpcHRpb25z-->fix(ui): add `markup` class to project descriptions<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9634
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: Cyborus <cyborus@cyborus.xyz>
Co-committed-by: Cyborus <cyborus@cyborus.xyz>
2025-10-11 11:19:33 +02:00
0ko
688a83e405 chore(ui): remove unused class .small-menu-items (#9639)
Followup to https://codeberg.org/forgejo/forgejo/pulls/8399/files. That PR turned `small-menu-items` completely unused.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9639
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-10-11 10:39:43 +02:00
0ko
edc6072da2 fix(ui): make it possible to post issues and comments w/o JS (#9614)
Fix regression of https://codeberg.org/forgejo/forgejo/pulls/5589 & https://codeberg.org/forgejo/forgejo/pulls/7006.

Both added invisible input fields with `required` attribute into the forms used for creating issues and adding comments via `combomarkdowneditor.tmpl`. These fields were not related to the form and were only used for the modal dialogs.
* When JS is on, modals are moved out of the form to the bottom of the page by JS that handles modals
* When JS is off, the forms are stuck with invisible inputs preventing form submission
    * Another side effect is that request data contains these unwanted fields

This was fixed by adding attribute `disabled` to unwanted inputs. Then JS removes it on initialization. Thanks to @Beowulf for helping with choosing the approach!
When a field is `disabled`, the browser doesn't consider it in form validation and doesn't even include it in the request data.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9614
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
2025-10-11 10:38:48 +02:00
0ko
03d77fd465 fix(ui/releases): strech elements apart when no search bar (#9626)
Fix minor visual defect, which is a regression of https://codeberg.org/forgejo/forgejo/pulls/8399.

When viewing individual releases, there's no search bar.

B: https://codeberg.org/attachments/5621e544-6d18-4f58-b4f5-f15bf2c10e3b
A: https://codeberg.org/attachments/f6ebc7bb-9168-4a3f-86ba-0b526c2ede89

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9626
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
2025-10-11 05:39:10 +02:00
Renovate Bot
4841b310d8 Update dependency monaco-editor-webpack-plugin to v7.1.1 (forgejo) (#9632)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9632
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-11 05:35:55 +02:00
Renovate Bot
f250195256 Update module golang.org/x/oauth2 to v0.32.0 (forgejo) (#9635)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9635
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-11 04:55:20 +02:00
0ko
9a35b6ba77 chore: remove branding from context imports (#9628)
Kind of followup to https://codeberg.org/forgejo/forgejo/pulls/7337.

With cherry-picking being no more, this shouldn't cause too much chaos.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9628
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-10-11 01:52:51 +02:00
0ko
220c8d173b chore(i18n): migrate download counts to json (#9625)
Previous such PR: https://codeberg.org/forgejo/forgejo/pulls/9463

As long as changes here do not conflict with https://codeberg.org/forgejo/forgejo/pulls/9597 it is safe to merge without merging that one first.

* removals from the INI are included to preserve traceability of strings being moved around
* in non-base items are prepended to the top to avoid conflict with Weblate
* in English insertion happened in a semi-random place to avoid conflict with PRs that append strings at the end

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9625
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-10-10 22:15:36 +02:00
Renovate Bot
188810c9e9 Update mcr.microsoft.com/devcontainers/go Docker tag to v2 (forgejo) (#9617)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-10 20:00:57 +02:00
Earl Warren
4adec07103 chore(ci): limit LDAP service container memory usage to 500M (#9611)
This is a noop and will be silently ignored until Forgejo runner v11.2.0 is servicing this repository with https://code.forgejo.org/forgejo/runner/pulls/1079

---

Resolves forgejo/forgejo#9406

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9611
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-10-10 16:26:34 +02:00
Gusted
89469d14e9 feat: avoid remote for codeowner's merge base (#9610)
The codeowner features computes the mergebase (I'm not exactly sure why, because this should be stored in the database in `merge_base` column, but if there's no harm to compute it again as that will always be the correct answer) in order to get the changed files between the merge base and the head commit. To do this a function was used that adds a remote... my best reasoning is that this was done because the only function that that was exported on the repository struct had this requirement. Add a new function that *simply* computes the merge base without requiring a remote.

The main benefit of not using a remote is that within Codeberg we are frequently seeing `config.lock` being lingered around (see forgejo/forgejo#1946) so its best to avoid modifying the config when possible - in this case it was completely unnecessary.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9610
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-10-10 15:50:38 +02:00
Gusted
b529b80132 feat: run tsc in CI (#9574)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9574
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-10-10 15:48:45 +02:00
0ko
39f389eb17 fix(e2e): disable webkit/safari in tests where they are too falky (#9599)
These tests often appear as failing with one failed retry in e2e logs for either browsers.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9599
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Otto <otto@codeberg.org>
2025-10-10 15:36:21 +02:00
Earl Warren
2189b35545 Update module connectrpc.com/connect to v1.19.1 (forgejo) (followup) (#9612)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9612
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-10-10 15:22:56 +02:00
Renovate Bot
ee41e6eead Update module golang.org/x/crypto to v0.43.0 (forgejo) (#9604)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9604
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-10 15:09:55 +02:00
Renovate Bot
71257fff2c Update module connectrpc.com/connect to v1.19.1 (forgejo) (#9567)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9567
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-10 14:33:57 +02:00
Gusted
419eb0a4a2 feat: improve getting shortstat (#9587)
Refactor the existing functions to get shortstat of commit and between two commits to use performant alternatives, mainly `git-diff-tree` and `git-diff-index`.

Resolves forgejo/forgejo#9551

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9587
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-10-10 14:15:38 +02:00
0ko
84e9b566a0 feat(ui): improve close/reopen/comment buttons (#9598)
Related: https://codeberg.org/forgejo/forgejo/issues/2650, https://codeberg.org/forgejo/forgejo/pulls/6044

* improve consistency by getting rid of the less usual button kinds
    * same as changes to profile buttons in https://codeberg.org/forgejo/forgejo/pulls/9359
        * transparent outline button is now secondary
        * bulb-bright red button is now secondary
    * I think that actions like Close and Reopen shouldn't attract much attention, so they are secondary
* add icons to better visually indicate the action
    * yes this is inspired by GitHub
    * unlike in GitHub, the icons are monochrome:
        * colored icons had bad contrast due to buttons being brighter than the usual areas with colored icons
        * they are not at all common inside of buttons in our UI
* convert the buttons to the new CSS
    * differences are described in https://codeberg.org/forgejo/forgejo/pulls/9359
* a few general CSS improvements
    * prevent 1px vertical padding on `<button>` provided by browser defaults
        * wasn't noticed before because no `<buttons>` were converted yet
    * increased the default gap (for buttons with such icons) to 0.5rem
        * looks much better than Fomantic's 0.25rem
        * I took this opportunity because no buttons with icons were converted yet, so there's no blast radius to worry about yet

Preview

B: https://codeberg.org/attachments/3cdb2fc8-3887-4e82-8213-45dde42a5b33
A: https://codeberg.org/attachments/133b59c2-470f-4f97-8e85-e374e0a0b52e

B: https://codeberg.org/attachments/d814d2dc-d2a2-4daf-ba65-70d9097bb046
A: https://codeberg.org/attachments/2f2e0214-33e5-4ca9-a315-21252dc27525

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9598
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-10-10 07:11:53 +02:00
0ko
2b4754c1d7 feat(ui): JSfree sorting on /explore/{users,organizations} (#9556)
This PR replaces the sort dropdowns on Users and Organizations pages of Explore with the one we've got earlier in two other areas. Previous such replacement happened in #8572.

This implies a few positive changes such as:
* larger font size
* larger clickable area for coarse cursor
* it is possible to use while scripts are still loading
* it is possible to use w/o JS

Some refactors were made to support this change and as general improvements.

Desktop, closed
B: https://codeberg.org/attachments/354f7194-b247-4ecd-8875-2e95dadc7445
A: https://codeberg.org/attachments/0fa49cf5-e8e5-4c15-b2b0-7d13e8505945

Desktop, open
B: https://codeberg.org/attachments/b01b75d1-dbe4-458c-abd5-64cd8c121bc1
A: https://codeberg.org/attachments/94baccc4-fe36-4ae1-ace0-9b4d5fbd9f42

Mobile, open
B: https://codeberg.org/attachments/f868720a-ec71-4829-87f7-a1cfab860e37
A: https://codeberg.org/attachments/bbe72710-6824-4107-8086-d2bd50897038

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9556
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-10-09 14:33:33 +02:00
Renovate Bot
07bff8143e Update linters (forgejo) (#9578)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-09 13:29:12 +02:00
Gusted
fc9db11c56 feat: avoid updating all columns (#9572)
This patch contains two fixes/enhancements to two functions that were updating all columns of the `access_token` and `repository` table when they were only updating a select few columns. Within Codeberg we saw these two queries quite often when something problematic with the database was going on, likely because of this all columns update pattern. `UpdateAccessToken` is removed and a new function `UpdateLastUsed` was added, for `updateRepoRunsNumbers` we can simply add which columns we want to have updated in that query.

It's likely there are more of such queries, but these were the ones being executed often.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9572
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-10-09 13:22:29 +02:00
Renovate Bot
a5abeba442 Update dependency @vitest/eslint-plugin to v1.3.16 (forgejo) (#9575)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9575
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-09 13:13:36 +02:00
Renovate Bot
c79793be88 Update module mvdan.cc/gofumpt to v0.9.1 (forgejo) (#9580)
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [mvdan.cc/gofumpt](https://github.com/mvdan/gofumpt) | `v0.8.0` -> `v0.9.1` | [![age](https://developer.mend.io/api/mc/badges/age/go/mvdan.cc%2fgofumpt/v0.9.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/mvdan.cc%2fgofumpt/v0.8.0/v0.9.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>mvdan/gofumpt (mvdan.cc/gofumpt)</summary>

### [`v0.9.1`](https://github.com/mvdan/gofumpt/blob/HEAD/CHANGELOG.md#v091---2025-09-07)

[Compare Source](https://github.com/mvdan/gofumpt/compare/v0.9.0...v0.9.1)

This is a bugfix release to address a regression in detecting
comment directives with special characters such as `//golangcitest:config_path`.

### [`v0.9.0`](https://github.com/mvdan/gofumpt/blob/HEAD/CHANGELOG.md#v090---2025-09-02)

[Compare Source](https://github.com/mvdan/gofumpt/compare/v0.8.0...v0.9.0)

This release is based on Go 1.25's gofmt, and requires Go 1.24 or later.

A new rule is introduced to "clothe" naked returns for the sake of clarity.
While there is nothing wrong with naming results in function signatures,
using lone `return` statements can be confusing to the reader.

Go 1.25's `ignore` directives in `go.mod` files are now obeyed;
any directories within the module matching any of the patterns
are now omitted when walking directories, such as with `gofumpt -w .`.

Module information is now loaded via Go's [`x/mod/modfile` package](https://pkg.go.dev/golang.org/x/mod/modfile)
rather than executing `go mod edit -json`, which is way faster.
This should result in moderate speed-ups when formatting many directories.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM, on day 1 of the month ( * 0-3 1 * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzUuNSIsInVwZGF0ZWRJblZlciI6IjQxLjEzNS41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9580
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-09 12:16:59 +02:00
Renovate Bot
5281ac76cb Update https://data.forgejo.org/actions/setup-node action to v5 (forgejo) (#9585)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9585
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-09 11:20:31 +02:00
Renovate Bot
3897001cec Update https://data.forgejo.org/actions/checkout action to v5 (forgejo) (#9583)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [https://data.forgejo.org/actions/checkout](https://data.forgejo.org/actions/checkout) | action | major | `v4` -> `v5` |

---

### Release Notes

<details>
<summary>actions/checkout (https://data.forgejo.org/actions/checkout)</summary>

### [`v5`](https://data.forgejo.org/actions/checkout/compare/v4...v5)

[Compare Source](https://data.forgejo.org/actions/checkout/compare/v4...v5)

</details>

---

### 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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzUuNSIsInVwZGF0ZWRJblZlciI6IjQxLjEzNS41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9583
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-09 10:50:46 +02:00
Renovate Bot
815857cfc0 Update registry.redict.io/redict Docker tag to v7.3.6 (forgejo) (#9576)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| registry.redict.io/redict | service | patch | `7.3.5-scratch` -> `7.3.6-scratch` |

---

### 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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzUuNSIsInVwZGF0ZWRJblZlciI6IjQxLjEzNS41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9576
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-09 10:40:48 +02:00
Earl Warren
08cb52a768 i18n: update of translations from Codeberg Translate (#9465)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9465
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-10-09 09:40:22 +02:00
Codeberg Translate
d5742c31fb
i18n: update of translations from Codeberg Translate
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Juno Takano <jutty@noreply.codeberg.org>
Co-authored-by: Lzebulon <lzebulon@noreply.codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@noreply.codeberg.org>
Co-authored-by: Ricky-Tigg <ricky-tigg@noreply.codeberg.org>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: Vaibhav Sunder <vaibhavswire@gmail.com>
Co-authored-by: Vyxie <kitakita@disroot.org>
Co-authored-by: Wuzzy <wuzzy@disroot.org>
Co-authored-by: X1SystemError0X <x1systemerror0x@noreply.codeberg.org>
Co-authored-by: arifpedia <arifpedia@noreply.codeberg.org>
Co-authored-by: artnay <artnay@noreply.codeberg.org>
Co-authored-by: bespinas <bespinas@noreply.codeberg.org>
Co-authored-by: butterflyoffire <butterflyoffire@noreply.codeberg.org>
Co-authored-by: dyniec <dyniec@noreply.codeberg.org>
Co-authored-by: erral <erral@noreply.codeberg.org>
Co-authored-by: justbispo <justbispo@noreply.codeberg.org>
Co-authored-by: m13o <m13o@noreply.codeberg.org>
Co-authored-by: smlxdesign <smlxdesign@noreply.codeberg.org>
Co-authored-by: talu <talu@noreply.codeberg.org>
Co-authored-by: xtex <xtexchooser@duck.com>
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/ca/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/cs/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/fi/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/fil/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/fr/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/id/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/it/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/kab/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/nds/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pt_BR/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pt_PT/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/ru/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/sv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/zh_Hans/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/ca/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/eu/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fi/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/hi/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/pt_BR/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/pt_PT/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/sv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/tr/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/zh_Hans/
Translation: Forgejo/forgejo
Translation: Forgejo/forgejo-next
2025-10-09 07:02:21 +00:00
Renovate Bot
a28526a521 Update dependency happy-dom to v19 (forgejo) (#9582)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-09 01:18:56 +02:00
Renovate Bot
098cb0786d Update dependency @playwright/test to v1.56.0 (forgejo) (#9577)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-09 01:05:02 +02:00
Renovate Bot
9db4e2f38f Update module github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker to v3.4.0 (forgejo) (#9579)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-08 23:07:05 +02:00
Renovate Bot
1fa23c219f Update https://data.forgejo.org/actions/setup-go action to v6 (forgejo) (#9584)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9584
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-08 21:58:10 +02:00
Renovate Bot
f80a5e7445 Update x/tools to v0.37.0 (forgejo) (#9581)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-08 21:48:19 +02:00
Mathieu Fenniak
68bf916acd fix!: detect extra cmdline args and emit errors (#9458)
Fixes #9433.

```
$ ./gitea admin user create --username blah --must-change-password false
Hint: boolean false must be specified as a single arg, eg. '--restricted=false', not '--restricted false'
Command error: unexpected arguments: false
```

**Breaking**:  CLI sub-commands that only have flags would previously ignore anything that might be considered an "extra" argument, and would proceed without any errors.

I've manually tested this change on the single `admin user create` command with positive (ensuring cmd still works) and negative (ensuring errors are reported) test cases.

I've attempted to ensure the change is applied only to commands which don't use the CLI `Args()` and avoided touching them, including:
- `admin user must-change-password` takes a list of users
- `doctor recreate-tables` takes a list of tables
- `embedded [list/view/extract]` use a pattern of resources to operate upon
- git repo hook subcommands, and the ssh serv command, use arguments and have been omitted from the change

## 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.
  - [ ] 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.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [x] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9458
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-08 18:20:28 +02:00
0ko
563291579e fix(ui/mde): fix switch height and buttons alignment (#9545)
Followup to https://codeberg.org/forgejo/forgejo/pulls/9359.

The custom height override for the switch in MDE was not taken into account in that PR.
* How it used to be: constant height + variable padding for different scenarios
* How it works now: there's no padding, just variable height

After the change the override that was supposed to decrease the padding started increasing it from 0, making the switch too tall.

Also two of the buttons on the toolbar used to have a completely unused `button` class, which detonated them after it was globally implemented, so it was removed.

First time a button with this class was added in 4615891b9d, then it was duplicated in 6dad457552. Modals do not depend on presence of this class:
6610eb1dbf/web_src/js/features/common-global.js (L441)

Preview:
B: https://codeberg.org/attachments/5d10ac6e-45b3-4cd3-8083-f446824d4310
A: https://codeberg.org/attachments/93a00f69-56a6-4c02-93d8-6080f51d273f

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9545
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-10-08 17:53:50 +02:00
Renovate Bot
94c068e91e Update dependency go to v1.25 (forgejo) (#8908)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8908
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-08 15:57:37 +02:00
Renovate Bot
b5e9b26ae0 Update dependency webpack to v5.102.1 (forgejo) (#9564)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9564
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-08 14:15:02 +02:00
Renovate Bot
5ed86bf257 Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.5.0 (forgejo) (#9563)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-08 13:15:33 +02:00
Renovate Bot
5ac21c69aa Update dependency go to v1.24.8 (forgejo) (#9559)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [go](https://go.dev/) ([source](https://github.com/golang/go)) | toolchain | patch | `1.24.7` -> `1.24.8` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), 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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzUuNSIsInVwZGF0ZWRJblZlciI6IjQxLjEzNS41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9559
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-08 12:37:33 +02:00
Renovate Bot
2ba873cbff Update module github.com/go-swagger/go-swagger/cmd/swagger to v0.33.1 (forgejo) (#9562)
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [github.com/go-swagger/go-swagger/cmd/swagger](https://github.com/go-swagger/go-swagger) | `v0.31.0` -> `v0.33.1` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgo-swagger%2fgo-swagger%2fcmd%2fswagger/v0.33.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgo-swagger%2fgo-swagger%2fcmd%2fswagger/v0.31.0/v0.33.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>go-swagger/go-swagger (github.com/go-swagger/go-swagger/cmd/swagger)</summary>

### [`v0.33.1`](https://github.com/go-swagger/go-swagger/compare/v0.33.0...v0.33.1)

[Compare Source](https://github.com/go-swagger/go-swagger/compare/v0.33.0...v0.33.1)

### [`v0.33.0`](https://github.com/go-swagger/go-swagger/compare/v0.32.3...v0.33.0)

[Compare Source](https://github.com/go-swagger/go-swagger/compare/v0.32.3...v0.33.0)

### [`v0.32.3`](https://github.com/go-swagger/go-swagger/compare/v0.32.2...v0.32.3)

[Compare Source](https://github.com/go-swagger/go-swagger/compare/v0.32.2...v0.32.3)

### [`v0.32.2`](https://github.com/go-swagger/go-swagger/compare/v0.32.1...v0.32.2)

[Compare Source](https://github.com/go-swagger/go-swagger/compare/v0.32.1...v0.32.2)

### [`v0.32.1`](https://github.com/go-swagger/go-swagger/compare/v0.32.0...v0.32.1)

[Compare Source](https://github.com/go-swagger/go-swagger/compare/v0.32.0...v0.32.1)

### [`v0.32.0`](https://github.com/go-swagger/go-swagger/compare/v0.31.0...v0.32.0)

[Compare Source](https://github.com/go-swagger/go-swagger/compare/v0.31.0...v0.32.0)

</details>

---

### 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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzUuNSIsInVwZGF0ZWRJblZlciI6IjQxLjEzNS41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9562
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-08 12:10:51 +02:00
Renovate Bot
16e415ebf1 Update dependency asciinema-player to v3.11.1 (forgejo) (#9524)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9524
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-07 22:14:42 +02:00
Ryan Lerch
7ce74a31e2 fix!: prevent forked .profile repositories from displaying profile content (#9513)
This PR fixes an issue where forked `.profile` repositories were unexpectedly displaying profile content on user profile pages. The fix ensures that only regular `.profile` repositories (not forks) are used to populate user profiles.

Fixes #9235
### Problem

When a user forked a repository named `.profile` without having created their own `.profile` repository, the content from the forked repository was unexpectedly displayed on their public profile page. This could lead to users' profiles displaying content they did not intentionally create for that purpose.

This issue was particularly problematic on instances where users had repository creation limits (-1) and would inappropriately use forked `.profile` repositories to obtain profile customization.

### Solution

Modified the `FindUserProfileReadme()` function in `routers/web/shared/user/header.go` to check if the `.profile` repository is a fork (`profileDbRepo.IsFork`) and return early if it is, preventing forked repositories from being used for profile content.

**For existing users:**
- Users with forked `.profile` repositories will no longer see unexpected profile content
- No action required unless they want to keep the content

**For users who want to use forked content:**
- Can convert the fork to a regular repository in Repository Settings → "Danger Zone" → "Convert fork"
- This preserves the content while making it available for profile display

### Testing

- 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)).

**Tests:** Added comprehensive integration test `forked-profile-repo` that verifies:
  - Original `.profile` repositories still work correctly
  - Forked `.profile` repositories do not display profile content
  - Forked repositories remain accessible via direct repository URLs
  - Fork relationships are maintained correctly

### Documentation

- [x] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [ ] I did not document these changes and I do not expect someone else to do it.

Docs PR is here: https://codeberg.org/forgejo/docs/pulls/1525

### Release notes

- [ ] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [x] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Release Notes available at `release-notes/9235.md`
---
More at: https://codeberg.org/fedora/forgejo-deployment/issues/167

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Breaking bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9513): <!--number 9513 --><!--line 0 --><!--description Zml4ITogUHJldmVudCBmb3JrZWQgYC5wcm9maWxlYCByZXBvc2l0b3JpZXMgZnJvbSBkaXNwbGF5aW5nIHByb2ZpbGUgY29udGVudC4gV2hlbiBhIHVzZXIgZm9ya2VkIGEgcmVwb3NpdG9yeSBuYW1lZCBgLnByb2ZpbGVgIHdpdGhvdXQgaGF2aW5nIGNyZWF0ZWQgdGhlaXIgb3duIGAucHJvZmlsZWAgcmVwb3NpdG9yeSwgdGhlIGNvbnRlbnQgZnJvbSB0aGUgZm9ya2VkIHJlcG9zaXRvcnkgd2FzIHVuZXhwZWN0ZWRseSBkaXNwbGF5ZWQgb24gdGhlaXIgcHVibGljIHByb2ZpbGUgcGFnZS4gVGhpcyBjb3VsZCBsZWFkIHRvIHVzZXJzJyBwcm9maWxlcyBkaXNwbGF5aW5nIGNvbnRlbnQgdGhleSBkaWQgbm90IGludGVudGlvbmFsbHkgY3JlYXRlIGZvciB0aGF0IHB1cnBvc2UuIEZvcmtlZCBgLnByb2ZpbGVgIHJlcG9zaXRvcmllcyBhcmUgbm93IHRyZWF0ZWQgYXMgc3RhbmRhcmQgcmVwb3NpdG9yaWVzIGFuZCBkbyBub3QgcG9wdWxhdGUgdGhlIHVzZXIncyBwdWJsaWMgcHJvZmlsZSBwYWdlLiBVc2VycyB3aG8gd2lzaCB0byB1c2UgdGhlIGNvbnRlbnQgZnJvbSBhIGZvcmtlZCBgLnByb2ZpbGVgIHJlcG9zaXRvcnkgY2FuIGNvbnZlcnQgdGhlIGZvcmsgdG8gYSByZWd1bGFyIHJlcG9zaXRvcnkgaW4gdGhlICJEYW5nZXIgWm9uZSIgc2VjdGlvbiBvZiBSZXBvc2l0b3J5IHNldHRpbmdzLiBUaGlzIGlzc3VlIHdhcyBwYXJ0aWN1bGFybHkgcHJvYmxlbWF0aWMgb24gaW5zdGFuY2VzIHdoZXJlIHVzZXJzIGhhZCByZXBvc2l0b3J5IGNyZWF0aW9uIGxpbWl0cyAoLTEpIGFuZCB3b3VsZCBpbmFwcHJvcHJpYXRlbHkgdXNlIGZvcmtlZCBgLnByb2ZpbGVgIHJlcG9zaXRvcmllcyB0byBvYnRhaW4gcHJvZmlsZSBjdXN0b21pemF0aW9uLiA=-->fix!: Prevent forked `.profile` repositories from displaying profile content. When a user forked a repository named `.profile` without having created their own `.profile` repository, the content from the forked repository was unexpectedly displayed on their public profile page. This could lead to users' profiles displaying content they did not intentionally create for that purpose. Forked `.profile` repositories are now treated as standard repositories and do not populate the user's public profile page. Users who wish to use the content from a forked `.profile` repository can convert the fork to a regular repository in the "Danger Zone" section of Repository settings. This issue was particularly problematic on instances where users had repository creation limits (-1) and would inappropriately use forked `.profile` repositories to obtain profile customization.<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: mfenniak <mfenniak@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9513
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: Ryan Lerch <rlerch@redhat.com>
Co-committed-by: Ryan Lerch <rlerch@redhat.com>
2025-10-07 18:53:57 +02:00
Renovate Bot
b71df03e35 Update dependency esbuild-loader to v4.4.0 (forgejo) (#9538)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9538
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-07 14:39:22 +02:00
thubrecht
6610eb1dbf fix(ui): Don't use the subtle color for log text (#9507)
This improves the contrast from the background, especially when ansi escape sequences are used in the logs.

Co-authored-by: Tom Hubrecht <tom@hubrecht.ovh>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9507
Reviewed-by: patka <patka@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: thubrecht <thubrecht@noreply.codeberg.org>
Co-committed-by: thubrecht <thubrecht@noreply.codeberg.org>
2025-10-06 16:34:14 +02:00
Renovate Bot
86dbec6b57 Update renovate to v41.135.5 (forgejo) (#9537)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [data.forgejo.org/renovate/renovate](https://renovatebot.com) ([source](https://github.com/renovatebot/renovate)) | container | minor | `41.131.9` -> `41.135.5` |
| [renovate](https://renovatebot.com) ([source](https://github.com/renovatebot/renovate)) |  | minor | `41.131.9` -> `41.135.5` |

---

### Release Notes

<details>
<summary>renovatebot/renovate (data.forgejo.org/renovate/renovate)</summary>

### [`v41.135.5`](https://github.com/renovatebot/renovate/releases/tag/41.135.5)

[Compare Source](https://github.com/renovatebot/renovate/compare/41.135.4...41.135.5)

##### Bug Fixes

- **deps:** update ghcr.io/renovatebot/base-image docker tag to v10.52.4 (main) ([#&#8203;38383](https://github.com/renovatebot/renovate/issues/38383)) ([80ae9b5](80ae9b5846))

##### Miscellaneous Chores

- **deps:** update dependency lint-staged to v16.2.2 (main) ([#&#8203;38379](https://github.com/renovatebot/renovate/issues/38379)) ([24f2d11](24f2d112e4))
- **deps:** update dependency lint-staged to v16.2.3 (main) ([#&#8203;38382](https://github.com/renovatebot/renovate/issues/38382)) ([a43bb66](a43bb66ff7))

### [`v41.135.4`](https://github.com/renovatebot/renovate/releases/tag/41.135.4)

[Compare Source](https://github.com/renovatebot/renovate/compare/41.135.3...41.135.4)

##### Bug Fixes

- **deps:** update ghcr.io/renovatebot/base-image docker tag to v10.52.3 (main) ([#&#8203;38377](https://github.com/renovatebot/renovate/issues/38377)) ([4789c55](4789c5536d))

##### Miscellaneous Chores

- **deps:** update dependency memfs to v4.47.0 (main) ([#&#8203;38376](https://github.com/renovatebot/renovate/issues/38376)) ([4b81d2b](4b81d2bfa7))

### [`v41.135.3`](https://github.com/renovatebot/renovate/releases/tag/41.135.3)

[Compare Source](https://github.com/renovatebot/renovate/compare/41.132.5...41.135.3)

##### Bug Fixes

- **deps:** update ghcr.io/renovatebot/base-image docker tag to v10.52.2 (main) ([#&#8203;38370](https://github.com/renovatebot/renovate/issues/38370)) ([c8bd276](c8bd2768d3))

##### Documentation

- change `yes` to `no` for dependabot dashboard in comparison ([#&#8203;38197](https://github.com/renovatebot/renovate/issues/38197)) ([ba31dc1](ba31dc1ebe))
- **mend-hosted:** clarify the API ([#&#8203;38318](https://github.com/renovatebot/renovate/issues/38318)) ([2029695](202969590d)), closes [#&#8203;38315](https://github.com/renovatebot/renovate/issues/38315)
- remove encrypted secrets deprecation announcement ([#&#8203;38316](https://github.com/renovatebot/renovate/issues/38316)) ([c3cd184](c3cd1846fa))

##### Miscellaneous Chores

- **deps:** update ghcr.io/containerbase/devcontainer docker tag to v13.14.9 (main) ([#&#8203;38369](https://github.com/renovatebot/renovate/issues/38369)) ([f1633b0](f1633b0f26))

### [`v41.132.5`](https://github.com/renovatebot/renovate/releases/tag/41.132.5)

[Compare Source](https://github.com/renovatebot/renovate/compare/41.132.4...41.132.5)

##### Bug Fixes

- **deps:** update dependency mkdocs-material to v9.6.21 (main) ([#&#8203;38301](https://github.com/renovatebot/renovate/issues/38301)) ([fe308e7](fe308e77c3))

##### Miscellaneous Chores

- **deps:** update dependency tar to v7.5.0 (main) ([#&#8203;38295](https://github.com/renovatebot/renovate/issues/38295)) ([5da6c91](5da6c913f2))
- **deps:** update dependency tar to v7.5.1 (main) ([#&#8203;38297](https://github.com/renovatebot/renovate/issues/38297)) ([17c700c](17c700c808))

### [`v41.132.4`](https://github.com/renovatebot/renovate/releases/tag/41.132.4)

[Compare Source](https://github.com/renovatebot/renovate/compare/41.132.3...41.132.4)

##### Bug Fixes

- **github-actions:** uses-with action versions for ruby, deno, bun) ([#&#8203;38294](https://github.com/renovatebot/renovate/issues/38294)) ([804f9ae](804f9aefcc))

### [`v41.132.3`](https://github.com/renovatebot/renovate/releases/tag/41.132.3)

[Compare Source](https://github.com/renovatebot/renovate/compare/41.132.2...41.132.3)

##### Bug Fixes

- **deps:** update ghcr.io/renovatebot/base-image docker tag to v10.51.2 (main) ([#&#8203;38292](https://github.com/renovatebot/renovate/issues/38292)) ([8489251](8489251c5c))

### [`v41.132.2`](https://github.com/renovatebot/renovate/releases/tag/41.132.2)

[Compare Source](https://github.com/renovatebot/renovate/compare/41.132.1...41.132.2)

##### Build System

- **deps:** update dependency better-sqlite3 to v12.4.1 (main) ([#&#8203;38289](https://github.com/renovatebot/renovate/issues/38289)) ([07e86d7](07e86d757f))

### [`v41.132.1`](https://github.com/renovatebot/renovate/releases/tag/41.132.1)

[Compare Source](https://github.com/renovatebot/renovate/compare/41.132.0...41.132.1)

##### Bug Fixes

- **deps:** update ghcr.io/renovatebot/base-image docker tag to v10.51.1 (main) ([#&#8203;38287](https://github.com/renovatebot/renovate/issues/38287)) ([9dbfaf0](9dbfaf068a))

### [`v41.132.0`](https://github.com/renovatebot/renovate/releases/tag/41.132.0)

[Compare Source](https://github.com/renovatebot/renovate/compare/41.131.12...41.132.0)

##### Features

- **deps:** update ghcr.io/renovatebot/base-image docker tag to v10.51.0 (main) ([#&#8203;38286](https://github.com/renovatebot/renovate/issues/38286)) ([447a2db](447a2dbf81))

##### Miscellaneous Chores

- **deps:** update dependency pnpm to v10.17.1 (main) ([#&#8203;38283](https://github.com/renovatebot/renovate/issues/38283)) ([351a7da](351a7da443))
- **deps:** update ghcr.io/containerbase/devcontainer docker tag to v13.14.4 (main) ([#&#8203;38285](https://github.com/renovatebot/renovate/issues/38285)) ([c2c15b0](c2c15b0db0))

### [`v41.131.12`](https://github.com/renovatebot/renovate/releases/tag/41.131.12)

[Compare Source](https://github.com/renovatebot/renovate/compare/41.131.11...41.131.12)

##### Build System

- **deps:** update dependency nanoid to v5.1.6 (main) ([#&#8203;38281](https://github.com/renovatebot/renovate/issues/38281)) ([1d358a1](1d358a1516))

### [`v41.131.11`](https://github.com/renovatebot/renovate/releases/tag/41.131.11)

[Compare Source](https://github.com/renovatebot/renovate/compare/41.131.10...41.131.11)

##### Bug Fixes

- **deps:** update ghcr.io/renovatebot/base-image docker tag to v10.50.3 (main) ([#&#8203;38279](https://github.com/renovatebot/renovate/issues/38279)) ([c5b5d6f](c5b5d6fa30))

### [`v41.131.10`](https://github.com/renovatebot/renovate/releases/tag/41.131.10)

[Compare Source](https://github.com/renovatebot/renovate/compare/41.131.9...41.131.10)

##### Documentation

- update references to renovate/renovate (main) ([#&#8203;38268](https://github.com/renovatebot/renovate/issues/38268)) ([30ff725](30ff7252d0))

##### Miscellaneous Chores

- **deps:** lock file maintenance (main) ([#&#8203;38269](https://github.com/renovatebot/renovate/issues/38269)) ([3de37e6](3de37e65e4))
- **deps:** update containerbase/internal-tools action to v3.13.10 (main) ([#&#8203;38272](https://github.com/renovatebot/renovate/issues/38272)) ([a07089a](a07089a057))
- **deps:** update containerbase/internal-tools action to v3.13.9 (main) ([#&#8203;38270](https://github.com/renovatebot/renovate/issues/38270)) ([3629662](3629662b9e))
- **deps:** update dependency [@&#8203;containerbase/eslint-plugin](https://github.com/containerbase/eslint-plugin) to v1.1.12 (main) ([#&#8203;38271](https://github.com/renovatebot/renovate/issues/38271)) ([d57ffc4](d57ffc4df6))
- **deps:** update dependency lint-staged to v16.2.0 (main) ([#&#8203;38276](https://github.com/renovatebot/renovate/issues/38276)) ([80265fb](80265fb9d6))
- **deps:** update dependency renovatebot/github-action to v43.0.14 (main) ([#&#8203;38274](https://github.com/renovatebot/renovate/issues/38274)) ([8a2c174](8a2c174aae))
- **deps:** update dependency tar to v7.4.4 (main) ([#&#8203;38273](https://github.com/renovatebot/renovate/issues/38273)) ([b95e136](b95e136321))
- **deps:** update dependency vite to v7.1.7 (main) ([#&#8203;38275](https://github.com/renovatebot/renovate/issues/38275)) ([328b561](328b5610a7))
- **deps:** update ghcr.io/containerbase/devcontainer docker tag to v13.14.3 (main) ([#&#8203;38277](https://github.com/renovatebot/renovate/issues/38277)) ([95e6584](95e6584789))

##### Build System

- **deps:** update dependency better-sqlite3 to v12.3.0 (main) ([#&#8203;38278](https://github.com/renovatebot/renovate/issues/38278)) ([657b7be](657b7be250))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzEuOSIsInVwZGF0ZWRJblZlciI6IjQxLjEzMS45IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJmb3JnZWpvL2NpIiwidGVzdC9ub3QtbmVlZGVkIl19-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9537
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-06 06:33:06 +02:00
Renovate Bot
643cd4fa6e Lock file maintenance (forgejo) (#9539)
This PR contains the following updates:

| Update | Change |
|---|---|
| lockFileMaintenance | All locks refreshed |

🔧 This Pull Request updates lock files to use the latest dependency versions.

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (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.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzEuOSIsInVwZGF0ZWRJblZlciI6IjQxLjEzMS45IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9539
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-06 06:31:11 +02:00
Robert Wolff
aa9006bca0 fix(ui): reworked file preview placement towards better HTML validity, take 2 (#9534)
Closes: forgejo/forgejo#9472.
Followup of: forgejo/forgejo#9181
Examples with render panic on code.forgejo.org:
- https://code.forgejo.org/forgejo/runner/issues/485#issue-6254
- https://code.forgejo.org/forgejo-helm/forgejo-helm/issues/705#issuecomment-37753

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] 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

- [x] I do not want this change to show in the release notes.
- [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9534
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Robert Wolff <mahlzahn@posteo.de>
Co-committed-by: Robert Wolff <mahlzahn@posteo.de>
2025-10-06 05:35:26 +02:00
0ko
abd69183ea feat(ui): responsive, JS-free repo language stats panel (#9532)
Followup to https://codeberg.org/forgejo/forgejo/pulls/6700 & https://codeberg.org/forgejo/forgejo/pulls/9429

## Testing

Test coverage is already present in `tests/e2e/repo-home.test.e2e.ts` - there are no changes in behavior, so just selectors were updated.

## Changes

* Re-make stats using details+summary: it now works without JS, works immediately after page is displayed, responds to clicking more quickly
* Make the clickable bar taller on coarse screens
* Fix broken overflowing on narrow screens

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9532
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-10-05 20:36:35 +02:00
Earl Warren
fcf2b0a187 chore(release-notes): add chroma updates for v13, v12, v10, v8 (#9533)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9533
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-10-05 16:27:15 +02:00
Earl Warren
068e318629 feat: Actions jobs that can't be understood display a technical error in the UI, not just server-side logs (#9530)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9530
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-10-05 16:09:07 +02:00
0ko
f8d25228ce chore(release-notes): add chroma update to v13.0.0 release notes 2025-10-05 17:50:35 +05:00
0ko
fd08eba8d2 chore(release-notes): add chroma update to v12.0.0 release notes
There were no chroma updates in v11.
2025-10-05 17:43:06 +05:00
0ko
f2570811a4 chore(release-notes): add chroma update to v10.0.0 release notes 2025-10-05 17:24:51 +05:00
0ko
1e113fd8dc chore(release-notes): fix release notes of chroma update in v8.0.0 2025-10-05 17:10:38 +05:00
Mathieu Fenniak
0a02ffd355 feat(email): reference the commit closing the issue (#9522)
Preview-on: https://codeberg.org/attachments/0016d106-0353-43d2-953e-4f2ae1a0d166
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9522
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-05 05:56:45 +02:00
0ko
9a29241cde feat(ui): implement new buttons for better cohesiveness (#9359)
Followup to https://codeberg.org/forgejo/forgejo/pulls/9317#issuecomment-7214470.

Summary of changes:
- implement new CSS for buttons that doesn't have problems Fomantic buttons have:
    - button height doesn't depend on it's content - `min-height:` is used instead of `padding-{top,bottom}:`
    - no margins to fit right in with the other elements while relying on `display:flex` and `flex-gap:`
- other `.button` changes compared to `.ui.button`:
    - no semi-bold black text for now, I think it looks just as fine with normal weight
    - no variable `font-size` - should give better readability compared to existing `.small` and `.tiny` buttons
    - variable height depending on specified size (currently normal or `.small`) and on `@media (pointer: )`
- apply the new buttons to areas where there are switches or dropdown openers near them

Before:
- https://codeberg.org/forgejo/forgejo/attachments/8d9a3941-8889-4420-8f4f-f44cb8c3726f
- https://codeberg.org/forgejo/forgejo/attachments/e5804fae-a71f-43ba-918b-20d4f742124c
- https://codeberg.org/forgejo/forgejo/attachments/65d4e31c-01b7-4050-89a1-4afe74aa574c
- https://codeberg.org/forgejo/forgejo/attachments/c8057262-a834-4b61-a87f-70dab60b5506
- https://codeberg.org/forgejo/forgejo/attachments/aa9508e3-dca1-4ffe-913e-9cbddbb0d6ff
- https://codeberg.org/forgejo/forgejo/attachments/4b2daa07-e0ca-4b44-8795-1609dff8968f
- https://codeberg.org/forgejo/forgejo/attachments/93f7803f-1338-44dc-a428-e44e26231517

After:
- https://codeberg.org/forgejo/forgejo/attachments/ca5426c4-d75e-493d-8b29-64eee1e1c9de
- https://codeberg.org/forgejo/forgejo/attachments/f21c7219-6880-4a2e-9117-6267d46b3081
- https://codeberg.org/forgejo/forgejo/attachments/da3ee771-b5d5-4b4f-8c88-9a8de11b1a45
- https://codeberg.org/forgejo/forgejo/attachments/56f974c3-f72e-4f80-9bbd-5bc785a4a624
- https://codeberg.org/forgejo/forgejo/attachments/17f6e360-dfe5-4bb6-a6b5-dd747dbc2af8
- https://codeberg.org/forgejo/forgejo/attachments/91cd10e1-6c5e-4134-be4c-18223ed2a4f4
- https://codeberg.org/forgejo/forgejo/attachments/f0322c5c-ee9d-4889-9840-0c46838566cc
- https://codeberg.org/forgejo/forgejo/attachments/96560fe7-3436-46dc-8456-c43bfaee2daf
- https://codeberg.org/forgejo/forgejo/attachments/273cf795-6bb4-479f-804f-f40010fae825

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9359
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-10-05 05:22:32 +02:00
Mathieu Fenniak
02ea77c6a0 display pre-execution errors in action view UI 2025-10-04 19:56:38 -06:00
Mathieu Fenniak
25ba696b6a don't execute workflows when event parsing fails; create a pre-execution error instead 2025-10-04 18:47:57 -06:00
Mathieu Fenniak
152b98da90 save pre-execution errors to the DB when workflow execution is prevented by user data 2025-10-04 18:47:51 -06:00
Renovate Bot
877d4ae833 Update dependency katex to v0.16.23 (forgejo) (#9523)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9523
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-04 23:29:58 +02:00
Mathieu Fenniak
c434b963b4 feat: implement "concurrency" block in Forgejo Actions at the workflow level (#9434)
Currently references a pre-release version of `code.forgejo.org/forgejo/runner/v11`, pending release of https://code.forgejo.org/forgejo/runner/pulls/1026.

Fixes #5914.

This PR is quite large, but it can be reviewed commit-by-commit in relatively small, logical chunks.

Adds support for workflows with a `concurrency` block, and submembers `group` and `cancel-in-progress`.  For example:
```
on:
  workflow_dispatch:
jobs:
  rust-checks:
    runs-on: debian-latest
    steps:
      - run: sleep 300
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: false
```

The concurrency block effectively ends up with four supported behaviors that users will want to choose from:
- Backwards compatibility / default -- if omitted completely, the existing Forgejo behavior will be implemented.  That behavior is that push and pull request synchronize events will cancel all previous runs on the same repository, branch, and workflow.
- Unlimited concurrency -- if the `cancel-in-progress` value is set to `false` and no `group` is provided, then the previously described Forgejo behavior will be disabled and an unlimited number of workflows can be executed simultaneously (to the maximum supported by the Forgejo Runner capacity).
- Queue-behind -- if a `group` is provided and `cancel-in-progress: false` is set, then every new action run with in the same repository with the same group value will be queued behind previous workflow runs, allowing only one workflow to execute at a time in the group, but allowing all workflows to finish naturally.
- Cancel-in-progress -- if a `group` is provided and `cancel-in-progress: true` is set, then every new action run with in the same repository with the same group value will cause previously queued or running runs to be cancelled, allowing only one workflow to execute at a time in the group, but preferring execution of the most recent workflow.

Both the `group` and `cancel-in-progress` values can access values from the `github`, `inputs` and `vars` context for dynamic behavior.

## 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...
  - [x] 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

- [x] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
  - https://codeberg.org/forgejo/docs/pulls/1513
- [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9434): <!--number 9434 --><!--line 0 --><!--description aW1wbGVtZW50ICJjb25jdXJyZW5jeSIgYmxvY2sgaW4gRm9yZ2VqbyBBY3Rpb25zIGF0IHRoZSB3b3JrZmxvdyBsZXZlbA==-->implement "concurrency" block in Forgejo Actions at the workflow level<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9434
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-03 18:43:02 +02:00
Earl Warren
0cf3030d7b chore: add unit test for SearchPointerBlobs (#9519)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9519
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-10-03 15:14:40 +02:00
Gusted
112ad8d1da
chore: add unit test for SearchPointerBlobs 2025-10-03 14:37:24 +02:00
Otto Richter
f87b76160e e2e: Selective screenshots (#9499)
* Add some test that only snapshot relevant content
* Allow adding marging around the element in case the environment is relevant (e.g. the location of an element relative to the parent, but excluding the environment of the parent)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9499
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Otto Richter <git@otto.splvs.net>
Co-committed-by: Otto Richter <git@otto.splvs.net>
2025-10-03 13:45:08 +02:00
Renovate Bot
cb7d2057ce Update module google.golang.org/protobuf to v1.36.10 (forgejo) (#9510)
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) | `v1.36.9` -> `v1.36.10` | [![age](https://developer.mend.io/api/mc/badges/age/go/google.golang.org%2fprotobuf/v1.36.10?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/google.golang.org%2fprotobuf/v1.36.9/v1.36.10?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>protocolbuffers/protobuf-go (google.golang.org/protobuf)</summary>

### [`v1.36.10`](https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.36.10)

[Compare Source](https://github.com/protocolbuffers/protobuf-go/compare/v1.36.9...v1.36.10)

**Full Changelog**: <https://github.com/protocolbuffers/protobuf-go/compare/v1.36.9...v1.36.10>

Bug fixes:
[CL/704415](https://go-review.googlesource.com/c/protobuf/+/704415): reflect/protodesc: edition-2024-specific properties should not be lost when converting FileDescriptorProto to protoreflect.FileDescriptor

Maintenance:
[CL/708555](https://go-review.googlesource.com/c/protobuf/+/708555): internal/race\_test: add missing impl.LazyEnabled() t.Skip
[CL/703295](https://go-review.googlesource.com/c/protobuf/+/703295): proto: add more invalid group encoding test cases
[CL/703276](https://go-review.googlesource.com/c/protobuf/+/703276): internal/impl: verify lazy unmarshal on Deterministic encoding
[CL/703275](https://go-review.googlesource.com/c/protobuf/+/703275): internal/impl: stop using deprecated .Field in lazy\_test.go
[CL/702795](https://go-review.googlesource.com/c/protobuf/+/702795): all: update to latest github.com/google/go-cmp

</details>

---

### 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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzEuOSIsInVwZGF0ZWRJblZlciI6IjQxLjEzMS45IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9510
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-03 09:02:14 +02:00
Gusted
8c6f572615
chore: add LFS test repo
3 commits, with LFS pointers.
2025-10-03 08:27:32 +02:00
Gusted
8bd5169c5f fix: allow unactivated users to send recovery mails (#9504)
With forgejo/forgejo#9075 the `GetUserByEmail` now actually only used activated emails. This however broke sending recovery mails to unactivated users, as their email are not yet activated.

Use the newly introduced function `GetUserByEmailSimple` to not care about this activated email requirement and also avoid the no-reply address being a valid email address for this functionality.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9504
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-10-03 07:16:24 +02:00
David Rotermund
957a76df3b feat: Drag and drop nested directories (#6687)
Adds the ability for the drag and drop file upload to handle subdirectories. You drag and drop and it preserves your sub-folder substructure. Nothing more, nothing less.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- User Interface features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/6687): <!--number 6687 --><!--line 0 --><!--description RHJhZyBhbmQgZHJvcCBuZXN0ZWQgZGlyZWN0b3JpZXM=-->Drag and drop nested directories<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: David Rotermund <davrot@neuro.uni-bremen.de>
Co-authored-by: Otto Richter <git@otto.splvs.net>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6687
Reviewed-by: jerger <jerger@noreply.codeberg.org>
Co-authored-by: David Rotermund <davrot@noreply.codeberg.org>
Co-committed-by: David Rotermund <davrot@noreply.codeberg.org>
2025-10-03 00:16:40 +02:00
Ryan Lerch
32c187e5bb fix(ui): improve Pagure migrator private issues clarity (#9502)
Followup to https://codeberg.org/forgejo/forgejo/pulls/8513
More at https://codeberg.org/fedora/forgejo-deployment/issues/186
Related: https://codeberg.org/forgejo/forgejo/pulls/8513#issuecomment-6075304, https://codeberg.org/forgejo/forgejo/pulls/8513/files#issuecomment-6075322

Previously, users were getting confused about the token/private issues
behavior in the Pagure migrator, as the UI didn't clearly explain the
two-repository workflow or the security implications of using an API token.
This commit updates the Pagure migration template to make the behavior
clearer by:

- Adding a collapsible details section for private issues functionality to
  reduce UI clutter since this feature is not expected to be used frequently
- Replacing inline help text with proper Fomantic UI message boxes (blue
  info for description, red warning for security notice)
- Providing clear explanations of the two-step migration process (public
  content first, then private issues archive)
- Adding prominent security warnings about repository visibility when
  importing private content

The private issues section is now hidden by default in a collapsible
element, making the standard migration flow cleaner while still providing
access to advanced functionality when needed.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9502
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Ryan Lerch <rlerch@redhat.com>
Co-committed-by: Ryan Lerch <rlerch@redhat.com>
2025-10-02 15:40:19 +02:00
Renovate Bot
25233f8aad Lock file maintenance (forgejo) (#9460)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9460
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-02 15:34:08 +02:00
Renovate Bot
c37ccaeff1 Update dependency typescript to v5.9.3 (forgejo) (#9505)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9505
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-02 10:41:19 +02:00
Renovate Bot
ac6555f3fd Update dependency webpack to v5.102.0 (forgejo) (#9477)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9477
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-02 08:44:12 +02:00
Renovate Bot
cbf13d73d4 Update dependency tailwindcss to v3.4.18 (forgejo) (#9500)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9500
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-02 03:13:16 +02:00
Renovate Bot
5c9211f381 Update dependency @vitest/eslint-plugin to v1.3.13 (forgejo) (#9491)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-01 23:50:37 +02:00
Renovate Bot
d24ee72e42 Update dependency @playwright/test to v1.55.1 (forgejo) (#9488)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-01 23:48:49 +02:00
Gusted
8db9870295 chore: add npm version constraint to renovate (#9496)
Renovate uses the latest npm version, however this is now causing a
issue where the latest npm version is diverging from the npm version
packaged with node v22 (version the CI uses) in terms of what the
`package-lock.json` should contain (!9477) (some `"peer": true` lines).

Constrain renovate to use npm v10 to avoid this mismatch issue.

Thank you @viceice for helping with this patch.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9496
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-10-01 17:29:56 +02:00
Earl Warren
8435a8eb16 chore: remove not working PREFERRED_TIMESTAMP_TENSE setting (#9490)
It was only partially implemented about two years ago and never completed.

Resolves forgejo/forgejo#8938

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9490
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-10-01 15:16:01 +02:00
zokki
bfee082c01 fix(ui): make "Token name"-input a real required-field (#8877)
## 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.
  - [ ] 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.
- [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Before:
![image](/attachments/f957bab5-7a8f-4642-8528-6b82f38dd329)

After:
![image](/attachments/80620a95-3828-479a-8ae3-61e34e0d8c40)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8877
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: zokki <zokki.softwareschmiede@gmail.com>
Co-committed-by: zokki <zokki.softwareschmiede@gmail.com>
2025-10-01 12:07:30 +02:00
Renovate Bot
ec172f2d0e Update github.com/google/pprof digest to 9e5a51a (forgejo) (#9487)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/google/pprof](https://github.com/google/pprof) | require | digest | `6e76a2b` -> `9e5a51a` |

---

### Configuration

📅 **Schedule**: Branch creation - On day 1 of the month, every 3 months ( * * 1 */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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzEuOSIsInVwZGF0ZWRJblZlciI6IjQxLjEzMS45IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9487
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-01 10:06:50 +02:00
Jordan Atwood
796f129b8d fix(ui): improve markdown editor indentation counting (#9403)
Previously, the markdown editor would count instances of indentation text (ie. 4 spaces, tabs, and "> ") from anywhere in the line, rather than only counting those at the start of the line, so attempting to indent a line of text containing those strings in other locations could fail when it ought to be indented. This commit replaces the previous regex implementation with a function to count indents at the start of the line instead.

Fixes #9339

## 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.
  - [ ] 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.
  - [x] 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/<pull request number>.md` to be be used for the release notes instead of the title.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- User Interface bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9403): <!--number 9403 --><!--line 0 --><!--description Zml4KHVpKTogaW1wcm92ZSBtYXJrZG93biBlZGl0b3IgaW5kZW50YXRpb24gY291bnRpbmc=-->fix(ui): improve markdown editor indentation counting<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9403
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Jordan Atwood <nightfirecat@nightfirec.at>
Co-committed-by: Jordan Atwood <nightfirecat@nightfirec.at>
2025-10-01 10:03:32 +02:00
anthony-unicare
10e976699a fix: replace "Gitea" with "Forgejo" in button label (#9494)
The button label was "View in Gitea".
This commit changes it to "View in Forgejo".

## 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.
  - [ ] 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

- [x] I do not want this change to show in the release notes.
- [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9494
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: anthony-unicare <anthony-unicare@noreply.codeberg.org>
Co-committed-by: anthony-unicare <anthony-unicare@noreply.codeberg.org>
2025-10-01 09:56:25 +02:00
Mubelotix
7b1ed4d723 fix: replace the plus sign to confirm a new due date on issues with a check mark (#9486)
Closes #7428
A previous PR (#7464) was closed because of lack of response from its author but it was already RFR
This PR is the same except I will answer

Before:

![Screenshot from 2025-09-30 23-07-30](/attachments/66ed0ce2-7981-49b2-a6f0-ddd5be58f4b6)

After:

![Screenshot from 2025-09-30 23-07-52](/attachments/ca68403a-a3a8-416d-ae61-953d2daad066)

## Testing

- Open an issue
- Change the due date
- Click on the check mark to validate the change

## 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.
  - [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9486
Co-authored-by: Mubelotix <mubelotix@gmail.com>
Co-committed-by: Mubelotix <mubelotix@gmail.com>
2025-10-01 09:50:43 +02:00
Renovate Bot
e4779f32c5 Update module code.forgejo.org/f3/gof3/v3 to v3.11.1 (forgejo) (#9492)
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [code.forgejo.org/f3/gof3/v3](https://code.forgejo.org/f3/gof3) | `v3.11.0` -> `v3.11.1` | [![age](https://developer.mend.io/api/mc/badges/age/go/code.forgejo.org%2ff3%2fgof3%2fv3/v3.11.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/code.forgejo.org%2ff3%2fgof3%2fv3/v3.11.0/v3.11.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>f3/gof3 (code.forgejo.org/f3/gof3/v3)</summary>

### [`v3.11.1`](https://code.forgejo.org/f3/gof3/releases/tag/v3.11.1)

[Compare Source](https://code.forgejo.org/f3/gof3/compare/v3.11.0...v3.11.1)

<!--start release-notes-assistant-->

<!--URL:https://code.forgejo.org/f3/gof3-->

- features
  - [PR](https://code.forgejo.org/f3/gof3/pulls/204): <!--number 204 --><!--line 0 --><!--description ZmVhdDogZ2VuZXJpYzogTG9va3VwTWFwcGVkSUQgaXMgcHJvdmlkZWQgZjMuSW50ZXJmYWNlIGluc3RlYWQgb2YgaWQ=-->feat: generic: LookupMappedID is provided f3.Interface instead of id<!--description-->
- bug fixes
  - [PR](https://code.forgejo.org/f3/gof3/pulls/234): <!--number 234 --><!--line 0 --><!--description Zml4OiBleHByZXNzaW9ucyBpbiB3b3JrZmxvd3MgaGF2ZSBzdHJpbmdzIGluIHNpbmdsZSBxdW90ZXM=-->fix: expressions in workflows have strings in single quotes<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/205): <!--number 205 --><!--line 0 --><!--description Zml4KGNvc21ldGljKTogL3ssZm9yZ2V9Ly4uLiBzaG91bGQgYmUgL2ZvcmdlLy4uLg==-->fix(cosmetic): /{,forge}/... should be /forge/...<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/202): <!--number 202 --><!--line 0 --><!--description Zml4OiBmb3JnZWpvOiBhdHRhY2htZW50cyBhcmUgbm90IGFsd2F5cyBwdWJsaWM=-->fix: forgejo: attachments are not always public<!--description-->
- other
  - [PR](https://code.forgejo.org/f3/gof3/pulls/253): <!--number 253 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnby51YmVyLm9yZy9tb2NrL21vY2tnZW4gdG8gdjAuNi4w-->Update module go.uber.org/mock/mockgen to v0.6.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/257): <!--number 257 --><!--line 0 --><!--description VXBkYXRlIGRlcGVuZGVuY3kgZ28gdG8gdjEuMjQuNw==-->Update dependency go to v1.24.7<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/256): <!--number 256 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBtdmRhbi5jYy9nb2Z1bXB0IHRvIHYwLjkuMQ==-->Update module mvdan.cc/gofumpt to v0.9.1<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/255): <!--number 255 --><!--line 0 --><!--description VXBkYXRlIHRlc3RzL3NldHVwLWZvcmdlam8gZGlnZXN0IHRvIGQzMDdkYjE=-->Update tests/setup-forgejo digest to [`d307db1`](d307db1)<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/252): <!--number 252 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRsYWIuY29tL2dpdGxhYi1vcmcvYXBpL2NsaWVudC1nbyB0byB2MC4xNDMuMg==-->Update module gitlab.com/gitlab-org/api/client-go to v0.143.2<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/251): <!--number 251 --><!--line 0 --><!--description VXBkYXRlIHRlc3RzL2VuZC10by1lbmQgZGlnZXN0IHRvIDliMTdmNTE=-->Update tests/end-to-end digest to [`9b17f51`](9b17f51)<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/243): <!--number 243 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRodWIuY29tL2VkaXRvcmNvbmZpZy1jaGVja2VyL2VkaXRvcmNvbmZpZy1jaGVja2VyL3YzL2NtZC9lZGl0b3Jjb25maWctY2hlY2tlciB0byB2My40LjA=-->Update module github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker to v3.4.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/249): <!--number 249 --><!--line 0 --><!--description VXBkYXRlIHRlc3RzL2VuZC10by1lbmQgZGlnZXN0IHRvIDY0NTU4OTY=-->Update tests/end-to-end digest to [`6455896`](6455896)<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/250): <!--number 250 --><!--line 0 --><!--description VXBkYXRlIGdpdGxhYi9naXRsYWItY2UgRG9ja2VyIHRhZyB0byB2MTcuMTEuNy1jZS4w-->Update gitlab/gitlab-ce Docker tag to v17.11.7-ce.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/248): <!--number 248 --><!--line 0 --><!--description VXBkYXRlIHRlc3RzL3NldHVwLWZvcmdlam8gZGlnZXN0IHRvIGJjYmFkY2U=-->Update tests/setup-forgejo digest to [`bcbadce`](bcbadce)<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/247): <!--number 247 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRsYWIuY29tL2dpdGxhYi1vcmcvYXBpL2NsaWVudC1nbyB0byB2MC4xMzkuMg==-->Update module gitlab.com/gitlab-org/api/client-go to v0.139.2<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/246): <!--number 246 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRodWIuY29tL2dvbGFuZ2NpL2dvbGFuZ2NpLWxpbnQvdjIvY21kL2dvbGFuZ2NpLWxpbnQgdG8gdjIuNC4w-->Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.4.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/245): <!--number 245 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRsYWIuY29tL2dpdGxhYi1vcmcvYXBpL2NsaWVudC1nbyB0byB2MC4xMzguMA==-->Update module gitlab.com/gitlab-org/api/client-go to v0.138.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/244): <!--number 244 --><!--line 0 --><!--description VXBkYXRlIHRlc3RzL2VuZC10by1lbmQgZGlnZXN0IHRvIDIwZjE3MGQ=-->Update tests/end-to-end digest to [`20f170d`](20f170d)<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/237): <!--number 237 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRodWIuY29tL2dvbGFuZ2NpL2dvbGFuZ2NpLWxpbnQvdjIvY21kL2dvbGFuZ2NpLWxpbnQgdG8gdjIuMy4x-->Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.3.1<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/242): <!--number 242 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRodWIuY29tL3VyZmF2ZS9jbGkvdjMgdG8gdjMuNC4x-->Update module github.com/urfave/cli/v3 to v3.4.1<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/241): <!--number 241 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnb2xhbmcub3JnL3gvdG9vbHMvY21kL2RlYWRjb2RlIHRvIHYwLjM2LjA=-->Update module golang.org/x/tools/cmd/deadcode to v0.36.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/240): <!--number 240 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnb2xhbmcub3JnL3gvY3J5cHRvIHRvIHYwLjQxLjA=-->Update module golang.org/x/crypto to v0.41.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/239): <!--number 239 --><!--line 0 --><!--description VXBkYXRlIGRlcGVuZGVuY3kgZ28gdG8gdjEuMjQuNg==-->Update dependency go to v1.24.6<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/238): <!--number 238 --><!--line 0 --><!--description VXBkYXRlIGh0dHBzOi8vZGF0YS5mb3JnZWpvLm9yZy9hY3Rpb25zL2Zvcmdlam8tcmVsZWFzZSBhY3Rpb24gdG8gdjIuNy4y-->Update <https://data.forgejo.org/actions/forgejo-release> action to v2.7.2<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/236): <!--number 236 --><!--line 0 --><!--description VXBkYXRlIGh0dHBzOi8vZGF0YS5mb3JnZWpvLm9yZy9hY3Rpb25zL2Zvcmdlam8tcmVsZWFzZSBhY3Rpb24gdG8gdjIuNy4x-->Update <https://data.forgejo.org/actions/forgejo-release> action to v2.7.1<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/235): <!--number 235 --><!--line 0 --><!--description VXBkYXRlIGRlcGVuZGVuY3kgU3BlY3RvTGFicy9ob3ZlcmZseSB0byB2MS4xMS4z-->Update dependency SpectoLabs/hoverfly to v1.11.3<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/229): <!--number 229 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnb2xhbmcub3JnL3gvY3J5cHRvIHRvIHYwLjQwLjA=-->Update module golang.org/x/crypto to v0.40.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/233): <!--number 233 --><!--line 0 --><!--description VXBkYXRlIGh0dHBzOi8vZGF0YS5mb3JnZWpvLm9yZy9hY3Rpb25zL2Zvcmdlam8tcmVsZWFzZSBhY3Rpb24gdG8gdjIuNy4w-->Update <https://data.forgejo.org/actions/forgejo-release> action to v2.7.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/227): <!--number 227 --><!--line 0 --><!--description VXBkYXRlIGRlcGVuZGVuY3kgZ28gdG8gdjEuMjQuNQ==-->Update dependency go to v1.24.5<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/232): <!--number 232 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRodWIuY29tL2dvbGFuZ2NpL2dvbGFuZ2NpLWxpbnQvdjIvY21kL2dvbGFuZ2NpLWxpbnQgdG8gdjIuMy4w-->Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.3.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/228): <!--number 228 --><!--line 0 --><!--description VXBkYXRlIGdpdGxhYi9naXRsYWItY2UgRG9ja2VyIHRhZyB0byB2MTcuMTEuNi1jZS4w-->Update gitlab/gitlab-ce Docker tag to v17.11.6-ce.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/226): <!--number 226 --><!--line 0 --><!--description VXBkYXRlIHRlc3RzL2VuZC10by1lbmQgZGlnZXN0IHRvIDQ3ZjUwZDM=-->Update tests/end-to-end digest to [`47f50d3`](47f50d3)<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/225): <!--number 225 --><!--line 0 --><!--description VXBkYXRlIHRlc3RzL3NldHVwLWZvcmdlam8gZGlnZXN0IHRvIDIwMjZjNTk=-->Update tests/setup-forgejo digest to [`2026c59`](2026c59)<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/224): <!--number 224 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRsYWIuY29tL2dpdGxhYi1vcmcvYXBpL2NsaWVudC1nbyB0byB2MC4xMzcuMA==-->Update module gitlab.com/gitlab-org/api/client-go to v0.137.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/231): <!--number 231 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnb2xhbmcub3JnL3gvdG9vbHMvY21kL2RlYWRjb2RlIHRvIHYwLjM1LjA=-->Update module golang.org/x/tools/cmd/deadcode to v0.35.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/230): <!--number 230 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRodWIuY29tL2dvbGFuZ2NpL2dvbGFuZ2NpLWxpbnQvdjIvY21kL2dvbGFuZ2NpLWxpbnQgdG8gdjIuMi4y-->Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.2.2<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/221): <!--number 221 --><!--line 0 --><!--description VXBkYXRlIHRlc3RzL2VuZC10by1lbmQgZGlnZXN0IHRvIDA3YjkzMTg=-->Update tests/end-to-end digest to [`07b9318`](07b9318)<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/223): <!--number 223 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRsYWIuY29tL2dpdGxhYi1vcmcvYXBpL2NsaWVudC1nbyB0byB2MC4xMzEuMA==-->Update module gitlab.com/gitlab-org/api/client-go to v0.131.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/222): <!--number 222 --><!--line 0 --><!--description VXBkYXRlIHRlc3RzL3NldHVwLWZvcmdlam8gZGlnZXN0IHRvIDhhOGQ5NDQ=-->Update tests/setup-forgejo digest to [`8a8d944`](8a8d944)<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/220): <!--number 220 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRodWIuY29tL2dvbGFuZ2NpL2dvbGFuZ2NpLWxpbnQvdjIvY21kL2dvbGFuZ2NpLWxpbnQgdG8gdjIuMi4x-->Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.2.1<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/218): <!--number 218 --><!--line 0 --><!--description VXBkYXRlIHRlc3RzL2VuZC10by1lbmQgZGlnZXN0IHRvIGQwNTc3MTE=-->Update tests/end-to-end digest to [`d057711`](d057711)<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/219): <!--number 219 --><!--line 0 --><!--description VXBkYXRlIGdpdGxhYi9naXRsYWItY2UgRG9ja2VyIHRhZyB0byB2MTcuMTEuNS1jZS4w-->Update gitlab/gitlab-ce Docker tag to v17.11.5-ce.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/217): <!--number 217 --><!--line 0 --><!--description VXBkYXRlIHRlc3RzL2VuZC10by1lbmQgZGlnZXN0IHRvIDFiOWYxYWY=-->Update tests/end-to-end digest to [`1b9f1af`](1b9f1af)<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/216): <!--number 216 --><!--line 0 --><!--description VXBkYXRlIGRlcGVuZGVuY3kgU3BlY3RvTGFicy9ob3ZlcmZseSB0byB2MS4xMS4y-->Update dependency SpectoLabs/hoverfly to v1.11.2<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/215): <!--number 215 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRodWIuY29tL3VyZmF2ZS9jbGkvdjMgdG8gdjMuMy44-->Update module github.com/urfave/cli/v3 to v3.3.8<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/213): <!--number 213 --><!--line 0 --><!--description VXBkYXRlIGdpdGxhYi9naXRsYWItY2UgRG9ja2VyIHRhZyB0byB2MTcuMTEuNC1jZS4w-->Update gitlab/gitlab-ce Docker tag to v17.11.4-ce.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/214): <!--number 214 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnaXRsYWIuY29tL2dpdGxhYi1vcmcvYXBpL2NsaWVudC1nbyB0byB2MC4xMzAuMQ==-->Update module gitlab.com/gitlab-org/api/client-go to v0.130.1<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/211): <!--number 211 --><!--line 0 --><!--description VXBkYXRlIHRlc3RzL2VuZC10by1lbmQgZGlnZXN0IHRvIDI0ZjAyMTA=-->Update tests/end-to-end digest to [`24f0210`](24f0210)<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/212): <!--number 212 --><!--line 0 --><!--description VXBkYXRlIGdpdGVhL2dpdGVhIERvY2tlciB0YWcgdG8gdjEuMjQ=-->Update gitea/gitea Docker tag to v1.24<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/210): <!--number 210 --><!--line 0 --><!--description VXBkYXRlIHRlc3RzL2VuZC10by1lbmQgZGlnZXN0IHRvIGFhYjQ3NmI=-->Update tests/end-to-end digest to [`aab476b`](aab476b)<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/209): <!--number 209 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnb2xhbmcub3JnL3gvdG9vbHMvY21kL2RlYWRjb2RlIHRvIHYwLjM0LjA=-->Update module golang.org/x/tools/cmd/deadcode to v0.34.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/208): <!--number 208 --><!--line 0 --><!--description VXBkYXRlIG1vZHVsZSBnb2xhbmcub3JnL3gvY3J5cHRvIHRvIHYwLjM5LjA=-->Update module golang.org/x/crypto to v0.39.0<!--description-->
  - [PR](https://code.forgejo.org/f3/gof3/pulls/207): <!--number 207 --><!--line 0 --><!--description VXBkYXRlIGRlcGVuZGVuY3kgZ28gdG8gdjEuMjQuNA==-->Update dependency go to v1.24.4<!--description-->

<!--end release-notes-assistant-->

</details>

---

### Configuration

📅 **Schedule**: Branch creation - On day 1 of the month, every 3 months ( * * 1 */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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzEuOSIsInVwZGF0ZWRJblZlciI6IjQxLjEzMS45IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9492
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-10-01 05:02:30 +02:00
Lucas Schwiderski
7530e8a941 feat(ui): improve rendering commit links for PR commits, external repos and diffs (#9146)
- fix links to PR commits, e.g. `!7979 (commit 4d968c08e0)`
- show the repo slug for links other than the current repository, e.g. `forgejo/docs@498bd80133`
- truncate long `diff-...` fragments, e.g. `600be26638 (diff-953bb4f01)`
- show `files` query values for compare links, e.g. `8bbac4c679...e2278e5a38 (options/locale/locale_fi-FI.ini)`

Closes: #7980
Closes: #9130
Closes: #8023
Ref: #5901

## 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...
  - [x] 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/<pull request number>.md` to be be used for the release notes instead of the title.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- User Interface features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9146): <!--number 9146 --><!--line 0 --><!--description ZmVhdCh1aSk6IGltcHJvdmUgcmVuZGVyaW5nIGNvbW1pdCBsaW5rcyBmb3IgUFIgY29tbWl0cywgZXh0ZXJuYWwgcmVwb3MgYW5kIGRpZmZz-->feat(ui): improve rendering commit links for PR commits, external repos and diffs<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9146
Reviewed-by: Robert Wolff <mahlzahn@posteo.de>
Co-authored-by: Lucas Schwiderski <lucas@lschwiderski.de>
Co-committed-by: Lucas Schwiderski <lucas@lschwiderski.de>
2025-10-01 05:00:41 +02:00
Antonin Delpeuch
6d1818ffdb feat: allow PRs between common forks of the same base repository (#9045)
Fixes #6185.

## Checklist

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [x] in the `tests/integration` directory if it involves interactions with a live Forgejo server.

I also tested the changes manually.

### 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9045
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Co-committed-by: Antonin Delpeuch <antonin@delpeuch.eu>
2025-10-01 04:58:12 +02:00
Matej Focko
0145621e8d docs: add back warning as a commit status (#8935)
`warning` has been originally removed, but it caused issues with the CIs
and therefore the removal has been reverted. However the docs have not
been properly updated, the warning option is supported on the backend,
but it's not mentioned anywhere in the generated docs / API.

(Removal and revert has been propagated from the Gitea)

Fixes #8934

Signed-off-by: Matej Focko <me@mfocko.xyz>

## 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.
  - [ ] 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.
- [ ] 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.
- [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8935
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Matej Focko <me@mfocko.xyz>
Co-committed-by: Matej Focko <me@mfocko.xyz>
2025-10-01 04:52:16 +02:00
Beowulf
1cd0c5e99b fix: prevent page jumps due to textarea auto resizing (#7569)
The change prevents unnecessary resizing of the text field.

## Testing

- Compose some text e.g. in an issue
- Enter a lot of lines, until the compose field is as big as possible
- Move the screen up, the top of the compose field should leave the screen, but the last e.g. 5 lines should still be visible on the screen
- Append some text
- Make sure the textfield just gets bigger, but doesn't jump to the bottom of the page

Fixes #7522

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7569
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2025-10-01 03:47:19 +02:00
Mathieu Fenniak
dcd431b0d4 fix: ensure deleted Debian package does not remain referenced in the apt repository files (#9386)
Introduces a new `Notifier` which listens for `PackageDelete` events and triggers a rebuild of the `Packages` & `Release` files which are stored in the debian package repository.

Fixes #9369.

## 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9386
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-01 03:11:03 +02:00
Daniel Sy
7939521a10 feat: add support for ephemeral runners compatible with autoscaling tools (#9409)
PR for #9407

Endpoints compliant with github api spec:
https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28

## 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.
- [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Co-authored-by: Manuel Ganter <manuel.ganter@think-ahead.tech>
Co-authored-by: Martin McCaffery <martin.mccaffery@think-ahead.tech>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9409
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Daniel Sy <Daniel.Sy@telekom.de>
Co-committed-by: Daniel Sy <Daniel.Sy@telekom.de>
2025-10-01 00:38:35 +02:00
Mathieu Fenniak
187ad99f3c feat: add foreign keys to stopwatch & tracked_time tables (#9373)
Adds four foreign keys:
- stopwatch -- issue_id -> issue, user_id -> user
- tracked_time -- issue_id -> issue, user_id -> user

The majority of work encompassed in this PR is updating testing and support infrastructure to support foreign keys:
- `models/db/foreign_keys.go` adds new capabilities to sort registered tables into the right insertion order to avoid violating foreign keys
- `RecreateTables`, used by migration testing and the `doctor recreate-table` CLI, has been updated to support tables with foreign keys; new restrictions require that FK-related tables be rebuilt at the same time
- test fixture data is inserted in foreign-key order, and deleted in the reverse

An upgrade to xorm v1.3.9-forgejo.2 is incorporated in this PR, as two unexpected behaviors in the foreign key schema management were discovered during development of the updated `RecreateTables` routine.

Work in this PR is laid out to be reviewed easier commit-by-commit.

## 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...
  - [x] 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.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [x] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9373
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-10-01 00:31:38 +02:00
Earl Warren
ee4f9b02f9 chore: release-notes-assistant: there may be three supported releases (#9480)
After a release branch is cut and before it is released, there are three supported releases. For instance:

- v11.0 LTS
- v12.0 not yet EOL
- v13.0 not yet released

## Testing

```sh
time ../release-notes-assistant/release-notes-assistant --verbose --workdir /tmp/rna-milestone-11 --config .release-notes-assistant.yaml --forgejo-url https://codeberg.org --repository forgejo/forgejo --storage-location /tmp/rna-v11.txt --token $RNA_TOKEN release v11.0.7
```

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9468) ([backported](https://codeberg.org/forgejo/forgejo/pulls/9469)): <!--number 9469 --><!--line 0 --><!--description Zml4OiBwYWNrYWdlIGNsZWFuZWQgcnVsZSBmYWlscyBpZiB0aGUga2VlcCBjb3VudCBpcyB0b28gaGlnaA==-->fix: package cleaned rule fails if the keep count is too high<!--description-->
- Included for completeness but not user-facing (chores, etc.)
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9417) ([backported](https://codeberg.org/forgejo/forgejo/pulls/9418)): <!--number 9418 --><!--line 0 --><!--description Zml4OiB1cGdyYWRlIHRvIHRoZSBsZGFwIHZlcnNpb24gdXNlZCBmb3IgdGVzdGluZyB0byAyLjU=-->fix: upgrade to the ldap version used for testing to 2.5<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9480
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-09-30 14:20:22 +02:00
Earl Warren
debf12f6c5 fix: markup rendering panic must not abort the process (#9478)
It must return on error instead, and log a stack trace for forensic analysis.

Refs https://codeberg.org/forgejo/forgejo/issues/9472

## 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...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] 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

- [x] I do not want this change to show in the release notes.
- [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9478
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-09-30 09:39:34 +02:00
Ellen Εμιλία Άννα Zscheile
5687a8ef65 feat(build): add support for the base.Messenger, $.locale.Tr, Form structs to lint-locale-usage (#9095)
- Move a file around to avoid a circular dependency.
- Make lint-locale-usage aware of `base.Messenger`, form struct tags and `$.locale.Tr`.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9095
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Ellen Εμιλία Άννα Zscheile <fogti+devel@ytrizja.de>
Co-committed-by: Ellen Εμιλία Άννα Zscheile <fogti+devel@ytrizja.de>
2025-09-30 03:25:45 +02:00
Earl Warren
710600f459 fix: package cleaned rule fails if the keep count is too high (#9468)
If the keep count of a cleanup rule is greater than the number of available packages, it fails with:

```
panic(boundsError{x: int64(x), signed: true, y: y, code: boundsSliceB})
.../packages/packages.go:175
.../routers/web/org/setting_packages.go:108
```

Regression of https://codeberg.org/forgejo/forgejo/pulls/9219/files

Refs https://codeberg.org/forgejo/forgejo/issues/9461

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9468): <!--number 9468 --><!--line 0 --><!--description cGFja2FnZSBjbGVhbmVkIHJ1bGUgZmFpbHMgaWYgdGhlIGtlZXAgY291bnQgaXMgdG9vIGhpZ2g=-->package cleaned rule fails if the keep count is too high<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9468
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-09-29 16:28:43 +02:00
Gusted
52925c44c7 fix: add vue data to createApp instead mount (#9467)
- Regression of forgejo/forgejo#9444
- Resolves forgejo/forgejo#9462

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9467
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-09-29 15:44:01 +02:00
DasLixou
f30fc08468 fix: don't enlarge the clone-panel on mobile (#9447)
This is a short CSS fix for "mobile" devices (being screen-width < 390px) where the clone panel would not get smaller than 370px and thus causes an ugly overflow which also leads to the page being wider than view when loaded and thus causes the page to weirdly bounce a bit left and right when scrolling.

The 390px mark was chosen because that's exactly the point where, with padding, the panel stops having a usable size.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9447
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: DasLixou <einlixou@gmail.com>
Co-committed-by: DasLixou <einlixou@gmail.com>
2025-09-29 15:43:22 +02:00
famfo
98073ac28d feat: ability to filter listed accounts by type in admin dashboard (#9455)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9455
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: famfo <famfo@famfo.xyz>
Co-committed-by: famfo <famfo@famfo.xyz>
2025-09-29 15:35:40 +02:00
Renovate Bot
c271c73e53 Update renovate to v41.131.9 (forgejo) (#9456)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-09-29 09:37:12 +02:00
0ko
16e66254c6 chore(i18n): move some plural strings to json (#9463)
* move two strings to json so they have good culture aware plurals
* move formatting tags out of the strings
* simplify keys
* add basic testing

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9463
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-09-29 09:27:50 +02:00
0ko
b470c6c454 merge commit: i18n: update of translations from Codeberg Translate (#9423)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9423
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2025-09-29 09:14:20 +02:00
Codeberg Translate
cd7a8f4546
i18n: update of translations from Codeberg Translate
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: 11xx <11xx@noreply.codeberg.org>
Co-authored-by: Baturax <baturax@noreply.codeberg.org>
Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Juno Takano <jutty@noreply.codeberg.org>
Co-authored-by: Languages add-on <noreply-addon-languages@weblate.org>
Co-authored-by: Outbreak2096 <outbreak2096@noreply.codeberg.org>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: Wuzzy <wuzzy@disroot.org>
Co-authored-by: Xinayder <xinayder@noreply.codeberg.org>
Co-authored-by: matheusgomesms <matheusgomesms@noreply.codeberg.org>
Co-authored-by: smlxdesign <smlxdesign@noreply.codeberg.org>
Co-authored-by: thecoolcats <thecoolcats@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/nds/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/nl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pt_BR/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/ru/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/sv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/bg/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/nl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/pt_BR/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/ru/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/tr/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/zh_Hans/
Translation: Forgejo/forgejo
Translation: Forgejo/forgejo-next
2025-09-29 06:34:48 +00:00
Mathieu Fenniak
0b923a03b4 test: fix 'Missing required prop' warning during RepoActionView frontend tests (#9454)
Fixes warnings in the `RepoActionView.test.js`, introduced in #9444 but caused by the frontend tests not providing all required properties to the component.

```
stderr | web_src/js/components/RepoActionView.test.js > processes ##[group] and ##[endgroup]
[Vue warn]: Missing required prop: "runIndex"
  at <RepoActionView jobIndex="1" attemptNumber="1" initialJobData= {
  state: {
    run: { status: 'success', commit: [Object] },
    currentJob: { steps: [Array] }
  },
  logs: { stepsLog: [] }
}  ... >
  at <VTUROOT>
```

## 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.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [x] 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

- [x] I do not want this change to show in the release notes.
- [ ] 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/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9454
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-09-28 18:53:18 +02:00
0ko
0a18c04a4b feat(ui): add legends to storage overview (#9429)
Followup to https://codeberg.org/forgejo/forgejo/pulls/6602

* added nontransparent background to the empty part of the bar
* the rule is now a `details` with a legend that can be opened so it is easier to see categories that take up space:
    1. when they are tiny
    2. when on touchscreen where tooltips are less easy to use
    3. when a better overview is needed instead of checking one tooltip at a time
    4. when having JS disabled so tooltips aren't available
* made the bars slightly taller (0.714285714rem -> 0.75rem)
    * made them more taller for coarse pointer

Preview-on: https://codeberg.org/attachments/54065bf8-5e7b-46cd-ad8f-57e8278f59a3
Preview-on: https://codeberg.org/attachments/a3d57a76-a607-4e8b-8112-fe83c9db4026
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9429
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-09-28 10:35:07 +02:00
Gusted
c8ec9bc2cc feat(ui): lazy-load all Vue components (#9444)
Some Vue components were already lazy-loaded, but not all.

There are three main changes:
1. Move init scripts outside Vue code.
2. Make the init scripts lazy-load the Vue components.
3. Deal with vue linters, because apparently if you do `export default` then some Vue linters will notice that's vue sfc.

The rationale for this pull requests is that this reduces the size of the `index.js` file.
- Uncompressed: 1.24 MB -> 954.40 kB
- Compressed (gzip, via `reverse_proxy` of Caddy): 400.45 kB -> 298.95 kB
- Compressed (zstd, via `bindata` tag): 363.75 kB -> 274.22 kB

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9444
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-09-28 05:40:40 +02:00
Max Günther
5da9c6ce64 fix: replace "All pull requests" in repo issue filter (#9401)
When on the issue page, show "All issues" instead of "All pull requests" inside the "Type" filter.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9401
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Max Günther <code-mg@mailbox.org>
Co-committed-by: Max Günther <code-mg@mailbox.org>
2025-09-27 17:11:45 +02:00
danielep
fd27fceacb fix(ui): strike through deleted comment revisions (#8458)
Resolves #8403

There's a issue with the comment history items that are deleted, they can be deleted by the author of the comment or by those that have write access. However when the item is deleted, it shows that the one who wrote that revision of the comment deleted it, which is not always true. Strike-through the item instead.

Co-authored-by: Daniele Pintore <daniele.pintore1@gmail.com>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8458
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: danielep <danielep@noreply.codeberg.org>
Co-committed-by: danielep <danielep@noreply.codeberg.org>
2025-09-27 13:23:10 +02:00
Antonin Delpeuch
64cfb3580d feat: display the PR editable status in the right-hand side menu (#9392)
Fixes #9332.

I decided to leave the "Editable" badge next to the PR branch name, because I think it doesn't hurt to have it there, especially if some users have already learned to look for it there.

For those more familiar with the Github UI and not knowing to look for the "Editable" badge, this patch will also put the information in a more familiar place.

Unfortunately the changes to the existing test had to be more involved because the existing test used a PR which was made with the same head repo as the base repo (whereas the editable setting is only offered for PRs from forks).

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9392
Reviewed-by: Lucas <sclu1034@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Co-committed-by: Antonin Delpeuch <antonin@delpeuch.eu>
2025-09-27 13:08:38 +02:00
Earl Warren
152fd11bc6 fix: revert update of connectrpc.com/connect from v1.19.0 to v1.18.1 (#9438)
It does not break the CI but breaks the releases:

19.38 CGO_CFLAGS="-O2 -g -DSQLITE_MAX_VARIABLE_NUMBER=32766" /usr/local/go/bin/go build -trimpath  -tags 'netgo osusergo bindata timetzdata sqlite sqlite_unlock_notify' -ldflags '-linkmode external -extldflags "-static" -buildid= -s -w -X "main.ReleaseVersion=14.0-test" -X "main.MakeVersion=GNU Make 4.4.1" -X "main.Version=14.0.0-dev-2-42097bc0cb+gitea-1.22.0" -X "main.Tags=bindata timetzdata sqlite sqlite_unlock_notify" -X "main.ForgejoVersion=14.0.0-dev-2-42097bc0cb+gitea-1.22.0"' -o gitea
41.39 # connectrpc.com/connect
41.39 /go/pkg/mod/connectrpc.com/connect@v1.19.0/envelope.go:378:24: math.MaxUint32 (untyped int constant 4294967295) overflows int
99.47 make: *** [Makefile:851: static-executable] Error 1

There is a regression at https://github.com/connectrpc/connect-go/issues/886

This reverts commit 42097bc0cb.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9438
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-09-27 06:30:21 +02:00
Renovate Bot
42097bc0cb Update module connectrpc.com/connect to v1.19.0 (forgejo) (#9425)
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [connectrpc.com/connect](https://github.com/connectrpc/connect-go) | `v1.18.1` -> `v1.19.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/connectrpc.com%2fconnect/v1.19.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/connectrpc.com%2fconnect/v1.18.1/v1.19.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>connectrpc/connect-go (connectrpc.com/connect)</summary>

### [`v1.19.0`](https://github.com/connectrpc/connect-go/releases/tag/v1.19.0)

[Compare Source](https://github.com/connectrpc/connect-go/compare/v1.18.1...v1.19.0)

This release introduces the highly requested "simple" flag for code generation, making Connect significantly more ergonomic for everyday RPC development.

The new simple flag in protoc-gen-connect-go generates cleaner, more intuitive client and handler interfaces that eliminate request/response wrappers for most use cases. This addresses community feedback about verbosity and provides a more straightforward API. When enabled, metadata (headers/trailers) can be passed through context instead of explicit wrapper objects, optimizing for the common case where developers don't need direct access to HTTP headers.

#### What's Changed

##### Enhancements

- Add simple flag for more ergonomic generated code by [@&#8203;bufdev](https://github.com/bufdev) and [@&#8203;smaye81](https://github.com/smaye81) in [#&#8203;851](https://github.com/connectrpc/connect-go/pull/851)
- Update Go to v1.24 and document http.Protocol use removing the dependency on `golang.org/x/net/http2` by [@&#8203;maxbrunet](https://github.com/maxbrunet) in [#&#8203;873](https://github.com/connectrpc/connect-go/pull/873), [#&#8203;877](https://github.com/connectrpc/connect-go/pull/877)
- Add support for Edition 2024 by [@&#8203;emcfarlane](https://github.com/emcfarlane) in [#&#8203;878](https://github.com/connectrpc/connect-go/pull/878)

##### Bugfixes

- Include valid spec and headers when calling recover handler for streaming RPCs by [@&#8203;jhump](https://github.com/jhump) in [#&#8203;817](https://github.com/connectrpc/connect-go/pull/817)

##### Other changes

- Go version support updated to latest two instead of three by [@&#8203;jhump](https://github.com/jhump) in [#&#8203;837](https://github.com/connectrpc/connect-go/pull/837)
- CI testing improvements by [@&#8203;pkwarren](https://github.com/pkwarren) and [@&#8203;jhump](https://github.com/jhump) in [#&#8203;838](https://github.com/connectrpc/connect-go/pull/838), [#&#8203;839](https://github.com/connectrpc/connect-go/pull/839)
- Code quality improvements by [@&#8203;mattrobenolt](https://github.com/mattrobenolt) and [@&#8203;bufdev](https://github.com/bufdev) in [#&#8203;841](https://github.com/connectrpc/connect-go/pull/841), [#&#8203;867](https://github.com/connectrpc/connect-go/pull/867)
- Documentation improvements by [@&#8203;adlion](https://github.com/adlion) and [@&#8203;stefanvanburen](https://github.com/stefanvanburen) in [#&#8203;821](https://github.com/connectrpc/connect-go/pull/821),
  [#&#8203;880](https://github.com/connectrpc/connect-go/pull/880)

#### New Contributors

- [@&#8203;adlion](https://github.com/adlion) made their first contribution in [#&#8203;821](https://github.com/connectrpc/connect-go/pull/821)
- [@&#8203;maxbrunet](https://github.com/maxbrunet) made their first contribution in [#&#8203;873](https://github.com/connectrpc/connect-go/pull/873)
- [@&#8203;stefanvanburen](https://github.com/stefanvanburen) made their first contribution in [#&#8203;880](https://github.com/connectrpc/connect-go/pull/880)

**Full Changelog**: <https://github.com/connectrpc/connect-go/compare/v1.18.1...v1.19.0>

</details>

---

### 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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMjIuMyIsInVwZGF0ZWRJblZlciI6IjQxLjEyMi4zIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9425
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-09-26 09:49:48 +02:00
forgejo-release-manager
b29ab34338 chore: 13.0.0 is now stable - first commit 2025-09-25 15:19:52 +02:00
993 changed files with 14000 additions and 4302 deletions

View file

@ -11,7 +11,7 @@ include_file = ["main.go"]
include_dir = ["cmd", "models", "modules", "options", "routers", "services"]
exclude_dir = [
"models/fixtures",
"models/migrations/fixtures",
"models/gitea_migrations/fixtures",
"modules/avatar/identicon/testdata",
"modules/avatar/testdata",
"modules/git/tests",

View file

@ -18,9 +18,11 @@ forgejo.org/models/auth
forgejo.org/models/db
TruncateBeans
TruncateBeansCascade
InTransaction
DumpTables
GetTableNames
extendBeansForCascade
forgejo.org/models/dbfs
file.renameTo
@ -32,6 +34,9 @@ forgejo.org/models/forgejo/semver
SetVersionString
SetVersion
forgejo.org/models/forgejo_migrations
resetMigrations
forgejo.org/models/git
RemoveDeletedBranchByID
@ -224,6 +229,12 @@ forgejo.org/services/context
forgejo.org/services/federation
FollowRemoteActor
forgejo.org/services/mailer
ActionCloseIssueByCommit.isActionAdditionalData
forgejo.org/services/notify
UnregisterNotifier
forgejo.org/services/repository
IsErrForkAlreadyExist

View file

@ -1,6 +1,6 @@
{
"name": "Gitea DevContainer",
"image": "mcr.microsoft.com/devcontainers/go:1.24-bullseye",
"image": "mcr.microsoft.com/devcontainers/go:2.0-bullseye",
"features": {
// installs nodejs into container
"ghcr.io/devcontainers/features/node:1": {

View file

@ -17,7 +17,7 @@ runs:
apt-get -q install -qq -y zstd
- name: "Set up Go using setup-go"
uses: https://data.forgejo.org/actions/setup-go@v5
uses: https://data.forgejo.org/actions/setup-go@v6
id: go-version
with:
go-version-file: "go.mod"

View file

@ -25,7 +25,7 @@ jobs:
if: vars.ROLE == 'forgejo-coding'
runs-on: lxc-bookworm
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- id: forgejo
uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.4

View file

@ -33,7 +33,7 @@ jobs:
# root is used for testing, allow it
if: vars.ROLE == 'forgejo-integration' || github.repository_owner == 'root'
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
with:
fetch-depth: 0
@ -43,11 +43,11 @@ jobs:
repository="${{ github.repository }}"
echo "value=${repository##*/}" >> "$GITHUB_OUTPUT"
- uses: https://data.forgejo.org/actions/setup-node@v4
- uses: https://data.forgejo.org/actions/setup-node@v6
with:
node-version: 22
- uses: https://data.forgejo.org/actions/setup-go@v5
- uses: https://data.forgejo.org/actions/setup-go@v6
with:
go-version-file: "go.mod"

View file

@ -37,7 +37,7 @@ jobs:
container:
image: data.forgejo.org/oci/node:22-bookworm
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
with:
fetch-depth: '0'
show-progress: 'false'

View file

@ -58,10 +58,10 @@ jobs:
POSTGRESQL_EXTRA_FLAGS: -c full_page_writes=off
options: --tmpfs /bitnami/postgresql
cacher:
image: registry.redict.io/redict:7.3.5-scratch
image: registry.redict.io/redict:7.3.6-scratch
options: --tmpfs /data:noatime
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}

View file

@ -41,7 +41,7 @@ jobs:
runs-on: lxc-bookworm
if: vars.DOER != '' && vars.FORGEJO != '' && vars.TO_OWNER != '' && vars.FROM_OWNER != '' && secrets.TOKEN != ''
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- name: copy & sign
uses: https://data.forgejo.org/forgejo/forgejo-build-publish/publish@v5.4.1

View file

@ -15,7 +15,7 @@ jobs:
container:
image: 'data.forgejo.org/oci/ci:1'
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- uses: https://data.forgejo.org/actions/cache@v4
with:

View file

@ -17,7 +17,7 @@ jobs:
container:
image: 'data.forgejo.org/oci/node:22-bookworm'
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- name: event
run: |
@ -28,7 +28,7 @@ jobs:
${{ toJSON(github.event) }}
EOF
- uses: https://data.forgejo.org/actions/setup-go@v5
- uses: https://data.forgejo.org/actions/setup-go@v6
with:
go-version-file: "go.mod"
cache: false

View file

@ -28,7 +28,7 @@ jobs:
runs-on: docker
container:
image: data.forgejo.org/renovate/renovate:41.122.3
image: data.forgejo.org/renovate/renovate:41.146.0
steps:
- name: Load renovate repo cache

View file

@ -34,7 +34,7 @@ jobs:
image: 'data.forgejo.org/oci/node:22-bookworm'
options: --tmpfs /tmp:exec,noatime
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- uses: ./.forgejo/workflows-composite/setup-env
- name: install git 2.34.1 and git-lfs 3.0.2
uses: ./.forgejo/workflows-composite/install-minimum-git-version
@ -53,7 +53,7 @@ jobs:
image: 'data.forgejo.org/oci/node:22-bookworm'
options: --tmpfs /tmp:exec,noatime
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- uses: ./.forgejo/workflows-composite/setup-env
- name: install git 2.34.1 and git-lfs 3.0.2
uses: ./.forgejo/workflows-composite/install-minimum-git-version
@ -85,7 +85,7 @@ jobs:
MARIADB_DATABASE: testgitea
options: --tmpfs /var/lib/mysql:noatime
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- uses: ./.forgejo/workflows-composite/setup-env
- name: install dependencies & git >= 2.42
uses: ./.forgejo/workflows-composite/apt-install-from

View file

@ -21,7 +21,7 @@ jobs:
cat <<'EOF'
${{ toJSON(github) }}
EOF
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- uses: ./.forgejo/workflows-composite/setup-env
- run: su forgejo -c 'make deps-backend deps-tools'
- run: su forgejo -c 'make --always-make -j$(nproc) lint-backend tidy-check swagger-check lint-swagger fmt-check swagger-validate' # ensure the "go-licenses" make target runs
@ -33,7 +33,7 @@ jobs:
image: 'data.forgejo.org/oci/node:22-bookworm'
options: --tmpfs /tmp:exec,noatime
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- run: make deps-frontend
- run: make lint-frontend
- run: make checks-frontend
@ -77,7 +77,7 @@ jobs:
MINIO_ROOT_USER: 123456
MINIO_ROOT_PASSWORD: 12345678
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- uses: ./.forgejo/workflows-composite/setup-env
- name: install git >= 2.42
uses: ./.forgejo/workflows-composite/apt-install-from
@ -104,7 +104,7 @@ jobs:
image: 'data.forgejo.org/oci/playwright:latest'
options: --tmpfs /tmp:exec,noatime
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
with:
fetch-depth: 20
- uses: ./.forgejo/workflows-composite/setup-env
@ -126,7 +126,7 @@ jobs:
echo "all=1" >> "$GITHUB_OUTPUT"
- name: Get changed files
id: changed-files
uses: https://data.forgejo.org/tj-actions/changed-files@v46
uses: https://data.forgejo.org/tj-actions/changed-files@v47
with:
separator: '\n'
- run: |
@ -172,7 +172,7 @@ jobs:
image: ${{ matrix.cacher.image }}
options: ${{ matrix.cacher.options }}
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- uses: ./.forgejo/workflows-composite/setup-env
- name: install git >= 2.42
uses: ./.forgejo/workflows-composite/apt-install-from
@ -205,7 +205,7 @@ jobs:
MYSQL_EXTRA_FLAGS: --innodb-adaptive-flushing=OFF --innodb-buffer-pool-size=4G --innodb-log-buffer-size=128M --innodb-flush-log-at-trx-commit=0 --innodb-flush-log-at-timeout=30 --innodb-flush-method=nosync --innodb-fsync-threshold=1000000000 --disable-log-bin
options: --tmpfs /bitnami/mysql/data:noatime
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- uses: ./.forgejo/workflows-composite/setup-env
- name: install dependencies & git >= 2.42
uses: ./.forgejo/workflows-composite/apt-install-from
@ -233,6 +233,7 @@ jobs:
options: --tmpfs /bitnami/minio/data
ldap:
image: data.forgejo.org/oci/forgejo-test-openldap:1
options: --memory 500M
pgsql:
image: data.forgejo.org/oci/bitnami/postgresql:16
env:
@ -242,7 +243,7 @@ jobs:
POSTGRESQL_EXTRA_FLAGS: -c full_page_writes=off
options: --tmpfs /bitnami/postgresql
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- uses: ./.forgejo/workflows-composite/setup-env
- name: install dependencies & git >= 2.42
uses: ./.forgejo/workflows-composite/apt-install-from
@ -264,7 +265,7 @@ jobs:
image: 'data.forgejo.org/oci/node:22-bookworm'
options: --tmpfs /tmp:exec,noatime
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- uses: ./.forgejo/workflows-composite/setup-env
- name: install dependencies & git >= 2.42
uses: ./.forgejo/workflows-composite/apt-install-from
@ -292,7 +293,7 @@ jobs:
image: 'data.forgejo.org/oci/node:22-bookworm'
options: --tmpfs /tmp:exec,noatime
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/checkout@v5
- uses: ./.forgejo/workflows-composite/setup-env
- run: su forgejo -c 'make deps-backend deps-tools'
- run: su forgejo -c 'make security-check'

View file

@ -94,6 +94,7 @@ linters:
- all
testifylint:
disable:
- error-is-as
- go-require
exclusions:
generated: lax
@ -119,7 +120,7 @@ linters:
- errcheck
- gocyclo
- gosec
path: models/migrations/v
path: models/gitea_migrations/v
- linters:
- forbidigo
path: cmd

View file

@ -5,6 +5,7 @@ branch-find-version: 'v(?P<version>\d+\.\d+)/forgejo'
branch-to-version: '${version}.0'
branch-from-version: 'v%[1]d.%[2]d/forgejo'
tag-from-version: 'v%[1]d.%[2]d.%[3]d'
supported-release-count: 3
branch-known:
- 'v7.0/forgejo'
cleanup-line: 'sed -Ee "s/^(feat|fix):\s*//g" -e "s/^\[WIP\] //" -e "s/^WIP: //" -e "s;\[(UI|BUG|FEAT|v.*?/forgejo)\]\s*;;g"'

View file

@ -38,6 +38,10 @@ routers/.* @gusted
options/locale/.* @0ko
options/locale_next/.* @0ko
# Personal interest
# lint-locale-usage
build/lint-locale-usage/.* @fogti
models/unit/.* @fogti
services/migrations/lint-locale-usage/.* @fogti
# Personal interest
.*/webhook.* @oliverpool

View file

@ -37,17 +37,17 @@ endif
XGO_VERSION := go-1.21.x
AIR_PACKAGE ?= github.com/air-verse/air@v1 # renovate: datasource=go
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3.3.0 # renovate: datasource=go
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.8.0 # renovate: datasource=go
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.3.1 # renovate: datasource=go
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3.4.1 # renovate: datasource=go
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.9.1 # renovate: datasource=go
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.5.0 # renovate: datasource=go
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.15 # renovate: datasource=go
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.31.0 # renovate: datasource=go
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.33.1 # renovate: datasource=go
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0 # renovate: datasource=go
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1 # renovate: datasource=go
DEADCODE_PACKAGE ?= golang.org/x/tools/cmd/deadcode@v0.36.0 # renovate: datasource=go
DEADCODE_PACKAGE ?= golang.org/x/tools/cmd/deadcode@v0.38.0 # renovate: datasource=go
GOMOCK_PACKAGE ?= go.uber.org/mock/mockgen@v0.6.0 # renovate: datasource=go
RENOVATE_NPM_PACKAGE ?= renovate@41.122.3 # renovate: datasource=docker packageName=data.forgejo.org/renovate/renovate
RENOVATE_NPM_PACKAGE ?= renovate@41.146.0 # renovate: datasource=docker packageName=data.forgejo.org/renovate/renovate
# https://github.com/disposable-email-domains/disposable-email-domains/commits/main/
DISPOSABLE_EMAILS_SHA ?= 0c27e671231d27cf66370034d7f6818037416989 # renovate: ...
@ -287,14 +287,14 @@ show-version-api: verify-version
.PHONY: compute-go-test-packages
compute-go-test-packages:
ifeq ($(HAS_GO), yes)
$(eval GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list forgejo.org/models/migrations/...) $(shell $(GO) list forgejo.org/models/forgejo_migrations/...) forgejo.org/tests/integration/migration-test forgejo.org/tests forgejo.org/tests/integration forgejo.org/tests/e2e,$(shell $(GO) list ./...)))
$(eval GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list forgejo.org/models/gitea_migrations/...) $(shell $(GO) list forgejo.org/models/forgejo_migrations_legacy/...) $(shell $(GO) list forgejo.org/models/forgejo_migrations/...) forgejo.org/tests/integration/migration-test forgejo.org/tests forgejo.org/tests/integration forgejo.org/tests/e2e,$(shell $(GO) list ./...)))
endif
# Target to compute MIGRATION_PACKAGES - only runs when needed
.PHONY: compute-migration-packages
compute-migration-packages:
ifeq ($(HAS_GO), yes)
$(eval MIGRATION_PACKAGES := $(shell $(GO) list forgejo.org/models/migrations/... forgejo.org/models/forgejo_migrations/...))
$(eval MIGRATION_PACKAGES := $(shell $(GO) list forgejo.org/models/gitea_migrations/... forgejo.org/models/forgejo_migrations_legacy/... forgejo.org/models/forgejo_migrations/...))
endif
###
@ -432,7 +432,7 @@ lint: lint-frontend lint-backend
lint-fix: lint-frontend-fix lint-backend-fix
.PHONY: lint-frontend
lint-frontend: lint-js lint-css
lint-frontend: lint-js tsc lint-css
.PHONY: lint-frontend-fix
lint-frontend-fix: lint-js-fix lint-css-fix
@ -475,7 +475,7 @@ lint-locale:
.PHONY: lint-locale-usage
lint-locale-usage:
$(GO) run ./build/lint-locale-usage --allow-masked-usages-from=build/lint-locale-usage/allowed-masked-usage.txt
$(GO) run ./build/lint-locale-usage/bin --allow-masked-usages-from=build/lint-locale-usage/allowed-masked-usage.txt
.PHONY: lint-md
lint-md: node_modules
@ -514,7 +514,11 @@ lint-disposable-emails-fix:
.PHONY: security-check
security-check:
go run $(GOVULNCHECK_PACKAGE) -show color ./...
$(GO) run $(GOVULNCHECK_PACKAGE) -show color ./...
.PHONY: tsc
tsc: node_modules
npx tsc --noEmit
###
# Development and testing targets
@ -774,7 +778,7 @@ migrations.individual.mysql.test: $(GO_SOURCES) | compute-migration-packages
.PHONY: migrations.individual.sqlite.test\#%
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/migrations/$*
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/gitea_migrations/$*
.PHONY: migrations.individual.pgsql.test
migrations.individual.pgsql.test: $(GO_SOURCES) | compute-migration-packages
@ -784,7 +788,7 @@ migrations.individual.pgsql.test: $(GO_SOURCES) | compute-migration-packages
.PHONY: migrations.individual.pgsql.test\#%
migrations.individual.pgsql.test\#%: $(GO_SOURCES) generate-ini-pgsql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/migrations/$*
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/gitea_migrations/$*
.PHONY: migrations.individual.sqlite.test
migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite | compute-migration-packages
@ -794,7 +798,7 @@ migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite | compute-m
.PHONY: migrations.individual.sqlite.test\#%
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/migrations/$*
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/gitea_migrations/$*
e2e.mysql.test: $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/e2e -o e2e.mysql.test

View file

@ -130,6 +130,10 @@ A [companion blog post](https://forgejo.org/2024-07-release-v8-0/) provides addi
- [PR](https://codeberg.org/forgejo/forgejo/pulls/3334): <!--number 3334 --><!--number--><!--description Added support for the `workflow_dispatch` workflow trigger-->added support for the [`workflow_dispatch` trigger](https://forgejo.org/docs/v8.0/user/actions/#onworkflow_dispatch) in Forgejo Actions.<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/3307): <!--number 3307 --><!--number--><!--description Support [Proof Key for Code Exchange (PKCE - RFC7636)](https://www.rfc-editor.org/rfc/rfc7636) for external login using the OpenID Connect authentication source.-->support [Proof Key for Code Exchange (PKCE - RFC7636)](https://www.rfc-editor.org/rfc/rfc7636) for external login using the OpenID Connect authentication source.<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/3139): <!--number 3139 --><!--number--><!--description Allow hiding auto generated release archives-->allow hiding auto generated release archives.<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/3952): Update of Chroma from v2.13.0: to v2.14.0:
- [`1e983e7`](https://github.com/alecthomas/chroma/commit/1e983e7) lexers/cue: support CUE attributes ([#&#8203;961](https://github.com/alecthomas/chroma/issues/961))
- [`9347b55`](https://github.com/alecthomas/chroma/commit/9347b55) Add Gleam syntax highlighting ([#&#8203;959](https://github.com/alecthomas/chroma/issues/959))
- [`2580aaa`](https://github.com/alecthomas/chroma/commit/2580aaa) Add Bazel bzlmod support into Python lexer ([#&#8203;947](https://github.com/alecthomas/chroma/issues/947))
- **Bug fixes**
- [PR](https://codeberg.org/forgejo/forgejo/pulls/4732) ([backported from](https://codeberg.org/forgejo/forgejo/pulls/4715)): <!--number 4732 --><!--number--><!--description -->Show the AGit label on merged pull requests.<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/4689) ([backported from](https://codeberg.org/forgejo/forgejo/pulls/4687)): <!--number 4689 --><!--number--><!--description -->Fixed: issue state change via the API is not idempotent.<!--description-->
@ -146,6 +150,9 @@ A [companion blog post](https://forgejo.org/2024-07-release-v8-0/) provides addi
- [PR](https://codeberg.org/forgejo/forgejo/pulls/3442): <!--number 3442 --><!--number--><!--description Save updated empty comments instead of skipping the update silently, [which prevented the removal of attachments of such comments](https://codeberg.org/forgejo/forgejo/issues/3424).-->Fixed: it is not possible to remove attachments from an empty comment.<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/3430): <!--number 3430 --><!--number--><!--description Fixed a bug where the `/api/v1/repos/{owner}/{repo}/wiki` API endpoints were using a hardcoded "master" branch for the wiki, rather than the branch they really use.-->Fixed: the `/api/v1/repos/{owner}/{repo}/wiki` API endpoints is using a hardcoded "master" branch for the wiki, rather than the branch they really use.<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/3379): <!--number 3379 --><!--number--><!--description -->Fixed: using the API to search for users, the results are not paged by default an the default paging limits are not respected.<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/3952): Update of Chroma from v2.13.0: to v2.14.0:
- [`736c0ea`](https://github.com/alecthomas/chroma/commit/736c0ea) Typescript: Several fixes ([#&#8203;952](https://github.com/alecthomas/chroma/issues/952))
- [`e5c25d0`](https://github.com/alecthomas/chroma/commit/e5c25d0) Org: Keep all newlines ([#&#8203;951](https://github.com/alecthomas/chroma/issues/951))
- **Localization**
- [PR](https://codeberg.org/forgejo/forgejo/pulls/4661) ([backported from](https://codeberg.org/forgejo/forgejo/pulls/4568)): <!--number 4661 --><!--number--><!--description -->24 July updates<!--description-->
- [PR](https://codeberg.org/forgejo/forgejo/pulls/4565) ([backported from](https://codeberg.org/forgejo/forgejo/pulls/4451)): <!--number 4565 --><!--number--><!--description -->19 July updates<!--description-->

File diff suppressed because one or more lines are too long

View file

@ -74,7 +74,7 @@ func newFileCollector(fileFilter string, batchSize int) (*fileCollector, error)
co.excludePatterns = append(co.excludePatterns, regexp.MustCompile(`tests/integration/migration-test`))
co.excludePatterns = append(co.excludePatterns, regexp.MustCompile(`modules/git/tests`))
co.excludePatterns = append(co.excludePatterns, regexp.MustCompile(`models/fixtures`))
co.excludePatterns = append(co.excludePatterns, regexp.MustCompile(`models/migrations/fixtures`))
co.excludePatterns = append(co.excludePatterns, regexp.MustCompile(`models/gitea_migrations/fixtures`))
co.excludePatterns = append(co.excludePatterns, regexp.MustCompile(`services/gitdiff/testdata`))
}
@ -181,7 +181,7 @@ func parseArgs() (mainOptions map[string]string, subCmd string, subArgs []string
break
}
}
return
return mainOptions, subCmd, subArgs
}
func showUsage() {

View file

@ -23,12 +23,6 @@ themes.names.
# services/context/context.go
relativetime.
# templates/mail/issue/default.tmpl: $.locale.Tr
mail.issue.in_tree_path
# templates/package/metadata/arch.tmpl: $.locale.Tr
packages.details.license
# templates/repo/issue/view_content.tmpl: indirection via $closeTranslationKey
repo.issues.close
repo.pulls.close
@ -48,7 +42,3 @@ projects.type-3.display_name
# templates/repo/settings/webhook/link_menu.tmpl, templates/webhook/new.tmpl: repo.settings.web_hook_name_
# tests/integration/repo_archive_text_test.go
repo.settings.
# services/migrations/migrate.go: messenger calls
# ToDo: give them a unique prefix
repo.migrate.

View file

@ -0,0 +1,177 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package main
import (
"fmt"
"go/ast"
goParser "go/parser"
"go/token"
"reflect"
"slices"
"strconv"
"strings"
llu "forgejo.org/build/lint-locale-usage"
lluUnit "forgejo.org/models/unit/lint-locale-usage"
lluMigrate "forgejo.org/services/migrations/lint-locale-usage"
)
// the `Handle*File` functions follow the following calling convention:
// * `fname` is the name of the input file
// * `src` is either `nil` (then the function invokes `ReadFile` to read the file)
// or the contents of the file as {`[]byte`, or a `string`}
func HandleGoFile(handler llu.Handler, fname string, src any) error {
fset := token.NewFileSet()
node, err := goParser.ParseFile(fset, fname, src, goParser.SkipObjectResolution|goParser.ParseComments)
if err != nil {
return llu.LocatedError{
Location: fname,
Kind: "Go parser",
Err: err,
}
}
ast.Inspect(node, func(n ast.Node) bool {
// search for function calls of the form `anything.Tr(any-string-lit, ...)`
switch n2 := n.(type) {
case *ast.CallExpr:
if len(n2.Args) == 0 {
return true
}
funSel, ok := n2.Fun.(*ast.SelectorExpr)
if !ok {
return true
}
ltf, ok := handler.LocaleTrFunctions[funSel.Sel.Name]
if !ok {
return true
}
var gotUnexpectedInvoke *int
for _, argNum := range ltf {
if len(n2.Args) <= int(argNum) {
argc := len(n2.Args)
gotUnexpectedInvoke = &argc
} else {
handler.HandleGoTrArgument(fset, n2.Args[int(argNum)], "")
}
}
if gotUnexpectedInvoke != nil {
handler.OnUnexpectedInvoke(fset, funSel.Sel.NamePos, funSel.Sel.Name, *gotUnexpectedInvoke)
}
case *ast.CompositeLit:
if strings.HasSuffix(fname, "models/unit/unit.go") {
lluUnit.HandleCompositeUnit(handler, fset, n2)
}
case *ast.FuncDecl:
matchInsPrefix := handler.HandleGoCommentGroup(fset, n2.Doc, "llu:returnsTrKey")
if matchInsPrefix != nil {
results := n2.Type.Results.List
if len(results) != 1 {
handler.OnWarning(fset, n2.Type.Func, fmt.Sprintf("function %s has unexpected return type; expected single return value", n2.Name.Name))
return true
}
ast.Inspect(n2.Body, func(n ast.Node) bool {
// search for return stmts
// TODO: what about nested functions?
if ret, ok := n.(*ast.ReturnStmt); ok {
for _, res := range ret.Results {
ast.Inspect(res, func(n ast.Node) bool {
if expr, ok := n.(ast.Expr); ok {
handler.HandleGoTrArgument(fset, expr, *matchInsPrefix)
}
return true
})
}
return false
}
return true
})
}
if strings.HasSuffix(fname, "services/migrations/migrate.go") {
lluMigrate.HandleMessengerInFunc(handler, fset, n2)
}
return true
case *ast.GenDecl:
switch n2.Tok {
case token.CONST, token.VAR:
matchInsPrefix := handler.HandleGoCommentGroup(fset, n2.Doc, " llu:TrKeys")
if matchInsPrefix == nil {
return true
}
for _, spec := range n2.Specs {
// interpret all contained strings as message IDs
ast.Inspect(spec, func(n ast.Node) bool {
if argLit, ok := n.(*ast.BasicLit); ok {
handler.HandleGoTrBasicLit(fset, argLit, *matchInsPrefix)
return false
}
return true
})
}
case token.TYPE:
// modules/web/middleware/binding.go:Validate uses the convention that structs
// entries can have tags.
// In particular, `locale:$msgid` should be handled; any fields with `form:-` shouldn't.
// Problem: we don't know which structs are forms, actually.
for _, spec := range n2.Specs {
tspec := spec.(*ast.TypeSpec)
structNode, ok := tspec.Type.(*ast.StructType)
if !ok || !(strings.HasSuffix(tspec.Name.Name, "Form") ||
(tspec.Doc != nil &&
slices.ContainsFunc(tspec.Doc.List, func(c *ast.Comment) bool {
return c.Text == "// swagger:model"
}))) {
continue
}
for _, field := range structNode.Fields.List {
if field.Names == nil {
continue
}
if len(field.Names) != 1 {
handler.OnWarning(fset, field.Type.Pos(), "unsupported multiple field names")
continue
}
msgidPos := field.Names[0].NamePos
msgid := "form." + field.Names[0].Name
if field.Tag != nil && field.Tag.Kind == token.STRING {
rawTag, err := strconv.Unquote(field.Tag.Value)
if err != nil {
handler.OnWarning(fset, field.Tag.ValuePos, "invalid tag value encountered")
continue
}
tag := reflect.StructTag(rawTag)
if tag.Get("form") == "-" {
continue
}
tmp := tag.Get("locale")
if len(tmp) != 0 {
msgidPos = field.Tag.ValuePos
msgid = tmp
}
}
handler.OnMsgid(fset, msgidPos, msgid, true)
}
}
}
}
return true
})
return nil
}

View file

@ -16,6 +16,7 @@ import (
"sort"
"strings"
llu "forgejo.org/build/lint-locale-usage"
"forgejo.org/modules/container"
"forgejo.org/modules/translation/localeiter"
)
@ -23,27 +24,6 @@ import (
// this works by first gathering all valid source string IDs from `en-US` reference files
// and then checking if all used source strings are actually defined
type LocatedError struct {
Location string
Kind string
Err error
}
func (e LocatedError) Error() string {
var sb strings.Builder
sb.WriteString(e.Location)
sb.WriteString(":\t")
if e.Kind != "" {
sb.WriteString(e.Kind)
sb.WriteString(": ")
}
sb.WriteString("ERROR: ")
sb.WriteString(e.Err.Error())
return sb.String()
}
func InitLocaleTrFunctions() map[string][]uint {
ret := make(map[string][]uint)
@ -58,14 +38,6 @@ func InitLocaleTrFunctions() map[string][]uint {
return ret
}
type Handler struct {
OnMsgid func(fset *token.FileSet, pos token.Pos, msgid string)
OnMsgidPrefix func(fset *token.FileSet, pos token.Pos, msgidPrefix string, truncated bool)
OnUnexpectedInvoke func(fset *token.FileSet, pos token.Pos, funcname string, argc int)
OnWarning func(fset *token.FileSet, pos token.Pos, msg string)
LocaleTrFunctions map[string][]uint
}
type StringTrie interface {
Matches(key []string) bool
}
@ -113,7 +85,7 @@ func (m StringTrieMap) Insert(key []string) {
func ParseAllowedMaskedUsages(fname string, usedMsgids container.Set[string], allowedMaskedPrefixes StringTrieMap, chkMsgid func(msgid string) bool) error {
file, err := os.Open(fname)
if err != nil {
return LocatedError{
return llu.LocatedError{
Location: fname,
Kind: "Open",
Err: err,
@ -133,7 +105,7 @@ func ParseAllowedMaskedUsages(fname string, usedMsgids container.Set[string], al
allowedMaskedPrefixes.Insert(strings.Split(linePrefix, "."))
} else {
if !chkMsgid(line) {
return LocatedError{
return llu.LocatedError{
Location: fmt.Sprintf("%s: line %d", fname, lno),
Kind: "undefined msgid",
Err: errors.New(line),
@ -143,7 +115,7 @@ func ParseAllowedMaskedUsages(fname string, usedMsgids container.Set[string], al
}
}
if err := scanner.Err(); err != nil {
return LocatedError{
return llu.LocatedError{
Location: fname,
Kind: "Scanner",
Err: err,
@ -152,15 +124,6 @@ func ParseAllowedMaskedUsages(fname string, usedMsgids container.Set[string], al
return nil
}
// Truncating a message id prefix to the last dot
func PrepareMsgidPrefix(s string) (string, bool) {
index := strings.LastIndexByte(s, 0x2e)
if index == -1 {
return "", true
}
return s[:index], index != len(s)-1
}
func Usage() {
outp := flag.CommandLine.Output()
fmt.Fprintf(outp, "Usage of %s:\n", os.Args[0])
@ -210,6 +173,7 @@ func Usage() {
func main() {
allowMissingMsgids := false
allowUnusedMsgids := false
allowWeakMissingMsgids := true
usedMsgids := make(container.Set[string])
allowedMaskedPrefixes := make(StringTrieMap)
@ -228,6 +192,12 @@ func main() {
false,
"don't return an error code if missing message IDs are found",
)
flag.BoolVar(
&allowWeakMissingMsgids,
"allow-weak-missing-msgids",
true,
"Don't return an error code if missing 'weak' (e.g. \"form.$msgid\") message IDs are found",
)
flag.BoolVar(
&allowUnusedMsgids,
"allow-unused-msgids",
@ -289,7 +259,7 @@ func main() {
os.Exit(3)
}
handler := Handler{
handler := llu.Handler{
OnMsgidPrefix: func(fset *token.FileSet, pos token.Pos, msgidPrefix string, truncated bool) {
msgidPrefixSplit := strings.Split(msgidPrefix, ".")
if !truncated {
@ -299,8 +269,11 @@ func main() {
fmt.Printf("%s:\tmissing msgid prefix: %s\n", fset.Position(pos).String(), msgidPrefix)
}
},
OnMsgid: func(fset *token.FileSet, pos token.Pos, msgid string) {
OnMsgid: func(fset *token.FileSet, pos token.Pos, msgid string, weak bool) {
if !msgids.Contains(msgid) {
if weak && allowWeakMissingMsgids {
return
}
gotAnyMsgidError = true
fmt.Printf("%s:\tmissing msgid: %s\n", fset.Position(pos).String(), msgid)
} else {
@ -314,7 +287,7 @@ func main() {
OnWarning: func(fset *token.FileSet, pos token.Pos, msg string) {
fmt.Printf("%s:\tWARNING: %s\n", fset.Position(pos).String(), msg)
},
LocaleTrFunctions: InitLocaleTrFunctions(),
LocaleTrFunctions: llu.InitLocaleTrFunctions(),
}
if err := filepath.WalkDir(".", func(fpath string, d fs.DirEntry, err error) error {
@ -332,7 +305,7 @@ func main() {
} else if name == "bindata.go" || fpath == "modules/translation/i18n/i18n_test.go" {
// skip false positives
} else if strings.HasSuffix(name, ".go") {
onError(handler.HandleGoFile(fpath, nil))
onError(HandleGoFile(handler, fpath, nil))
} else if strings.HasSuffix(name, ".tmpl") {
if strings.HasPrefix(fpath, "tests") && strings.HasSuffix(name, ".ini.tmpl") {
// skip false positives

View file

@ -7,24 +7,26 @@ import (
"go/token"
"testing"
llu "forgejo.org/build/lint-locale-usage"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func buildHandler(ret *[]string) Handler {
return Handler{
OnMsgid: func(fset *token.FileSet, pos token.Pos, msgid string) {
func buildHandler(ret *[]string) llu.Handler {
return llu.Handler{
OnMsgid: func(fset *token.FileSet, pos token.Pos, msgid string, weak bool) {
*ret = append(*ret, msgid)
},
OnUnexpectedInvoke: func(fset *token.FileSet, pos token.Pos, funcname string, argc int) {},
LocaleTrFunctions: InitLocaleTrFunctions(),
LocaleTrFunctions: llu.InitLocaleTrFunctions(),
}
}
func HandleGoFileWrapped(t *testing.T, fname, src string) []string {
var ret []string
handler := buildHandler(&ret)
require.NoError(t, handler.HandleGoFile(fname, src))
require.NoError(t, HandleGoFile(handler, fname, src))
return ret
}

View file

@ -2,18 +2,17 @@
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package main
package lintLocaleUsage
import (
"fmt"
"go/ast"
goParser "go/parser"
"go/token"
"strconv"
"strings"
)
func (handler Handler) handleGoTrBasicLit(fset *token.FileSet, argLit *ast.BasicLit, prefix string) {
func (handler Handler) HandleGoTrBasicLit(fset *token.FileSet, argLit *ast.BasicLit, prefix string) {
if argLit.Kind == token.STRING {
// extract string content
arg, err := strconv.Unquote(argLit.Value)
@ -29,14 +28,14 @@ func (handler Handler) handleGoTrBasicLit(fset *token.FileSet, argLit *ast.Basic
}
handler.OnMsgidPrefix(fset, argLit.ValuePos, prep, trunc)
} else {
handler.OnMsgid(fset, argLit.ValuePos, arg)
handler.OnMsgid(fset, argLit.ValuePos, arg, false)
}
}
}
func (handler Handler) handleGoTrArgument(fset *token.FileSet, n ast.Expr, prefix string) {
func (handler Handler) HandleGoTrArgument(fset *token.FileSet, n ast.Expr, prefix string) {
if argLit, ok := n.(*ast.BasicLit); ok {
handler.handleGoTrBasicLit(fset, argLit, prefix)
handler.HandleGoTrBasicLit(fset, argLit, prefix)
} else if argBinExpr, ok := n.(*ast.BinaryExpr); ok {
if argBinExpr.Op != token.ADD {
// pass
@ -57,7 +56,7 @@ func (handler Handler) handleGoTrArgument(fset *token.FileSet, n ast.Expr, prefi
}
}
func (handler Handler) handleGoCommentGroup(fset *token.FileSet, cg *ast.CommentGroup, commentPrefix string) *string {
func (handler Handler) HandleGoCommentGroup(fset *token.FileSet, cg *ast.CommentGroup, commentPrefix string) *string {
if cg == nil {
return nil
}
@ -87,131 +86,3 @@ func (handler Handler) handleGoCommentGroup(fset *token.FileSet, cg *ast.Comment
return &matchInsPrefix
}
}
// the `Handle*File` functions follow the following calling convention:
// * `fname` is the name of the input file
// * `src` is either `nil` (then the function invokes `ReadFile` to read the file)
// or the contents of the file as {`[]byte`, or a `string`}
func (handler Handler) HandleGoFile(fname string, src any) error {
fset := token.NewFileSet()
node, err := goParser.ParseFile(fset, fname, src, goParser.SkipObjectResolution|goParser.ParseComments)
if err != nil {
return LocatedError{
Location: fname,
Kind: "Go parser",
Err: err,
}
}
ast.Inspect(node, func(n ast.Node) bool {
// search for function calls of the form `anything.Tr(any-string-lit, ...)`
switch n2 := n.(type) {
case *ast.CallExpr:
if len(n2.Args) == 0 {
return true
}
funSel, ok := n2.Fun.(*ast.SelectorExpr)
if !ok {
return true
}
ltf, ok := handler.LocaleTrFunctions[funSel.Sel.Name]
if !ok {
return true
}
var gotUnexpectedInvoke *int
for _, argNum := range ltf {
if len(n2.Args) <= int(argNum) {
argc := len(n2.Args)
gotUnexpectedInvoke = &argc
} else {
handler.handleGoTrArgument(fset, n2.Args[int(argNum)], "")
}
}
if gotUnexpectedInvoke != nil {
handler.OnUnexpectedInvoke(fset, funSel.Sel.NamePos, funSel.Sel.Name, *gotUnexpectedInvoke)
}
case *ast.CompositeLit:
ident, ok := n2.Type.(*ast.Ident)
if !ok {
return true
}
// special case: models/unit/unit.go
if strings.HasSuffix(fname, "unit.go") && ident.Name == "Unit" {
if len(n2.Elts) != 6 {
handler.OnWarning(fset, n2.Pos(), "unexpected initialization of 'Unit' (unexpected number of arguments)")
}
// NameKey has index 2
// invoked like '{{ctx.Locale.Tr $unit.NameKey}}'
nameKey, ok := n2.Elts[2].(*ast.BasicLit)
if !ok || nameKey.Kind != token.STRING {
handler.OnWarning(fset, n2.Elts[2].Pos(), "unexpected initialization of 'Unit' (expected string literal as NameKey)")
return true
}
// extract string content
arg, err := strconv.Unquote(nameKey.Value)
if err == nil {
// found interesting strings
handler.OnMsgid(fset, nameKey.ValuePos, arg)
}
}
case *ast.FuncDecl:
matchInsPrefix := handler.handleGoCommentGroup(fset, n2.Doc, "llu:returnsTrKey")
if matchInsPrefix == nil {
return true
}
results := n2.Type.Results.List
if len(results) != 1 {
handler.OnWarning(fset, n2.Type.Func, fmt.Sprintf("function %s has unexpected return type; expected single return value", n2.Name.Name))
return true
}
ast.Inspect(n2.Body, func(n ast.Node) bool {
// search for return stmts
// TODO: what about nested functions?
if ret, ok := n.(*ast.ReturnStmt); ok {
for _, res := range ret.Results {
ast.Inspect(res, func(n ast.Node) bool {
if expr, ok := n.(ast.Expr); ok {
handler.handleGoTrArgument(fset, expr, *matchInsPrefix)
}
return true
})
}
return false
}
return true
})
return true
case *ast.GenDecl:
if !(n2.Tok == token.CONST || n2.Tok == token.VAR) {
return true
}
matchInsPrefix := handler.handleGoCommentGroup(fset, n2.Doc, " llu:TrKeys")
if matchInsPrefix == nil {
return true
}
for _, spec := range n2.Specs {
// interpret all contained strings as message IDs
ast.Inspect(spec, func(n ast.Node) bool {
if argLit, ok := n.(*ast.BasicLit); ok {
handler.handleGoTrBasicLit(fset, argLit, *matchInsPrefix)
return false
}
return true
})
}
}
return true
})
return nil
}

View file

@ -2,7 +2,7 @@
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package main
package lintLocaleUsage
import (
"fmt"
@ -48,18 +48,29 @@ func (handler Handler) handleTemplateNode(fset *token.FileSet, node tmplParser.N
}
funcname := ""
if nodeChain, ok := nodeCommand.Args[0].(*tmplParser.ChainNode); ok {
switch nodeCommand.Args[0].Type() {
case tmplParser.NodeChain:
nodeChain := nodeCommand.Args[0].(*tmplParser.ChainNode)
if nodeIdent, ok := nodeChain.Node.(*tmplParser.IdentifierNode); ok {
if nodeIdent.Ident != "ctx" || len(nodeChain.Field) != 2 || nodeChain.Field[0] != "Locale" {
return
}
funcname = nodeChain.Field[1]
}
} else if nodeField, ok := nodeCommand.Args[0].(*tmplParser.FieldNode); ok {
case tmplParser.NodeField:
nodeField := nodeCommand.Args[0].(*tmplParser.FieldNode)
if len(nodeField.Ident) != 2 || !(nodeField.Ident[0] == "locale" || nodeField.Ident[0] == "Locale") {
return
}
funcname = nodeField.Ident[1]
case tmplParser.NodeVariable:
nodeVar := nodeCommand.Args[0].(*tmplParser.VariableNode)
if len(nodeVar.Ident) != 3 || !(nodeVar.Ident[0] == "$" && nodeVar.Ident[1] == "locale") {
return
}
funcname = nodeVar.Ident[2]
}
var gotUnexpectedInvoke *int
@ -93,7 +104,7 @@ func (handler Handler) handleTemplateMsgid(fset *token.FileSet, node tmplParser.
case tmplParser.NodeString:
nodeString := node.(*tmplParser.StringNode)
// found interesting strings
handler.OnMsgid(fset, pos, nodeString.Text)
handler.OnMsgid(fset, pos, nodeString.Text, false)
case tmplParser.NodePipe:
nodePipe := node.(*tmplParser.PipeNode)
@ -132,7 +143,7 @@ func (handler Handler) handleTemplateMsgid(fset *token.FileSet, node tmplParser.
if len(nodeCommand.Args) == 2 {
// found interesting strings
handler.OnMsgid(fset, stringPos, msgidPrefix)
handler.OnMsgid(fset, stringPos, msgidPrefix, false)
} else {
if nodeIdent.Ident == "printf" {
parts := strings.SplitN(msgidPrefix, "%", 2)

View file

@ -0,0 +1,62 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package lintLocaleUsage
import (
"go/token"
"strings"
)
type LocatedError struct {
Location string
Kind string
Err error
}
func (e LocatedError) Error() string {
var sb strings.Builder
sb.WriteString(e.Location)
sb.WriteString(":\t")
if e.Kind != "" {
sb.WriteString(e.Kind)
sb.WriteString(": ")
}
sb.WriteString("ERROR: ")
sb.WriteString(e.Err.Error())
return sb.String()
}
func InitLocaleTrFunctions() map[string][]uint {
ret := make(map[string][]uint)
f0 := []uint{0}
ret["Tr"] = f0
ret["TrString"] = f0
ret["TrHTML"] = f0
ret["TrPluralString"] = []uint{1}
ret["TrN"] = []uint{1, 2}
return ret
}
type Handler struct {
OnMsgid func(fset *token.FileSet, pos token.Pos, msgid string, weak bool)
OnMsgidPrefix func(fset *token.FileSet, pos token.Pos, msgidPrefix string, truncated bool)
OnUnexpectedInvoke func(fset *token.FileSet, pos token.Pos, funcname string, argc int)
OnWarning func(fset *token.FileSet, pos token.Pos, msg string)
LocaleTrFunctions map[string][]uint
}
// Truncating a message id prefix to the last dot
func PrepareMsgidPrefix(s string) (string, bool) {
index := strings.LastIndexByte(s, 0x2e)
if index == -1 {
return "", true
}
return s[:index], index != len(s)-1
}

View file

@ -28,6 +28,7 @@ func subcmdActionsGenRunnerToken() *cli.Command {
return &cli.Command{
Name: "generate-runner-token",
Usage: "Generate a new token for a runner to use to register with the server",
Before: noDanglingArgs,
Action: runGenerateActionsRunnerToken,
Aliases: []string{"grt"},
Flags: []cli.Flag{

View file

@ -37,6 +37,7 @@ func subcmdRepoSyncReleases() *cli.Command {
return &cli.Command{
Name: "repo-sync-releases",
Usage: "Synchronize repository releases with tags",
Before: noDanglingArgs,
Action: runRepoSyncReleases,
}
}
@ -75,6 +76,7 @@ func subcmdSendMail() *cli.Command {
return &cli.Command{
Name: "sendmail",
Usage: "Send a message to all users",
Before: noDanglingArgs,
Action: runSendMail,
Flags: []cli.Flag{
&cli.StringFlag{
@ -103,7 +105,7 @@ func idFlag() *cli.Int64Flag {
}
}
func runRepoSyncReleases(ctx context.Context, _ *cli.Command) error {
func runRepoSyncReleases(ctx context.Context, c *cli.Command) error {
ctx, cancel := installSignals(ctx)
defer cancel()

View file

@ -31,6 +31,7 @@ func microcmdAuthDelete() *cli.Command {
Name: "delete",
Usage: "Delete specific auth source",
Flags: []cli.Flag{idFlag()},
Before: noDanglingArgs,
Action: runDeleteAuth,
}
}
@ -39,6 +40,7 @@ func microcmdAuthList() *cli.Command {
return &cli.Command{
Name: "list",
Usage: "List auth sources",
Before: noDanglingArgs,
Action: runListAuth,
Flags: []cli.Flag{
&cli.IntFlag{

View file

@ -133,8 +133,9 @@ func ldapSimpleAuthCLIFlags() []cli.Flag {
func microcmdAuthAddLdapBindDn() *cli.Command {
return &cli.Command{
Name: "add-ldap",
Usage: "Add new LDAP (via Bind DN) authentication source",
Name: "add-ldap",
Usage: "Add new LDAP (via Bind DN) authentication source",
Before: noDanglingArgs,
Action: func(ctx context.Context, cli *cli.Command) error {
return newAuthService().addLdapBindDn(ctx, cli)
},
@ -144,8 +145,9 @@ func microcmdAuthAddLdapBindDn() *cli.Command {
func microcmdAuthUpdateLdapBindDn() *cli.Command {
return &cli.Command{
Name: "update-ldap",
Usage: "Update existing LDAP (via Bind DN) authentication source",
Name: "update-ldap",
Usage: "Update existing LDAP (via Bind DN) authentication source",
Before: noDanglingArgs,
Action: func(ctx context.Context, cli *cli.Command) error {
return newAuthService().updateLdapBindDn(ctx, cli)
},
@ -155,8 +157,9 @@ func microcmdAuthUpdateLdapBindDn() *cli.Command {
func microcmdAuthAddLdapSimpleAuth() *cli.Command {
return &cli.Command{
Name: "add-ldap-simple",
Usage: "Add new LDAP (simple auth) authentication source",
Name: "add-ldap-simple",
Usage: "Add new LDAP (simple auth) authentication source",
Before: noDanglingArgs,
Action: func(ctx context.Context, cli *cli.Command) error {
return newAuthService().addLdapSimpleAuth(ctx, cli)
},
@ -166,8 +169,9 @@ func microcmdAuthAddLdapSimpleAuth() *cli.Command {
func microcmdAuthUpdateLdapSimpleAuth() *cli.Command {
return &cli.Command{
Name: "update-ldap-simple",
Usage: "Update existing LDAP (simple auth) authentication source",
Name: "update-ldap-simple",
Usage: "Update existing LDAP (simple auth) authentication source",
Before: noDanglingArgs,
Action: func(ctx context.Context, cli *cli.Command) error {
return newAuthService().updateLdapSimpleAuth(ctx, cli)
},

View file

@ -136,6 +136,7 @@ func microcmdAuthAddOauth() *cli.Command {
return &cli.Command{
Name: "add-oauth",
Usage: "Add new Oauth authentication source",
Before: noDanglingArgs,
Action: newAuthService().addOauth,
Flags: oauthCLIFlags(),
}
@ -145,6 +146,7 @@ func microcmdAuthUpdateOauth() *cli.Command {
return &cli.Command{
Name: "update-oauth",
Usage: "Update existing Oauth authentication source",
Before: noDanglingArgs,
Action: newAuthService().updateOauth,
Flags: append(oauthCLIFlags()[:1], append([]cli.Flag{idFlag()}, oauthCLIFlags()[1:]...)...),
}

View file

@ -78,6 +78,7 @@ func microcmdAuthAddSMTP() *cli.Command {
return &cli.Command{
Name: "add-smtp",
Usage: "Add new SMTP authentication source",
Before: noDanglingArgs,
Action: runAddSMTP,
Flags: smtpCLIFlags(),
}
@ -87,6 +88,7 @@ func microcmdAuthUpdateSMTP() *cli.Command {
return &cli.Command{
Name: "update-smtp",
Usage: "Update existing SMTP authentication source",
Before: noDanglingArgs,
Action: runUpdateSMTP,
Flags: append(smtpCLIFlags()[:1], append([]cli.Flag{idFlag()}, smtpCLIFlags()[1:]...)...),
}

View file

@ -17,17 +17,19 @@ var (
microcmdRegenHooks = &cli.Command{
Name: "hooks",
Usage: "Regenerate git-hooks",
Before: noDanglingArgs,
Action: runRegenerateHooks,
}
microcmdRegenKeys = &cli.Command{
Name: "keys",
Usage: "Regenerate authorized_keys file",
Before: noDanglingArgs,
Action: runRegenerateKeys,
}
)
func runRegenerateHooks(ctx context.Context, _ *cli.Command) error {
func runRegenerateHooks(ctx context.Context, c *cli.Command) error {
ctx, cancel := installSignals(ctx)
defer cancel()
@ -37,7 +39,7 @@ func runRegenerateHooks(ctx context.Context, _ *cli.Command) error {
return repo_service.SyncRepositoryHooks(graceful.GetManager().ShutdownContext())
}
func runRegenerateKeys(ctx context.Context, _ *cli.Command) error {
func runRegenerateKeys(ctx context.Context, c *cli.Command) error {
ctx, cancel := installSignals(ctx)
defer cancel()

View file

@ -21,6 +21,7 @@ func microcmdUserChangePassword() *cli.Command {
return &cli.Command{
Name: "change-password",
Usage: "Change a user's password",
Before: noDanglingArgs,
Action: runChangePassword,
Flags: []cli.Flag{
&cli.StringFlag{

View file

@ -23,6 +23,7 @@ func microcmdUserCreate() *cli.Command {
return &cli.Command{
Name: "create",
Usage: "Create a new user in database",
Before: noDanglingArgs,
Action: runCreateUser,
Flags: []cli.Flag{
&cli.StringFlag{

View file

@ -40,6 +40,7 @@ func microcmdUserDelete() *cli.Command {
Usage: "Purge user, all their repositories, organizations and comments",
},
},
Before: noDanglingArgs,
Action: runDeleteUser,
}
}

View file

@ -40,6 +40,7 @@ func microcmdUserGenerateAccessToken() *cli.Command {
Usage: `Comma separated list of scopes to apply to access token, examples: "all", "public-only,read:issue", "write:repository,write:user"`,
},
},
Before: noDanglingArgs,
Action: runGenerateAccessToken,
}
}

View file

@ -18,6 +18,7 @@ func microcmdUserList() *cli.Command {
return &cli.Command{
Name: "list",
Usage: "List users",
Before: noDanglingArgs,
Action: runListUsers,
Flags: []cli.Flag{
&cli.BoolFlag{

View file

@ -17,6 +17,7 @@ func microcmdUserResetMFA() *cli.Command {
return &cli.Command{
Name: "reset-mfa",
Usage: "Remove all two-factor authentication configurations for a user",
Before: noDanglingArgs,
Action: runResetMFA,
Flags: []cli.Flag{
&cli.StringFlag{

View file

@ -31,6 +31,7 @@ func cmdCert() *cli.Command {
Usage: "Generate self-signed certificate",
Description: `Generate a self-signed X.509 certificate for a TLS server.
Outputs to 'cert.pem' and 'key.pem' and will overwrite existing files.`,
Before: noDanglingArgs,
Action: runCert,
Flags: []cli.Flag{
&cli.StringFlag{

View file

@ -12,6 +12,7 @@ import (
"io"
"os"
"os/signal"
"slices"
"strings"
"syscall"
@ -40,6 +41,19 @@ func argsSet(c *cli.Command, args ...string) error {
return nil
}
// When a CLI command is intended to be used only with flags and no other arbitrary args, noDanglingArgs will validate
// the end-user's usage.
func noDanglingArgs(ctx context.Context, c *cli.Command) (context.Context, error) {
if c.Args().Len() != 0 {
args := c.Args().Slice()
if slices.Contains(args, "false") {
println("Hint: boolean false must be specified as a single arg, eg. '--restricted=false', not '--restricted false'")
}
return nil, fmt.Errorf("unexpected arguments: %s", strings.Join(c.Args().Slice(), ", "))
}
return nil, nil
}
// confirm waits for user input which confirms an action
func confirm() (bool, error) {
var response string
@ -135,3 +149,18 @@ func PrepareConsoleLoggerLevel(defaultLevel log.Level) func(ctx context.Context,
return ctx, nil
}
}
func multipleBefore(beforeFuncs ...cli.BeforeFunc) cli.BeforeFunc {
return func(ctx context.Context, cli *cli.Command) (context.Context, error) {
for _, beforeFunc := range beforeFuncs {
bctx, err := beforeFunc(ctx, cli)
if err != nil {
return bctx, err
}
if bctx != nil {
ctx = bctx
}
}
return ctx, nil
}
}

View file

@ -6,6 +6,8 @@ package cmd
import (
"context"
"fmt"
"image"
"io"
golog "log"
"os"
"path/filepath"
@ -13,13 +15,17 @@ import (
"text/tabwriter"
"forgejo.org/models/db"
"forgejo.org/models/migrations"
migrate_base "forgejo.org/models/migrations/base"
"forgejo.org/models/gitea_migrations"
migrate_base "forgejo.org/models/gitea_migrations/base"
repo_model "forgejo.org/models/repo"
user_model "forgejo.org/models/user"
"forgejo.org/modules/container"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
"forgejo.org/modules/storage"
"forgejo.org/services/doctor"
exif_terminator "code.superseriousbusiness.org/exif-terminator"
"github.com/urfave/cli/v3"
)
@ -34,6 +40,7 @@ func cmdDoctor() *cli.Command {
cmdDoctorCheck(),
cmdRecreateTable(),
cmdDoctorConvert(),
cmdAvatarStripExif(),
},
}
}
@ -43,6 +50,7 @@ func cmdDoctorCheck() *cli.Command {
Name: "check",
Usage: "Diagnose and optionally fix problems",
Description: "A command to diagnose problems with the current Forgejo instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
Before: noDanglingArgs,
Action: runDoctorCheck,
Flags: []cli.Flag{
&cli.BoolFlag{
@ -98,6 +106,15 @@ You should back-up your database before doing this and ensure that your database
}
}
func cmdAvatarStripExif() *cli.Command {
return &cli.Command{
Name: "avatar-strip-exif",
Usage: "Strip EXIF metadata from all images in the avatar storage",
Before: noDanglingArgs,
Action: runAvatarStripExif,
}
}
func runRecreateTable(stdCtx context.Context, ctx *cli.Command) error {
stdCtx, cancel := installSignals(stdCtx)
defer cancel()
@ -142,7 +159,7 @@ func runRecreateTable(stdCtx context.Context, ctx *cli.Command) error {
return err
}
if err := migrations.EnsureUpToDate(engine); err != nil {
if err := gitea_migrations.EnsureUpToDate(engine); err != nil {
return err
}
@ -230,3 +247,78 @@ func runDoctorCheck(stdCtx context.Context, ctx *cli.Command) error {
}
return doctor.RunChecks(stdCtx, colorize, ctx.Bool("fix"), checks)
}
func runAvatarStripExif(ctx context.Context, c *cli.Command) error {
ctx, cancel := installSignals(ctx)
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
if err := storage.Init(); err != nil {
return err
}
type HasCustomAvatarRelativePath interface {
CustomAvatarRelativePath() string
}
doExifStrip := func(obj HasCustomAvatarRelativePath, name string, target_storage storage.ObjectStorage) error {
if obj.CustomAvatarRelativePath() == "" {
return nil
}
log.Info("Stripping avatar for %s...", name)
avatarFile, err := target_storage.Open(obj.CustomAvatarRelativePath())
if err != nil {
return fmt.Errorf("storage.Avatars.Open: %w", err)
}
_, imgType, err := image.DecodeConfig(avatarFile)
if err != nil {
return fmt.Errorf("image.DecodeConfig: %w", err)
}
// reset io.Reader for exif termination scan
_, err = avatarFile.Seek(0, io.SeekStart)
if err != nil {
return fmt.Errorf("avatarFile.Seek: %w", err)
}
cleanedData, err := exif_terminator.Terminate(avatarFile, imgType)
if err != nil && strings.Contains(err.Error(), "cannot be processed") {
// expected error for an image type that isn't supported by exif_terminator
log.Info("... image type %s is not supported by exif_terminator, skipping.", imgType)
return nil
} else if err != nil {
return fmt.Errorf("error cleaning exif data: %w", err)
}
if err := storage.SaveFrom(target_storage, obj.CustomAvatarRelativePath(), func(w io.Writer) error {
_, err := io.Copy(w, cleanedData)
return err
}); err != nil {
return fmt.Errorf("Failed to create dir %s: %w", obj.CustomAvatarRelativePath(), err)
}
log.Info("... completed %s.", name)
return nil
}
err := db.Iterate(ctx, nil, func(ctx context.Context, user *user_model.User) error {
return doExifStrip(user, fmt.Sprintf("user %s", user.Name), storage.Avatars)
})
if err != nil {
return err
}
err = db.Iterate(ctx, nil, func(ctx context.Context, repo *repo_model.Repository) error {
return doExifStrip(repo, fmt.Sprintf("repo %s", repo.Name), storage.RepoAvatars)
})
if err != nil {
return err
}
return nil
}

View file

@ -20,6 +20,7 @@ func cmdDoctorConvert() *cli.Command {
Name: "convert",
Usage: "Convert the database",
Description: "A command to convert an existing MySQL database from utf8 to utf8mb4",
Before: noDanglingArgs,
Action: runDoctorConvert,
}
}

View file

@ -164,6 +164,7 @@ func cmdDump() *cli.Command {
Usage: "Dump Forgejo files and database",
Description: `Dump compresses all related files and database into zip file.
It can be used for backup and capture Forgejo server image to send to maintainer`,
Before: noDanglingArgs,
Action: runDump,
Flags: []cli.Flag{
&cli.StringFlag{

View file

@ -28,6 +28,7 @@ func cmdDumpRepository() *cli.Command {
Name: "dump-repo",
Usage: "Dump the repository from git/github/gitea/gitlab",
Description: "This is a command for dumping the repository data.",
Before: noDanglingArgs,
Action: runDumpRepository,
Flags: []cli.Flag{
&cli.StringFlag{

View file

@ -42,6 +42,7 @@ func microcmdGenerateInternalToken() *cli.Command {
return &cli.Command{
Name: "INTERNAL_TOKEN",
Usage: "Generate a new INTERNAL_TOKEN",
Before: noDanglingArgs,
Action: runGenerateInternalToken,
}
}
@ -51,6 +52,7 @@ func microcmdGenerateLfsJwtSecret() *cli.Command {
Name: "JWT_SECRET",
Aliases: []string{"LFS_JWT_SECRET"},
Usage: "Generate a new JWT_SECRET",
Before: noDanglingArgs,
Action: runGenerateLfsJwtSecret,
}
}
@ -59,6 +61,7 @@ func microcmdGenerateSecretKey() *cli.Command {
return &cli.Command{
Name: "SECRET_KEY",
Usage: "Generate a new SECRET_KEY",
Before: noDanglingArgs,
Action: runGenerateSecretKey,
}
}

View file

@ -21,7 +21,7 @@ func cmdKeys() *cli.Command {
Name: "keys",
Usage: "(internal) Should only be called by SSH server",
Description: "Queries the Forgejo database to get the authorized command for a given ssh key fingerprint",
Before: PrepareConsoleLoggerLevel(log.FATAL),
Before: multipleBefore(noDanglingArgs, PrepareConsoleLoggerLevel(log.FATAL)),
Action: runKeys,
Flags: []cli.Flag{
&cli.StringFlag{

View file

@ -39,6 +39,7 @@ func subcmdShutdown() *cli.Command {
Name: "debug",
},
},
Before: noDanglingArgs,
Action: runShutdown,
}
}
@ -52,6 +53,7 @@ func subcmdRestart() *cli.Command {
Name: "debug",
},
},
Before: noDanglingArgs,
Action: runRestart,
}
}
@ -65,6 +67,7 @@ func subcmdReloadTemplates() *cli.Command {
Name: "debug",
},
},
Before: noDanglingArgs,
Action: runReloadTemplates,
}
}
@ -73,6 +76,7 @@ func subcmdFlushQueues() *cli.Command {
return &cli.Command{
Name: "flush-queues",
Usage: "Flush queues in the running process",
Before: noDanglingArgs,
Action: runFlushQueues,
Flags: []cli.Flag{
&cli.DurationFlag{
@ -95,6 +99,7 @@ func subCmdProcesses() *cli.Command {
return &cli.Command{
Name: "processes",
Usage: "Display running processes within the current process",
Before: noDanglingArgs,
Action: runProcesses,
Flags: []cli.Flag{
&cli.BoolFlag{

View file

@ -77,6 +77,7 @@ func subcmdLogging() *cli.Command {
Name: "debug",
},
},
Before: noDanglingArgs,
Action: runPauseLogging,
}, {
Name: "resume",
@ -86,6 +87,7 @@ func subcmdLogging() *cli.Command {
Name: "debug",
},
},
Before: noDanglingArgs,
Action: runResumeLogging,
}, {
Name: "release-and-reopen",
@ -95,6 +97,7 @@ func subcmdLogging() *cli.Command {
Name: "debug",
},
},
Before: noDanglingArgs,
Action: runReleaseReopenLogging,
}, {
Name: "remove",
@ -156,6 +159,7 @@ func subcmdLogging() *cli.Command {
Usage: "Compression level to use",
},
}...),
Before: noDanglingArgs,
Action: runAddFileLogger,
}, {
Name: "conn",
@ -182,6 +186,7 @@ func subcmdLogging() *cli.Command {
Usage: "Host address and port to connect to (defaults to :7020)",
},
}...),
Before: noDanglingArgs,
Action: runAddConnLogger,
},
},
@ -197,6 +202,7 @@ func subcmdLogging() *cli.Command {
Usage: "Switch off SQL logging",
},
},
Before: noDanglingArgs,
Action: runSetLogSQL,
},
},

View file

@ -7,7 +7,7 @@ import (
"context"
"forgejo.org/models/db"
"forgejo.org/models/migrations"
"forgejo.org/models/gitea_migrations"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
@ -20,6 +20,7 @@ func cmdMigrate() *cli.Command {
Name: "migrate",
Usage: "Migrate the database",
Description: "This is a command for migrating the database, so that you can run 'forgejo admin user create' before starting the server.",
Before: noDanglingArgs,
Action: runMigrate,
}
}
@ -43,7 +44,7 @@ func runMigrate(stdCtx context.Context, ctx *cli.Command) error {
if err != nil {
return err
}
return migrations.Migrate(masterEngine)
return gitea_migrations.Migrate(masterEngine)
}); err != nil {
log.Fatal("Failed to initialize ORM engine: %v", err)
return err

View file

@ -13,7 +13,7 @@ import (
actions_model "forgejo.org/models/actions"
"forgejo.org/models/db"
git_model "forgejo.org/models/git"
"forgejo.org/models/migrations"
"forgejo.org/models/gitea_migrations"
packages_model "forgejo.org/models/packages"
repo_model "forgejo.org/models/repo"
user_model "forgejo.org/models/user"
@ -32,6 +32,7 @@ func cmdMigrateStorage() *cli.Command {
Name: "migrate-storage",
Usage: "Migrate the storage",
Description: "Copies stored files from storage configured in app.ini to parameter-configured storage",
Before: noDanglingArgs,
Action: runMigrateStorage,
Flags: []cli.Flag{
&cli.StringFlag{
@ -199,7 +200,7 @@ func runMigrateStorage(stdCtx context.Context, ctx *cli.Command) error {
log.Info("Configuration file: %s", setting.CustomConf)
if err := db.InitEngineWithMigration(context.Background(), func(e db.Engine) error {
return migrations.Migrate(e.(*xorm.Engine))
return gitea_migrations.Migrate(e.(*xorm.Engine))
}); err != nil {
log.Fatal("Failed to initialize ORM engine: %v", err)
return err

View file

@ -19,6 +19,7 @@ func cmdRestoreRepository() *cli.Command {
Name: "restore-repo",
Usage: "Restore the repository from disk",
Description: "This is a command for restoring the repository data.",
Before: noDanglingArgs,
Action: runRestoreRepository,
Flags: []cli.Flag{
&cli.StringFlag{

View file

@ -39,7 +39,7 @@ func cmdWeb() *cli.Command {
Usage: "Start the Forgejo web server",
Description: `The Forgejo web server is the only thing you need to run,
and it takes care of all the other things for you`,
Before: PrepareConsoleLoggerLevel(log.INFO),
Before: multipleBefore(noDanglingArgs, PrepareConsoleLoggerLevel(log.INFO)),
Action: runWeb,
Flags: []cli.Flag{
&cli.StringFlag{

View file

@ -8,8 +8,8 @@ PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}: '
# Those must be explicitly required and are excluded from the full list of packages because they
# would interfere with the testing fixtures.
#
excluded+='forgejo.org/models/migrations|' # must be run before database specific tests
excluded+='forgejo.org/models/forgejo_migrations|' # must be run before database specific tests
excluded+='forgejo.org/models/gitea_migrations|' # must be run before database specific tests
excluded+='forgejo.org/models/forgejo_migrations_legacy|' # must be run before database specific tests
excluded+='forgejo.org/tests/integration/migration-test|' # must be run before database specific tests
excluded+='forgejo.org/tests|' # only tests, no coverage to get there
excluded+='forgejo.org/tests/e2e|' # JavaScript is not in scope here and if it adds coverage it should not be counted

View file

@ -12,10 +12,10 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; These values are environment-dependent but form the basis of a lot of values. They will be
;; reported as part of the default configuration when running `gitea help` or on start-up. The order they are emitted there is slightly different but we will list them here in the order they are set-up.
;; reported as part of the default configuration when running `forgejo help` or on start-up. The order they are emitted there is slightly different but we will list them here in the order they are set-up.
;;
;; - _`AppPath`_: This is the absolute path of the running gitea binary.
;; - _`AppWorkPath`_: This refers to "working path" of the `gitea` binary. It is determined by using the first set thing in the following hierarchy:
;; - _`AppPath`_: This is the absolute path of the running Forgejo binary.
;; - _`AppWorkPath`_: This refers to "working path" of the `forgejo` binary. It is determined by using the first set thing in the following hierarchy:
;; - The "WORK_PATH" option in "app.ini" file
;; - The `--work-path` flag passed to the binary
;; - The environment variable `$GITEA_WORK_DIR`
@ -54,7 +54,7 @@ APP_NAME = ; Forgejo: Beyond coding. We Forge.
RUN_USER = ; git
;;
;; Application run mode, affects performance and debugging: "dev" or "prod", default is "prod"
;; Mode "dev" makes Gitea easier to develop and debug, values other than "dev" are treated as "prod" which is for production use.
;; Mode "dev" makes Forgejo easier to develop and debug, values other than "dev" are treated as "prod" which is for production use.
;RUN_MODE = prod
;;
;; The working directory, see the comment of AppWorkPath above
@ -127,7 +127,7 @@ RUN_USER = ; git
;; Permission for unix socket
;UNIX_SOCKET_PERMISSION = 666
;;
;; Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service. In
;; Local (DMZ) URL for Forgejo workers (such as SSH update) accessing web service. In
;; most cases you do not need to change the default value. Alter it only if
;; your SSH server node is not the same as HTTP node. For different protocol, the default
;; values are different. If `PROTOCOL` is `http+unix`, the default value is `http://unix/`.
@ -169,11 +169,11 @@ RUN_USER = ; git
;; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
;SSH_ROOT_PATH =
;;
;; Gitea will create a authorized_keys file by default when it is not using the internal ssh server
;; Forgejo will create a authorized_keys file by default when it is not using the internal ssh server
;; If you intend to use the AuthorizedKeysCommand functionality then you should turn this off.
;SSH_CREATE_AUTHORIZED_KEYS_FILE = true
;;
;; Gitea will create a authorized_principals file by default when it is not using the internal ssh server
;; Forgejo will create a authorized_principals file by default when it is not using the internal ssh server
;; If you intend to use the AuthorizedPrincipalsCommand functionality then you should turn this off.
;SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE = true
;;
@ -198,7 +198,7 @@ RUN_USER = ; git
;; default is the system temporary directory.
;SSH_KEY_TEST_PATH =
;;
;; Use `ssh-keygen` to parse public SSH keys. The value is passed to the shell. By default, Gitea does the parsing itself.
;; Use `ssh-keygen` to parse public SSH keys. The value is passed to the shell. By default, Forgejo does the parsing itself.
;SSH_KEYGEN_PATH =
;;
;; Enable SSH Authorized Key Backup when rewriting all keys, default is false
@ -220,9 +220,9 @@ RUN_USER = ; git
;; E.g."ssh-<algorithm> <key>". or "ssh-<algorithm> <key1>, ssh-<algorithm> <key2>".
;; For more information see "TrustedUserCAKeys" in the sshd config manpages.
;SSH_TRUSTED_USER_CA_KEYS =
;; Absolute path of the `TrustedUserCaKeys` file gitea will manage.
;; Absolute path of the `TrustedUserCaKeys` file Forgejo will manage.
;; Default this `RUN_USER`/.ssh/gitea-trusted-user-ca-keys.pem
;; If you're running your own ssh server and you want to use the gitea managed file you'll also need to modify your
;; If you're running your own ssh server and you want to use the Forgejo managed file you'll also need to modify your
;; sshd_config to point to this file. The official docker image will automatically work without further configuration.
;SSH_TRUSTED_USER_CA_KEYS_FILENAME =
;;
@ -277,7 +277,7 @@ RUN_USER = ; git
;; Manual TLS settings: (Only applicable if ENABLE_ACME=false)
;;
;; Generate steps:
;; $ ./gitea cert -ca=true -duration=8760h0m0s -host=myhost.example.com
;; $ ./forgejo cert -ca=true -duration=8760h0m0s -host=myhost.example.com
;;
;; Or from a .pfx file exported from the Windows certificate store (do
;; not forget to export the private key):
@ -288,7 +288,7 @@ RUN_USER = ; git
;KEY_FILE = https/key.pem
;;
;; Root directory containing templates and static files.
;; default is the path where Gitea is executed
;; default is the path where Forgejo is executed
;STATIC_ROOT_PATH = ; Will default to the built-in value _`StaticRootPath`_
;;
;; Default path for App data
@ -302,7 +302,7 @@ RUN_USER = ; git
;; For "serve" command it dumps to disk at PPROF_DATA_PATH as (cpuprofile|memprofile)_<username>_<temporary id>
;ENABLE_PPROF = false
;;
;; PPROF_DATA_PATH, use an absolute path when you start gitea as service
;; PPROF_DATA_PATH, use an absolute path when you start Forgejo as service
;PPROF_DATA_PATH = data/tmp/pprof ; Path is relative to _`AppWorkPath`_
;;
;; Landing page, can be "home", "explore", "organizations", "login", or any URL such as "/org/repo" or even "https://anotherwebsite.com"
@ -374,7 +374,7 @@ DB_TYPE = sqlite3
;USER = root
;PASSWD = ;Use PASSWD = `your password` for quoting if you use special characters in the password.
;SSL_MODE = false ; either "false" (default), "true", or "skip-verify"
;CHARSET_COLLATION = ; Empty as default, Gitea will try to find a case-sensitive collation. Don't change it unless you clearly know what you need.
;CHARSET_COLLATION = ; Empty as default, Forgejo will try to find a case-sensitive collation. Don't change it unless you clearly know what you need.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
@ -440,7 +440,7 @@ SECRET_KEY =
;; This key is VERY IMPORTANT. If you lose it, the data encrypted by it (like 2FA secret) can't be decrypted anymore.
;SECRET_KEY_URI = file:/etc/gitea/secret_key
;;
;; Secret used to validate communication within Gitea binary.
;; Secret used to validate communication within Forgejo binary.
INTERNAL_TOKEN =
;;
;; Alternative location to specify internal token, instead of this file; you cannot specify both this and INTERNAL_TOKEN, and must pick one
@ -474,9 +474,9 @@ INTERNAL_TOKEN =
;;
;; Set to false to allow users with git hook privileges to create custom git hooks.
;; Custom git hooks can be used to perform arbitrary code execution on the host operating system.
;; This enables the users to access and modify this config file and the Gitea database and interrupt the Gitea service.
;; By modifying the Gitea database, users can gain Gitea administrator privileges.
;; It also enables them to access other resources available to the user on the operating system that is running the Gitea instance and perform arbitrary actions in the name of the Gitea OS user.
;; This enables the users to access and modify this config file and the Forgejo database and interrupt the Forgejo service.
;; By modifying the Forgejo database, users can gain Forgejo administrator privileges.
;; It also enables them to access other resources available to the user on the operating system that is running the Forgejo instance and perform arbitrary actions in the name of the Forgejo OS user.
;; WARNING: This maybe harmful to you website or your operating system.
;; WARNING: Setting this to true does not change existing hooks in git repos; adjust it before if necessary.
;DISABLE_GIT_HOOKS = true
@ -484,7 +484,7 @@ INTERNAL_TOKEN =
;; Set to true to disable webhooks feature.
;DISABLE_WEBHOOKS = false
;;
;; Set to false to allow pushes to gitea repositories despite having an incomplete environment - NOT RECOMMENDED
;; Set to false to allow pushes to Forgejo repositories despite having an incomplete environment - NOT RECOMMENDED
;ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET = true
;;
;;Comma separated list of character classes required to pass minimum complexity.
@ -545,7 +545,7 @@ ENABLED = true
;; The file must contain a RSA or ECDSA private key in the PKCS8 format. If no key exists a 4096 bit key will be created for you.
;JWT_SIGNING_PRIVATE_KEY_FILE = jwt/private.pem
;;
;; OAuth2 authentication secret for access and refresh tokens, change this yourself to a unique string. CLI generate option is helpful in this case. https://docs.gitea.io/en-us/command-line/#generate
;; OAuth2 authentication secret for access and refresh tokens, change this yourself to a unique string. CLI generate option is helpful in this case. https://forgejo.org/docs/latest/admin/command-line/#generate-secret
;; This setting is only needed if JWT_SIGNING_ALGORITHM is set to HS256, HS384 or HS512.
;JWT_SECRET =
;;
@ -670,7 +670,7 @@ LEVEL = Info
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; The path of git executable. If empty, Gitea searches through the PATH environment.
;; The path of git executable. If empty, Forgejo searches through the PATH environment.
;PATH =
;;
;; The HOME directory for Git
@ -755,17 +755,17 @@ LEVEL = Info
;; Whether a new user needs to be confirmed manually after registration. (Requires `REGISTER_EMAIL_CONFIRM` to be disabled.)
;REGISTER_MANUAL_CONFIRM = false
;;
;; List of domain names that are allowed to be used to register on a Gitea instance, wildcard is supported
;; eg: gitea.io,example.com,*.mydomain.com
;; List of domain names that are allowed to be used to register on a Forgejo instance, wildcard is supported
;; eg: forgejo.org,example.com,*.mydomain.com
;EMAIL_DOMAIN_ALLOWLIST =
;;
;; Comma-separated list of domain names that are not allowed to be used to register on a Gitea instance, wildcard is supported
;; Comma-separated list of domain names that are not allowed to be used to register on a Forgejo instance, wildcard is supported
;EMAIL_DOMAIN_BLOCKLIST =
;;
;; Disallow registration, only allow admins to create accounts.
;DISABLE_REGISTRATION = false
;;
;; Allow registration only using gitea itself, it works only when DISABLE_REGISTRATION is false
;; Allow registration only using Forgejo itself, it works only when DISABLE_REGISTRATION is false
;ALLOW_ONLY_INTERNAL_REGISTRATION = false
;;
;; Allow registration only using third-party services, it works only when DISABLE_REGISTRATION is false
@ -777,7 +777,7 @@ LEVEL = Info
;; Mail notification
;ENABLE_NOTIFY_MAIL = false
;;
;; This setting enables gitea to be signed in with HTTP BASIC Authentication using the user's password
;; This setting enables Forgejo to be signed in with HTTP BASIC Authentication using the user's password
;; If you set this to false you will not be able to access the tokens endpoints on the API with your password
;; Please note that setting this to false will not disable OAuth Basic or Basic authentication using a token
;ENABLE_BASIC_AUTHENTICATION = true
@ -1012,7 +1012,7 @@ LEVEL = Info
;; Close issues as long as a commit on any branch marks it as fixed
;DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH = false
;;
;; Allow users to push local repositories to Gitea and have them automatically created for a user or an org
;; Allow users to push local repositories to Forgejo and have them automatically created for a user or an org
;ENABLE_PUSH_CREATE_USER = false
;ENABLE_PUSH_CREATE_ORG = false
;;
@ -1076,7 +1076,7 @@ LEVEL = Info
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Path for local repository copy. Defaults to `tmp/local-repo` (content gets deleted on gitea restart)
;; Path for local repository copy. Defaults to `tmp/local-repo` (content gets deleted on Forgejo restart)
;LOCAL_COPY_PATH = tmp/local-repo
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -1088,7 +1088,7 @@ LEVEL = Info
;; Whether repository file uploads are enabled. Defaults to `true`
;ENABLED = true
;;
;; Path for uploads. Defaults to `data/tmp/uploads` (content gets deleted on gitea restart)
;; Path for uploads. Defaults to `data/tmp/uploads` (content gets deleted on Forgejo restart)
;TEMP_PATH = data/tmp/uploads
;;
;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
@ -1187,7 +1187,7 @@ LEVEL = Info
;; Sets the default trust model for repositories. Options are: collaborator, committer, collaboratorcommitter
;DEFAULT_TRUST_MODEL = collaborator
;;
;; Determines when gitea should sign the initial commit when creating a repository
;; Determines when Forgejo should sign the initial commit when creating a repository
;; Either:
;; - never
;; - pubkey: only sign if the user has a pubkey
@ -1301,7 +1301,7 @@ LEVEL = Info
;; Whether the email of the user should be shown in the Explore Users page
;SHOW_USER_EMAIL = true
;;
;; Set the default theme for the Gitea install
;; Set the default theme for the Forgejo install
;DEFAULT_THEME = forgejo-auto
;;
;; All available themes. Allow users select personalized themes regardless of the value of `DEFAULT_THEME`.
@ -1338,10 +1338,6 @@ LEVEL = Info
;; Change the sort type of the explore pages.
;; Default is "recentupdate", but you also have "alphabetically", "reverselastlogin", "newest", "oldest".
;EXPLORE_PAGING_DEFAULT_SORT = recentupdate
;;
;; The tense all timestamps should be rendered in. Possible values are `absolute` time (i.e. 1970-01-01, 11:59) and `mixed`.
;; `mixed` means most timestamps are rendered in relative time (i.e. 2 days ago).
;PREFERRED_TIMESTAMP_TENSE = mixed
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -1710,10 +1706,10 @@ LEVEL = Info
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; NOTICE: this section is for Gitea 1.18 and later. If you are using Gitea 1.17 or older,
;; NOTICE: this section is for Forgejo 1.18 and later. If you are using Forgejo 1.17 or older,
;; please refer to
;; https://github.com/go-gitea/gitea/blob/release/v1.17/custom/conf/app.example.ini
;; https://github.com/go-gitea/gitea/blob/release/v1.17/docs/content/doc/advanced/config-cheat-sheet.en-us.md
;; https://codeberg.org/forgejo/forgejo/src/commit/8769df117d6cc2f4ab00d6e1d54ef4241d063f11/custom/conf/app.example.ini
;; https://codeberg.org/forgejo/forgejo/src/commit/8769df117d6cc2f4ab00d6e1d54ef4241d063f11/docs/content/doc/advanced/config-cheat-sheet.en-us.md
;;
;ENABLED = false
;;
@ -1766,7 +1762,7 @@ LEVEL = Info
;; Sometimes it is helpful to use a different address on the envelope. Set this to use ENVELOPE_FROM as the from on the envelope. Set to `<>` to send an empty address.
;ENVELOPE_FROM =
;;
;; If gitea sends mails on behave of users, it will just use the name also displayed in the WebUI. If you want e.g. `Mister X (by CodeIt) <gitea@codeit.net>`,
;; If Forgejo sends mails on behave of users, it will just use the name also displayed in the WebUI. If you want e.g. `John Doe (by AppName) <johndoe@example.com>`,
;; set it to `{{ .DisplayName }} (by {{ .AppName }})`. Available Variables: `.DisplayName`, `.AppName` and `.Domain`.
;FROM_DISPLAY_NAME_FORMAT = {{ .DisplayName }}
;;
@ -1927,7 +1923,7 @@ LEVEL = Info
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; How Gitea deals with missing repository avatars
;; How Forgejo deals with missing repository avatars
;; none = no avatar will be displayed; random = random avatar will be displayed; image = default image will be used
;REPOSITORY_AVATAR_FALLBACK = none
;REPOSITORY_AVATAR_FALLBACK_IMAGE = /img/repo_default.png
@ -2045,7 +2041,7 @@ LEVEL = Info
;;
;; Setting this to true will enable all cron tasks periodically with default settings.
;ENABLED = false
;; Setting this to true will run all enabled cron tasks when Gitea starts.
;; Setting this to true will run all enabled cron tasks when Forgejo starts.
;RUN_AT_START = false
;;
;; Note: ``SCHEDULE`` accept formats
@ -2085,7 +2081,7 @@ LEVEL = Info
;SCHEDULE = @every 10m
;; Enable running Update mirrors task periodically.
;ENABLED = true
;; Run Update mirrors task when Gitea starts.
;; Run Update mirrors task when Forgejo starts.
;RUN_AT_START = false
;; Notice if not success
;NOTICE_ON_SUCCESS = false
@ -2106,7 +2102,7 @@ LEVEL = Info
;SCHEDULE = @midnight
;; Enable running Repository health check task periodically.
;ENABLED = true
;; Run Repository health check task when Gitea starts.
;; Run Repository health check task when Forgejo starts.
;RUN_AT_START = false
;; Notice if not success
;NOTICE_ON_SUCCESS = false
@ -2124,7 +2120,7 @@ LEVEL = Info
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Enable running check repository statistics task periodically.
;ENABLED = true
;; Run check repository statistics task when Gitea starts.
;; Run check repository statistics task when Forgejo starts.
;RUN_AT_START = true
;; Notice if not success
;NOTICE_ON_SUCCESS = false
@ -2279,7 +2275,7 @@ LEVEL = Info
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Update the '.ssh/authorized_keys' file with Gitea SSH keys
;; Update the '.ssh/authorized_keys' file with Forgejo SSH keys
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;[cron.resync_all_sshkeys]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -2352,7 +2348,7 @@ LEVEL = Info
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Check for new Gitea versions
;; Check for new Forgejo versions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;[cron.update_checker]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -2453,7 +2449,7 @@ LEVEL = Info
;[other]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Show version information about Gitea and Go in the footer
;; Show version information about Forgejo and Go in the footer
;SHOW_FOOTER_VERSION = true
;; Show template execution time in the footer
;SHOW_FOOTER_TEMPLATE_LOAD_TIME = true
@ -2700,7 +2696,7 @@ LEVEL = Info
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; settings for Gitea's LFS client (eg: mirroring an upstream lfs endpoint)
;; settings for Forgejo's LFS client (eg: mirroring an upstream lfs endpoint)
;;
;[lfs_client]
;; Limit the number of pointers in each batch request to this number
@ -2786,6 +2782,10 @@ LEVEL = Info
;SKIP_WORKFLOW_STRINGS = [skip ci],[ci skip],[no ci],[skip actions],[actions skip]
;; Limit on inputs for manual / workflow_dispatch triggers, default is 10
;LIMIT_DISPATCH_INPUTS = 10
;; Support queuing workflow jobs, by setting `concurrency.group` & `concurrency.cancel-in-progress: false`, can increase
;; server and database workload due to more complex database queries and more frequent server task querying; this
;; feature can be disabled to reduce performance impact
;CONCURRENCY_GROUP_QUEUE_ENABLED = true
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -58,7 +58,14 @@ export default tseslint.config(
sourceType: 'module',
},
rules: {
'@typescript-eslint/no-unused-vars': 'off', // TODO: enable this rule again
'@typescript-eslint/no-unused-vars': [2, {
args: 'all',
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
ignoreRestSiblings: false,
}],
'@eslint-community/eslint-comments/disable-enable-pair': [2],
'@eslint-community/eslint-comments/no-aggregating-enable': [2],
@ -539,14 +546,7 @@ export default tseslint.config(
'no-unused-labels': [2],
'no-unused-private-class-members': [2],
'no-unused-vars': [2, {
args: 'all',
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
ignoreRestSiblings: false,
}],
'no-unused-vars': [0],
'no-use-before-define': [2, {
functions: false,
@ -703,7 +703,6 @@ export default tseslint.config(
'sonarjs/no-inverted-boolean-check': [2],
'sonarjs/no-nested-switch': [0],
'sonarjs/no-nested-template-literals': [0],
'sonarjs/no-one-iteration-loop': [2],
'sonarjs/no-redundant-boolean': [2],
'sonarjs/no-redundant-jump': [2],
'sonarjs/no-same-line-conditional': [2],
@ -1083,6 +1082,7 @@ export default tseslint.config(
'@vitest/no-standalone-expect': [0],
'@vitest/no-test-prefixes': [0],
'@vitest/no-test-return-statement': [0],
'@vitest/prefer-called-exactly-once-with': [2],
'@vitest/prefer-called-with': [0],
'@vitest/prefer-comparison-matcher': [0],
'@vitest/prefer-each': [0],
@ -1090,6 +1090,7 @@ export default tseslint.config(
'@vitest/prefer-expect-resolves': [0],
'@vitest/prefer-hooks-in-order': [0],
'@vitest/prefer-hooks-on-top': [2],
'@vitest/prefer-import-in-mock': [0],
'@vitest/prefer-lowercase-title': [0],
'@vitest/prefer-mock-promise-shorthand': [0],
'@vitest/prefer-snapshot-hint': [0],

73
go.mod
View file

@ -2,23 +2,25 @@ module forgejo.org
go 1.24.0
toolchain go1.24.7
toolchain go1.25.3
require (
code.forgejo.org/f3/gof3/v3 v3.11.0
code.forgejo.org/f3/gof3/v3 v3.11.1
code.forgejo.org/forgejo-contrib/go-libravatar v0.0.0-20191008002943-06d1c002b251
code.forgejo.org/forgejo/go-rpmutils v1.0.0
code.forgejo.org/forgejo/levelqueue v1.0.0
code.forgejo.org/forgejo/reply v1.0.2
code.forgejo.org/forgejo/runner/v11 v11.1.1
code.forgejo.org/forgejo/runner/v11 v11.1.2
code.forgejo.org/go-chi/binding v1.0.1
code.forgejo.org/go-chi/cache v1.0.1
code.forgejo.org/go-chi/captcha v1.0.2
code.forgejo.org/go-chi/session v1.0.2
code.gitea.io/actions-proto-go v0.4.0
code.gitea.io/sdk/gitea v0.21.0
code.superseriousbusiness.org/exif-terminator v0.11.0
code.superseriousbusiness.org/go-jpeg-image-structure/v2 v2.3.0
codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570
connectrpc.com/connect v1.18.1
connectrpc.com/connect v1.19.1
github.com/42wim/httpsig v1.2.3
github.com/42wim/sshsig v0.0.0-20250502153856-5100632e8920
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358
@ -34,6 +36,7 @@ require (
github.com/djherbis/buffer v1.2.0
github.com/djherbis/nio/v3 v3.0.1
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707
github.com/dsoprea/go-exif/v3 v3.0.1
github.com/dustin/go-humanize v1.0.1
github.com/editorconfig/editorconfig-core-go/v2 v2.6.3
github.com/emersion/go-imap v1.2.1
@ -47,7 +50,7 @@ require (
github.com/go-co-op/gocron v1.37.0
github.com/go-enry/go-enry/v2 v2.9.2
github.com/go-ldap/ldap/v3 v3.4.6
github.com/go-openapi/spec v0.21.0
github.com/go-openapi/spec v0.22.0
github.com/go-sql-driver/mysql v1.9.3
github.com/go-webauthn/webauthn v0.14.0
github.com/gobwas/glob v0.2.3
@ -56,7 +59,7 @@ require (
github.com/golang-jwt/jwt/v5 v5.3.0
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
github.com/google/go-github/v64 v64.0.0
github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5
github.com/google/pprof v0.0.0-20250923004556-9e5a51aed1e8
github.com/google/uuid v1.6.0
github.com/gorilla/feeds v1.2.0
github.com/gorilla/sessions v1.4.0
@ -74,7 +77,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/mattn/go-sqlite3 v1.14.32
github.com/meilisearch/meilisearch-go v0.34.0
github.com/mholt/archives v0.1.4
github.com/mholt/archives v0.1.5
github.com/microcosm-cc/bluemonday v1.0.27
github.com/minio/minio-go/v7 v7.0.95
github.com/msteinert/pam/v2 v2.1.0
@ -96,17 +99,17 @@ require (
github.com/yohcop/openid-go v1.0.1
github.com/yuin/goldmark v1.7.13
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
gitlab.com/gitlab-org/api/client-go v0.130.1
gitlab.com/gitlab-org/api/client-go v0.143.2
go.uber.org/mock v0.6.0
go.yaml.in/yaml/v3 v3.0.4
golang.org/x/crypto v0.42.0
golang.org/x/image v0.31.0
golang.org/x/net v0.44.0
golang.org/x/oauth2 v0.31.0
golang.org/x/crypto v0.43.0
golang.org/x/image v0.32.0
golang.org/x/net v0.46.0
golang.org/x/oauth2 v0.32.0
golang.org/x/sync v0.17.0
golang.org/x/sys v0.36.0
golang.org/x/text v0.29.0
google.golang.org/protobuf v1.36.9
golang.org/x/sys v0.37.0
golang.org/x/text v0.30.0
google.golang.org/protobuf v1.36.10
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gopkg.in/ini.v1 v1.67.0
mvdan.cc/xurls/v2 v2.5.0
@ -116,6 +119,7 @@ require (
require (
cloud.google.com/go/compute/metadata v0.6.0 // indirect
code.superseriousbusiness.org/go-png-image-structure/v2 v2.3.0 // indirect
dario.cat/mergo v1.0.2 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 // indirect
@ -145,7 +149,7 @@ require (
github.com/blevesearch/zapx/v14 v14.4.2 // indirect
github.com/blevesearch/zapx/v15 v15.4.2 // indirect
github.com/blevesearch/zapx/v16 v16.2.4 // indirect
github.com/bmatcuk/doublestar/v4 v4.8.0 // indirect
github.com/bmatcuk/doublestar/v4 v4.9.1 // indirect
github.com/bodgit/plumbing v1.3.0 // indirect
github.com/bodgit/sevenzip v1.6.1 // indirect
github.com/bodgit/windows v1.0.1 // indirect
@ -160,6 +164,10 @@ require (
github.com/davidmz/go-pageant v1.0.2 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dlclark/regexp2 v1.11.5 // indirect
github.com/dsoprea/go-iptc v0.0.0-20200609062250-162ae6b44feb // indirect
github.com/dsoprea/go-logging v0.0.0-20200710184922-b02d349568dd // indirect
github.com/dsoprea/go-photoshop-info-format v0.0.0-20200609050348-3db9b63b202c // indirect
github.com/dsoprea/go-utility/v2 v2.0.0-20221003172846-a3e1774ef349 // indirect
github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.18.0 // indirect
@ -167,17 +175,26 @@ require (
github.com/go-ap/errors v0.0.0-20231003111023-183eef4b31b7 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
github.com/go-enry/go-oniguruma v1.2.1 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-fed/httpsig v1.1.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.6.2 // indirect
github.com/go-git/go-git/v5 v5.16.2 // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/go-openapi/jsonpointer v0.21.1 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.1 // indirect
github.com/go-openapi/jsonpointer v0.22.1 // indirect
github.com/go-openapi/jsonreference v0.21.2 // indirect
github.com/go-openapi/swag/conv v0.25.1 // indirect
github.com/go-openapi/swag/jsonname v0.25.1 // indirect
github.com/go-openapi/swag/jsonutils v0.25.1 // indirect
github.com/go-openapi/swag/loading v0.25.1 // indirect
github.com/go-openapi/swag/stringutils v0.25.1 // indirect
github.com/go-openapi/swag/typeutils v0.25.1 // indirect
github.com/go-openapi/swag/yamlutils v0.25.1 // indirect
github.com/go-webauthn/x v0.1.25 // indirect
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/golang/geo v0.0.0-20210211234256-740aa86cb551 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
@ -189,7 +206,7 @@ require (
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/hashicorp/go-retryablehttp v0.7.8 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
@ -198,7 +215,7 @@ require (
github.com/mailru/easyjson v0.9.0 // indirect
github.com/markbates/going v1.0.3 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mattn/go-runewidth v0.0.17 // indirect
github.com/mattn/go-shellwords v1.0.12 // indirect
github.com/mholt/acmez/v3 v3.1.2 // indirect
github.com/miekg/dns v1.1.63 // indirect
@ -212,7 +229,7 @@ require (
github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nwaples/rardecode/v2 v2.1.1 // indirect
github.com/nwaples/rardecode/v2 v2.2.0 // indirect
github.com/olekukonko/errors v1.1.0 // indirect
github.com/olekukonko/ll v0.0.9 // indirect
github.com/olekukonko/tablewriter v1.0.7 // indirect
@ -225,13 +242,13 @@ require (
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rhysd/actionlint v1.7.7 // indirect
github.com/rhysd/actionlint v1.7.8 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/skeema/knownhosts v1.3.1 // indirect
github.com/sorairolake/lzip-go v0.3.8 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
github.com/tinylib/msgp v1.3.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
@ -243,12 +260,14 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go.uber.org/zap/exp v0.3.0 // indirect
go.yaml.in/yaml/v4 v4.0.0-rc.2 // indirect
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
golang.org/x/mod v0.27.0 // indirect
golang.org/x/mod v0.29.0 // indirect
golang.org/x/time v0.13.0 // indirect
golang.org/x/tools v0.36.0 // indirect
golang.org/x/tools v0.38.0 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
@ -260,4 +279,4 @@ replace github.com/gliderlabs/ssh => code.forgejo.org/forgejo/ssh v0.0.0-2024121
replace git.sr.ht/~mariusor/go-xsd-duration => code.forgejo.org/forgejo/go-xsd-duration v0.0.0-20220703122237-02e73435a078
replace xorm.io/xorm v1.3.9 => code.forgejo.org/xorm/xorm v1.3.9-forgejo.1
replace xorm.io/xorm v1.3.9 => code.forgejo.org/xorm/xorm v1.3.9-forgejo.3

183
go.sum
View file

@ -16,8 +16,8 @@ cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2k
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
code.forgejo.org/f3/gof3/v3 v3.11.0 h1:f/xToKwqTgxG6PYxvewywjDQyCcyHEEJ6sZqUitFsAE=
code.forgejo.org/f3/gof3/v3 v3.11.0/go.mod h1:4FaRUNSQGBiD1M0DuB0yNv+Z2wMtlOeckgygHSSq4KQ=
code.forgejo.org/f3/gof3/v3 v3.11.1 h1:c0vE8XvqpbXuSv8gzttn96k5T2FQi0u9bYnux46qSAs=
code.forgejo.org/f3/gof3/v3 v3.11.1/go.mod h1:1p2UKrqZiwxKneQF2DKrMnc403YIgR/lfcfvadZtmDs=
code.forgejo.org/forgejo-contrib/go-libravatar v0.0.0-20191008002943-06d1c002b251 h1:HTZl3CBk3ABNYtFI6TPLvJgGKFIhKT5CBk0sbOtkDKU=
code.forgejo.org/forgejo-contrib/go-libravatar v0.0.0-20191008002943-06d1c002b251/go.mod h1:PphB88CPbx601QrWPMZATeorACeVmQlyv3u+uUMbSaM=
code.forgejo.org/forgejo/go-rpmutils v1.0.0 h1:RZGGeKt70p/WaIEL97pyT6uiiEIoN8/aLmS5Z6WmX0M=
@ -28,8 +28,8 @@ code.forgejo.org/forgejo/levelqueue v1.0.0 h1:9krYpU6BM+j/1Ntj6m+VCAIu0UNnne1/Uf
code.forgejo.org/forgejo/levelqueue v1.0.0/go.mod h1:fmG6zhVuqim2rxSFOoasgXO8V2W/k9U31VVYqLIRLhQ=
code.forgejo.org/forgejo/reply v1.0.2 h1:dMhQCHV6/O3L5CLWNTol+dNzDAuyCK88z4J/lCdgFuQ=
code.forgejo.org/forgejo/reply v1.0.2/go.mod h1:RyZUfzQLc+fuLIGjTSQWDAJWPiL4WtKXB/FifT5fM7U=
code.forgejo.org/forgejo/runner/v11 v11.1.1 h1:CoSfxBOLKLMJZq5VhKd5ZIUc3tCf04iyFx926s+zaMA=
code.forgejo.org/forgejo/runner/v11 v11.1.1/go.mod h1:9f0D2EG7uabL+cv71SWHKrGgo2vmLpvko0QLmtn3RDE=
code.forgejo.org/forgejo/runner/v11 v11.1.2 h1:jM5YsNmScH11VJEwmvsTUiqGjAqtiUzBhQ65BIo8ZOs=
code.forgejo.org/forgejo/runner/v11 v11.1.2/go.mod h1:9f0D2EG7uabL+cv71SWHKrGgo2vmLpvko0QLmtn3RDE=
code.forgejo.org/forgejo/ssh v0.0.0-20241211213324-5fc306ca0616 h1:kEZL84+02jY9RxXM4zHBWZ3Fml0B09cmP1LGkDsCfIA=
code.forgejo.org/forgejo/ssh v0.0.0-20241211213324-5fc306ca0616/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8=
code.forgejo.org/go-chi/binding v1.0.1 h1:coKNI+X1NzRN7X85LlrpvBRqk0TXpJ+ja28vusQWEuY=
@ -40,16 +40,22 @@ code.forgejo.org/go-chi/captcha v1.0.2 h1:vyHDPXkpjDv8bLO9NqtWzZayzstD/WpJ5xwEkA
code.forgejo.org/go-chi/captcha v1.0.2/go.mod h1:lxiPLcJ76UCZHoH31/Wbum4GUi2NgjfFZLrJkKv1lLE=
code.forgejo.org/go-chi/session v1.0.2 h1:pG+AXre9L9VXJmTaADXkmeEPuRalhmBXyv6tG2Rvjcc=
code.forgejo.org/go-chi/session v1.0.2/go.mod h1:HnEGyBny7WPzCiVLP2vzL5ssma+3gCSl/vLpuVNYrqc=
code.forgejo.org/xorm/xorm v1.3.9-forgejo.1 h1:jU5CICzbkpqol6qTa4yctLuS0BI3D2mVCx7q6ogK/gE=
code.forgejo.org/xorm/xorm v1.3.9-forgejo.1/go.mod h1:0q+miQUSpTlsgMw2blcO9a87GB5WyatiX3GuwBca31w=
code.forgejo.org/xorm/xorm v1.3.9-forgejo.3 h1:7KW1+3cr2YIZCS85TM+imdsUe8OdNsfV3F8iP2t36rM=
code.forgejo.org/xorm/xorm v1.3.9-forgejo.3/go.mod h1:5ouTxqMcalQUvlBpQynRpzu/44GwaMpkA1nU+encsDE=
code.gitea.io/actions-proto-go v0.4.0 h1:OsPBPhodXuQnsspG1sQ4eRE1PeoZyofd7+i73zCwnsU=
code.gitea.io/actions-proto-go v0.4.0/go.mod h1:mn7Wkqz6JbnTOHQpot3yDeHx+O5C9EGhMEE+htvHBas=
code.gitea.io/sdk/gitea v0.21.0 h1:69n6oz6kEVHRo1+APQQyizkhrZrLsTLXey9142pfkD4=
code.gitea.io/sdk/gitea v0.21.0/go.mod h1:tnBjVhuKJCn8ibdyyhvUyxrR1Ca2KHEoTWoukNhXQPA=
code.superseriousbusiness.org/exif-terminator v0.11.0 h1:Hof0MCcsa+1fS17gf86fTTZ8AQnMY9h9kzcc+2C6mVg=
code.superseriousbusiness.org/exif-terminator v0.11.0/go.mod h1:9sutT1axa/kSdlPLlRFjCNKmyo/KNx8eX3XZvWBlAEY=
code.superseriousbusiness.org/go-jpeg-image-structure/v2 v2.3.0 h1:r9uq8StaSHYKJ8DklR9Xy+E9c40G1Z8yj5TRGi8L6+4=
code.superseriousbusiness.org/go-jpeg-image-structure/v2 v2.3.0/go.mod h1:IK1OlR6APjVB3E9tuYGvf0qXMrwP+TrzcHS5rf4wffQ=
code.superseriousbusiness.org/go-png-image-structure/v2 v2.3.0 h1:I512jiIeXDC4//2BeSPrRM2ZS4wpBKUaPeTPxakMNGA=
code.superseriousbusiness.org/go-png-image-structure/v2 v2.3.0/go.mod h1:SNHomXNW88o1pFfLHpD4KsCZLfcr4z5dm+xcX5SV10A=
codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570 h1:TXbikPqa7YRtfU9vS6QJBg77pUvbEb6StRdZO8t1bEY=
codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570/go.mod h1:IIAjsijsd8q1isWX8MACefDEgTQslQ4stk2AeeTt3kM=
connectrpc.com/connect v1.18.1 h1:PAg7CjSAGvscaf6YZKUefjoih5Z/qYkyaTrBW8xvYPw=
connectrpc.com/connect v1.18.1/go.mod h1:0292hj1rnx8oFrStN7cB4jjVBeqs+Yx5yDIC2prWDO8=
connectrpc.com/connect v1.19.1 h1:R5M57z05+90EfEvCY1b7hBxDVOUl45PrtXtAV2fOC14=
connectrpc.com/connect v1.19.1/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w=
dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8=
dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
@ -143,8 +149,8 @@ github.com/blevesearch/zapx/v15 v15.4.2 h1:sWxpDE0QQOTjyxYbAVjt3+0ieu8NCE0fDRaFx
github.com/blevesearch/zapx/v15 v15.4.2/go.mod h1:1pssev/59FsuWcgSnTa0OeEpOzmhtmr/0/11H0Z8+Nw=
github.com/blevesearch/zapx/v16 v16.2.4 h1:tGgfvleXTAkwsD5mEzgM3zCS/7pgocTCnO1oyAUjlww=
github.com/blevesearch/zapx/v16 v16.2.4/go.mod h1:Rti/REtuuMmzwsI8/C/qIzRaEoSK/wiFYw5e5ctUKKs=
github.com/bmatcuk/doublestar/v4 v4.8.0 h1:DSXtrypQddoug1459viM9X9D3dp1Z7993fw36I2kNcQ=
github.com/bmatcuk/doublestar/v4 v4.8.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/bmatcuk/doublestar/v4 v4.9.1 h1:X8jg9rRZmJd4yRy7ZeNDRnM+T3ZfHv15JiBJ/avrEXE=
github.com/bmatcuk/doublestar/v4 v4.9.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/bodgit/plumbing v1.3.0 h1:pf9Itz1JOQgn7vEOE7v7nlEfBykYqvUYioC61TwWCFU=
github.com/bodgit/plumbing v1.3.0/go.mod h1:JOTb4XiRu5xfnmdnDJo6GmSbSbtSyufrsyZFByMtKEs=
github.com/bodgit/sevenzip v1.6.1 h1:kikg2pUMYC9ljU7W9SaqHXhym5HyKm8/M/jd31fYan4=
@ -209,6 +215,28 @@ github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cn
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 h1:2tV76y6Q9BB+NEBasnqvs7e49aEBFI8ejC89PSnWH+4=
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s=
github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY=
github.com/dsoprea/go-exif/v2 v2.0.0-20200321225314-640175a69fe4/go.mod h1:Lm2lMM2zx8p4a34ZemkaUV95AnMl4ZvLbCUbwOvLC2E=
github.com/dsoprea/go-exif/v3 v3.0.0-20200717053412-08f1b6708903/go.mod h1:0nsO1ce0mh5czxGeLo4+OCZ/C6Eo6ZlMWsz7rH/Gxv8=
github.com/dsoprea/go-exif/v3 v3.0.0-20210428042052-dca55bf8ca15/go.mod h1:cg5SNYKHMmzxsr9X6ZeLh/nfBRHHp5PngtEPcujONtk=
github.com/dsoprea/go-exif/v3 v3.0.0-20210625224831-a6301f85c82b/go.mod h1:cg5SNYKHMmzxsr9X6ZeLh/nfBRHHp5PngtEPcujONtk=
github.com/dsoprea/go-exif/v3 v3.0.0-20221003160559-cf5cd88aa559/go.mod h1:rW6DMEv25U9zCtE5ukC7ttBRllXj7g7TAHl7tQrT5No=
github.com/dsoprea/go-exif/v3 v3.0.0-20221003171958-de6cb6e380a8/go.mod h1:akyZEJZ/k5bmbC9gA612ZLQkcED8enS9vuTiuAkENr0=
github.com/dsoprea/go-exif/v3 v3.0.1 h1:/IE4iW7gvY7BablV1XY0unqhMv26EYpOquVMwoBo/wc=
github.com/dsoprea/go-exif/v3 v3.0.1/go.mod h1:10HkA1Wz3h398cDP66L+Is9kKDmlqlIJGPv8pk4EWvc=
github.com/dsoprea/go-iptc v0.0.0-20200609062250-162ae6b44feb h1:gwjJjUr6FY7zAWVEueFPrcRHhd9+IK81TcItbqw2du4=
github.com/dsoprea/go-iptc v0.0.0-20200609062250-162ae6b44feb/go.mod h1:kYIdx9N9NaOyD7U6D+YtExN7QhRm+5kq7//yOsRXQtM=
github.com/dsoprea/go-logging v0.0.0-20190624164917-c4f10aab7696/go.mod h1:Nm/x2ZUNRW6Fe5C3LxdY1PyZY5wmDv/s5dkPJ/VB3iA=
github.com/dsoprea/go-logging v0.0.0-20200517223158-a10564966e9d/go.mod h1:7I+3Pe2o/YSU88W0hWlm9S22W7XI1JFNJ86U0zPKMf8=
github.com/dsoprea/go-logging v0.0.0-20200710184922-b02d349568dd h1:l+vLbuxptsC6VQyQsfD7NnEC8BZuFpz45PgY+pH8YTg=
github.com/dsoprea/go-logging v0.0.0-20200710184922-b02d349568dd/go.mod h1:7I+3Pe2o/YSU88W0hWlm9S22W7XI1JFNJ86U0zPKMf8=
github.com/dsoprea/go-photoshop-info-format v0.0.0-20200609050348-3db9b63b202c h1:7j5aWACOzROpr+dvMtu8GnI97g9ShLWD72XIELMgn+c=
github.com/dsoprea/go-photoshop-info-format v0.0.0-20200609050348-3db9b63b202c/go.mod h1:pqKB+ijp27cEcrHxhXVgUUMlSDRuGJJp1E+20Lj5H0E=
github.com/dsoprea/go-utility v0.0.0-20200711062821-fab8125e9bdf/go.mod h1:95+K3z2L0mqsVYd6yveIv1lmtT3tcQQ3dVakPySffW8=
github.com/dsoprea/go-utility/v2 v2.0.0-20200717064901-2fccff4aa15e/go.mod h1:uAzdkPTub5Y9yQwXe8W4m2XuP0tK4a9Q/dantD0+uaU=
github.com/dsoprea/go-utility/v2 v2.0.0-20221003142440-7a1927d49d9d/go.mod h1:LVjRU0RNUuMDqkPTxcALio0LWPFPXxxFCvVGVAwEpFc=
github.com/dsoprea/go-utility/v2 v2.0.0-20221003160719-7bc88537c05e/go.mod h1:VZ7cB0pTjm1ADBWhJUOHESu4ZYy9JN+ZPqjfiW09EPU=
github.com/dsoprea/go-utility/v2 v2.0.0-20221003172846-a3e1774ef349 h1:DilThiXje0z+3UQ5YjYiSRRzVdtamFpvBQXKwMglWqw=
github.com/dsoprea/go-utility/v2 v2.0.0-20221003172846-a3e1774ef349/go.mod h1:4GC5sXji84i/p+irqghpPFZBF8tRN/Q7+700G0/DLe8=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/editorconfig/editorconfig-core-go/v2 v2.6.3 h1:XVUp6qW3BIkmM3/1EkrHpa6bL56APOynfXcZEmIgOhs=
@ -258,6 +286,11 @@ github.com/go-enry/go-enry/v2 v2.9.2 h1:giOQAtCgBX08kosrX818DCQJTCNtKwoPBGu0qb6n
github.com/go-enry/go-enry/v2 v2.9.2/go.mod h1:9yrj4ES1YrbNb1Wb7/PWYr2bpaCXUGRt0uafN0ISyG8=
github.com/go-enry/go-oniguruma v1.2.1 h1:k8aAMuJfMrqm/56SG2lV9Cfti6tC4x8673aHCcBk+eo=
github.com/go-enry/go-oniguruma v1.2.1/go.mod h1:bWDhYP+S6xZQgiRL7wlTScFYBe023B6ilRZbCAD5Hf4=
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
github.com/go-errors/errors v1.0.2/go.mod h1:psDX2osz5VnTOnFWbDeWwS7yejl+uV3FEWEp4lssFEs=
github.com/go-errors/errors v1.1.1/go.mod h1:psDX2osz5VnTOnFWbDeWwS7yejl+uV3FEWEp4lssFEs=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-fed/httpsig v1.1.0 h1:9M+hb0jkEICD8/cAiNqEB66R87tTINszBRTjwjQzWcI=
github.com/go-fed/httpsig v1.1.0/go.mod h1:RCMrTZvN1bJYtofsG4rd5NaO5obxQ5xBkdiS7xsT7bM=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
@ -274,14 +307,28 @@ github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-ldap/ldap/v3 v3.4.6 h1:ert95MdbiG7aWo/oPYp9btL3KJlMPKnP58r09rI8T+A=
github.com/go-ldap/ldap/v3 v3.4.6/go.mod h1:IGMQANNtxpsOzj7uUAMjpGBaOVTC4DYyIy8VsTdxmtc=
github.com/go-openapi/jsonpointer v0.21.1 h1:whnzv/pNXtK2FbX/W9yJfRmE2gsmkfahjMKB0fZvcic=
github.com/go-openapi/jsonpointer v0.21.1/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk=
github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
github.com/go-openapi/swag v0.23.1 h1:lpsStH0n2ittzTnbaSloVZLuB5+fvSY/+hnagBjSNZU=
github.com/go-openapi/swag v0.23.1/go.mod h1:STZs8TbRvEQQKUA+JZNAm3EWlgaOBGpyFDqQnDHMef0=
github.com/go-openapi/jsonpointer v0.22.1 h1:sHYI1He3b9NqJ4wXLoJDKmUmHkWy/L7rtEo92JUxBNk=
github.com/go-openapi/jsonpointer v0.22.1/go.mod h1:pQT9OsLkfz1yWoMgYFy4x3U5GY5nUlsOn1qSBH5MkCM=
github.com/go-openapi/jsonreference v0.21.2 h1:Wxjda4M/BBQllegefXrY/9aq1fxBA8sI5M/lFU6tSWU=
github.com/go-openapi/jsonreference v0.21.2/go.mod h1:pp3PEjIsJ9CZDGCNOyXIQxsNuroxm8FAJ/+quA0yKzQ=
github.com/go-openapi/spec v0.22.0 h1:xT/EsX4frL3U09QviRIZXvkh80yibxQmtoEvyqug0Tw=
github.com/go-openapi/spec v0.22.0/go.mod h1:K0FhKxkez8YNS94XzF8YKEMULbFrRw4m15i2YUht4L0=
github.com/go-openapi/swag/conv v0.25.1 h1:+9o8YUg6QuqqBM5X6rYL/p1dpWeZRhoIt9x7CCP+he0=
github.com/go-openapi/swag/conv v0.25.1/go.mod h1:Z1mFEGPfyIKPu0806khI3zF+/EUXde+fdeksUl2NiDs=
github.com/go-openapi/swag/jsonname v0.25.1 h1:Sgx+qbwa4ej6AomWC6pEfXrA6uP2RkaNjA9BR8a1RJU=
github.com/go-openapi/swag/jsonname v0.25.1/go.mod h1:71Tekow6UOLBD3wS7XhdT98g5J5GR13NOTQ9/6Q11Zo=
github.com/go-openapi/swag/jsonutils v0.25.1 h1:AihLHaD0brrkJoMqEZOBNzTLnk81Kg9cWr+SPtxtgl8=
github.com/go-openapi/swag/jsonutils v0.25.1/go.mod h1:JpEkAjxQXpiaHmRO04N1zE4qbUEg3b7Udll7AMGTNOo=
github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.1 h1:DSQGcdB6G0N9c/KhtpYc71PzzGEIc/fZ1no35x4/XBY=
github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.1/go.mod h1:kjmweouyPwRUEYMSrbAidoLMGeJ5p6zdHi9BgZiqmsg=
github.com/go-openapi/swag/loading v0.25.1 h1:6OruqzjWoJyanZOim58iG2vj934TysYVptyaoXS24kw=
github.com/go-openapi/swag/loading v0.25.1/go.mod h1:xoIe2EG32NOYYbqxvXgPzne989bWvSNoWoyQVWEZicc=
github.com/go-openapi/swag/stringutils v0.25.1 h1:Xasqgjvk30eUe8VKdmyzKtjkVjeiXx1Iz0zDfMNpPbw=
github.com/go-openapi/swag/stringutils v0.25.1/go.mod h1:JLdSAq5169HaiDUbTvArA2yQxmgn4D6h4A+4HqVvAYg=
github.com/go-openapi/swag/typeutils v0.25.1 h1:rD/9HsEQieewNt6/k+JBwkxuAHktFtH3I3ysiFZqukA=
github.com/go-openapi/swag/typeutils v0.25.1/go.mod h1:9McMC/oCdS4BKwk2shEB7x17P6HmMmA6dQRtAkSnNb8=
github.com/go-openapi/swag/yamlutils v0.25.1 h1:mry5ez8joJwzvMbaTGLhw8pXUnhDK91oSJLDPF1bmGk=
github.com/go-openapi/swag/yamlutils v0.25.1/go.mod h1:cm9ywbzncy3y6uPm/97ysW8+wZ09qsks+9RS8fLWKqg=
github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=
github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
@ -291,6 +338,8 @@ github.com/go-webauthn/webauthn v0.14.0 h1:ZLNPUgPcDlAeoxe+5umWG/tEeCoQIDr7gE2Zx
github.com/go-webauthn/webauthn v0.14.0/go.mod h1:QZzPFH3LJ48u5uEPAu+8/nWJImoLBWM7iAH/kSVSo6k=
github.com/go-webauthn/x v0.1.25 h1:g/0noooIGcz/yCVqebcFgNnGIgBlJIccS+LYAa+0Z88=
github.com/go-webauthn/x v0.1.25/go.mod h1:ieblaPY1/BVCV0oQTsA/VAo08/TWayQuJuo5Q+XxmTY=
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b h1:khEcpUM4yFcxg4/FHQWkvVRmgijNXRfzkIDHh23ggEo=
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM=
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
@ -308,6 +357,10 @@ github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9v
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
github.com/golang/geo v0.0.0-20200319012246-673a6f80352d/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
github.com/golang/geo v0.0.0-20210211234256-740aa86cb551 h1:gtexQ/VGyN+VVFRXSFiguSNcXmS6rkKT+X7FdIrTtfo=
github.com/golang/geo v0.0.0-20210211234256-740aa86cb551/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@ -360,8 +413,8 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5 h1:xhMrHhTJ6zxu3gA4enFM9MLn9AY7613teCdFnlUVbSQ=
github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5/go.mod h1:5hDyRhoBCxViHszMt12TnOpEI4VVi+U8Gm9iphldiMA=
github.com/google/pprof v0.0.0-20250923004556-9e5a51aed1e8 h1:ZI8gCoCjGzPsum4L21jHdQs8shFBIQih1TM9Rd/c+EQ=
github.com/google/pprof v0.0.0-20250923004556-9e5a51aed1e8/go.mod h1:I6V7YzU0XDpsHqbsyrghnFZLO1gwK6NPTNvmetQIk9U=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@ -387,8 +440,8 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
github.com/hashicorp/go-retryablehttp v0.7.8 h1:ylXZWnqa7Lhqpk0L1P1LzDtGcCR0rPVUrx/c8Unxc48=
github.com/hashicorp/go-retryablehttp v0.7.8/go.mod h1:rjiScheydd+CxvumBsIrFKlx3iS0jrZ7LvzFGFmuKbw=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
@ -404,6 +457,8 @@ github.com/inbucket/html2text v0.9.0 h1:ULJmVcBEMAcmLE+/rN815KG1Fx6+a4HhbUxiDiN+
github.com/inbucket/html2text v0.9.0/go.mod h1:QDaumzl+/OzlSVbNohhmg+yAy5pKjUjzCKW2BMvztKE=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
github.com/jhillyerd/enmime/v2 v2.2.0 h1:Pe35MB96eZK5Q0XjlvPftOgWypQpd1gcbfJKAt7rsB8=
github.com/jhillyerd/enmime/v2 v2.2.0/go.mod h1:SOBXlCemjhiV2DvHhAKnJiWrtJGS/Ffuw4Iy7NjBTaI=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
@ -453,8 +508,8 @@ github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHP
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.17 h1:78v8ZlW0bP43XfmAfPsdXcoNCelfMHsDmd/pkENfrjQ=
github.com/mattn/go-runewidth v0.0.17/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/mattn/go-sqlite3 v1.14.32 h1:JD12Ag3oLy1zQA+BNn74xRgaBbdhbNIDYvQUEuuErjs=
@ -463,8 +518,8 @@ github.com/meilisearch/meilisearch-go v0.34.0 h1:P+Ohdx4/PCxXaoI5wNi0LMwPkuiNrF/
github.com/meilisearch/meilisearch-go v0.34.0/go.mod h1:cUVJZ2zMqTvvwIMEEAdsWH+zrHsrLpAw6gm8Lt1MXK0=
github.com/mholt/acmez/v3 v3.1.2 h1:auob8J/0FhmdClQicvJvuDavgd5ezwLBfKuYmynhYzc=
github.com/mholt/acmez/v3 v3.1.2/go.mod h1:L1wOU06KKvq7tswuMDwKdcHeKpFFgkppZy/y0DFxagQ=
github.com/mholt/archives v0.1.4 h1:sU+/lLNgafUontWFv3AVwO8VUWye3rrtN6hgC2dU11c=
github.com/mholt/archives v0.1.4/go.mod h1:I2ia+SQTtQHej9w1GZM/mz7qfdgQv+BHr3hEKqDcGuk=
github.com/mholt/archives v0.1.5 h1:Fh2hl1j7VEhc6DZs2DLMgiBNChUux154a1G+2esNvzQ=
github.com/mholt/archives v0.1.5/go.mod h1:3TPMmBLPsgszL+1As5zECTuKwKvIfj6YcwWPpeTAXF4=
github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwXFM08ygZfk=
github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA=
github.com/miekg/dns v1.1.63 h1:8M5aAw6OMZfFXTT7K5V0Eu5YiiL8l7nUAkyN6C9YwaY=
@ -498,8 +553,8 @@ github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdh
github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
github.com/niklasfasching/go-org v1.9.1 h1:/3s4uTPOF06pImGa2Yvlp24yKXZoTYM+nsIlMzfpg/0=
github.com/niklasfasching/go-org v1.9.1/go.mod h1:ZAGFFkWvUQcpazmi/8nHqwvARpr1xpb+Es67oUGX/48=
github.com/nwaples/rardecode/v2 v2.1.1 h1:OJaYalXdliBUXPmC8CZGQ7oZDxzX1/5mQmgn0/GASew=
github.com/nwaples/rardecode/v2 v2.1.1/go.mod h1:7uz379lSxPe6j9nvzxUZ+n7mnJNgjsRNb6IbvGVHRmw=
github.com/nwaples/rardecode/v2 v2.2.0 h1:4ufPGHiNe1rYJxYfehALLjup4Ls3ck42CWwjKiOqu0A=
github.com/nwaples/rardecode/v2 v2.2.0/go.mod h1:7uz379lSxPe6j9nvzxUZ+n7mnJNgjsRNb6IbvGVHRmw=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
@ -553,8 +608,8 @@ github.com/redis/go-redis/v9 v9.8.0 h1:q3nRvjrlge/6UD7eTu/DSg2uYiU2mCL0G/uzBWqhi
github.com/redis/go-redis/v9 v9.8.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rhysd/actionlint v1.7.7 h1:0KgkoNTrYY7vmOCs9BW2AHxLvvpoY9nEUzgBHiPUr0k=
github.com/rhysd/actionlint v1.7.7/go.mod h1:AE6I6vJEkNaIfWqC2GNE5spIJNhxf8NCtLEKU4NnUXg=
github.com/rhysd/actionlint v1.7.8 h1:3d+N9ourgAxVYG4z2IFxFIk/YiT6V+VnKASfXGwT60E=
github.com/rhysd/actionlint v1.7.8/go.mod h1:3kiS6egcbXG+vQsJIhFxTz+UKaF1JprsE0SKrpCZKvU=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
@ -580,8 +635,8 @@ github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnB
github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY=
github.com/sorairolake/lzip-go v0.3.8 h1:j5Q2313INdTA80ureWYRhX+1K78mUXfMoPZCw/ivWik=
github.com/sorairolake/lzip-go v0.3.8/go.mod h1:JcBqGMV0frlxwrsE9sMWXDjqn3EeVf0/54YPsw66qkU=
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=
github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf h1:pvbZ0lM0XWPBqUKqFU8cmavspvIl9nulOYwdy6IFRRo=
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02nZ62WenDCkgHFerpIOmW0iT7GKmXM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@ -632,8 +687,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.130.1 h1:1xF5C5Zq3sFeNg3PzS2z63oqrxifne3n/OnbI7nptRc=
gitlab.com/gitlab-org/api/client-go v0.130.1/go.mod h1:ZhSxLAWadqP6J9lMh40IAZOlOxBLPRh7yFOXR/bMJWM=
gitlab.com/gitlab-org/api/client-go v0.143.2 h1:tfmUW8u+G/DGKOB/FDR0c06f0RVUAEe0ym8WpLoiHXI=
gitlab.com/gitlab-org/api/client-go v0.143.2/go.mod h1:gJn5yLx9vYGXr73Yv0ueHWCVl+fL8iUOgJFxC7qV+iM=
go.etcd.io/bbolt v1.4.3 h1:dEadXpI6G79deX5prL3QRNP6JB8UxVkqo4UPnHaNXJo=
go.etcd.io/bbolt v1.4.3/go.mod h1:tKQlpPaYCVFctUIgFKFnAlvbmB3tpy1vkTnDWohtc0E=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
@ -655,6 +710,8 @@ go.uber.org/zap/exp v0.3.0 h1:6JYzdifzYkGmTdRR59oYH+Ng7k49H9qVpWwNSsGJj3U=
go.uber.org/zap/exp v0.3.0/go.mod h1:5I384qq7XGxYyByIhHm6jg5CHkGY0nsTfbDLgDDlgJQ=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
go.yaml.in/yaml/v4 v4.0.0-rc.2 h1:/FrI8D64VSr4HtGIlUtlFMGsm7H7pWTbj6vOLVZcA6s=
go.yaml.in/yaml/v4 v4.0.0-rc.2/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
go4.org v0.0.0-20230225012048-214862532bf5 h1:nifaUDeh+rPaBCMPMQHZmvJf+QdpLFnuQPwx+LxVmtc=
go4.org v0.0.0-20230225012048-214862532bf5/go.mod h1:F57wTi5Lrj6WLyswp5EYV1ncrEbFGHD4hhz6S1ZYeaU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
@ -669,8 +726,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04=
golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@ -683,8 +740,8 @@ golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/y
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.31.0 h1:mLChjE2MV6g1S7oqbXC0/UcKijjm5fnJLUYKIYrLESA=
golang.org/x/image v0.31.0/go.mod h1:R9ec5Lcp96v9FTF+ajwaH3uGxPH4fKfHHAVbUILxghA=
golang.org/x/image v0.32.0 h1:6lZQWq75h7L5IWNk0r+SCpUJ6tUVd3v4ZHnbRKLkUDQ=
golang.org/x/image v0.32.0/go.mod h1:/R37rrQmKXtO6tYXAjtDLwQgFLHmhW+V6ayXlxzP2Pc=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@ -706,8 +763,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ=
golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc=
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -722,11 +779,16 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200320220750-118fecf932d8/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
@ -734,15 +796,15 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I=
golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4=
golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.31.0 h1:8Fq0yVZLh4j4YA47vHKFTa9Ew5XIrCP8LC6UeNZnLxo=
golang.org/x/oauth2 v0.31.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY=
golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@ -780,12 +842,15 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@ -793,8 +858,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@ -804,8 +869,8 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ=
golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA=
golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q=
golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@ -819,8 +884,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.13.0 h1:eUlYslOIt32DgYD6utsuUeHs4d7AsEYLuIAdg7FlYgI=
@ -854,8 +919,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@ -899,8 +964,8 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw=
google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@ -921,8 +986,10 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
@ -933,14 +1000,14 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
modernc.org/libc v1.66.3 h1:cfCbjTUcdsKyyZZfEUKfoHcP3S0Wkvz3jgSzByEWVCQ=
modernc.org/libc v1.66.3/go.mod h1:XD9zO8kt59cANKvHPXpx7yS2ELPheAey0vjIuZOhOU8=
modernc.org/libc v1.66.10 h1:yZkb3YeLx4oynyR+iUsXsybsX4Ubx7MQlSYEw4yj59A=
modernc.org/libc v1.66.10/go.mod h1:8vGSEwvoUoltr4dlywvHqjtAqHBaw0j1jI7iFBTAr2I=
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
modernc.org/sqlite v1.39.0 h1:6bwu9Ooim0yVYA7IZn9demiQk/Ejp0BtTjBWFLymSeY=
modernc.org/sqlite v1.39.0/go.mod h1:cPTJYSlgg3Sfg046yBShXENNtPrWrDX8bsbAQBzgQ5E=
modernc.org/sqlite v1.39.1 h1:H+/wGFzuSCIEVCvXYVHX5RQglwhMOvtHSv+VtidL2r4=
modernc.org/sqlite v1.39.1/go.mod h1:9fjQZ0mB1LLP0GYrp39oOJXx/I2sxEnZtzCmEQIKvGE=
mvdan.cc/xurls/v2 v2.5.0 h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
mvdan.cc/xurls/v2 v2.5.0/go.mod h1:yQgaGQ1rFtJUzkmKiHYSSfuQxqfYmd//X6PxvholpeE=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=

View file

@ -25,11 +25,23 @@ import (
"xorm.io/builder"
)
type ConcurrencyMode int
const (
// Don't enforce concurrency control. Note that you won't find `UnlimitedConcurrency` implemented directly in the
// code; setting it on an `ActionRun` prevents the other limiting behaviors.
UnlimitedConcurrency ConcurrencyMode = iota
// Queue behind other jobs with the same concurrency group
QueueBehind
// Cancel other jobs with the same concurrency group
CancelInProgress
)
// ActionRun represents a run of a workflow file
type ActionRun struct {
ID int64
Title string
RepoID int64 `xorm:"index unique(repo_index)"`
RepoID int64 `xorm:"index unique(repo_index) index(concurrency)"`
Repo *repo_model.Repository `xorm:"-"`
OwnerID int64 `xorm:"index"`
WorkflowID string `xorm:"index"` // the name of workflow file
@ -56,6 +68,11 @@ type ActionRun struct {
Created timeutil.TimeStamp `xorm:"created"`
Updated timeutil.TimeStamp `xorm:"updated"`
NotifyEmail bool
ConcurrencyGroup string `xorm:"'concurrency_group' index(concurrency)"`
ConcurrencyType ConcurrencyMode
PreExecutionError string `xorm:"LONGTEXT"` // used to report errors that blocked execution of a workflow
}
func init() {
@ -163,6 +180,24 @@ func (run *ActionRun) GetPullRequestEventPayload() (*api.PullRequestPayload, err
return nil, fmt.Errorf("event %s is not a pull request event", run.Event)
}
func (run *ActionRun) SetConcurrencyGroup(concurrencyGroup string) {
// Concurrency groups are case insensitive identifiers, implemented by collapsing case here. Unfortunately the
// `ConcurrencyGroup` field can't be made a private field because xorm doesn't map those fields -- using
// `SetConcurrencyGroup` is required for consistency but not enforced at compile-time.
run.ConcurrencyGroup = strings.ToLower(concurrencyGroup)
}
func (run *ActionRun) SetDefaultConcurrencyGroup() {
// Before ConcurrencyGroups were supported, Forgejo would automatically cancel runs with matching git refs, workflow
// IDs, and trigger events. For backwards compatibility we emulate that behavior:
run.SetConcurrencyGroup(fmt.Sprintf(
"%s_%s_%s__auto",
run.Ref,
run.WorkflowID,
run.TriggerEvent,
))
}
func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) error {
_, err := db.GetEngine(ctx).ID(repo.ID).
SetExpr("num_action_runs",
@ -183,6 +218,7 @@ func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) err
),
),
).
Cols("num_action_runs", "num_closed_action_runs").
Update(repo)
return err
}

View file

@ -5,6 +5,7 @@ package actions
import (
"context"
"strings"
"forgejo.org/models/db"
repo_model "forgejo.org/models/repo"
@ -64,14 +65,15 @@ func (runs RunList) LoadRepos(ctx context.Context) error {
type FindRunOptions struct {
db.ListOptions
RepoID int64
OwnerID int64
WorkflowID string
Ref string // the commit/tag/… that caused this workflow
TriggerUserID int64
TriggerEvent webhook_module.HookEventType
Approved bool // not util.OptionalBool, it works only when it's true
Status []Status
RepoID int64
OwnerID int64
WorkflowID string
Ref string // the commit/tag/… that caused this workflow
TriggerUserID int64
TriggerEvent webhook_module.HookEventType
Approved bool // not util.OptionalBool, it works only when it's true
Status []Status
ConcurrencyGroup string
}
func (opts FindRunOptions) ToConds() builder.Cond {
@ -100,6 +102,9 @@ func (opts FindRunOptions) ToConds() builder.Cond {
if opts.TriggerEvent != "" {
cond = cond.And(builder.Eq{"trigger_event": opts.TriggerEvent})
}
if opts.ConcurrencyGroup != "" {
cond = cond.And(builder.Eq{"concurrency_group": strings.ToLower(opts.ConcurrencyGroup)})
}
return cond
}

View file

@ -5,7 +5,84 @@ package actions
import (
"testing"
repo_model "forgejo.org/models/repo"
"forgejo.org/models/unittest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestGetRunBefore(t *testing.T) {
}
func TestSetConcurrencyGroup(t *testing.T) {
run := ActionRun{}
run.SetConcurrencyGroup("abc123")
assert.Equal(t, "abc123", run.ConcurrencyGroup)
run.SetConcurrencyGroup("ABC123") // case should collapse in SetConcurrencyGroup
assert.Equal(t, "abc123", run.ConcurrencyGroup)
}
func TestSetDefaultConcurrencyGroup(t *testing.T) {
run := ActionRun{
Ref: "refs/heads/main",
WorkflowID: "testing",
TriggerEvent: "pull_request",
}
run.SetDefaultConcurrencyGroup()
assert.Equal(t, "refs/heads/main_testing_pull_request__auto", run.ConcurrencyGroup)
run = ActionRun{
Ref: "refs/heads/main",
WorkflowID: "TESTING", // case should collapse in SetDefaultConcurrencyGroup
TriggerEvent: "pull_request",
}
run.SetDefaultConcurrencyGroup()
assert.Equal(t, "refs/heads/main_testing_pull_request__auto", run.ConcurrencyGroup)
}
func TestUpdateRepoRunsNumbers(t *testing.T) {
require.NoError(t, unittest.PrepareTestDatabase())
t.Run("Normal", func(t *testing.T) {
t.Run("Repo 1", func(t *testing.T) {
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
require.NoError(t, updateRepoRunsNumbers(t.Context(), repo))
repo = unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
assert.Equal(t, 1, repo.NumActionRuns)
assert.Equal(t, 1, repo.NumClosedActionRuns)
})
t.Run("Repo 4", func(t *testing.T) {
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 4})
require.NoError(t, updateRepoRunsNumbers(t.Context(), repo))
repo = unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 4})
assert.Equal(t, 4, repo.NumActionRuns)
assert.Equal(t, 4, repo.NumClosedActionRuns)
})
t.Run("Repo 63", func(t *testing.T) {
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 63})
require.NoError(t, updateRepoRunsNumbers(t.Context(), repo))
repo = unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 63})
assert.Equal(t, 3, repo.NumActionRuns)
assert.Equal(t, 2, repo.NumClosedActionRuns)
})
})
t.Run("Columns specifc", func(t *testing.T) {
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
repo.Name = "ishouldnotbeupdated"
require.NoError(t, updateRepoRunsNumbers(t.Context(), repo))
repo = unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
assert.Equal(t, "repo1", repo.Name)
})
}

View file

@ -239,6 +239,88 @@ func GetRunningTaskByToken(ctx context.Context, token string) (*ActionTask, erro
return nil, errNotExist
}
func getConcurrencyCondition() builder.Cond {
concurrencyCond := builder.NewCond()
// OK to pick if there's no concurrency_group on the run
concurrencyCond = concurrencyCond.Or(builder.Eq{"concurrency_group": ""})
concurrencyCond = concurrencyCond.Or(builder.IsNull{"concurrency_group"})
// OK to pick if it's not a "QueueBehind" concurrency type
concurrencyCond = concurrencyCond.Or(builder.Neq{"concurrency_type": QueueBehind})
// subQuery ends up representing all the runs that would block a run from executing:
subQuery := builder.Select("id").From("action_run", "inner_run").
// A run can't block itself, so exclude it from this search
Where(builder.Neq{"inner_run.id": builder.Expr("outer_run.id")}).
// Blocking runs must be from the same repo & concurrency group
And(builder.Eq{"inner_run.repo_id": builder.Expr("outer_run.repo_id")}).
And(builder.Eq{"inner_run.concurrency_group": builder.Expr("outer_run.concurrency_group")}).
And(
// Ideally the logic here would be that a blocking run is "not done", and "younger", which allows each run
// to be blocked on the previous runs in the concurrency group and therefore execute in order from oldest to
// newest.
//
// But it's possible for runs to be required to run out-of-order -- for example, if a younger run has
// already completed but then it is re-run. If we only used "not done" and "younger" as logic, then the
// re-run would not be blocked, and therefore would violate the concurrency group's single-run goal.
//
// So we use two conditions to meet both needs:
//
// Blocking runs have a running status...
builder.Eq{"inner_run.status": StatusRunning}.Or(
// Blocking runs don't have a IsDone status & are younger than the outer_run
builder.NotIn("inner_run.status", []Status{StatusSuccess, StatusFailure, StatusCancelled, StatusSkipped}).
And(builder.Lt{"inner_run.`index`": builder.Expr("outer_run.`index`")})))
// OK to pick if there are no blocking runs
concurrencyCond = concurrencyCond.Or(builder.NotExists(subQuery))
return concurrencyCond
}
// Returns all the available jobs that could be executed on `runner`, before label filtering is applied. Note that
// only a single job can actually be run from this result for any given invocation, as multiple runs (in order) from any
// single concurrency group could be returned.
func GetAvailableJobsForRunner(e db.Engine, runner *ActionRunner) ([]*ActionRunJob, error) {
jobCond := builder.NewCond()
if runner.RepoID != 0 {
jobCond = builder.Eq{"repo_id": runner.RepoID}
} else if runner.OwnerID != 0 {
jobCond = builder.In("repo_id", builder.Select("`repository`.id").From("repository").
Join("INNER", "repo_unit", "`repository`.id = `repo_unit`.repo_id").
Where(builder.Eq{"`repository`.owner_id": runner.OwnerID, "`repo_unit`.type": unit.TypeActions}))
}
// Concurrency group checks for queuing one run behind the last run in the concurrency group are more
// computationally expensive on the database. To manage the risk that this might have on large-scale deployments
// When this feature is initially released, it can be disabled in the ini file by setting
// `CONCURRENCY_GROUP_QUEUE_ENABLED = false` in the `[actions]` section. If disabled, then actions with a
// concurrency group and `cancel-in-progress: false` will run simultaneously rather than being queued.
if setting.Actions.ConcurrencyGroupQueueEnabled {
jobCond = jobCond.And(getConcurrencyCondition())
}
if jobCond.IsValid() {
// It is *likely* more efficient to use an EXISTS query here rather than an IN clause, as that allows the
// database's query optimizer to perform partial computation of the subquery rather than complete computation.
// However, database engines can be fickle and difficult to predict. We'll retain the original IN clause
// implementation when ConcurrencyGroupQueueEnabled is disabled, which should maintain the same performance
// characteristics. When ConcurrencyGroupQueueEnabled is enabled, it will switch to the EXISTS clause.
if setting.Actions.ConcurrencyGroupQueueEnabled {
jobCond = builder.Exists(builder.Select("id").From("action_run", "outer_run").
Where(builder.Eq{"outer_run.id": builder.Expr("action_run_job.run_id")}).
And(jobCond))
} else {
jobCond = builder.In("run_id", builder.Select("id").From("action_run", "outer_run").Where(jobCond))
}
}
var jobs []*ActionRunJob
if err := e.Where("task_id=? AND status=?", 0, StatusWaiting).And(jobCond).Asc("updated", "id").Find(&jobs); err != nil {
return nil, err
}
return jobs, nil
}
func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask, bool, error) {
ctx, commiter, err := db.TxContext(ctx)
if err != nil {
@ -248,20 +330,8 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask
e := db.GetEngine(ctx)
jobCond := builder.NewCond()
if runner.RepoID != 0 {
jobCond = builder.Eq{"repo_id": runner.RepoID}
} else if runner.OwnerID != 0 {
jobCond = builder.In("repo_id", builder.Select("`repository`.id").From("repository").
Join("INNER", "repo_unit", "`repository`.id = `repo_unit`.repo_id").
Where(builder.Eq{"`repository`.owner_id": runner.OwnerID, "`repo_unit`.type": unit.TypeActions}))
}
if jobCond.IsValid() {
jobCond = builder.In("run_id", builder.Select("id").From("action_run").Where(jobCond))
}
var jobs []*ActionRunJob
if err := e.Where("task_id=? AND status=?", 0, StatusWaiting).And(jobCond).Asc("updated", "id").Find(&jobs); err != nil {
jobs, err := GetAvailableJobsForRunner(e, runner)
if err != nil {
return nil, false, err
}

View file

@ -127,6 +127,13 @@ func (t *AccessToken) DisplayPublicOnly() bool {
return publicOnly
}
// UpdateLastUsed updates the time this token was last used to now.
func (t *AccessToken) UpdateLastUsed(ctx context.Context) error {
t.UpdatedUnix = timeutil.TimeStampNow()
_, err := db.GetEngine(ctx).ID(t.ID).Cols("updated_unix").NoAutoTime().Update(t)
return err
}
func getAccessTokenIDFromCache(token string) int64 {
if successfulAccessTokenCache == nil {
return 0
@ -220,12 +227,6 @@ func (opts ListAccessTokensOptions) ToOrders() string {
return "created_unix DESC"
}
// UpdateAccessToken updates information of access token.
func UpdateAccessToken(ctx context.Context, t *AccessToken) error {
_, err := db.GetEngine(ctx).ID(t.ID).AllCols().Update(t)
return err
}
// DeleteAccessTokenByID deletes access token by given ID.
func DeleteAccessTokenByID(ctx context.Context, id, userID int64) error {
cnt, err := db.GetEngine(ctx).ID(id).Delete(&AccessToken{
@ -258,5 +259,6 @@ func RegenerateAccessTokenByID(ctx context.Context, id, userID int64) (*AccessTo
// Reset the creation time, token is unused
t.UpdatedUnix = timeutil.TimeStampNow()
return t, UpdateAccessToken(ctx, t)
_, err = db.GetEngine(ctx).ID(t.ID).Cols("token_salt", "token", "token_hash", "token_last_eight", "updated_unix").NoAutoTime().Update(t)
return t, err
}

View file

@ -5,10 +5,12 @@ package auth_test
import (
"testing"
"time"
auth_model "forgejo.org/models/auth"
"forgejo.org/models/db"
"forgejo.org/models/unittest"
"forgejo.org/modules/timeutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -107,14 +109,17 @@ func TestListAccessTokens(t *testing.T) {
assert.Empty(t, tokens)
}
func TestUpdateAccessToken(t *testing.T) {
require.NoError(t, unittest.PrepareTestDatabase())
token, err := auth_model.GetAccessTokenBySHA(db.DefaultContext, "4c6f36e6cf498e2a448662f915d932c09c5a146c")
require.NoError(t, err)
token.Name = "Token Z"
func TestUpdateLastUsed(t *testing.T) {
timeutil.MockSet(time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC))
defer timeutil.MockUnset()
require.NoError(t, auth_model.UpdateAccessToken(db.DefaultContext, token))
unittest.AssertExistsAndLoadBean(t, token)
require.NoError(t, unittest.PrepareTestDatabase())
token := unittest.AssertExistsAndLoadBean(t, &auth_model.AccessToken{ID: 2})
require.NoError(t, token.UpdateLastUsed(t.Context()))
token = unittest.AssertExistsAndLoadBean(t, &auth_model.AccessToken{ID: 2})
assert.Equal(t, timeutil.TimeStampNow(), token.UpdatedUnix)
}
func TestDeleteAccessTokenByID(t *testing.T) {

View file

@ -298,6 +298,31 @@ func TruncateBeans(ctx context.Context, beans ...any) (err error) {
return nil
}
// TruncateBeansCascade deletes all given beans. Beans MUST NOT contain delete conditions, as tables related by foreign
// keys will also be truncated.
func TruncateBeansCascade(ctx context.Context, beans ...any) (err error) {
// Expand the list of beans to any other table with a foreign key reference to the beans
cascadeTables, err := extendBeansForCascade(beans)
if err != nil {
return err
}
// Sort the beans in inverse foreign key delete order
cascadeSorted, err := sortBeans(cascadeTables, foreignKeySortDelete)
if err != nil {
return err
}
// Execute the truncate
e := GetEngine(ctx)
for i := range cascadeSorted {
if _, err = e.Truncate(cascadeSorted[i]); err != nil {
return err
}
}
return nil
}
// CountByBean counts the number of database records according non-empty fields of the bean as conditions.
func CountByBean(ctx context.Context, bean any) (int64, error) {
return GetEngine(ctx).Count(bean)

View file

@ -161,9 +161,13 @@ func (w engineGroupWrapper) AddHook(hook contexts.Hook) bool {
// SyncAllTables sync the schemas of all tables
func SyncAllTables() error {
_, err := x.StoreEngine("InnoDB").SyncWithOptions(xorm.SyncOptions{
sortedTables, err := sortBeans(tables, foreignKeySortInsert)
if err != nil {
return err
}
_, err = x.StoreEngine("InnoDB").SyncWithOptions(xorm.SyncOptions{
WarnIfDatabaseColumnMissed: true,
}, tables...)
}, sortedTables...)
return err
}

275
models/db/foreign_keys.go Normal file
View file

@ -0,0 +1,275 @@
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: GPL-3.0-or-later
package db
import (
"cmp"
"fmt"
"slices"
"sync"
"forgejo.org/modules/container"
"xorm.io/xorm/schemas"
)
type schemaWithDefaultBean struct {
schema *schemas.Table
bean any
}
var (
cachedForeignKeyOrderedTables = sync.OnceValues(foreignKeyOrderedTables)
cachedTableNameLookupOrder = sync.OnceValues(tableNameLookupOrder)
// Slice of all registered tables, including their bean from `RegisterModel()` and their schemas.Table reference.
cachedSchemaTables = sync.OnceValues(func() ([]schemaWithDefaultBean, error) {
schemaTables := make([]schemaWithDefaultBean, 0, len(tables))
for _, bean := range tables {
table, err := TableInfo(bean)
if err != nil {
return nil, fmt.Errorf("cachedSchemaTables: failure to fetch schema table for bean %#v: %w", bean, err)
}
schemaTables = append(schemaTables, schemaWithDefaultBean{
schema: table,
bean: bean,
})
}
return schemaTables, nil
})
// Lookup map from table name -> {schemas.Table, bean}. The bean is the empty bean from `RegisterModel()`.
cachedTableMap = sync.OnceValues(func() (map[string]schemaWithDefaultBean, error) {
schemaTables, err := cachedSchemaTables()
if err != nil {
return nil, err
}
retval := make(map[string]schemaWithDefaultBean, len(schemaTables))
for _, table := range schemaTables {
retval[table.schema.Name] = table
}
return retval, nil
})
// Table A has foreign keys to [B, C], this is a map of A -> {B, C}.
cachedReferencingTables = sync.OnceValues(func() (map[string][]string, error) {
schemaTables, err := cachedSchemaTables()
if err != nil {
return nil, err
}
return calculateReferencingTables(schemaTables), nil
})
// Table A has foreign keys to [B, C], this is a map of B -> {A}, C -> {A}.
cachedReferencedTables = sync.OnceValues(func() (map[string][]string, error) {
referencingTables, err := cachedReferencingTables()
if err != nil {
return nil, err
}
referencedTables := make(map[string][]string)
for referencingTable, targetTables := range referencingTables {
for _, targetTable := range targetTables {
referencedTables[targetTable] = append(referencedTables[targetTable], referencingTable)
}
}
return referencedTables, nil
})
)
// Create a map for each schema table which contains a slice of all the tables that reference it (with a foreign key).
func calculateReferencingTables(tables []schemaWithDefaultBean) map[string][]string {
referencingTables := make(map[string][]string, len(tables))
for _, table := range tables {
tableName := table.schema.Name
for _, fk := range table.schema.ForeignKeys {
referencingTables[tableName] = append(referencingTables[tableName], fk.TargetTableName)
}
}
return referencingTables
}
// Create a list of database tables in their "foreign key order". This order specifies the safe insertion order for
// records into tables, where earlier tables in the list are referenced by foreign keys that exist in tables later in
// the list. This order can be used in reverse as a safe deletion order as well.
//
// An ordered list of tables is incompatible with tables that have self-referencing foreign keys and circular referenced
// foreign keys; however neither of those cases are in-use in Forgejo.
func calculateTableForeignKeyOrder(tables []schemaWithDefaultBean) ([]schemaWithDefaultBean, error) {
remainingTables := slices.Clone(tables)
referencingTables := calculateReferencingTables(remainingTables)
orderedTables := make([]schemaWithDefaultBean, 0, len(remainingTables))
for len(remainingTables) > 0 {
nextGroup := make([]schemaWithDefaultBean, 0, len(remainingTables))
for _, targetTable := range remainingTables {
// Skip if this targetTable has foreign keys and the target table hasn't been created.
slice, ok := referencingTables[targetTable.schema.Name]
if ok && len(slice) > 0 { // This table is still referencing an uncreated table
continue
}
// This table's references are satisfied or it had none
nextGroup = append(nextGroup, targetTable)
}
if len(nextGroup) == 0 {
return nil, fmt.Errorf("calculateTableForeignKeyOrder: unable to figure out next table from remainingTables = %#v", remainingTables)
}
orderedTables = append(orderedTables, nextGroup...)
// Cleanup between loops: remove each table in nextGroup from remainingTables, and remove their table names from
// referencingTables as well.
for _, doneTable := range nextGroup {
remainingTables = slices.DeleteFunc(remainingTables, func(remainingTable schemaWithDefaultBean) bool {
return remainingTable.schema.Name == doneTable.schema.Name
})
for referencingTable, referencedTables := range referencingTables {
referencingTables[referencingTable] = slices.DeleteFunc(referencedTables, func(tableName string) bool {
return tableName == doneTable.schema.Name
})
}
}
}
return orderedTables, nil
}
// Create a list of registered database tables in their "foreign key order", per calculateTableForeignKeyOrder.
func foreignKeyOrderedTables() ([]schemaWithDefaultBean, error) {
schemaTables, err := cachedSchemaTables()
if err != nil {
return nil, err
}
orderedTables, err := calculateTableForeignKeyOrder(schemaTables)
if err != nil {
return nil, err
}
return orderedTables, nil
}
// Create a map from each registered database table's name to its order in "foreign key order", per
// calculateTableForeignKeyOrder.
func tableNameLookupOrder() (map[string]int, error) {
tables, err := cachedForeignKeyOrderedTables()
if err != nil {
return nil, err
}
lookupMap := make(map[string]int, len(tables))
for i, table := range tables {
lookupMap[table.schema.Name] = i
}
return lookupMap, nil
}
// When used as a comparator function in `slices.SortFunc`, can sort a slice into the safe insertion order for records
// in tables, where earlier tables in the list are referenced by foreign keys that exist in tables later in the list.
func TableNameInsertionOrderSortFunc(table1, table2 string) int {
lookupMap, err := cachedTableNameLookupOrder()
if err != nil {
panic(fmt.Sprintf("cachedTableNameLookupOrder failed: %#v", err))
}
// Since this is typically used by `slices.SortFunc` it can't return an error. If a table is referenced that isn't
// a registered model then it will be sorted at the beginning -- this case is used in models/gitea_migrations/test.
val1, ok := lookupMap[table1]
if !ok {
val1 = -1
}
val2, ok := lookupMap[table2]
if !ok {
val2 = -1
}
return cmp.Compare(val1, val2)
}
// In "Insert" order, tables that have a foreign key will be sorted after the tables that the foreign key points to, so
// that records can be safely inserted in this order. "Delete" order is the opposite, and allows records to be safely
// deleted in this order.
type foreignKeySortOrder int8
const (
foreignKeySortInsert foreignKeySortOrder = iota
foreignKeySortDelete
)
// Sort the provided beans in the provided foreign-key sort order.
func sortBeans(beans []any, sortOrder foreignKeySortOrder) ([]any, error) {
type beanWithTableName struct {
bean any
tableName string
}
beansWithTableNames := make([]beanWithTableName, 0, len(beans))
for _, bean := range beans {
table, err := TableInfo(bean)
if err != nil {
return nil, fmt.Errorf("sortBeans: failure to fetch schema table for bean %#v: %w", bean, err)
}
beansWithTableNames = append(beansWithTableNames, beanWithTableName{bean: bean, tableName: table.Name})
}
slices.SortFunc(beansWithTableNames, func(a, b beanWithTableName) int {
if sortOrder == foreignKeySortInsert {
return TableNameInsertionOrderSortFunc(a.tableName, b.tableName)
}
return TableNameInsertionOrderSortFunc(b.tableName, a.tableName)
})
beanRetval := make([]any, len(beans))
for i, beanWithTableName := range beansWithTableNames {
beanRetval[i] = beanWithTableName.bean
}
return beanRetval, nil
}
// A database operation on `beans` may need to affect additional tables based upon foreign keys to those beans.
// extendBeansForCascade returns a new list of beans which includes all the referencing tables that link to `beans`'
// tables. For example, provided a `&User{}`, it will return `[&User{}, &Stopwatch{}, ...]` where `Stopwatch` is a table
// that references `User`. The additional beans returned will be default structs that were provided to
// `db.RegisterModel`.
func extendBeansForCascade(beans []any) ([]any, error) {
referencedTables, err := cachedReferencedTables()
if err != nil {
return nil, err
}
tableMap, err := cachedTableMap()
if err != nil {
return nil, err
}
deduplicateTables := make(container.Set[string], len(beans))
finalBeans := slices.Clone(beans)
newBeans := beans
nextBeanSet := make([]any, 0)
for {
for _, bean := range newBeans {
schema, err := TableInfo(bean)
if err != nil {
return nil, fmt.Errorf("cascadeDeleteTables: failure to fetch schema table for bean %#v: %w", bean, err)
}
if deduplicateTables.Contains(schema.Name) {
continue
}
deduplicateTables.Add(schema.Name)
for _, referencingTable := range referencedTables[schema.Name] {
table := tableMap[referencingTable]
finalBeans = append(finalBeans, table.bean)
nextBeanSet = append(nextBeanSet, table.bean)
}
}
if len(nextBeanSet) == 0 {
break
}
newBeans = nextBeanSet
nextBeanSet = nextBeanSet[:0] // set len 0, keep allocation for reuse
}
return finalBeans, nil
}

View file

@ -5,39 +5,82 @@ package db
import (
"context"
"fmt"
"reflect"
"forgejo.org/modules/setting"
"xorm.io/builder"
)
// Iterate iterate all the Bean object
// Iterate iterate all the Bean object. The table being iterated must have a single-column primary key.
func Iterate[Bean any](ctx context.Context, cond builder.Cond, f func(ctx context.Context, bean *Bean) error) error {
var start int
var dummy Bean
batchSize := setting.Database.IterateBufferSize
sess := GetEngine(ctx)
table, err := TableInfo(&dummy)
if err != nil {
return fmt.Errorf("unable to fetch table info for bean %v: %w", dummy, err)
}
if len(table.PrimaryKeys) != 1 {
return fmt.Errorf("iterate only supported on a table with 1 primary key field, but table %s had %d", table.Name, len(table.PrimaryKeys))
}
pkDbName := table.PrimaryKeys[0]
var pkStructFieldName string
for _, c := range table.Columns() {
if c.Name == pkDbName {
pkStructFieldName = c.FieldName
break
}
}
if pkStructFieldName == "" {
return fmt.Errorf("iterate unable to identify struct field for primary key %s", pkDbName)
}
var lastPK any
for {
select {
case <-ctx.Done():
return ctx.Err()
default:
beans := make([]*Bean, 0, batchSize)
sess := GetEngine(ctx)
sess = sess.OrderBy(pkDbName)
if cond != nil {
sess = sess.Where(cond)
}
if err := sess.Limit(batchSize, start).Find(&beans); err != nil {
if lastPK != nil {
sess = sess.Where(builder.Gt{pkDbName: lastPK})
}
if err := sess.Limit(batchSize).Find(&beans); err != nil {
return err
}
if len(beans) == 0 {
return nil
}
start += len(beans)
for _, bean := range beans {
if err := f(ctx, bean); err != nil {
return err
}
}
lastBean := beans[len(beans)-1]
lastPK = extractFieldValue(lastBean, pkStructFieldName)
}
}
}
func extractFieldValue(bean any, fieldName string) any {
v := reflect.ValueOf(bean)
if v.Kind() == reflect.Ptr {
v = v.Elem()
}
field := v.FieldByName(fieldName)
return field.Interface()
}

View file

@ -5,42 +5,113 @@ package db_test
import (
"context"
"fmt"
"slices"
"testing"
"forgejo.org/models/db"
repo_model "forgejo.org/models/repo"
"forgejo.org/models/unittest"
"forgejo.org/modules/setting"
"forgejo.org/modules/test"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"xorm.io/builder"
)
func TestIterate(t *testing.T) {
require.NoError(t, unittest.PrepareTestDatabase())
xe, err := unittest.GetXORMEngine()
require.NoError(t, err)
require.NoError(t, xe.Sync(&repo_model.RepoUnit{}))
db.SetLogSQL(t.Context(), true)
defer test.MockVariableValue(&setting.Database.IterateBufferSize, 50)()
cnt, err := db.GetEngine(db.DefaultContext).Count(&repo_model.RepoUnit{})
require.NoError(t, err)
t.Run("No Modifications", func(t *testing.T) {
require.NoError(t, unittest.PrepareTestDatabase())
xe, err := unittest.GetXORMEngine()
require.NoError(t, err)
require.NoError(t, xe.Sync(&repo_model.RepoUnit{}))
var repoUnitCnt int
err = db.Iterate(db.DefaultContext, nil, func(ctx context.Context, repo *repo_model.RepoUnit) error {
repoUnitCnt++
return nil
// Fetch all the repo unit IDs...
var remainingRepoIDs []int64
db.GetEngine(t.Context()).Table(&repo_model.RepoUnit{}).Cols("id").Find(&remainingRepoIDs)
// Ensure that every repo unit ID is found when doing iterate:
err = db.Iterate(t.Context(), nil, func(ctx context.Context, repo *repo_model.RepoUnit) error {
remainingRepoIDs = slices.DeleteFunc(remainingRepoIDs, func(n int64) bool {
return repo.ID == n
})
return nil
})
require.NoError(t, err)
assert.Empty(t, remainingRepoIDs)
})
require.NoError(t, err)
assert.EqualValues(t, cnt, repoUnitCnt)
err = db.Iterate(db.DefaultContext, nil, func(ctx context.Context, repoUnit *repo_model.RepoUnit) error {
has, err := db.ExistByID[repo_model.RepoUnit](ctx, repoUnit.ID)
if err != nil {
return err
}
if !has {
return db.ErrNotExist{Resource: "repo_unit", ID: repoUnit.ID}
}
return nil
t.Run("Concurrent Delete", func(t *testing.T) {
require.NoError(t, unittest.PrepareTestDatabase())
xe, err := unittest.GetXORMEngine()
require.NoError(t, err)
require.NoError(t, xe.Sync(&repo_model.RepoUnit{}))
// Fetch all the repo unit IDs...
var remainingRepoIDs []int64
db.GetEngine(t.Context()).Table(&repo_model.RepoUnit{}).Cols("id").Find(&remainingRepoIDs)
// Ensure that every repo unit ID is found, even if someone else performs a DELETE on the table while we're
// iterating. In real-world usage the deleted record may or may not be returned, but the important
// subject-under-test is that no *other* record is skipped.
didDelete := false
err = db.Iterate(t.Context(), nil, func(ctx context.Context, repo *repo_model.RepoUnit) error {
// While on page 2 (assuming ID ordering, 50 record buffer size)...
if repo.ID == 51 {
// Delete a record that would have been on page 1.
affected, err := db.GetEngine(t.Context()).ID(25).Delete(&repo_model.RepoUnit{})
if err != nil {
return err
} else if affected != 1 {
return fmt.Errorf("expected to delete 1 record, but affected %d records", affected)
}
didDelete = true
}
remainingRepoIDs = slices.DeleteFunc(remainingRepoIDs, func(n int64) bool {
return repo.ID == n
})
return nil
})
require.NoError(t, err)
assert.True(t, didDelete, "didDelete")
assert.Empty(t, remainingRepoIDs)
})
t.Run("Verify cond applied", func(t *testing.T) {
require.NoError(t, unittest.PrepareTestDatabase())
xe, err := unittest.GetXORMEngine()
require.NoError(t, err)
require.NoError(t, xe.Sync(&repo_model.RepoUnit{}))
// Fetch all the repo unit IDs...
var remainingRepoIDs []int64
db.GetEngine(t.Context()).Table(&repo_model.RepoUnit{}).Cols("id").Find(&remainingRepoIDs)
// Remove those that we're not expecting to find based upon `Iterate`'s condition. We'll trim the front few
// records and last few records, which will confirm that cond is applied on all pages.
remainingRepoIDs = slices.DeleteFunc(remainingRepoIDs, func(n int64) bool {
return n <= 15 || n > 1000
})
err = db.Iterate(t.Context(), builder.Gt{"id": 15}.And(builder.Lt{"id": 1000}), func(ctx context.Context, repo *repo_model.RepoUnit) error {
removedRecord := false
// Remove the record from remainingRepoIDs, but track to make sure we did actually remove a record
remainingRepoIDs = slices.DeleteFunc(remainingRepoIDs, func(n int64) bool {
if repo.ID == n {
removedRecord = true
return true
}
return false
})
if !removedRecord {
return fmt.Errorf("unable to find record in remainingRepoIDs for repo %d, indicating a cond application failure", repo.ID)
}
return nil
})
require.NoError(t, err)
assert.Empty(t, remainingRepoIDs)
})
require.NoError(t, err)
}

View file

@ -525,6 +525,7 @@
ref: "refs/heads/main"
commit_sha: "97f29ee599c373c729132a5c46a046978311e0ee"
event: "workflow_dispatch"
trigger_event: "workflow_dispatch"
is_fork_pull_request: 0
status: 6 # running
started: 1683636528

View file

@ -349,7 +349,7 @@
is_archived: false
is_mirror: false
status: 0
is_fork: false
is_fork: true
fork_id: 10
is_template: false
template_id: 0

View file

@ -24,7 +24,6 @@
-
id: 4
user_id: -1
issue_id: 4
time: 1
created_unix: 946684803

View file

@ -1562,3 +1562,41 @@
theme: ""
keep_activity_private: false
created_unix: 1672578400
-
id: 42
lower_name: federated-example.net
name: federated-example.net
full_name: federated
email: f73240e82-c061-41ef-b7d6-4376cb6f2e1c@example.com
keep_email_private: false
email_notifications_preference: enabled
passwd: ZogKvWdyEx:password
passwd_hash_algo: dummy
must_change_password: false
login_source: 0
login_name: federated-example.net
type: 5
salt: ZogKvWdyEx
max_repo_creation: -1
is_active: false
is_admin: false
is_restricted: false
allow_git_hook: false
allow_import_local: false
allow_create_organization: false
prohibit_login: false
avatar: ""
avatar_email: f73240e82-c061-41ef-b7d6-4376cb6f2e1c@example.com
use_custom_avatar: false
num_followers: 0
num_following: 0
num_stars: 0
num_repos: 0
num_teams: 0
num_members: 0
visibility: 0
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1759086716

View file

@ -0,0 +1,105 @@
# forgejo_migrations
Forgejo has three database migration mechanisms:
- `models/gitea_migrations`
- Original database schema migrations from Forgejo's legacy as a fork of Gitea.
- A linear set of migrations referenced in `models/gitea_migrations/migrations.go`, each represented by a number (eg. migration 304).
- The current version is recorded in the database in the table `version`.
- `models/forgejo_migrations_legacy`
- The next 50-ish database schema migrations reflecting change in Forgejo's database structure between Forgejo v7.0 and v14.0
- A linear set of migrations referenced in `models/forgejo_migrations_legacy/migrate.go`, each represented by a number (eg. migration 43).
- The current version is recorded in the database in the table `forgejo_version`.
- `models/forgejo_migrations`
- The most recent database schema migrations, reflecting change in the v14.0 release cycle and onwards into the future.
- Each migration is identified by the filename it is stored in.
- The applied migrations are recorded in the database in the table `forgejo_migration`.
`forgejo_migrations` is designed to reduce code conflicts when multiple developers may be making schema migrations in close succession, which it does by avoiding having one code file with a long array of migrations. Instead, each file in `models/forgejo_migrations` registers itself as a migration, and its filename indicates the order that migration will be applied.
Files in `forgejo_migrations` must:
- Define an `init` function which registers a function to be invoked for the migration.
- Follow the naming convention:
- The letter `v`
- A number, representing the development cycle that the migration was created in
- A letter, indicating any required migration ordering
- The character `_` (underscore)
- A short descriptive identifier for the migration
For example, valid migration file names would look like this:
- `v14a_add-threaded-comments.go`
- `v14a_add-federated-emojis.go`
- `v14b_fix-threaded-comments-index.go`
## Migration Ordering
Forgejo executes registered migrations in `forgejo_migrations` in the `strings.Compare()` ordering of their filename.
There are edge cases where migrations may not be executed in this exact order:
- If a schema change is backported to an earlier Forgejo release. For example, if a bugfix during the v15 development cycle was backported into a v14 patch release, then a migration labeled `v15a_fix-unusual-data-corruption.go` could be applied during a v14 software upgrade. In the future when a v15 software release occurs, that migration will be identified as already applied and will be skipped.
- If a developer working on Forgejo switches between different branches with different schema migrations.
- If the contents of the `forgejo_migrations` database table are changed outside of Forgejo modifying it.
## Creating a new Migration
First, determine the filename for your migration. In general, you create a new migration by starting a file with the same prefix as the most recent migration present. If `v14a_add-forgejo-migrations-table.go` was the last file, most of the time you can create your migration with the same `v14a_...` prefix.
There are two exceptions:
- After the release branch is cut for a release, increment the version in the migration. If v14 was cut, you would start `v15a_...` as the next migration.
- If your migration requires that an earlier migration is complete first, you would increment the letter in the prefix. If you were modifying the table created by `v14a_add-forgejo-migrations-table.go`, then you would name your migration `v14b_...`.
Once you've determined the migration filename, then you can copy this template into the file:
```go
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: GPL-3.0-or-later
package forgejo_migrations
import (
"forgejo.org/modules/timeutil"
"xorm.io/xorm"
)
func init() {
registerMigration(&Migration{
Description: "short sentence describing this migration",
Upgrade: myMigrationFunction, // rename
})
}
func myMigrationFunction(x *xorm.Engine) error {
// add migration logic here
//
// to prevent `make watch` from recording this migration as done when it
// isn't authored yet, returh an error until the implementation is done
return errors.New("not implemented yet")
}
```
And now it's up to you to write the contents of your migration function.
## Development Notes
Once migrations are executed, a record of their execution is stored in the database table `forgejo_migration`.
```sql
=> SELECT * FROM forgejo_migration;
id | created_unix
-----------------------------------+--------------
v14a_add-forgejo-migrations-table | 1760402451
v14a_example-other-migration | 1760402453
v14b_another-example | 1760402455
v15a_add-something-cool | 1760402456
v15a_another-example-again | 1760402457
```
If your migration successfully executes once, it will be recorded in this table and it will never execute again, even if you change the migration code. It is common during development to need to re-run a migration, in which case you can delete the record that you're working on developing. The migration will be re-run as soon as the Forgejo server is restarted:
```sql
=> DELETE FROM forgejo_migration WHERE id = 'v15a_another-example-again';
```

View file

@ -0,0 +1,31 @@
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: GPL-3.0-or-later
package forgejo_migrations
import (
"errors"
"forgejo.org/modules/log"
"xorm.io/xorm"
)
func syncDoctorForeignKey(x *xorm.Engine, beans []any) error {
for _, bean := range beans {
// Sync() drops indexes by default, which will cause unnecessary rebuilding of indexes when syncDoctorForeignKey
// is used with partial bean definitions; so we disable that option
_, err := x.SyncWithOptions(xorm.SyncOptions{IgnoreDropIndices: true}, bean)
if err != nil {
if errors.Is(err, xorm.ErrForeignKeyViolation) {
tableName := x.TableName(bean)
log.Error(
"Foreign key creation on table %s failed. Run `forgejo doctor check --all` to identify the orphaned records preventing this foreign key from being created. Error was: %v",
tableName, err)
return err
}
return err
}
}
return nil
}

View file

@ -1,12 +1,12 @@
// Copyright 2023 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: GPL-3.0-or-later
package forgejo_migrations
import (
"testing"
migration_tests "forgejo.org/models/migrations/test"
migration_tests "forgejo.org/models/gitea_migrations/test"
)
func TestMain(m *testing.M) {

View file

@ -1,229 +1,222 @@
// Copyright 2023 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: GPL-3.0-or-later
package forgejo_migrations
import (
"context"
"errors"
"fmt"
"os"
"regexp"
"runtime"
"slices"
"strings"
"forgejo.org/models/forgejo/semver"
forgejo_v1_20 "forgejo.org/models/forgejo_migrations/v1_20"
forgejo_v1_22 "forgejo.org/models/forgejo_migrations/v1_22"
"forgejo.org/modules/git"
"forgejo.org/modules/container"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
"forgejo.org/modules/timeutil"
"xorm.io/xorm"
"xorm.io/xorm/names"
)
// ForgejoVersion describes the Forgejo version table. Should have only one row with id = 1.
type ForgejoVersion struct {
ID int64 `xorm:"pk autoincr"`
Version int64
// ForgejoMigration table contains a record of migrations applied to the database. (Note that there are older
// migrations in the forgejo_version table from before this table was introduced, and the `version` table from Gitea
// migrations). Each record in this table represents one successfully completed migration which was completed at the
// `CreatedUnix` time.
type ForgejoMigration struct {
ID string `xorm:"pk"`
CreatedUnix timeutil.TimeStamp `xorm:"created"`
}
type Migration struct {
description string
migrate func(*xorm.Engine) error
Description string // short plaintext explanation of the migration
Upgrade func(*xorm.Engine) error // perform the migration
id string // unique migration identifier
}
// NewMigration creates a new migration.
func NewMigration(desc string, fn func(*xorm.Engine) error) *Migration {
return &Migration{desc, fn}
var (
rawMigrations []*Migration
migrationFilenameRegex = regexp.MustCompile(`/(?P<migration_group>v[0-9]+[a-z])_(?P<migration_id>[^/]+)\.go$`)
)
var getMigrationFilename = func() string {
_, migrationFilename, _, _ := runtime.Caller(2)
return migrationFilename
}
// This is a sequence of additional Forgejo migrations.
// Add new migrations to the bottom of the list.
var migrations = []*Migration{
// v0 -> v1
NewMigration("Create the `forgejo_blocked_user` table", forgejo_v1_20.AddForgejoBlockedUser),
// v1 -> v2
NewMigration("Create the `forgejo_sem_ver` table", forgejo_v1_20.CreateSemVerTable),
// v2 -> v3
NewMigration("Create the `forgejo_auth_token` table", forgejo_v1_20.CreateAuthorizationTokenTable),
// v3 -> v4
NewMigration("Add the `default_permissions` column to the `repo_unit` table", forgejo_v1_22.AddDefaultPermissionsToRepoUnit),
// v4 -> v5
NewMigration("Create the `forgejo_repo_flag` table", forgejo_v1_22.CreateRepoFlagTable),
// v5 -> v6
NewMigration("Add the `wiki_branch` column to the `repository` table", forgejo_v1_22.AddWikiBranchToRepository),
// v6 -> v7
NewMigration("Add the `enable_repo_unit_hints` column to the `user` table", forgejo_v1_22.AddUserRepoUnitHintsSetting),
// v7 -> v8
NewMigration("Modify the `release`.`note` content to remove SSH signatures", forgejo_v1_22.RemoveSSHSignaturesFromReleaseNotes),
// v8 -> v9
NewMigration("Add the `apply_to_admins` column to the `protected_branch` table", forgejo_v1_22.AddApplyToAdminsSetting),
// v9 -> v10
NewMigration("Add pronouns to user", forgejo_v1_22.AddPronounsToUser),
// v10 -> v11
NewMigration("Add the `created` column to the `issue` table", forgejo_v1_22.AddCreatedToIssue),
// v11 -> v12
NewMigration("Add repo_archive_download_count table", forgejo_v1_22.AddRepoArchiveDownloadCount),
// v12 -> v13
NewMigration("Add `hide_archive_links` column to `release` table", AddHideArchiveLinksToRelease),
// v13 -> v14
NewMigration("Remove Gitea-specific columns from the repository and badge tables", RemoveGiteaSpecificColumnsFromRepositoryAndBadge),
// v14 -> v15
NewMigration("Create the `federation_host` table", CreateFederationHostTable),
// v15 -> v16
NewMigration("Create the `federated_user` table", CreateFederatedUserTable),
// v16 -> v17
NewMigration("Add `normalized_federated_uri` column to `user` table", AddNormalizedFederatedURIToUser),
// v17 -> v18
NewMigration("Create the `following_repo` table", CreateFollowingRepoTable),
// v18 -> v19
NewMigration("Add external_url to attachment table", AddExternalURLColumnToAttachmentTable),
// v19 -> v20
NewMigration("Creating Quota-related tables", CreateQuotaTables),
// v20 -> v21
NewMigration("Add SSH keypair to `pull_mirror` table", AddSSHKeypairToPushMirror),
// v21 -> v22
NewMigration("Add `legacy` to `web_authn_credential` table", AddLegacyToWebAuthnCredential),
// v22 -> v23
NewMigration("Add `delete_branch_after_merge` to `auto_merge` table", AddDeleteBranchAfterMergeToAutoMerge),
// v23 -> v24
NewMigration("Add `purpose` column to `forgejo_auth_token` table", AddPurposeToForgejoAuthToken),
// v24 -> v25
NewMigration("Migrate `secret` column to store keying material", MigrateTwoFactorToKeying),
// v25 -> v26
NewMigration("Add `hash_blake2b` column to `package_blob` table", AddHashBlake2bToPackageBlob),
// v26 -> v27
NewMigration("Add `created_unix` column to `user_redirect` table", AddCreatedUnixToRedirect),
// v27 -> v28
NewMigration("Add pronoun privacy settings to user", AddHidePronounsOptionToUser),
// v28 -> v29
NewMigration("Add public key information to `FederatedUser` and `FederationHost`", AddPublicKeyInformationForFederation),
// v29 -> v30
NewMigration("Migrate `User.NormalizedFederatedURI` column to extract port & schema into FederatedHost", MigrateNormalizedFederatedURI),
// v30 -> v31
NewMigration("Normalize repository.topics to empty slice instead of null", SetTopicsAsEmptySlice),
// v31 -> v32
NewMigration("Migrate maven package name concatenation", ChangeMavenArtifactConcatenation),
// v32 -> v33
NewMigration("Add federated user activity tables, update the `federated_user` table & add indexes", FederatedUserActivityMigration),
// v33 -> v34
NewMigration("Add `notify-email` column to `action_run` table", AddNotifyEmailToActionRun),
// v34 -> v35
NewMigration("Noop because of https://codeberg.org/forgejo/forgejo/issues/8373", NoopAddIndexToActionRunStopped),
// v35 -> v36
NewMigration("Fix wiki unit default permission", FixWikiUnitDefaultPermission),
// v36 -> v37
NewMigration("Add `branch_filter` to `push_mirror` table", AddPushMirrorBranchFilter),
// v37 -> v38
NewMigration("Add `resolved_unix` column to `abuse_report` table", AddResolvedUnixToAbuseReport),
// v38 -> v39
NewMigration("Migrate `data` column of `secret` table to store keying material", MigrateActionSecretsToKeying),
// v39 -> v40
NewMigration("Add index for release sha1", AddIndexForReleaseSha1),
}
func registerMigration(migration *Migration) {
migrationFilename := getMigrationFilename()
// GetCurrentDBVersion returns the current Forgejo database version.
func GetCurrentDBVersion(x *xorm.Engine) (int64, error) {
if err := x.Sync(new(ForgejoVersion)); err != nil {
return -1, fmt.Errorf("sync: %w", err)
if migrationResolutionComplete {
panic(fmt.Sprintf("attempted to register migration from %s after migration resolution is already complete", migrationFilename))
}
currentVersion := &ForgejoVersion{ID: 1}
has, err := x.Get(currentVersion)
matches := migrationFilenameRegex.FindStringSubmatch(migrationFilename)
if len(matches) == 0 {
panic(fmt.Sprintf("registerMigration must be invoked from a file matching migrationFilenameRegex, but was invoked from %q", migrationFilename))
}
migration.id = fmt.Sprintf("%s_%s", matches[1], matches[2]) // this just rebuilds the filename, but guarantees that the regex applied for consistent naming
rawMigrations = append(rawMigrations, migration)
}
// For testing only
func resetMigrations() {
rawMigrations = nil
orderedMigrations = nil
migrationResolutionComplete = false
inMemoryMigrationIDs = nil
}
var (
migrationResolutionComplete = false
inMemoryMigrationIDs container.Set[string]
orderedMigrations []*Migration
)
func resolveMigrations() {
if migrationResolutionComplete {
return
}
inMemoryMigrationIDs = make(container.Set[string])
for _, m := range rawMigrations {
if inMemoryMigrationIDs.Contains(m.id) {
// With the filename-based migration ID this shouldn't be possible, but a bit of a sanity check..
panic(fmt.Sprintf("migration id is duplicated: %q", m.id))
}
inMemoryMigrationIDs.Add(m.id)
}
orderedMigrations = slices.Clone(rawMigrations)
slices.SortFunc(orderedMigrations, func(m1, m2 *Migration) int {
return strings.Compare(m1.id, m2.id)
})
migrationResolutionComplete = true
}
func getInDBMigrationIDs(x *xorm.Engine) (container.Set[string], error) {
var inDBMigrations []ForgejoMigration
err := x.Find(&inDBMigrations)
if err != nil {
return -1, fmt.Errorf("get: %w", err)
return nil, err
}
if !has {
return -1, nil
}
return currentVersion.Version, nil
}
// ExpectedVersion returns the expected Forgejo database version.
func ExpectedVersion() int64 {
return int64(len(migrations))
inDBMigrationIDs := make(container.Set[string], len(inDBMigrations))
for _, inDB := range inDBMigrations {
inDBMigrationIDs.Add(inDB.ID)
}
return inDBMigrationIDs, nil
}
// EnsureUpToDate will check if the Forgejo database is at the correct version.
func EnsureUpToDate(x *xorm.Engine) error {
currentDB, err := GetCurrentDBVersion(x)
resolveMigrations()
inDBMigrationIDs, err := getInDBMigrationIDs(x)
if err != nil {
return err
}
if currentDB < 0 {
return errors.New("database has not been initialized")
// invalidMigrations are those that are in the database, but aren't registered.
invalidMigrations := inDBMigrationIDs.Difference(inMemoryMigrationIDs)
if len(invalidMigrations) > 0 {
return fmt.Errorf("current Forgejo database has migration(s) %s applied, which are not registered migrations", strings.Join(invalidMigrations.Slice(), ", "))
}
expected := ExpectedVersion()
if currentDB != expected {
return fmt.Errorf(`current Forgejo database version %d is not equal to the expected version %d. Please run "forgejo [--config /path/to/app.ini] migrate" to update the database version`, currentDB, expected)
// unappliedMigrations are those that haven't yet been applied, but seem valid
unappliedMigrations := inMemoryMigrationIDs.Difference(inDBMigrationIDs)
if len(unappliedMigrations) > 0 {
return fmt.Errorf(`current Forgejo database is missing migration(s) %s. Please run "forgejo [--config /path/to/app.ini] migrate" to update the database version`, strings.Join(unappliedMigrations.Slice(), ", "))
}
return nil
}
func recordMigrationComplete(x *xorm.Engine, migration *Migration) error {
affected, err := x.Insert(&ForgejoMigration{ID: migration.id})
if err != nil {
return err
} else if affected != 1 {
return fmt.Errorf("migration[%s]: failed to insert into DB, %d records affected", migration.id, affected)
}
return nil
}
// Migrate Forgejo database to current version.
func Migrate(x *xorm.Engine) error {
func Migrate(x *xorm.Engine, freshDB bool) error {
resolveMigrations()
// Set a new clean the default mapper to GonicMapper as that is the default for .
x.SetMapper(names.GonicMapper{})
if err := x.Sync(new(ForgejoVersion)); err != nil {
if err := x.Sync(new(ForgejoMigration)); err != nil {
return fmt.Errorf("sync: %w", err)
}
currentVersion := &ForgejoVersion{ID: 1}
has, err := x.Get(currentVersion)
inDBMigrationIDs, err := getInDBMigrationIDs(x)
if err != nil {
return fmt.Errorf("get: %w", err)
} else if !has {
// If the version record does not exist we think
// it is a fresh installation and we can skip all migrations.
currentVersion.ID = 0
currentVersion.Version = ExpectedVersion()
if _, err = x.InsertOne(currentVersion); err != nil {
return fmt.Errorf("insert: %w", err)
return err
} else if len(inDBMigrationIDs) == 0 && freshDB {
// During startup on a new, empty database, and during integration tests, we rely only on `SyncAllTables` to
// create the DB schema. No migrations can be applied because `SyncAllTables` occurs later in the
// initialization cycle. We mark all migrations as complete up to this point and only run future migrations.
for _, migration := range orderedMigrations {
err := recordMigrationComplete(x, migration)
if err != nil {
return err
}
}
inDBMigrationIDs, err = getInDBMigrationIDs(x)
if err != nil {
return err
}
} else if freshDB {
return fmt.Errorf("unexpected state: migrator called with freshDB=true, but existing migrations in DB %#v", inDBMigrationIDs)
}
v := currentVersion.Version
// Downgrading Forgejo's database version not supported
if v > ExpectedVersion() {
msg := fmt.Sprintf("Your Forgejo database (migration version: %d) is for a newer version of Forgejo, you cannot use the newer database for this old Forgejo release (%d).", v, ExpectedVersion())
// invalidMigrations are those that are in the database, but aren't registered.
invalidMigrations := inDBMigrationIDs.Difference(inMemoryMigrationIDs)
if len(invalidMigrations) > 0 {
// Downgrading Forgejo's database version not supported
msg := fmt.Sprintf("Your Forgejo database has %d migration(s) (%s) for a newer version of Forgejo, you cannot use the newer database for this old Forgejo release.", len(invalidMigrations), strings.Join(invalidMigrations.Slice(), ", "))
msg += "\nForgejo will exit to keep your database safe and unchanged. Please use the correct Forgejo release, do not change the migration version manually (incorrect manual operation may cause data loss)."
if !setting.IsProd {
msg += fmt.Sprintf("\nIf you are in development and really know what you're doing, you can force changing the migration version by executing: UPDATE forgejo_version SET version=%d WHERE id=1;", ExpectedVersion())
msg += "\nIf you are in development and know what you're doing, you can remove the migration records from the forgejo_migration table. The affect of those migrations will still be present."
quoted := slices.Clone(invalidMigrations.Slice())
for i, s := range quoted {
quoted[i] = "'" + s + "'"
}
msg += fmt.Sprintf("\n DELETE FROM forgejo_migration WHERE id IN (%s)", strings.Join(quoted, ", "))
}
_, _ = fmt.Fprintln(os.Stderr, msg)
log.Fatal(msg)
return nil
}
// Some migration tasks depend on the git command
if git.DefaultContext == nil {
if err = git.InitSimple(context.Background()); err != nil {
return err
// unappliedMigrations are those that are registered but haven't been applied.
unappliedMigrations := inMemoryMigrationIDs.Difference(inDBMigrationIDs)
for _, migration := range orderedMigrations {
if !unappliedMigrations.Contains(migration.id) {
continue
}
}
// Migrate
for i, m := range migrations[v:] {
log.Info("Migration[%d]: %s", v+int64(i), m.description)
log.Info("Migration[%s]: %s", migration.id, migration.Description)
// Reset the mapper between each migration - migrations are not supposed to depend on each other
x.SetMapper(names.GonicMapper{})
if err = m.migrate(x); err != nil {
return fmt.Errorf("migration[%d]: %s failed: %w", v+int64(i), m.description, err)
if err = migration.Upgrade(x); err != nil {
return fmt.Errorf("migration[%s]: %s failed: %w", migration.id, migration.Description, err)
}
currentVersion.Version = v + int64(i) + 1
if _, err = x.ID(1).Update(currentVersion); err != nil {
err := recordMigrationComplete(x, migration)
if err != nil {
return err
}
}
if err := x.Sync(new(semver.ForgejoSemVer)); err != nil {
return fmt.Errorf("sync: %w", err)
}
return semver.SetVersionStringWithEngine(x, setting.ForgejoVersion)
return nil
}

View file

@ -1,39 +1,314 @@
// Copyright 2023 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: GPL-3.0-or-later
package forgejo_migrations
import (
"fmt"
"testing"
migration_tests "forgejo.org/models/migrations/test"
migration_tests "forgejo.org/models/gitea_migrations/test"
"forgejo.org/modules/test"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"xorm.io/xorm"
)
// TestEnsureUpToDate tests the behavior of EnsureUpToDate.
func TestEnsureUpToDate(t *testing.T) {
x, deferable := migration_tests.PrepareTestEnv(t, 0, new(ForgejoVersion))
defer deferable()
if x == nil || t.Failed() {
return
func noOpMigration(x *xorm.Engine) error {
return nil
}
func nilMigration() *Migration {
return &Migration{
Description: "nothing",
Upgrade: noOpMigration,
}
}
func TestRegisterMigration(t *testing.T) {
resetMigrations()
defer test.MockVariableValue(&getMigrationFilename, func() string {
return "some-path/v99b_neat_migration.go"
})()
t.Run("migrationResolutionComplete", func(t *testing.T) {
defer test.MockVariableValue(&migrationResolutionComplete, true)()
assert.PanicsWithValue(t, "attempted to register migration from some-path/v99b_neat_migration.go after migration resolution is already complete", func() {
registerMigration(nilMigration())
})
})
for _, fn := range []string{
"v99b_neat_migration.go", // no leading path
"vb_neat_migration.go", // no version number
"v12_neat_migration.go", // no migration group letter
"v12a-neat-migration.go", // no undescore
"v12a.go", // no descriptive identifier
} {
t.Run(fmt.Sprintf("bad name - %s", fn), func(t *testing.T) {
defer test.MockVariableValue(&getMigrationFilename, func() string {
return fn
})()
assert.PanicsWithValue(t, fmt.Sprintf("registerMigration must be invoked from a file matching migrationFilenameRegex, but was invoked from %q", fn), func() {
registerMigration(nilMigration())
})
})
}
// Ensure error if there's no row in Forgejo Version.
err := EnsureUpToDate(x)
require.Error(t, err)
// Insert 'good' Forgejo Version row.
_, err = x.InsertOne(&ForgejoVersion{ID: 1, Version: ExpectedVersion()})
require.NoError(t, err)
err = EnsureUpToDate(x)
require.NoError(t, err)
// Modify forgejo version to have a lower version.
_, err = x.Exec("UPDATE `forgejo_version` SET version = ? WHERE id = 1", ExpectedVersion()-1)
require.NoError(t, err)
err = EnsureUpToDate(x)
require.Error(t, err)
registerMigration(nilMigration())
found := false
for _, m := range rawMigrations {
if m.id == "v99b_neat_migration" {
found = true
}
}
require.True(t, found, "found registered migration")
}
func TestResolveMigrations(t *testing.T) {
t.Run("duplicate migration IDs", func(t *testing.T) {
resetMigrations()
defer test.MockVariableValue(&getMigrationFilename, func() string {
return "some-path/v99b_neat_migration.go"
})()
registerMigration(nilMigration())
registerMigration(nilMigration())
assert.PanicsWithValue(t, "migration id is duplicated: \"v99b_neat_migration\"", func() {
resolveMigrations()
})
})
t.Run("success", func(t *testing.T) {
resetMigrations()
defer test.MockVariableValue(&getMigrationFilename, func() string {
return "some-path/v99b_neat_migration.go"
})()
registerMigration(nilMigration())
defer test.MockVariableValue(&getMigrationFilename, func() string {
return "some-path/v77a_neat_migration.go"
})()
registerMigration(nilMigration())
resolveMigrations()
assert.True(t, migrationResolutionComplete, "migration resolution complete")
assert.Contains(t, inMemoryMigrationIDs, "v77a_neat_migration")
assert.Contains(t, inMemoryMigrationIDs, "v99b_neat_migration")
require.Len(t, orderedMigrations, 2)
assert.Equal(t, "v77a_neat_migration", orderedMigrations[0].id)
assert.Equal(t, "v99b_neat_migration", orderedMigrations[1].id)
})
}
func TestGetInDBMigrationIDs(t *testing.T) {
x, deferable := migration_tests.PrepareTestEnv(t, 0, new(ForgejoMigration))
defer deferable()
require.NotNil(t, x)
migrationIDs, err := getInDBMigrationIDs(x)
require.NoError(t, err)
require.NotNil(t, migrationIDs)
assert.Empty(t, migrationIDs)
_, err = x.Insert(&ForgejoMigration{ID: "v77a_neat_migration"})
require.NoError(t, err)
_, err = x.Insert(&ForgejoMigration{ID: "v99b_neat_migration"})
require.NoError(t, err)
migrationIDs, err = getInDBMigrationIDs(x)
require.NoError(t, err)
require.NotNil(t, migrationIDs)
assert.Len(t, migrationIDs, 2)
assert.Contains(t, migrationIDs, "v77a_neat_migration")
assert.Contains(t, migrationIDs, "v99b_neat_migration")
}
func TestEnsureUpToDate(t *testing.T) {
tests := []struct {
desc string
inMemory []string
inDB []string
err string
}{
{
desc: "up-to-date",
inMemory: []string{"v77a_neat_migration"},
inDB: []string{"v77a_neat_migration"},
},
{
desc: "invalid-migration",
inMemory: []string{},
inDB: []string{"v77a_neat_migration"},
err: "current Forgejo database has migration(s) v77a_neat_migration applied, which are not registered migrations",
},
{
desc: "missing-migration",
inMemory: []string{"v77a_neat_migration"},
inDB: []string{},
err: "current Forgejo database is missing migration(s) v77a_neat_migration",
},
}
for _, tc := range tests {
t.Run(tc.desc, func(t *testing.T) {
resetMigrations()
x, deferable := migration_tests.PrepareTestEnv(t, 0, new(ForgejoMigration))
defer deferable()
require.NotNil(t, x)
for _, inMemory := range tc.inMemory {
defer test.MockVariableValue(&getMigrationFilename, func() string {
return fmt.Sprintf("some-path/%s.go", inMemory)
})()
registerMigration(nilMigration())
}
for _, inDB := range tc.inDB {
x.Insert(&ForgejoMigration{ID: inDB})
}
err := EnsureUpToDate(x)
if tc.err == "" {
assert.NoError(t, err)
} else {
assert.ErrorContains(t, err, tc.err)
}
})
}
}
func TestMigrate(t *testing.T) {
resetMigrations()
x, deferable := migration_tests.PrepareTestEnv(t, 0, new(ForgejoMigration))
defer deferable()
require.NotNil(t, x)
v77aRun := false
defer test.MockVariableValue(&getMigrationFilename, func() string {
return "some-path/v77a_neat_migration.go"
})()
registerMigration(&Migration{
Description: "nothing",
Upgrade: func(x *xorm.Engine) error {
v77aRun = true
return nil
},
})
// v77a_neat_migration will already be marked as already run
_, err := x.Insert(&ForgejoMigration{ID: "v77a_neat_migration"})
require.NoError(t, err)
v99bRun := false
defer test.MockVariableValue(&getMigrationFilename, func() string {
return "some-path/v99b_neat_migration.go"
})()
registerMigration(&Migration{
Description: "nothing",
Upgrade: func(x *xorm.Engine) error {
v99bRun = true
type ForgejoMagicFunctionality struct {
ID int64 `xorm:"pk autoincr"`
Name string
}
return x.Sync(new(ForgejoMagicFunctionality))
},
})
v99cRun := false
defer test.MockVariableValue(&getMigrationFilename, func() string {
return "some-path/v99c_neat_migration.go"
})()
registerMigration(&Migration{
Description: "nothing",
Upgrade: func(x *xorm.Engine) error {
v99cRun = true
type ForgejoMagicFunctionality struct {
NewField string
}
return x.Sync(new(ForgejoMagicFunctionality))
},
})
err = Migrate(x, false)
require.NoError(t, err)
assert.False(t, v77aRun, "v77aRun") // was already marked as run in the DB so shouldn't have run again
assert.True(t, v99bRun, "v99bRun")
assert.True(t, v99cRun, "v99cRun")
migrationIDs, err := getInDBMigrationIDs(x)
require.NoError(t, err)
assert.Contains(t, migrationIDs, "v77a_neat_migration")
assert.Contains(t, migrationIDs, "v99b_neat_migration")
assert.Contains(t, migrationIDs, "v99c_neat_migration")
// should be able to query all three of the fields from this table created, verifying both migrations creating the
// table and adding a column were run
rec := make([]map[string]any, 0)
err = x.Cols("id", "name", "new_field").Table("forgejo_magic_functionality").Find(&rec)
assert.NoError(t, err)
}
func TestMigrateFreshDB(t *testing.T) {
resetMigrations()
x, deferable := migration_tests.PrepareTestEnv(t, 0, new(ForgejoMigration))
defer deferable()
require.NotNil(t, x)
v77aRun := false
defer test.MockVariableValue(&getMigrationFilename, func() string {
return "some-path/v77a_neat_migration.go"
})()
registerMigration(&Migration{
Description: "nothing",
Upgrade: func(x *xorm.Engine) error {
v77aRun = true
return nil
},
})
v99bRun := false
defer test.MockVariableValue(&getMigrationFilename, func() string {
return "some-path/v99b_neat_migration.go"
})()
registerMigration(&Migration{
Description: "nothing",
Upgrade: func(x *xorm.Engine) error {
v99bRun = true
type ForgejoMagicFunctionality struct {
ID int64 `xorm:"pk autoincr"`
Name string
}
return x.Sync(new(ForgejoMagicFunctionality))
},
})
v99cRun := false
defer test.MockVariableValue(&getMigrationFilename, func() string {
return "some-path/v99c_neat_migration.go"
})()
registerMigration(&Migration{
Description: "nothing",
Upgrade: func(x *xorm.Engine) error {
v99cRun = true
type ForgejoMagicFunctionality struct {
NewField string
}
return x.Sync(new(ForgejoMagicFunctionality))
},
})
err := Migrate(x, true)
require.NoError(t, err)
assert.False(t, v77aRun, "v77aRun") // none should be run due to freshDB flag
assert.False(t, v99bRun, "v99bRun")
assert.False(t, v99cRun, "v99cRun")
migrationIDs, err := getInDBMigrationIDs(x)
require.NoError(t, err)
assert.Contains(t, migrationIDs, "v77a_neat_migration")
assert.Contains(t, migrationIDs, "v99b_neat_migration")
assert.Contains(t, migrationIDs, "v99c_neat_migration")
}

View file

@ -0,0 +1,25 @@
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: GPL-3.0-or-later
package forgejo_migrations
import (
"xorm.io/xorm"
)
func init() {
registerMigration(&Migration{
Description: "add forgejo_migration table",
Upgrade: addForeignKeysCollaboration,
})
}
func addForeignKeysCollaboration(x *xorm.Engine) error {
type Collaboration struct {
RepoID int64 `xorm:"UNIQUE(s) INDEX NOT NULL REFERENCES(repository, id)"`
UserID int64 `xorm:"UNIQUE(s) INDEX NOT NULL REFERENCES(user, id)"`
}
return syncDoctorForeignKey(x, []any{
new(Collaboration),
})
}

View file

@ -0,0 +1,25 @@
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: GPL-3.0-or-later
package forgejo_migrations
import (
"forgejo.org/modules/timeutil"
"xorm.io/xorm"
)
func init() {
registerMigration(&Migration{
Description: "add forgejo_migration table",
Upgrade: addForgejoMigration,
})
}
func addForgejoMigration(x *xorm.Engine) error {
type ForgejoMigration struct {
ID string `xorm:"pk"`
CreatedUnix timeutil.TimeStamp `xorm:"created"`
}
return x.Sync(new(ForgejoMigration))
}

View file

@ -0,0 +1,14 @@
// Copyright 2023 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package forgejo_migrations_legacy
import (
"testing"
migration_tests "forgejo.org/models/gitea_migrations/test"
)
func TestMain(m *testing.M) {
migration_tests.MainTest(m)
}

View file

@ -0,0 +1,246 @@
// Copyright 2023 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package forgejo_migrations_legacy
import (
"context"
"errors"
"fmt"
"os"
"forgejo.org/models/forgejo/semver"
"forgejo.org/models/forgejo_migrations"
forgejo_v1_20 "forgejo.org/models/forgejo_migrations_legacy/v1_20"
forgejo_v1_22 "forgejo.org/models/forgejo_migrations_legacy/v1_22"
"forgejo.org/modules/git"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
"xorm.io/xorm"
"xorm.io/xorm/names"
)
// ForgejoVersion describes the Forgejo version table. Should have only one row with id = 1.
type ForgejoVersion struct {
ID int64 `xorm:"pk autoincr"`
Version int64
}
type Migration struct {
description string
migrate func(*xorm.Engine) error
}
// NewMigration creates a new migration.
func NewMigration(desc string, fn func(*xorm.Engine) error) *Migration {
return &Migration{desc, fn}
}
// This is a sequence of additional Forgejo migrations.
// Add new migrations to the bottom of the list.
var migrations = []*Migration{
// v0 -> v1
NewMigration("Create the `forgejo_blocked_user` table", forgejo_v1_20.AddForgejoBlockedUser),
// v1 -> v2
NewMigration("Create the `forgejo_sem_ver` table", forgejo_v1_20.CreateSemVerTable),
// v2 -> v3
NewMigration("Create the `forgejo_auth_token` table", forgejo_v1_20.CreateAuthorizationTokenTable),
// v3 -> v4
NewMigration("Add the `default_permissions` column to the `repo_unit` table", forgejo_v1_22.AddDefaultPermissionsToRepoUnit),
// v4 -> v5
NewMigration("Create the `forgejo_repo_flag` table", forgejo_v1_22.CreateRepoFlagTable),
// v5 -> v6
NewMigration("Add the `wiki_branch` column to the `repository` table", forgejo_v1_22.AddWikiBranchToRepository),
// v6 -> v7
NewMigration("Add the `enable_repo_unit_hints` column to the `user` table", forgejo_v1_22.AddUserRepoUnitHintsSetting),
// v7 -> v8
NewMigration("Modify the `release`.`note` content to remove SSH signatures", forgejo_v1_22.RemoveSSHSignaturesFromReleaseNotes),
// v8 -> v9
NewMigration("Add the `apply_to_admins` column to the `protected_branch` table", forgejo_v1_22.AddApplyToAdminsSetting),
// v9 -> v10
NewMigration("Add pronouns to user", forgejo_v1_22.AddPronounsToUser),
// v10 -> v11
NewMigration("Add the `created` column to the `issue` table", forgejo_v1_22.AddCreatedToIssue),
// v11 -> v12
NewMigration("Add repo_archive_download_count table", forgejo_v1_22.AddRepoArchiveDownloadCount),
// v12 -> v13
NewMigration("Add `hide_archive_links` column to `release` table", AddHideArchiveLinksToRelease),
// v13 -> v14
NewMigration("Remove Gitea-specific columns from the repository and badge tables", RemoveGiteaSpecificColumnsFromRepositoryAndBadge),
// v14 -> v15
NewMigration("Create the `federation_host` table", CreateFederationHostTable),
// v15 -> v16
NewMigration("Create the `federated_user` table", CreateFederatedUserTable),
// v16 -> v17
NewMigration("Add `normalized_federated_uri` column to `user` table", AddNormalizedFederatedURIToUser),
// v17 -> v18
NewMigration("Create the `following_repo` table", CreateFollowingRepoTable),
// v18 -> v19
NewMigration("Add external_url to attachment table", AddExternalURLColumnToAttachmentTable),
// v19 -> v20
NewMigration("Creating Quota-related tables", CreateQuotaTables),
// v20 -> v21
NewMigration("Add SSH keypair to `pull_mirror` table", AddSSHKeypairToPushMirror),
// v21 -> v22
NewMigration("Add `legacy` to `web_authn_credential` table", AddLegacyToWebAuthnCredential),
// v22 -> v23
NewMigration("Add `delete_branch_after_merge` to `auto_merge` table", AddDeleteBranchAfterMergeToAutoMerge),
// v23 -> v24
NewMigration("Add `purpose` column to `forgejo_auth_token` table", AddPurposeToForgejoAuthToken),
// v24 -> v25
NewMigration("Migrate `secret` column to store keying material", MigrateTwoFactorToKeying),
// v25 -> v26
NewMigration("Add `hash_blake2b` column to `package_blob` table", AddHashBlake2bToPackageBlob),
// v26 -> v27
NewMigration("Add `created_unix` column to `user_redirect` table", AddCreatedUnixToRedirect),
// v27 -> v28
NewMigration("Add pronoun privacy settings to user", AddHidePronounsOptionToUser),
// v28 -> v29
NewMigration("Add public key information to `FederatedUser` and `FederationHost`", AddPublicKeyInformationForFederation),
// v29 -> v30
NewMigration("Migrate `User.NormalizedFederatedURI` column to extract port & schema into FederatedHost", MigrateNormalizedFederatedURI),
// v30 -> v31
NewMigration("Normalize repository.topics to empty slice instead of null", SetTopicsAsEmptySlice),
// v31 -> v32
NewMigration("Migrate maven package name concatenation", ChangeMavenArtifactConcatenation),
// v32 -> v33
NewMigration("Add federated user activity tables, update the `federated_user` table & add indexes", FederatedUserActivityMigration),
// v33 -> v34
NewMigration("Add `notify-email` column to `action_run` table", AddNotifyEmailToActionRun),
// v34 -> v35
NewMigration("Noop because of https://codeberg.org/forgejo/forgejo/issues/8373", NoopAddIndexToActionRunStopped),
// v35 -> v36
NewMigration("Fix wiki unit default permission", FixWikiUnitDefaultPermission),
// v36 -> v37
NewMigration("Add `branch_filter` to `push_mirror` table", AddPushMirrorBranchFilter),
// v37 -> v38
NewMigration("Add `resolved_unix` column to `abuse_report` table", AddResolvedUnixToAbuseReport),
// v38 -> v39
NewMigration("Migrate `data` column of `secret` table to store keying material", MigrateActionSecretsToKeying),
// v39 -> v40
NewMigration("Add index for release sha1", AddIndexForReleaseSha1),
// v40 -> v41
NewMigration("Add foreign keys to stopwatch & tracked_time", AddForeignKeysStopwatchTrackedTime),
// v41 -> v42
NewMigration("Add action_run concurrency fields", AddActionRunConcurrency),
// v42 -> v43
NewMigration("Add action_run pre_execution_error field", AddActionRunPreExecutionError),
// v43 -> v44
NewMigration("Add foreign keys to access", AddForeignKeysAccess),
}
// GetCurrentDBVersion returns the current Forgejo database version.
func GetCurrentDBVersion(x *xorm.Engine) (int64, error) {
if err := x.Sync(new(ForgejoVersion)); err != nil {
return -1, fmt.Errorf("sync: %w", err)
}
currentVersion := &ForgejoVersion{ID: 1}
has, err := x.Get(currentVersion)
if err != nil {
return -1, fmt.Errorf("get: %w", err)
}
if !has {
return -1, nil
}
return currentVersion.Version, nil
}
// ExpectedVersion returns the expected Forgejo database version.
func ExpectedVersion() int64 {
return int64(len(migrations))
}
// EnsureUpToDate will check if the Forgejo database is at the correct version.
func EnsureUpToDate(x *xorm.Engine) error {
currentDB, err := GetCurrentDBVersion(x)
if err != nil {
return err
}
if currentDB < 0 {
return errors.New("database has not been initialized")
}
expected := ExpectedVersion()
if currentDB != expected {
return fmt.Errorf(`current Forgejo database version %d is not equal to the expected version %d. Please run "forgejo [--config /path/to/app.ini] migrate" to update the database version`, currentDB, expected)
}
return forgejoMigrationsEnsureUpToDate(x)
}
var forgejoMigrationsEnsureUpToDate = forgejo_migrations.EnsureUpToDate
// Migrate Forgejo database to current version.
func Migrate(x *xorm.Engine) error {
// Set a new clean the default mapper to GonicMapper as that is the default for .
x.SetMapper(names.GonicMapper{})
if err := x.Sync(new(ForgejoVersion)); err != nil {
return fmt.Errorf("sync: %w", err)
}
currentVersion := &ForgejoVersion{ID: 1}
has, err := x.Get(currentVersion)
freshDB := false
if err != nil {
return fmt.Errorf("get: %w", err)
} else if !has {
// If the version record does not exist we think
// it is a fresh installation and we can skip all migrations.
currentVersion.ID = 0
currentVersion.Version = ExpectedVersion()
freshDB = true
if _, err = x.InsertOne(currentVersion); err != nil {
return fmt.Errorf("insert: %w", err)
}
}
v := currentVersion.Version
// Downgrading Forgejo's database version not supported
if v > ExpectedVersion() {
msg := fmt.Sprintf("Your Forgejo database (migration version: %d) is for a newer version of Forgejo, you cannot use the newer database for this old Forgejo release (%d).", v, ExpectedVersion())
msg += "\nForgejo will exit to keep your database safe and unchanged. Please use the correct Forgejo release, do not change the migration version manually (incorrect manual operation may cause data loss)."
if !setting.IsProd {
msg += fmt.Sprintf("\nIf you are in development and really know what you're doing, you can force changing the migration version by executing: UPDATE forgejo_version SET version=%d WHERE id=1;", ExpectedVersion())
}
_, _ = fmt.Fprintln(os.Stderr, msg)
log.Fatal(msg)
return nil
}
// Some migration tasks depend on the git command
if git.DefaultContext == nil {
if err = git.InitSimple(context.Background()); err != nil {
return err
}
}
// Migrate
for i, m := range migrations[v:] {
log.Info("Migration[%d]: %s", v+int64(i), m.description)
// Reset the mapper between each migration - migrations are not supposed to depend on each other
x.SetMapper(names.GonicMapper{})
if err = m.migrate(x); err != nil {
return fmt.Errorf("migration[%d]: %s failed: %w", v+int64(i), m.description, err)
}
currentVersion.Version = v + int64(i) + 1
if _, err = x.ID(1).Update(currentVersion); err != nil {
return err
}
}
if err := x.Sync(new(semver.ForgejoSemVer)); err != nil {
return fmt.Errorf("sync: %w", err)
}
if err := semver.SetVersionStringWithEngine(x, setting.ForgejoVersion); err != nil {
return fmt.Errorf("SetVersionStringWithEngine: %w", err)
}
return forgejo_migrations.Migrate(x, freshDB)
}

View file

@ -0,0 +1,45 @@
// Copyright 2023 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package forgejo_migrations_legacy
import (
"testing"
migration_tests "forgejo.org/models/gitea_migrations/test"
"forgejo.org/modules/test"
"github.com/stretchr/testify/require"
"xorm.io/xorm"
)
// TestEnsureUpToDate tests the behavior of EnsureUpToDate.
func TestEnsureUpToDate(t *testing.T) {
defer test.MockVariableValue(&forgejoMigrationsEnsureUpToDate, func(x *xorm.Engine) error {
return nil
})()
x, deferable := migration_tests.PrepareTestEnv(t, 0, new(ForgejoVersion))
defer deferable()
if x == nil || t.Failed() {
return
}
// Ensure error if there's no row in Forgejo Version.
err := EnsureUpToDate(x)
require.Error(t, err)
// Insert 'good' Forgejo Version row.
_, err = x.InsertOne(&ForgejoVersion{ID: 1, Version: ExpectedVersion()})
require.NoError(t, err)
err = EnsureUpToDate(x)
require.NoError(t, err)
// Modify forgejo version to have a lower version.
_, err = x.Exec("UPDATE `forgejo_version` SET version = ? WHERE id = 1", ExpectedVersion()-1)
require.NoError(t, err)
err = EnsureUpToDate(x)
require.Error(t, err)
}

View file

@ -1,7 +1,7 @@
// Copyright 2024 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package forgejo_migrations
package forgejo_migrations_legacy
import "xorm.io/xorm"

View file

@ -1,10 +1,10 @@
// Copyright 2024 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package forgejo_migrations
package forgejo_migrations_legacy
import (
"forgejo.org/models/migrations/base"
"forgejo.org/models/gitea_migrations/base"
"xorm.io/xorm"
)

View file

@ -1,7 +1,7 @@
// Copyright 2024 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package forgejo_migrations
package forgejo_migrations_legacy
import (
"time"

View file

@ -1,7 +1,7 @@
// Copyright 2024 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package forgejo_migrations
package forgejo_migrations_legacy
import "xorm.io/xorm"

View file

@ -1,7 +1,7 @@
// Copyright 2024 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package forgejo_migrations
package forgejo_migrations_legacy
import "xorm.io/xorm"

View file

@ -1,7 +1,7 @@
// Copyright 2024 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package forgejo_migrations
package forgejo_migrations_legacy
import "xorm.io/xorm"

View file

@ -1,7 +1,7 @@
// Copyright 2024 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package forgejo_migrations
package forgejo_migrations_legacy
import "xorm.io/xorm"

View file

@ -6,7 +6,7 @@ package v1_22
import (
"testing"
migration_tests "forgejo.org/models/migrations/test"
migration_tests "forgejo.org/models/gitea_migrations/test"
)
func TestMain(m *testing.M) {

Some files were not shown because too many files have changed in this diff Show more