Commit graph

23197 commits

Author SHA1 Message Date
David Rotermund
eca999d9fe Merge branch 'forgejo' into delete_with_subpath 2025-06-26 12:50:23 +02:00
Codeberg Translate
414199fc66 i18n: update of translations from Codeberg Translate (#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/)

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

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

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Localization
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/8238): <!--number 8238 --><!--line 0 --><!--description aTE4bjogdXBkYXRlIG9mIHRyYW5zbGF0aW9ucyBmcm9tIENvZGViZXJnIFRyYW5zbGF0ZQ==-->i18n: update of translations from Codeberg Translate<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8238
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Robert Wolff <mahlzahn@posteo.de>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-committed-by: Codeberg Translate <translate@codeberg.org>
2025-06-26 10:44:26 +02:00
Renovate Bot
aee5e1fb94 Update module github.com/jhillyerd/enmime/v2 to v2.2.0 (forgejo) (#8254)
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [github.com/jhillyerd/enmime/v2](https://github.com/jhillyerd/enmime) | `v2.1.0` -> `v2.2.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fjhillyerd%2fenmime%2fv2/v2.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fjhillyerd%2fenmime%2fv2/v2.1.0/v2.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>jhillyerd/enmime (github.com/jhillyerd/enmime/v2)</summary>

### [`v2.2.0`](https://github.com/jhillyerd/enmime/releases/tag/v2.2.0)

[Compare Source](https://github.com/jhillyerd/enmime/compare/v2.1.0...v2.2.0)

#### What's Changed

- chore: bump golangci to last 1.x release by [@&#8203;jhillyerd](https://github.com/jhillyerd) in https://github.com/jhillyerd/enmime/pull/368
- chore: fix linter warnings by [@&#8203;jhillyerd](https://github.com/jhillyerd) in https://github.com/jhillyerd/enmime/pull/370
- chore: bump golangci to 2.x by [@&#8203;jhillyerd](https://github.com/jhillyerd) in https://github.com/jhillyerd/enmime/pull/369
- chore: bump go deps by [@&#8203;jhillyerd](https://github.com/jhillyerd) in https://github.com/jhillyerd/enmime/pull/371
- build(deps): bump golangci/golangci-lint-action from 7 to 8 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/jhillyerd/enmime/pull/373
- Switch to fork of html2text for tablewriter 1.0 by [@&#8203;jhillyerd](https://github.com/jhillyerd) in https://github.com/jhillyerd/enmime/pull/375
- Release for go 1.23 support by [@&#8203;jhillyerd](https://github.com/jhillyerd) in https://github.com/jhillyerd/enmime/pull/376

**Full Changelog**: https://github.com/jhillyerd/enmime/compare/v2.1.0...v2.2.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:eyJjcmVhdGVkSW5WZXIiOiI0MS4xLjMiLCJ1cGRhdGVkSW5WZXIiOiI0MS4xLjMiLCJ0YXJnZXRCcmFuY2giOiJmb3JnZWpvIiwibGFiZWxzIjpbImRlcGVuZGVuY3ktdXBncmFkZSIsInRlc3Qvbm90LW5lZWRlZCJdfQ==-->

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8254
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
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-06-26 08:49:20 +02:00
Renovate Bot
d3c712fe2a Lock file maintenance (forgejo) (#8257)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8257
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-06-26 02:27:54 +02:00
Otto
4a1f4acf76 fix(ui): release: name is overridden with tag name on edit (#8002)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8002
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2025-06-26 01:22:48 +02:00
Earl Warren
30bfa13308 git/blob: refactor line-counting logic (#8270)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8270
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-06-26 01:09:01 +02:00
Gusted
507a12bf82 Revert "fix(api): document is_system_webhook field (#7784)" (#8286)
The field is not part of the struct, it is instead part of the config field. See https://codeberg.org/forgejo/forgejo/pulls/7784#issuecomment-5511212

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8286
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-06-26 00:36:18 +02:00
Renovate Bot
69bd7a1f1b Update dependency mermaid to v11.7.0 (forgejo) (#8249)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8249
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-06-25 23:58:26 +02:00
Bente Groh
7ab27a7a7f fix(ui): add missing lazy load attribute to images (#8246)
closes #8076

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8246
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Bente Groh <mail@bentegroh.de>
Co-committed-by: Bente Groh <mail@bentegroh.de>
2025-06-25 18:31:03 +02:00
oliverpool
2bca029f6f chore(ci): testSleep: show actual times on failures (#8271)
I just experienced a spurious error on `testSleep`.
The current assertion only showed `expected false to be truthy`. With this PR it should show the actual elapsed time (to be able to knowingly adjust the expected delay).

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8271
Reviewed-by: floss4good <floss4good@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2025-06-25 15:58:55 +02:00
Earl Warren
8844b6b8e5
chore: 12.0 is now stable (take 2) 2025-06-25 06:41:35 +02:00
forgejo-release-manager
9e966ac91f chore: 12.0 is now stable 2025-06-25 06:24:12 +02:00
Robert Wolff
6d4554b01c chore: update security option in issue templates (#8268)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8268
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Robert Wolff <mahlzahn@posteo.de>
Co-committed-by: Robert Wolff <mahlzahn@posteo.de>
2025-06-24 19:02:12 +02:00
oliverpool
6ed62c14d3 move blobLineCount to disencentive its usage 2025-06-24 17:36:13 +02:00
oliverpool
744363597d test: before refatoring count function 2025-06-24 17:36:13 +02:00
oliverpool
7a6b5b6dd9 blame: count lines without reading blob 2025-06-24 17:36:13 +02:00
0ko
7086e7a9ac feat(ui): redesign user profile actions layout (#7906)
Related: https://codeberg.org/forgejo/forgejo/pulls/3950#issue-785253, https://codeberg.org/forgejo/forgejo/pulls/3950#issuecomment-1998551.

## Links in dropdown

* move _admin only_ User details link here, give it always-visible text
* add new _self only_ Edit profile link here
* move RSS feed link here
* add new Atom feed link here, previously unadvertised
* add new SSH keys link here (`.keys`), previously unadvertised
* add new GPG keys link here (`.gpg`), previously unadvertised
* move Block/Unblock button here
* move Report abuse link here

If primary action is available (Follow/Unfollow), dropdown with more actions goes after it. If not, it is in line with followers, in place where RSS feed button used to be.

## New dropdown

Related: https://codeberg.org/forgejo/design/issues/23, https://codeberg.org/forgejo/forgejo/issues/3853, https://codeberg.org/0ko/forgejo/issues/2.

Implemented a new dropdown: noJS-usable, JS-enhanced for better keyboard navigation and a11y.
Styling is mostly same as the existing ones have, but row density depends on `@media` pointer type.

My choice of CSS properties have been influenced of these:
* 72a3adb16b
* 51dd2293ca

Inspired-by: KiranMantha <kiranv.mantha@gmail.com>
Inspired-by: Lucas Larroche <lucas@larroche.com>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7906
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-06-24 14:16:51 +02:00
Danko Aleksejevs
f7d7d67238 fix: Token.ParseIssueReference crashing on empty string (#8260)
A fix for a bug introduced by me earlier, where attempting to parse an issue reference in an empty token would crash.

An empty token occurs if the search string is `\` or `"` (among other scenarios, probably). I'll make another PR that avoids having empty tokens (seems like a good idea).

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

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8260
Reviewed-by: Shiny Nematoda <snematoda@noreply.codeberg.org>
Co-authored-by: Danko Aleksejevs <danko@very.lv>
Co-committed-by: Danko Aleksejevs <danko@very.lv>
2025-06-24 06:52:36 +02:00
Robert Wolff
0b24915271 feat(ui): add links to milestones and projects in issue comments (#7992)
add links to the comments that appear in issue when changing milestones and projects

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7992
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Robert Wolff <mahlzahn@posteo.de>
Co-committed-by: Robert Wolff <mahlzahn@posteo.de>
2025-06-23 23:31:51 +02:00
Beowulf
43fb63a063
fix(ui): release: name is overridden with tag name on edit
Fixes #8001

Regression: f66a6b12cd
2025-06-23 19:11:43 +02:00
0ko
049cda526b feat(ui): use kbd in label selector hint, remove enter (#8199)
Rel: https://codeberg.org/forgejo/forgejo/pulls/7958

Also remove Enter from the hint as it is not working right now, ref https://codeberg.org/forgejo/forgejo/issues/1335#issuecomment-1073523

Preview:
* https://codeberg.org/attachments/b8eb7525-2bbe-4216-97f5-bc10aee1f3e2
* https://codeberg.org/attachments/37e3734e-0f51-4a8b-add6-7bc0e0a5ad6b

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8199
Reviewed-by: Beowulf <beowulf@beocode.eu>
2025-06-23 17:56:28 +02:00
David Rotermund
24bbe20487 Merge branch 'forgejo' into delete_with_subpath
Some checks failed
Integration tests for the release process / release-simulation (push) Has been cancelled
2025-06-23 17:23:49 +02:00
Danko Aleksejevs
39e6785da0 fix(ui): erroneous list continuation on Cmd+Enter on macOS (#8153) (#8170)
The line continuation code in the Markdown editor ignored Enter presses if Ctrl, Alt or Shift were being held. This now also accounts for Cmd on macOS (which browsers represent as metaKey).

### Tests

- Use Safari (on macOS)
- create a new issue in a repository
- start writing a list (with - one[enter]- two)
- now press Cmd+Enter
- verify that while the form is being submitted, no new line got visually added

***

The visual evidence of this bug is a race condition (form is being edited while also being submitted) and I don't think a reliable cross-browser E2E test is possible.

Bugged and fixed behavior verified manually on an actual Macbook in current Safari. Specifically,

* Before the fix: pressing Cmd+Enter submits the form *and* inserts a newline + list prefix in the markdown editor.  Reporter had the changed content submitted, I only saw it submit the original (but the change was visible during submission).
* After the fix: Cmd+Enter only submits the form. Enter with no modifiers inserts newlines/prefixes as before.

### 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/8170
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Danko Aleksejevs <danko@very.lv>
Co-committed-by: Danko Aleksejevs <danko@very.lv>
2025-06-23 15:21:15 +02:00
Earl Warren
debd74e1b6 fix: add an index to the ActionRun.stopped column (#8252)
The models/actions/run.go:GetRunBefore function sorts ActionRun rows to get the most recently stopped. Since the ActionRun rows do not expire, the cost will keep increasing over time.

The index is meant to ensure the execution time of the associated query does not grow linearly with the number of rows in the ActionRun table.

Ref https://codeberg.org/forgejo/forgejo/pulls/7491/files#issuecomment-5495441

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8252
Reviewed-by: Christopher Besch <mail@chris-besch.com>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-06-23 08:00:18 +02:00
Earl Warren
cf4d0e6c34 bug: unify RepoActionRun and ActionRun structs (#8250)
Two pull requests were merged at the same time

- https://codeberg.org/forgejo/forgejo/pulls/7699
- https://codeberg.org/forgejo/forgejo/pulls/7508

And added conflicting structs ActionRun modules/structs.  That broke
the forgejo development branch and a quick fix was made to resolve
the name conflict.

- https://codeberg.org/forgejo/forgejo/pulls/8066

However that creates an undesirable duplication of two structures that
serve the same purpose but are different.

- Remove RepoActionRun and replace it with ActionRun
- convert.ToActionRun has one more argument, the doer, because it
  is determined differently in the context of webhooks or API

### Tests

- No need because the two pull requests involved already have good coverage.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8250
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: klausfyhn <klausfyhn@noreply.codeberg.org>
Reviewed-by: Christopher Besch <mail@chris-besch.com>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-06-23 07:54:32 +02:00
Renovate Bot
b58cebc2d9 Update renovate to v41.1.4 (forgejo) (#8256)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-06-23 07:40:04 +02:00
John Veness
d8ad592d4e Fix sentence structure mentioning cooldown period (#8197)
The text should be two sentences, or at the very least separated by a semicolon rather than a comma.

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

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8197
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: John Veness <john-codeberg@jveness.co.uk>
Co-committed-by: John Veness <john-codeberg@jveness.co.uk>
2025-06-22 08:51:01 +02:00
Renovate Bot
b6dd1dd799 Update renovate to v41 (forgejo) (major) (#8253)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8253
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-06-21 18:42:42 +02:00
Earl Warren
d7329f5dd4 fix(ui): issue comment anchor on time stamp (#8214)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8214
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-06-21 14:51:50 +02:00
Alex Smith
690532efb8 add model viewer for .glb (GLTF) model in file view (#8111)
## Motivation

The GLTF (`.gltf`, `.glb`) 3D model format is very popular for game development and visual productions.

For an indie game studio, it would be convenient for a team to view textured 3D models directly from the Forgejo interface (otherwise they need to be downloaded and opened). [Perforce](https://www.perforce.com/products/helix-dam), [Diversion](https://www.diversion.dev/), and GitHub all have this capability to differing extents.

Some discussion on 3D file support here: https://codeberg.org/forgejo/forgejo/issues/5188

## Changes

Adds a model viewer similar to [GitHub STL viewer](https://github.com/assimp/assimp/blob/master/test/models/STL/Spider_ascii.stl) for `.glb` model files, and lays some groundwork to support future files. Uses the [model-viewer](https://modelviewer.dev/) library by Google and three.js. The model viewer is interactive and can be rotated and scaled.

![Screen Recording 2025-06-08 at 15.27.15](/attachments/84c63dea-a0ce-45f9-b48b-c80867636639)

## How to Test

1) Create a new repository or use an existing one.
2) Upload a `.glb` file such as `tests/testdata/data/viewer/Unicode❤♻Test.glb` (CC0 1.0 Universal)
3) View the file in the repository.
    - Similar to image files, the 3D model should be rendered in a viewer.
    - Use mouse clicks to turn and zoom.

## Licenses

Libraries used for this change include three.js and @google/model-viewer, which are MIT and Apache-2.0 licenses respectively. Both of these are compatible with Forgejo's GPL3.0 license.

## Future Plans

1) `.gltf` was not attempted because it is a multiple file format, referencing other files in the same directory. Still need to experiment with this to see if it can work. `.glb` is a single file containing a `.gltf` and all of its other file/texture dependencies so was easier to implement.
2) The PR diff still shows the model as an unviewable bin file, but clicking the "View File" button takes you to a view screen where this model viewer is used. It would be nice to view the before and after of the model in two side-by-side model viewers, akin to reviewing a change in an image.
3) Also inserted stubs for adding contexts for GLTF, STL, OBJ, and 3MF. These ultimately don't do anything yet as only `.glb` files can be detected by the type sniffer of all of these.

## 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 checking GLB file content using the first few bytes.
  - [x] in their respective `typesniffer_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

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

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

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- User Interface features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/8111): <!--number 8111 --><!--line 0 --><!--description YWRkIG1vZGVsIHZpZXdlciBmb3IgYC5nbGJgIChHTFRGKSBtb2RlbCBpbiBmaWxlIHZpZXc=-->add model viewer for `.glb` (GLTF) model in file view<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8111
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Co-authored-by: Alex Smith <amsmith.pro@pm.me>
Co-committed-by: Alex Smith <amsmith.pro@pm.me>
2025-06-21 14:42:35 +02:00
Earl Warren
b2c4fc9f94 bug: Forgejo Actions email notifications are opt-in (#8242)
* Add the `notify-email` column / NotifyEmail to ActionRun and set it:
  * services/actions/workflows.go `Dispatch`
  * services/actions/schedule_tasks.go `CreateScheduleTask`
  * services/actions/notifier_helper.go `handleWorkflows`
* Only send an email if the workflow has `enable-email-notifications: true` by having `MailActionRun` return immediately if `NotifyEmail` is false.
* Ignore or silently fail on `enable-email-notifications: true` parsing errors. Reporting such errors  belongs in workflow validation, not when it is evaluated for the notifications.
* Add unit and integration tests.

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

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

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

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8242
Reviewed-by: Christopher Besch <mail@chris-besch.com>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-06-21 13:11:01 +02:00
Earl Warren
9e6f722f94 fix: only send Forgejo Actions notifications to one user (#8227)
- If the run was attributed to a system user (which is the case for scheduled runs for instance), ignore it and fallback to the mail of the owner. System users may have email addresses, but they are not to be used.
- If the owner is a system user or an organization with no email associated with it, do nothing.
- If a user with an email exists, check if they did not disable notifications and send the email.

Refs: https://codeberg.org/forgejo/forgejo/issues/8187
Refs: https://codeberg.org/forgejo/forgejo/issues/8233

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

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8227
Reviewed-by: Christopher Besch <mail@chris-besch.com>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-06-21 12:15:38 +02:00
Michael Jerger
25d596d387 Federated user activity following: Isolated model changes (#8078)
This PR is part of https://codeberg.org/forgejo/forgejo/pulls/4767

This should not have an outside impact but bring all model changes needed & bring migrations.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8078
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
Co-committed-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
2025-06-21 12:02:58 +02:00
Otto Richter
1c0e9d8015 chore(ci): downgrade playwright temporarily and allow running all e2e tests (#8245)
In https://codeberg.org/forgejo/forgejo/pulls/7906#issuecomment-5511884, I noticed that the e2e tests were failing without obvious reasons. I was able to reproduce locally with Mobile Chrome, but the error doesn't make sense to me.

So I tried to downgrade playwright to the previous version, and it works fine. I actually suspect a bug in playwright, but I currently lack the capacity to reach out to upstream with a reproducer (I also found conversation with the playwright team a little difficult, unless you have absolutely convincing arguments that the flakiness you observe is really their fault, which is very hard to prove).

Tests pass with this version of playwright. In order to detect such cases earlier, I added a way to run all playwright tests (which I thought I had added with the changed files patch, but apparently forgot).

All tests are triggered by an explicit label (but only after firing a next event, because the testing workflows don't listen to label changes) and when the PR title contains "playwright", which should cover at least renovate dependency updates of playwright and the axe framework (both contain playwright).

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8245
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Otto Richter <git@otto.splvs.net>
Co-committed-by: Otto Richter <git@otto.splvs.net>
2025-06-21 11:50:39 +02:00
Renovate Bot
1efb4f1aaf Update module github.com/go-chi/chi/v5 to v5.2.2 (forgejo) (#8248)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/go-chi/chi/v5](https://github.com/go-chi/chi) | require | patch | `v5.2.1` -> `v5.2.2` |

---

### Release Notes

<details>
<summary>go-chi/chi (github.com/go-chi/chi/v5)</summary>

### [`v5.2.2`](https://github.com/go-chi/chi/releases/tag/v5.2.2)

[Compare Source](https://github.com/go-chi/chi/compare/v5.2.1...v5.2.2)

#### What's Changed

- Use strings.Cut in a few places by [@&#8203;JRaspass](https://github.com/JRaspass) in https://github.com/go-chi/chi/pull/971
- Fix non-constant format strings in t.Fatalf by [@&#8203;JRaspass](https://github.com/JRaspass) in https://github.com/go-chi/chi/pull/972
- Apply fieldalignment fixes to optimize struct memory layout by [@&#8203;pixel365](https://github.com/pixel365) in https://github.com/go-chi/chi/pull/974
- go 1.24 by [@&#8203;pkieltyka](https://github.com/pkieltyka) in https://github.com/go-chi/chi/pull/977
- chore: delint ioutil usage by [@&#8203;costela](https://github.com/costela) in https://github.com/go-chi/chi/pull/962
- Fixed typo in Router interface definition by [@&#8203;mithileshgupta12](https://github.com/mithileshgupta12) in https://github.com/go-chi/chi/pull/958
- Add support for TinyGo by [@&#8203;efraimbart](https://github.com/efraimbart) in https://github.com/go-chi/chi/pull/978
- Exclude middleware/profiler.go in TinyGo, as there's no net/http/pprof pkg by [@&#8203;cxjava](https://github.com/cxjava) in https://github.com/go-chi/chi/pull/982
- Make use of strings.Cut by [@&#8203;scop](https://github.com/scop) in https://github.com/go-chi/chi/pull/1005
- Change install command format to code block by [@&#8203;sglkc](https://github.com/sglkc) in https://github.com/go-chi/chi/pull/1001
- Correct documentation by [@&#8203;mrdomino](https://github.com/mrdomino) in https://github.com/go-chi/chi/pull/992

#### Security fix

- Fixes [GHSA-vrw8-fxc6-2r93](https://github.com/go-chi/chi/security/advisories/GHSA-vrw8-fxc6-2r93) - "Host Header Injection Leads to Open Redirect in RedirectSlashes" [commit](1be7ad938c)
  - a lower-severity Open Redirect that can't be exploited in browser or email client, as it requires manipulation of a Host header
  - reported by Anuraag Baishya, [@&#8203;anuraagbaishya](https://github.com/anuraagbaishya). Thank you!

#### New Contributors

- [@&#8203;pixel365](https://github.com/pixel365) made their first contribution in https://github.com/go-chi/chi/pull/974
- [@&#8203;mithileshgupta12](https://github.com/mithileshgupta12) made their first contribution in https://github.com/go-chi/chi/pull/958
- [@&#8203;efraimbart](https://github.com/efraimbart) made their first contribution in https://github.com/go-chi/chi/pull/978
- [@&#8203;cxjava](https://github.com/cxjava) made their first contribution in https://github.com/go-chi/chi/pull/982
- [@&#8203;sglkc](https://github.com/sglkc) made their first contribution in https://github.com/go-chi/chi/pull/1001
- [@&#8203;mrdomino](https://github.com/mrdomino) made their first contribution in https://github.com/go-chi/chi/pull/992

**Full Changelog**: https://github.com/go-chi/chi/compare/v5.2.1...v5.2.2

</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:eyJjcmVhdGVkSW5WZXIiOiI0MC41Ny4xIiwidXBkYXRlZEluVmVyIjoiNDAuNTcuMSIsInRhcmdldEJyYW5jaCI6ImZvcmdlam8iLCJsYWJlbHMiOlsiZGVwZW5kZW5jeS11cGdyYWRlIiwidGVzdC9ub3QtbmVlZGVkIl19-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8248
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-06-21 10:57:17 +02:00
Earl Warren
c8e54e11d7 feat: git/blob use NewTruncatedReader for profile and codeowners (#8243)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8243
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-06-20 21:41:30 +02:00
oliverpool
f708bacfff blob: use NewTruncatedReader for CodeOwners parsing
tested in tests/integration/pull_review_test.go:TestPullView_CodeOwner
2025-06-20 20:43:10 +02:00
oliverpool
dd79f0ce2b blob: use NewTruncatedReader for markdown 2025-06-20 20:43:10 +02:00
oliverpool
c78f56e7cb git/blob: add truncated tests 2025-06-20 20:43:10 +02:00
Robert Wolff
ef27d55468 chore(ui): add integration tests for issue comment badges and avatars 2025-06-19 19:10:25 +02:00
oliverpool
31ad7c9353 blob: GetBlobContent: reduce allocations (#8223)
See #8222 for context.

## git.Blob.NewTruncatedReader

This introduce a new `NewTruncatedReader` method to return a blob-reader which silently truncates when the limit is reached (io.EOF will be returned).
Since the actual size is also returned `GetBlobContent` can pre-allocate a `[]byte` of the full-size (min of the asked size and the actual size) and call `io.ReadFull(rc, buf)` (instead of `util.ReadWithLimit(dataRc, int(limit))` which is convoluted and not used anywhere else).

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

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8223
Reviewed-by: Lucas <sclu1034@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2025-06-19 18:36:12 +02:00
oliverpool
913eaffb8a fix: collaborator can edit wiki with write access (#8234)
fixes: #8119, replaces #8135

Bug likely introduced in 5eeccecafc

### Tests

- I added test coverage for Go changes 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.
- [ ] 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/8234
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2025-06-19 18:35:09 +02:00
oliverpool
285f66b782 fix: prevent 500 message on invalid username (#8236)
Bug introduced by #7998

### Tests

- go to your settings page https://v12.next.forgejo.org/user/settings
- try to change to an invalid username (like `.well--invalid`)
- verify that no 500 error is shown, only a flash message

I tried to add a test in `tests/integration/user_test.go`, but failed to catch the error message:

```
		resp := session.MakeRequest(t, req, http.StatusOK)
		txt := resp.Body.String()
		t.Log(txt) // no template error??
		t.FailNow()
```

### Release notes

- [x] I do not want this change to show in the release notes.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8236
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2025-06-19 18:31:08 +02:00
Earl Warren
968ba1bf84 i18n: update of translations from Codeberg Translate (#8178)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8178
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-06-19 07:59:28 +02:00
Codeberg Translate
42ea73d46f
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: Dirk <dirk@noreply.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@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: Lzebulon <lzebulon@noreply.codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@noreply.codeberg.org>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: Tin <hntin@noreply.codeberg.org>
Co-authored-by: Vyxie <kitakita@disroot.org>
Co-authored-by: earl-warren <earl-warren@noreply.codeberg.org>
Co-authored-by: hntin <hntin@noreply.codeberg.org>
Co-authored-by: janAkali <janakali@noreply.codeberg.org>
Co-authored-by: justbispo <justbispo@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: yeager <yeager@noreply.codeberg.org>
Co-authored-by: yurtpage <yurtpage@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/cs/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/da/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/fr/
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/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/cs/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/da/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fil/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fr/
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/ru/
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/vi/
Translation: Forgejo/forgejo
Translation: Forgejo/forgejo-next
2025-06-19 05:14:47 +00:00
Gusted
e7eca7f36c chore: migrate to @stylistic/eslint-plugin (#8216)
- The JS variant is deprecated, move to the unified package.
`[@stylistic/eslint-plugin-js] This package is deprecated in favor of
the unified @stylistic/eslint-plugin, please consider migrating to the
main package` is logged when running `make lint-frontend`.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8216
Reviewed-by: floss4good <floss4good@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-06-19 07:14:42 +02:00
Gusted
5fa37539de chore: sort mailer messages in test assertion (#8226)
- Ref https://codeberg.org/forgejo/forgejo/issues/8221#issuecomment-5461218
- Databases might return users in a different order, sort them before doing assertions on them.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8226
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-06-18 21:12:08 +02:00
Robert Wolff
1e114a1225 chore(ui): add integration tests for issue comments 2025-06-18 18:09:34 +02:00
Robert Wolff
1879ce8efe fix(ui): issue comment anchor on time stamp 2025-06-18 17:28:19 +02:00
Danko Aleksejevs
ae00a1d61b fix: Remove 1ms delay before inserting list prefix, fix race condition in tests (#8207)
Fixed the race condition that made the existing E2E tests fail. There was a 1ms delay between inserting a newline and the line prefix to facilitate creation of two "undo" entries (so "ctrl+z" basically undoes the list continuation, but not the newline). Thus scripted text changes may have happened out of order.

This only ever reliably worked in Firefox and seems to still work there even without a timeout.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8207
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Danko Aleksejevs <danko@very.lv>
Co-committed-by: Danko Aleksejevs <danko@very.lv>
2025-06-18 12:58:31 +02:00