Commit graph

23279 commits

Author SHA1 Message Date
Matthias Riße
f66ec4b6af Fix name in package-lock.json
The frontend-checks job started failing because the declared name does
not match the repository name.
2025-07-29 11:43:41 +02:00
Matthias Riße
81fd55527b Run testing workflow unconditionally 2025-07-29 11:43:41 +02:00
forgejo-backport-action
bcd0821f3e [v12.0/forgejo] Revert "feat: remove API authentication methods that uses the URL query (#7924)" (#8653)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8633

This reverts commit b2a3966e64.

weblate etc. are using this method and need to be updated before the change is enforced.

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8653
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-24 17:53:11 +02:00
forgejo-backport-action
8b06eb1bea [v12.0/forgejo] fix(ui): update i18n usage in comments (#8646)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8644

Fix regression of https://codeberg.org/forgejo/forgejo/pulls/8214 (regressing v11 feature https://codeberg.org/forgejo/forgejo/pulls/6523)

Reporeted by @Andre601.

## Preview

![bug](/attachments/0e0c4703-537f-4adc-95f7-4047710522b4)

![fixed](/attachments/07bc5824-87ae-43da-92a2-8e6e9b9cf567)

## Testing
* go to https://v13.next.forgejo.org/, log in
* create repo, add some issue labels (on `./labels`)
* create issue
* add some labels to it and then close it
* observe that what you see looks more like the 2nd screenshot than the 1st screenshot

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

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/8644): <!--number 8644 --><!--line 0 --><!--description Zml4KHVpKTogdXBkYXRlIGkxOG4gdXNhZ2UgaW4gY29tbWVudHM=-->fix(ui): update i18n usage in comments<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8646
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-24 07:57:37 +02:00
forgejo-backport-action
5e5dac84ed [v12.0/forgejo] Revert "fix(ci): pull stylus from github:stylus/stylus#0.57.0 (#8625)" (#8641)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8638

This reverts commit 4d06d62515a5e8d63f8714c67272159a7cc08ad2.

https://www.npmjs.com/package/stylus?activeTab=versions is back.

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8641
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-23 23:21:00 +02:00
forgejo-backport-action
ac0d653925 [v12.0/forgejo] fix: rebase and fast forward merge breaks commit signatures (#8624)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8622

- Do not try to rebase a pull request when it is zero commits behind. We can trust this number as before merging a repository the status of the pull request is mergeable and thus not in a conflict checking stage (where this would be updated).
- This resolves a issue where `git-replay` would rebase a pull request when this is not needed and causes to lose the signature of Git commits and commit IDs as shown in the pullrequest commits timeline.
- Resolves forgejo/forgejo#8619
- Add a simple integration test that simply checks that after merging a up-to-date pull request via the rebase style that the commit ID didn't change. This demonstrates that it didn't do needlessly rebasing.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8624
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-23 10:55:17 +02:00
forgejo-backport-action
43305dff03 [v12.0/forgejo] fix(ci): pull stylus from github:stylus/stylus#0.57.0 (#8627)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8625

npm error 404 Not Found - GET https://registry.npmjs.org/stylus/-/stylus-0.57.0.tgz - Not found

Workaround to be reverted when the issue is fixed.

Refs https://github.com/stylus/stylus/issues/2938

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8627
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-23 10:07:21 +02:00
forgejo-backport-action
06cb8dfcca [v12.0/forgejo] fix: make the action feed resilient to database inconsistencies (#8618)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8617

This reverts commit 7380eac5a2.

Resolves forgejo/forgejo#8612

It is possible for the action feed to reference deleted repositories the
`INNER JOIN` will make sure that these are filtered out. We cannot
filter these out after the fact, because the value of `count` will still
be incorrect.

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

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/8617): <!--number 8617 --><!--line 0 --><!--description bWFrZSB0aGUgYWN0aW9uIGZlZWQgcmVzaWxpZW50IHRvIGRhdGFiYXNlIGluY29uc2lzdGVuY2llcw==-->make the action feed resilient to database inconsistencies<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8618
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-23 00:18:50 +02:00
forgejo-backport-action
927dfb4f50 [v12.0/forgejo] chore: disable E2E test for webkit (#8616)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8611

As far as I can see and tell, the newest webkit version contains a regression that makes this specific test fail. The screenshots that are uploaded upon failure do not seem to suggest that this test should fail.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8616
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-22 21:08:03 +02:00
forgejo-backport-action
5dc9f86f09 [v12.0/forgejo] fix: upgrade fails or hang at migration[32]: Migrate maven package name concatenation (#8613)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8609

- Some SQL queries were not being run in the transaction of v32, which could lead to the migration failing or hanging indefinitely.
- Use `db.WithTx` to get a `context.Context` that will make sure to run SQL queries in the transaction.
- Using `db.DefaultContext` is fine to be used as parent context for starting the transaction, in all cases of starting the migration `x` and `db.DefaultContext` will point to the same engine.
- Resolves forgejo/forgejo#8580

## Testing

1. Have a v11 Forgejo database with a maven package.
2. Run this migration.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8613
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-22 19:24:22 +02:00
forgejo-backport-action
4819d4a29a [v12.0/forgejo] fix: follow symlinks for local assets (#8610)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8596

- This reverts behavior that was partially unintentionally introduced in forgejo/forgejo#8143, symbolic links were no longer followed (if they escaped the asset folder) for local assets.
- Having symbolic links for user-added files is, to my understanding, a ,common usecase for NixOS and would thus have symbolic links in the asset folders. Avoiding symbolic links is not easy.
- The previous code used `http.Dir`, we cannot use that as it's not of the same type. The equivalent is `os.DirFS`.
- Unit test to prevent this regression from happening again.

Reported-by: bloxx12 (Matrix).
Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8610
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-22 18:41:03 +02:00
forgejo-backport-action
9d47719545 [v12.0/forgejo] fix: make sure to use unaltered fields when saving a shadow copy for updated profiles or comments (#8584)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8533

Follow-up of !6977

### Manual testing
- User **S** creates an organization **O** and posts a comment **C** (on a random issue);
- User **R** report as abuse the comment **C**, the organization **O** as well as the user **S**;
- User **S** changes the content of comment **C** and the description of organization **O** as well as the description of their own profile;
- Check (within DB) that shadow copies are being created (and linked to corresponding abuse reports) for comment **C**, organization **O** and user **S** and the content is the one from the moment when the reports were submitted (therefore before the updates made by **S**).

Co-authored-by: floss4good <floss4good@disroot.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8584
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-22 03:08:12 +02:00
forgejo-backport-action
816a63ef28 [v12.0/forgejo] fix: allow for tracked time to be removed again (#8576)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8575

- `getElementById` requires a id to be passed and not a query selector, change it to `querySelector`.
- Regression of forgejo/forgejo#7408
- Resolves forgejo/forgejo#8571
- Add E2E tests for adding manual tracked time and removing it.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8576
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-19 20:45:36 +02:00
forgejo-backport-action
5095cafe49 [v12.0/forgejo] fix: correct image source for quoted reply (#8574)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8565

- Since v10 replies are generated on the fly to handle quoted reply (forgejo/forgejo#5677), this means that we have to do some work to construct markdown that is equivalent to the HTML of the comment.
- Images are slightly strange in the context of issues and pull requests, as Forgejo will render them in the context of the repository and as such links such as `/attachments` become `/user/repo/attachments`, the quoted reply did not take into account and would use `/user/repo/attachments` as link which means it gets transformed to `/user/repo//user/repo/attachments`.
- Instead of fixing this on the backend (and maybe break some existing links), teach the quoted reply about this context and remove it from the image source before generating the markdown.

Reported-by: mrwusel (via Matrix)

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8574
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-19 16:33:30 +02:00
forgejo-backport-action
1d7c366588 [v12.0/forgejo] fix(ui): prevent render failure on faulty org settings post (#8555)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8553

Fix regression of https://codeberg.org/forgejo/forgejo/pulls/7998
Same as https://codeberg.org/forgejo/forgejo/pulls/8236 but for orgs

Amended existing tests to verify which error messages show up and not show up.

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8555
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-18 14:01:38 +02:00
forgejo-backport-action
c2cd3fb19b [v12.0/forgejo] fix: use correct ACME default (#8552)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8550

- The `ACME_URL` setting is documented to default to Let's encrypt
production server if left empty, so do precisely that.
- Use a HTTP proxy to communicate with ACME if Forgejo is configured to
use that.
- Regression of forgejo/forgejo#7409 (previously certmagic took care of
setting these defaults).
- Resolves forgejo/forgejo#8548

## Testing

1. Configure Forgejo's root URL to a public facing domain (that can pass a ACME challenge)
2. Configure Forgejo to use ACME by setting `[server].ENABLE_ACME = true` and `[server].ACME_ACCEPTTOS = true`.
3. Start Forgejo.
4. Observe that it's available via https.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8552
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-17 21:21:43 +02:00
Earl Warren
0bbef2d581 [v12.0/forgejo] i18n: update of translations from Codeberg Translate (#8534)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8534
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-07-16 22:14:57 +02:00
0ko
034af02ed0 [v12.0/forgejo] i18n: update of translations from Codeberg Translate
Translation updates that were relevant to v12 branch were picked from this commit:
8efb6c09db70de54aa153f05b41a33ff7dbb4989 (#8490)

Changes to strings that are only present in the v13 branch were not picked.

Below is a list of co-authors of the ported commit. It may contain co-authors who's changes were not picked due to only being relevant to v13.

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: Fjuro <git@alius.cz>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Juno Takano <jutty@noreply.codeberg.org>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: Vyxie <kitakita@disroot.org>
Co-authored-by: Wuzzy <wuzzy@disroot.org>
Co-authored-by: adf19 <adf19@noreply.codeberg.org>
Co-authored-by: amv-bamboo <amv-bamboo@noreply.codeberg.org>
Co-authored-by: justbispo <justbispo@noreply.codeberg.org>
Co-authored-by: oatbiscuits <oatbiscuits@noreply.codeberg.org>
Co-authored-by: pixelcode <pixelcode@noreply.codeberg.org>
Co-authored-by: xtex <xtexchooser@duck.com>
2025-07-16 22:49:59 +05:00
forgejo-backport-action
592f149441 [v12.0/forgejo] fix(packages): skip another stack frame from logging (#8532)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8530

Log the right stack frame line. We currently always show the `apiError` method call.

related to #8529

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8532
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-16 19:33:28 +02:00
0ko
49b4965e1f [v12.0/forgejo] i18n: update of translations from Codeberg Translate
Translation updates that were relevant to v11 branch were picked from this commit:
dc6626453a1645bc48affd4583b439aae8b4bffd (#8410)

Changes to strings that are only present in the v13 branch were not picked.

Below is a list of co-authors of the ported commit. It may contain co-authors who's changes were not picked due to only being relevant to v13.

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Atul_Eterno <atul_eterno@noreply.codeberg.org>
Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Dirk <dirk@noreply.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: Fjuro <git@alius.cz>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Juno Takano <jutty@noreply.codeberg.org>
Co-authored-by: Laxystem <the@laxla.quest>
Co-authored-by: Miguel P.L <miguel_pl@noreply.codeberg.org>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: aivot-on <aivot-on@noreply.codeberg.org>
Co-authored-by: earl-warren <earl-warren@noreply.codeberg.org>
Co-authored-by: kne <kne@noreply.codeberg.org>
Co-authored-by: oster5 <oster5@noreply.codeberg.org>
Co-authored-by: readevalprintloop <readevalprintloop@noreply.codeberg.org>
Co-authored-by: tacaly <frederick@tacaly.com>
Co-authored-by: volkan <volkan@noreply.codeberg.org>
Co-authored-by: xtex <xtexchooser@duck.com>
Co-authored-by: yurtpage <yurtpage@noreply.codeberg.org>
2025-07-16 21:54:14 +05:00
0ko
edceb0c3d9 [v12.0/forgejo] i18n: update of translations from Codeberg Translate
Translation updates that were relevant to v11 branch were picked from this commit:
8cc20864029ff0ee705f0705da0b3790880c49d1 (#8295)

Changes to strings that are only present in the v13 branch were not picked.

Below is a list of co-authors of the ported commit. It may contain co-authors who's changes were not picked due to only being relevant to v13.

Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Dirk <dirk@noreply.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: Fjuro <git@alius.cz>
Co-authored-by: Gusted <postmaster@gusted.xyz>
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: Vyxie <kitakita@disroot.org>
Co-authored-by: Xinayder <xinayder@noreply.codeberg.org>
Co-authored-by: artnay <artnay@noreply.codeberg.org>
Co-authored-by: earl-warren <earl-warren@noreply.codeberg.org>
Co-authored-by: jedik <jedik@noreply.codeberg.org>
Co-authored-by: justbispo <justbispo@noreply.codeberg.org>
Co-authored-by: kwoot <kwoot@noreply.codeberg.org>
Co-authored-by: leandro-costa <leandro-costa@noreply.codeberg.org>
Co-authored-by: xtex <xtexchooser@duck.com>
Co-authored-by: yeager <yeager@noreply.codeberg.org>
Co-authored-by: zub <zub@noreply.codeberg.org>
2025-07-16 21:52:50 +05:00
forgejo-backport-action
3dd9172fd6 [v12.0/forgejo] fix: ignore "Close" error when uploading container blob (#8528)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8527

https://github.com/go-gitea/gitea/pull/34620/files

(cherry picked from commit 7a59f5a8253402d6f98234bf0047ec53156d3af9)

## Testing

Ask @viceice to run the reproducer in his environment once the v12 backport lands

Co-authored-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8528
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-16 16:00:56 +02:00
forgejo-backport-action
48920461a2 [v12.0/forgejo] chore: failed authentication attempts are not errors and are displayed at the log info level (#8526)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8524

I think those are not errors but simple info messages for admins.

I saw them a lot in my logs when no auth was passed to the api calls.

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8526
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-16 15:58:56 +02:00
forgejo-backport-action
8a93a3e59c [v12.0/forgejo] fix: expanding exactly 20 lines between diff sections leaves visual artifact (#8523)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8519

Fixes #8488.

The issue was caused by having exactly 20 lines of text between two diff sections, which is `BlobExcerptChunkSize`.  The previous diff section ends at 530, the next diff section starts at 551, leaving 20 hidden lines.  This triggered an off-by-one error in determining whether a synthetic section should be added to the render to include a new expander; it was falsely being triggered when it shouldn't have been.

Mostly correct logic was already present in `GetExpandDirection`, so I changed the `ExcerptBlob` web rendering to use `GetExpandDirection` on whether to include the synthetic section.  Then I covered `GetExpandDirection` with unit tests covering all boundary conditions, which discovered one other minor bug -- the case where exactly `BlobExcerptChunkSize` is hidden between two diff sections should never have displayed an "Up" and "Down" expansion, but just a single expander (as below).

![Untitled-2025-07-04-1538(1)](/attachments/05573c5e-3cd4-46d5-8c1f-ecdb28302a19)

Note that *technically* the `ExcerptBlob` change is not covered by any new tests... but the relevant logic has been moved to somewhere more easily testable and fully covered.  If this isn't covered enough for tests, let me know.

## 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.
- [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: Mathieu Fenniak <mathieu@fenniak.net>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8523
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-16 08:44:44 +02:00
forgejo-backport-action
3de8d7ec01 [v12.0/forgejo] chore: use eventually for mysql collation test (#8518)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8301

- Regression of removing `time.Sleep(5 * time.Second)` in forgejo/forgejo#7917.
- Ref: https://codeberg.org/forgejo/forgejo/issues/8221#issuecomment-5532035

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8518
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-16 01:05:37 +02:00
forgejo-backport-action
17f23d48d6 [v12.0/forgejo] fix: PR not blocked by review request for a whitelisted team (#8516)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8511

Fixes #8491.

Previous behavior always updated the newly created review to set the `official` flag to false.  This logic was removed.

The likely reason that this logic existed was that team reviews were being marked as official based upon `doer`, rather than the target team, which seems undesirable.  The expected behavior was retained by removing the check for `IsOfficialReviewer(..., doer)`, ensuring that when making a review request for a team, it doesn't matter *who* makes the request.

Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8516
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-16 00:06:22 +02:00
Beowulf
a7c64b3a5c [v12.0/forgejo] fix(ui): multiple ComboMarkdownEditors on one page interfere (#8514)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8417

Co-authored-by: zokki <zokki.softwareschmiede@gmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8514
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2025-07-15 23:22:35 +02:00
forgejo-backport-action
fc726fae9f [v12.0/forgejo] fix(code-search): HighlightSearchResultCode should count the number of bytes and not the number of runes (#8498)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8492

fixes incorrect handling of unicode in the matched line

Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8498
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-12 19:00:07 +02:00
forgejo-backport-action
6e9a2e89e8 [v12.0/forgejo] several fixes of ALT Package registry (#8480)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8475

closes #7946

- The `rpmsRepoPattern` regex has been fixed to handle releases with dots correctly. For example, the version `0.9.0-alt1.git.17.g2ba905d` is valid, just like `0.1.0-1.n1` mentioned in the issue (https://codeberg.org/forgejo/forgejo/issues/7946#issue-1628991)

- getEntries now returns entry names. In the integration tests, there were lines like:
```go
assert.Equal(t, []string{"", ""}, result.ProvideNames)
```
and it’s unclear how such test logic could have ever worked correctly (fixes problems with deps https://codeberg.org/forgejo/forgejo/issues/7946#issuecomment-5109795)

- ALT is an acronym for ALT Linux Team, so `Alt` was replaced with `ALT`. Strictly speaking, it should probably be `ALT Linux`, but since we use `Arch` instead of `Arch Linux`, this seems fine. Also, Distrowatch shows `Arch`/`ALT` in its dropdown, so it’s consistent.

- The strings `"Alt Linux Team"` and `"Sisyphus"` in the `Origin` and `Suite` fields have been replaced with `setting.AppName` and `"Unknown"`. `Unknown` is a valid value and is set by default, so this won’t cause any issues.

- The documentation link has been fixed: (404 docs.gitea.com/usage/packages/alt/ -> 200 forgejo.org/docs/latest/user/packages/alt/)

Co-authored-by: Maxim Slipenko <maks1ms@altlinux.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8480
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-10 21:57:46 +02:00
forgejo-backport-action
18b542f8b1 [v12.0/forgejo] fix: use parent context for new transactions (#8474)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8464

- Older code (154 places to be exact) that want to do transactions uses `TxContext`. If the context is not already in a transaction then it uses `DefaultContext` for the new transaction.
- Not reusing the context it was given leads to two problems: for tracing (forgejo/forgejo#6470) any SQL code that is executed inside this transaction is not shown in the trace. If the context is cancelled then the transaction is not cancelled and will always complete (given there's no SQL error).
- When this function was introduced it didn't take a parent context, hence the usage of `DefaultContext`. When `parentCtx` was introduced it was only used to avoid nested transactions and use the parent's transaction. I do not see any reasons why the parent context cannot be reused, it is reused in the newer transaction function `WithTx` without any known problems.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8474
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-10 14:44:56 +02:00
forgejo-backport-action
e730199499 [v12.0/forgejo] chore: disable mismatched root URL e2e test for safari (#8466)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8460

- I cannot give a good rationale why Mobile Safari and webkit is failing this test quite consistently and also succeed quite often. We add a script to ensure that we get a mismatched URL - but these two browsers either ignore this script sometime or delays the execution until after the root URL check is done.
- Because it is very hard to run webkit and mobile safari without running a heavily containerized environment (without a graphical interface) it is near impossible to debug this issue properly; save ourselves a headache and disable it instead. I find it more likely to be a problem with my playwright test than it to be a problem with the mismatched root URL code.
- Ref forgejo/forgejo#8359

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8466
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-10 03:30:37 +02:00
forgejo-backport-action
3db3379249 [v12.0/forgejo] chore: do not navigate to same URL in E2E test (#8463)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8461

- In `test.beforeEach` the browser is navigated to `/user2/repo1/pulls/5` and the test environment is prepared by making sure the pull request is not WIP. At the start of `simple toggle` the browser is navigated to the same URL (and the browser is already on this URL) which the Mobile Chrome browser does not handle gracefully and reliably errors with `net::ERR_ABORTED`.
- Because we are already at that URL, do not try to navigate to it again.
- I cannot offer a rationale why the Mobile Chrome browser does give a error when this happens in subsequent tests of 'Pull: Toggle WIP'.
- Ref forgejo/forgejo#8359

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8463
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-10 03:08:54 +02:00
forgejo-backport-action
501836df77 [v12.0/forgejo] fix: ASCII equal fold for authorization header (#8459)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8391

For the "Authorization:" header only lowercase "token" was accepted. This change allows uppercase "Token" as well.

Signed-off-by: Nis Wechselberg <enbewe@enbewe.de>
Co-authored-by: Nis Wechselberg <enbewe@enbewe.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8459
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-10 01:30:07 +02:00
forgejo-backport-action
eb543dcbdb [v12.0/forgejo] fix(email): actions notification template confuses branch with PR (#8455)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8448

When a mail notification is sent because of a failed pull request run,
the body will show:

Branch: #661 (f57df45)

where #661 is the number of the pull request and not the branch. This
is because run.PrettyRef() is used and has a misleading special case
returning a PR number instead of a ref.

Remove the textual description as it can easily be discovered from the
run web page linked in the mail.

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8455
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-09 10:20:54 +02:00
forgejo-backport-action
a1e3bace72 [v12.0/forgejo] fix: correctly mark reviews as stale for AGit PRs (#8454)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8450

The argument order for `ValidatePullRequest` is to first give the new commitID and then the old commit ID.

This results in reviews not being marked as stale when they are not stale and reviews as not stale when they are stale. The test will fail if the fix is not present.

Add testing for the following three scenarios:

1. A review is made, the PR is updated and as a consequence the PR's diff is changed. The review is now marked as stale.
2. A review is made but in the meantime the PR is updated and the review is submitted on a older commit ID. If the diff changed the review is marked as stale.
3. A review that was made against a older commit ID is no longer marked as stale if the PR is force-pushed to that older commit ID.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8454
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-09 08:13:05 +02:00
forgejo-backport-action
1d838c8d5e [v12.0/forgejo] fix: corrupted wiki unit default permission (#8234 follow-up) (#8439)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8258

Closes #8119, follow-up of #8234

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

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

Both aspects should now be covered.

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

### Testing

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

Before:

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

After:

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

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

Co-authored-by: oliverpool <git@olivier.pfad.fr>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8439
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-07 20:23:20 +02:00
forgejo-backport-action
d4c9c01f2d [v12.0/forgejo] fix: cancelled or skipped runs are not failures for notifications (#8404)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8366

From the point of view of a notification, the only status which must be considered a fail is `StatusFailure`. All others are either success `StatusSuccess` or undetermined `StatusCancelled` and `StatusSkipped`.

Those are the only four status in which a run can be when it reaches the `ActionRunNowDone` function because it is filtered on `IsDone` which is only true for those.

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

### Documentation

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

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8404
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-03 23:28:01 +02:00
forgejo-backport-action
36777a3a9e [v12.0/forgejo] chore: improve reliability of webauthn e2e test (#8402)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8400

- This test is the source of many transient errors https://codeberg.org/forgejo/forgejo/issues/8359#issuecomment-5655557 and is semi-reproducible locally. Any debugging code that is added will result in the error no longer being reproducible, making it hard to say why this is failing.
- It no longer seems necessary to add this `waitForURL` call as Playwright now seems to gracefully handle the case where we want to go to a specific page while playwright might still be navigating to another URL that was initiated by clicking on a button - thus removing the source of the transient error altogether.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8402
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-03 21:32:18 +02:00
forgejo-backport-action
7781c8bae4 [v12.0/forgejo] fix: skip empty tokens in SearchOptions.Tokens() (#8398)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8261

Query string tokenizer could return a list containing empty tokens when the query string was `\` or `"` (probably in other scenarios as well).

This seems undesirable and is what triggered #8260, but I'm posting this separately from that fix in case I'm wrong. Feel free to reject if so.

The actual change in behavior is that now searching for `\` or `"` behaves the same as if the query were empty (the bleve/elastic code checks that the tokenizer actually returned, anything rather than just query being non-empty).

### Tests

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

Co-authored-by: Danko Aleksejevs <danko@very.lv>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8398
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-03 15:56:58 +02:00
forgejo-backport-action
d1bb75eea0 [v12.0/forgejo] fix: disable Forgejo Actions email notifications on recovery (#8390)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8374

- Make the migration to add an index a noop - do not remove it as it would break v12.next & v13.next
- Keep the logic that relies on finding the last run, only always fail to find which is the same as assuming each run is one of a kind

Refs forgejo/forgejo#8373

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8390
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-02 20:03:18 +02:00
forgejo-backport-action
1ccd539b6c [v12.0/forgejo] fix: user activation with uppercase email address (#8386)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8367

- Right before the call to user email activation, the user is updated [^1]. This causes the email to be lowered, which in turn makes the call to activate the user activation fail (on database where collation is case sensitive, which is the recommend collation by Forgejo).
- The code in `BeforeUpdate` is quite confusing, the comment has become slightly out of date and was reworded to reflect reality and its purpose. The code is also slightly reworked to only lower the email for the `AvatarEmail` field to avoid causing side-effect.
- Added unit test.
- Resolves forgejo/forgejo#8354

[^1]: 4927d4ee3d/routers/web/auth/auth.go (L785)

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8386
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-02 13:54:45 +02:00
forgejo-backport-action
b2125a774e [v12.0/forgejo] fix(ui): Add pasted images to dropzone (#8362)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/7749

This adds pasted images to the dropzone. To provide the same experience
as when using the dropzone. This gives the possibility to preview and
delete the image. Additionally it provides a copy button to copy the
markdown code for inserting the image.

Fixes #4588

Co-authored-by: Beowulf <beowulf@beocode.eu>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8362
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-06-30 16:19:58 +02:00
forgejo-backport-action
1a0ceec5e2 [v12.0/forgejo] fix: load OldMilestone based on OldMilestoneID, not MilestoneID (#8349)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8330

Fixes #8329

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

### Documentation

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

Co-authored-by: floss4good <floss4good@disroot.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8349
Reviewed-by: floss4good <floss4good@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-06-29 13:29:45 +02:00
forgejo-backport-action
164c5ef87f [v12.0/forgejo] fix: make API /repos/{owner}/{repo}/compare/{basehead} work with forks (#8331)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8326

- fix: API must use headGitRepo instead of ctx.Repo.GitRepo for comparing
- fix: make API /repos/{owner}/{repo}/compare/{basehead} work with forks
- add test coverage for both fixes and the underlying function `parseCompareInfo`
- refactor and improve part of the helpers from `tests/integration/api_helper_for_declarative_test.go`
- remove a few wrong or misleading comments

Refs forgejo/forgejo#7978

## Note on the focus of the PR

It was initially created to address a regression introduced in v12. But the tests that verify it is fixed discovered a v11.0 bug. They cannot conveniently be separated because they both relate to the same area of code that was previously not covered by any test.

## Note on v11.0 backport

It must be manually done by cherry-picking all commits up to and not including `fix: API must use headGitRepo instead of ctx.Repo.GitRepo for comparing` because it is v12 specific.

## 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 the `tests/integration` directory if it involves interactions with a live Forgejo server.

### Documentation

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

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8331
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-06-29 00:10:56 +02:00
forgejo-backport-action
4a6182a3e3 [v12.0/forgejo] chore: sort blocked users list for determistic results (#8321)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8320

- Ref https://codeberg.org/forgejo/forgejo/issues/8221#issuecomment-5515478

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8321
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-06-27 18:15:43 +02:00
forgejo-backport-action
faff8f7c67 [v12.0/forgejo] fix: abuse reports string data types (#8319)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8267

Follow-up of !6977

I was fooled by the fact that for SQLite the columns corresponding to `string` fields were created as `TEXT`; but this is not the case for PostgreSQL and MariaDB/MySQL. According to XORM default mapping rules[^1] _String is corresponding to varchar(255)_.

Therefore `abuse_report`.`remarks` should be of type `VARCHAR(500)` and `abuse_report_shadow_copy`.`raw_value` of type `LONGTEXT`.

### Testing

I have dropped the affected columns (or the entire tables) and checked that for PostgreSQL and MariaDB they are created with the correct type and also manually tested the abusive content reporting functionality in order to make sure that no DB error will be returned if for 'Remarks' a text longer than 255 characters is submitted or when a (big) shadow copy is created.

[^1]: https://xorm.io/docs/chapter-02/4.columns/

Co-authored-by: floss4good <floss4good@disroot.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8319
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-06-27 16:30:23 +02:00
forgejo-backport-action
5f88d15a63 [v12.0/forgejo] fix: pass doer's ID for CRUD instance signing (#8318)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8304

- When doing CRUD actions, the commiter and author are reconstructed and
do not contain the doer's ID. Make sure to pass this ID along so it can
be used to verify the rules of instance signing for CRUD actions.
- Regression of forgejo/forgejo#7693. It seems that previously this
didn't work correctly as it would not care about a empty ID.
- Resolves forgejo/forgejo#8278

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8318
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-06-27 16:26:11 +02:00
forgejo-backport-action
71d3cb9590 [v12.0/forgejo] fix: add missing trust status to pull review commits (#8317)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8296

Closes: #8293

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

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

Co-authored-by: Lucas Schwiderski <lucas@lschwiderski.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8317
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-06-27 16:20:44 +02:00
forgejo-backport-action
cd0fb3152c [v12.0/forgejo] i18n: update of translations from Codeberg Translate (#8294)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8238

Translations update from [Codeberg Translate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

It also includes following components:

* [Forgejo/forgejo-next](https://translate.codeberg.org/projects/forgejo/forgejo-next/)

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: AzzyDev <azzydev@noreply.codeberg.org>
Co-authored-by: BarryLhm <barrylhm@outlook.com>
Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Dirk <dirk@noreply.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: EssGeeEich <essgeeeich@noreply.codeberg.org>
Co-authored-by: Fjuro <git@alius.cz>
Co-authored-by: Juno Takano <jutty@noreply.codeberg.org>
Co-authored-by: Laurent FAVOLE <lfavole@noreply.codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@noreply.codeberg.org>
Co-authored-by: Shihfu Juan <xlion@xlion.tw>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: VaiTon <vaiton@noreply.codeberg.org>
Co-authored-by: Vyxie <kitakita@disroot.org>
Co-authored-by: mahlzahn <mahlzahn@posteo.de>
Co-authored-by: xtex <xtexchooser@duck.com>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8294
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-06-26 11:30:48 +02:00
forgejo-backport-action
a70fa6d8ba [v12.0/forgejo] fix(ui): release: name is overridden with tag name on edit (#8290)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8002

Fixes #8001

Regression: f66a6b12cd (https://codeberg.org/forgejo/forgejo/issues/6645)
Co-authored-by: Beowulf <beowulf@beocode.eu>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8290
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-06-26 02:36:43 +02:00