Commit graph

976 commits

Author SHA1 Message Date
Otto f7f7800460 Merge pull request 'feat: support regexp in git-grep search' (#4968) from yoctozepto/git-grep-regexp into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4968
Reviewed-by: Shiny Nematoda <snematoda@noreply.codeberg.org>
2024-10-04 17:10:14 +00:00
Otto Richter 88f653b583 docs(e2e): Update e2e test instructions for changed file patterns
chore: let fnetx review e2e tests
2024-10-04 15:15:10 +02:00
Otto Richter 7765153b40 tests(e2e): Allow tests to run only on file changes
- supports glob patterns in testfiles
- only runs tests on changes
- always runs tests without specified patterns

tests(e2e): refactor global watch patterns

tests(e2e): add watch patterns to test files
2024-10-04 15:14:45 +02:00
Earl Warren a226064711
Fix artifact v4 upload above 8MB (#31664) (fix lint errors) 2024-09-29 09:58:47 +02:00
ChristopherHX 8f0a05a7e4
Fix artifact v4 upload above 8MB (#31664)
Multiple chunks are uploaded with type "block" without using
"appendBlock" and eventually out of order for bigger uploads.
8MB seems to be the chunk size

This change parses the blockList uploaded after all blocks to get the
final artifact size and order them correctly before calculating the
sha256 checksum over all blocks

Fixes #31354

(cherry picked from commit b594cec2bda6f861effedb2e8e0a7ebba191c0e9)

Conflicts:
	routers/api/actions/artifactsv4.go
  conflict because of Refactor AppURL usage (#30885) 67c1a07285008cc00036a87cef966c3bd519a50c
    that was not cherry-picked in Forgejo
    the resolution consist of removing the extra ctx argument
2024-09-29 09:24:15 +02:00
Exploding Dragon 89742c4913 feat: add architecture-specific removal support for arch package (#5351)
- [x] add architecture-specific removal support
- [x] Fix upload competition
- [x] Fix not checking input when downloading

docs: https://codeberg.org/forgejo/docs/pulls/874

### Release notes

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

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5351
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Exploding Dragon <explodingfkl@gmail.com>
Co-committed-by: Exploding Dragon <explodingfkl@gmail.com>
2024-09-27 08:21:22 +00:00
Earl Warren 89d9307d56 Merge pull request '[gitea] week 2024-39 cherry pick (gitea/main -> forgejo)' (#5372) from earl-warren/wcp/2024-39 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5372
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-09-27 08:12:43 +00:00
Jamie Schouten 9d34731198
Add bin to Composer Metadata (#32099)
This PR addresses the missing `bin` field in Composer metadata, which
currently causes vendor-provided binaries to not be symlinked to
`vendor/bin` during installation.

In the current implementation, running `composer install` does not
publish the binaries, leading to issues where expected binaries are not
available.

By properly declaring the `bin` field, this PR ensures that binaries are
correctly symlinked upon installation, as described in the [Composer
documentation](https://getcomposer.org/doc/articles/vendor-binaries.md).

(cherry picked from commit d351a42494e71b5e2da63302c2f9b46c78e6dbde)
2024-09-27 08:42:48 +02:00
KN4CK3R 526054332a
Fix incorrect /tokens api (#32085)
Fixes #32078

- Add missing scopes output.
- Disallow empty scope.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 08adbc468f8875fd4763c3656b334203c11adc0a)
2024-09-27 08:42:48 +02:00
Earl Warren 6275d1bc50
Refactor CSRF protector (#32057) (fix forgejo tests)
Fix the tests unique to Forgejo that are impacted by the refactor.
2024-09-27 08:42:48 +02:00
wxiaoguang 1ae3b127fc
Refactor CSRF protector (#32057)
Remove unused CSRF options, decouple "new csrf protector" and "prepare"
logic, do not redirect to home page if CSRF validation falis (it
shouldn't happen in daily usage, if it happens, redirecting to home
doesn't help either but just makes the problem more complex for "fetch")

(cherry picked from commit 1fede04b83288d8a91304a83b7601699bb5cba04)

Conflicts:
	options/locale/locale_en-US.ini
	tests/integration/repo_branch_test.go
  trivial context conflicts
2024-09-27 08:42:48 +02:00
Michael Kriese 1e5f7d2116
chore: fix lint error 2024-09-25 10:15:02 +02:00
Otto 8b62d3d5da Merge pull request 'i18n: UX improvements: Team permissions and issue closing' (#5383) from fnetx/team-permissions-i18n into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5383
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-09-24 21:16:40 +00:00
Otto Richter dc9a268d3c i18n: UX improvements: Team permissions and issue closing
Change word order for issue comment actions
-  An attempt to address https://codeberg.org/forgejo/forgejo/issues/2650

Org team permissions improvements

- consistency: added missing dot
- clarity: explain what external units mean
- use dedicated keys to explain the permissions.
- split in read/write permissions
- use explicit labels for accessibility
- ext_wiki.desc and ext_issues.desc are no longer in use.
2024-09-24 19:03:30 +02:00
Bram Hagens 4a74113dee
feat(ui): add more emoji and code block rendering in issues 2024-09-24 14:20:33 +02:00
Exploding Dragon a6508f5b03 Fix: database not updated when using git push --tags --force (#5319)
Closes #4274

link: https://github.com/go-gitea/gitea/pull/32040

### Release notes

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

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

## Draft release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/5319): <!--number 5319 --><!--line 0 --><!--description Rml4OiBkYXRhYmFzZSBub3QgdXBkYXRlZCB3aGVuIHVzaW5nIGBnaXQgcHVzaCAtLXRhZ3MgLS1mb3JjZWA=-->Fix: database not updated when using `git push --tags --force`<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5319
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Exploding Dragon <explodingfkl@gmail.com>
Co-committed-by: Exploding Dragon <explodingfkl@gmail.com>
2024-09-22 07:35:25 +00:00
Earl Warren 64d3fcd403 Merge pull request '[gitea] week 2024-38 cherry pick (gitea/main -> forgejo)' (#5325) from algernon/wcp/2024-38 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5325
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-09-20 05:06:42 +00:00
Otto a0c11f58dd Merge pull request 'Fix milestone assignment in new issue' (#5180) from esainane/forgejo:five-hundred-more into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5180
Reviewed-by: Otto <otto@codeberg.org>
2024-09-17 16:50:42 +00:00
Sai Nane 7f02f4722c Test: Milestone assignment in new issue
This test currently fails, as expected, given this functionality is currently
broken.
2024-09-17 17:45:02 +02:00
Otto Richter 61314f05fc tests(e2e): Test overflow in commit graph 2024-09-17 17:33:00 +02:00
Shiny Nematoda 9c70c7a8ea test(code-search): fix oops 2024-09-16 16:20:55 +02:00
Shiny Nematoda 30d07c3ba3 test(code-search): add for options dropdown 2024-09-16 16:20:55 +02:00
Otto Richter 804ca6590f tests(e2e): long search result overflow
Test fails before https://codeberg.org/forgejo/forgejo/pulls/5260
2024-09-14 22:28:24 +02:00
Kemal Zebari eb765dabfd
Handle invalid target when creating releases using API (#31841)
A 500 status code was thrown when passing a non-existent target to the
create release API. This snapshot handles this error and instead throws
a 404 status code.

Discovered while working on #31840.

(cherry picked from commit f05d9c98c4cb95e3a8a71bf3e2f8f4529e09f96f)
2024-09-14 18:45:18 +02:00
Otto Richter ef473d34f5 docs(e2e): Add parametric viewport example test 2024-09-14 12:49:57 +02:00
Shiny Nematoda 14abf65269 feat: set created_by as the default filter for /issues and /pulls (#5286)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5286
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
2024-09-13 12:55:39 +00:00
Michael Kriese 192a5ea68b Merge pull request 'tests(e2e): Allow running in parallel' (#5288) from fnetx/e2e-parallel into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5288
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-09-12 11:48:41 +00:00
Otto c98996f0d2 Merge pull request 'Improve textarea paste (part of gitea#31948)' (#5269) from algernon/forgejo:gitea/port/31948-partial into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5269
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-09-12 11:15:53 +00:00
Otto 742991abca Merge pull request 'Fix bad spacing on new release page' (#5261) from maltejur/forgejo:push-nnnyrrvzlqqy into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5261
Reviewed-by: Otto <otto@codeberg.org>
2024-09-11 22:21:43 +00:00
Otto Richter 3ff15d03f3 tests(e2e): assert URL paste behaviour 2024-09-11 21:44:10 +02:00
Otto Richter 3695f5d096 Parallelize playwright tests
- allow running with multiple workers (tested with up to four workers locally which
  didn't show signs of flakiness)
- prevent race condition with webauthn tests (running them in parallel
  on the same user could prevent another test from logging in)
- fix flakiness on CI action status (Chromium sometimes needs a long
  time to fill the href field, firefox is always faster)

This reverts commit e8585eff5c.
2024-09-11 16:53:51 +02:00
Otto Richter e4234fe6ab tests(e2e): remove unnecessary example test
The login behaviour is basically covered in login_user from utils_e2e.js, too.
2024-09-11 14:30:29 +02:00
Otto Richter a62521f241 New release form semantics
- correctly render labels without help text
- accessibility: fix external release button focus
- accessibility: test form aspects in browser test
2024-09-11 13:30:30 +02:00
Shiny Nematoda 6178a46fe2 feat: set fuzzy as default for issue search (#5270)
Closes #5225

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5270
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
2024-09-10 15:57:58 +00:00
Otto Richter 0f3ba99ff0 Add detailed instructions for e2e testing
- rewrite parts of and improve README
- simplify repo declaration
- list coverage in workflow path filter
2024-09-09 14:06:10 +02:00
Otto Richter d06da0d9c6 Update integration test README
and remove outdated chinese version
2024-09-09 14:06:10 +02:00
Solomon Victorino 829e661c39 test: assert navigation URLs in release E2E test
- last one waits for release deletion before the next browser run
- disambiguates failures due to error responses
2024-09-01 10:33:29 -06:00
Otto 1004ecd56b Merge pull request 'fix: WIP toggle by reducing max issue title' (#5143) from fnetx/wip-toggle-workaround into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5143
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-08-29 21:05:35 +00:00
Gusted 38076a44d7 Merge pull request 'Update module github.com/go-webauthn/webauthn to v0.11.2 (forgejo)' (#5147) from renovate/forgejo-github.com-go-webauthn-webauthn-0.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5147
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-08-29 20:35:23 +00:00
Exploding Dragon 6eb88be6e8 Merge branch 'forgejo' into bugfix-arch 2024-08-29 12:39:16 +00:00
Gusted 63736e8301
[FEAT] Add support for webauthn credential level 3
- For WebAuthn Credential level 3, the `backup_eligible` and
`backup_state` flags are checked if they are consistent with the values
given on login. Forgejo never stored this data, so add a database
migration that makes all webauthn credentials 'legacy' and on the next
first use capture the values of `backup_eligible` and `backup_state`.
As suggested in https://github.com/go-webauthn/webauthn/discussions/219#discussioncomment-10429662
- Adds unit tests.
- Add E2E test.
2024-08-29 10:05:03 +02:00
Gusted c87655b7ff Merge pull request '[CHORE] Move cache & captcha library' (#5146) from gusted/forgejo-captcha into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5146
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-08-29 08:02:09 +00:00
Otto Richter 7eac5feb74 fix: WIP toggle by reducing max issue title
- when the PR title has the maximum length, the WIP toggle switch does nothing
- work around this by slightly reducing the max input size (- 10 characters for eventually long prefixes)
- test WIP toggling edge case in playwright

fix(e2e): increase timeouts

A look at recent runs suggests they should be increased globally. The timeouts in the config file have no timeout by default.
2024-08-29 01:36:58 +02:00
Exploding Dragon 95f6cb7513 Merge branch 'forgejo' into bugfix-arch 2024-08-28 10:48:33 +00:00
Gusted 5a871f6095
[SEC] Ensure propagation of API scopes for Conan and Container authentication
- The Conan and Container packages use a different type of
authentication. It first authenticates via the regular way (api tokens
or user:password, handled via `auth.Basic`) and then generates a JWT
token that is used by the package software (such as Docker) to do the
action they wanted to do. This JWT token didn't properly propagate the
API scopes that the token was generated for, and thus could lead to a
'scope escalation' within the Conan and Container packages, read
access to write access.
- Store the API scope in the JWT token, so it can be propagated on
subsequent calls that uses that JWT token.
- Integration test added.
- Resolves #5128
2024-08-28 10:33:32 +02:00
Exploding Dragon 3a55604d3c Merge branch 'forgejo' into bugfix-arch 2024-08-28 00:38:10 +00:00
Gusted 0404662e99
[CHORE] Move captcha library
- This is a fork of https://github.com/dchest/captcha, as
https://gitea.com/go-chi/captcha is a fork of
github.com/go-macaron/captcha which is a fork (although not properly
credited) of a older version of https://github.com/dchest/captcha. Hence
why I've just forked the original.
- The fork includes some QoL improvements (uses standard library for
determistic RNG instead of rolling your own crypto), and removal of
audio support (500KiB unused data that bloated the binary otherwise).
Flips the image over the x-asis.
47270f2b55..main
- This move is needed for the next commit, because
gitea.com/go-chi/captcha included the gitea.com/go-chi/cache dependency.
2024-08-27 21:28:16 +02:00
Earl Warren 9addaedaf3 Merge pull request '[gitea] week 2024-35 cherry pick (gitea/main -> forgejo)' (#5109) from algernon/wcp/2024-35 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5109
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-08-27 06:09:19 +00:00
Exploding Dragon bc4849a904 Merge branch 'forgejo' into bugfix-arch 2024-08-27 02:34:54 +00:00
dragon 60b54c42ec add zst,xz,gz tests 2024-08-27 10:02:43 +08:00