Commit graph

18790 commits

Author SHA1 Message Date
oliverpool
16879b07d2 [PORT] drop utils.IsExternalURL (and expand IsRiskyRedirectURL tests) (#3167)
Related to  #2773
Related to Refactor URL detection [gitea#29960](https://github.com/go-gitea/gitea/pull/29960)
Related to Refactor external URL detection [gitea#29973](https://github.com/go-gitea/gitea/pull/29973)

I added a bunch of tests to `httplib.TestIsRiskyRedirectURL` and some cases should be better handled (however it is not an easy task).

I also ported the removal of `utils.IsExternalURL`, since it prevents duplicated (subtle) code.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3167
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2024-04-15 13:03:08 +00:00
Earl Warren
20c0292b5c Merge pull request 'fix(actions): the trigger user of a schedule is the action user' (#3213) from earl-warren/forgejo:wip-actions-trigger-user into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3213
Reviewed-by: thefox <thefox@noreply.codeberg.org>
2024-04-14 17:35:25 +00:00
Earl Warren
c3e2c25359
fix(actions): the trigger user of a schedule is the action user
The user that caused the notification to re-evaluates the
schedules is not the one that will trigger the workflows. They are
background tasks that are authored by the action user (id -2).

Such a mis-assignment is problematic when the user that caused the
notification is deleted.

Fixes: https://codeberg.org/forgejo/forgejo/issues/3211
2024-04-14 12:53:20 +02:00
Earl Warren
b833e5e7db Merge pull request '[BUG] Fix code search in explore reporting as git grep even with indexer enabled' (#3173) from snematoda/fix-grep-tmpl into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3173
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-13 08:52:08 +00:00
0ko
ea7a3ea8bf Merge pull request 'Fix box rounding on dashboard' (#3194) from 0ko/forgejo:fix-dashboard-rounding into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3194
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-13 07:17:10 +00:00
Shiny Nematoda
a67ca43f75 add test 2024-04-13 06:04:00 +00:00
Earl Warren
9f785710e9 Merge pull request 'Update module golang.org/x/vuln/cmd/govulncheck to v1.0.4' (#3201) from renovate/golang.org-x-vuln-cmd-govulncheck-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3201
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-13 05:38:16 +00:00
Earl Warren
306e0706a1
GOVULNCHECK_PACKAGE: pin to v1 instead of patch version 2024-04-13 07:00:52 +02:00
Renovate Bot
463ead502d Update module golang.org/x/vuln/cmd/govulncheck to v1.0.4 2024-04-13 02:11:12 +00:00
Renovate Bot
2059abd9c0 Update ghcr.io/visualon/renovate Docker tag to v37.290.1 2024-04-13 00:04:43 +00:00
Mai-Lapyst
1d1c0131bb Fix inline permalinks across repo; closes #2965 (#3042)
This PR fixes the possible ambiguity of rendered inline permalinks across repos by adding it as a suffix to the title element if the permalink refers to a file not inside the current repository. Closes #2965

![grafik](/attachments/e70e37b8-24c7-4f7b-ab52-92f1e8dfb009)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3042
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
Co-committed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-04-12 22:30:20 +00:00
Earl Warren
828ae39c22 Merge pull request '[BUG] Fix for PyPi Registry PEP 503 Compliance' (#3190) from Zottelchen/forgejo:bug/pep-503 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3190
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-12 22:19:51 +00:00
Zottelchen
14badb37fe Update tests/integration/api_packages_pypi_test.go 2024-04-12 21:02:42 +00:00
Earl Warren
0e42ba33fb Merge pull request '[BUG] Render correct label link' (#3187) from gusted/forgejo-labels into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3187
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-12 20:43:16 +00:00
Earl Warren
7bd3b18ebc Merge pull request 'Fix the settings tab highlighting' (#3191) from algernon/forgejo:highlight-of-another into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3191
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-12 20:42:31 +00:00
0ko
39cdcb4daf Fix box rounding on dashboard
Regression of d40127a3e8 (diff-1daf5eae3896bddcde764fc8a88dc3fd0c0ea21a) and 4711d3311b (diff-1daf5eae3896bddcde764fc8a88dc3fd0c0ea21a).
2024-04-12 23:16:17 +05:00
Gergely Nagy
65ed86e396
Fix the settings tab highlighting
When visiting a repos `/settings/units` page, highlight the active tab
properly: "Add more..." if the tab is displayed, or "Settings"
otherwise.

Fixes #3188.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-12 19:11:21 +02:00
Zottelchen
303b95a1c1 Update templates/api/packages/pypi/simple.tmpl 2024-04-12 16:43:30 +00:00
Gusted
7a97c05206
[BUG] Render correct label link
- Render the correct label for pull requests, it should link to the pull
requests list and not the issue list.
- Add unit test.
- Resolves https://codeberg.org/forgejo/forgejo/issues/3183
2024-04-12 17:23:20 +02:00
Gusted
0c42e3c755 Merge pull request '[CHORE] Remove println' (#3185) from gusted/forgejo-println into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3185
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-12 12:35:38 +00:00
Earl Warren
9ef05fec5d Merge pull request 'Update forgejo/forgejo-build-publish action to v5' (#3182) from renovate/forgejo-forgejo-build-publish-5.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3182
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-12 12:22:24 +00:00
Gusted
706846b628
[CHORE] Remove println
- It's not recommended to use it per the documentation: https://pkg.go.dev/builtin#println.
2024-04-12 13:36:31 +02:00
Earl Warren
ed7957d987 Merge pull request '[CI] backport upgrade to git-backporting@v4.8.0' (#3155) from earl-warren/forgejo:wip-ci-backport into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3155
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-12 10:31:06 +00:00
Renovate Bot
d7ae60ae91 Update forgejo/forgejo-build-publish action to v5 2024-04-12 10:19:15 +00:00
Earl Warren
c6a117fe4f Merge pull request 'Upgrade github.com/editorconfig-checker/editorconfig-checker to v2.8.0' (#3181) from viceice/forgejo:build/upgrade-editorconfig-checker into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3181
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-12 07:29:07 +00:00
Michael Kriese
222e69bfaa
Upgrade github.com/editorconfig-checker/editorconfig-checker to v2.8.0 2024-04-12 09:00:41 +02:00
Earl Warren
c85f0f59a8 Merge pull request 'Update module github.com/rhysd/actionlint/cmd/actionlint to v1.6.27' (#3179) from renovate/github.com-rhysd-actionlint-cmd-actionlint-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3179
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-12 06:43:46 +00:00
Renovate Bot
1331c7de8a Update module github.com/rhysd/actionlint/cmd/actionlint to v1.6.27 2024-04-12 02:07:18 +00:00
Antonin Delpeuch
6053dc624f Merge pull request 'Update golangci-lint to 1.57.2' (#3163) from wetneb/forgejo:3162-update-golangci-lint into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3163
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-11 18:36:53 +00:00
Antonin Delpeuch
592c20c7d4 Fix spelling mistakes caught by golangci-lint 2024-04-11 17:16:26 +02:00
Antonin Delpeuch
035bba89f5 Update golangci-lint to 1.57.2 2024-04-11 17:16:25 +02:00
Gusted
70972f70d7 Merge pull request 'chore(renovate): Update deps inside Makefile' (#3166) from viceice/forgejo:chore/renovate-makefile into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3166
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Antonin Delpeuch <wetneb@noreply.codeberg.org>
2024-04-11 15:12:30 +00:00
Shiny Nematoda
aec787b927 fix code search template 2024-04-11 14:52:37 +00:00
Earl Warren
c3aed7cb69 Merge pull request 'Update dependency @playwright/test to v1.43.0' (#3152) from renovate/playwright-monorepo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3152
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-11 14:39:50 +00:00
Michael Kriese
9f4f7368d0 chore(renovate): Update deps inside Makefile 2024-04-11 13:46:27 +00:00
Gusted
f89f7ced5f Merge pull request '[BUG] Handle bigger files in git grep' (#3160) from gusted/forgejo-grep into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3160
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Shiny Nematoda <snematoda@noreply.codeberg.org>
2024-04-11 13:17:02 +00:00
Earl Warren
ad8a3ed2a1 Merge pull request 'Do not update PRs based on events that happened before they existed' (#2932) from earl-warren/forgejo:wip-superfluous into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2932
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-11 12:07:07 +00:00
Earl Warren
b90d7e4956 Merge pull request '[BUG] Store JSON in contributors commit cache' (#3159) from gusted/forgejo-cache-json into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3159
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-11 12:03:54 +00:00
Earl Warren
3266acb2ce Merge pull request '[RENOVATE] bitnami/minio upgrades are rare' (#3157) from earl-warren/forgejo:wip-renovate-minio into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3157
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-11 11:59:59 +00:00
Gusted
668709a33f
[BUG] Handle bigger files in git grep
- The parser of `git grep`'s output uses `bufio.Scanner`, which is a good
choice overall, however it does have a limit that's usually not noticed,
it will not read more than `64 * 1024` bytes at once which can be hit in
practical scenarios.
- Use `bufio.Reader` instead which doesn't have this limitation, but is
a bit harder to work with as it's a more lower level primitive.
- Adds unit test.
- Resolves https://codeberg.org/forgejo/forgejo/issues/3149
2024-04-11 13:47:50 +02:00
Gusted
4c8b67c4b2
[BUG] Store JSON in contributors commit cache
- The code that gets contributor stats tried to store an
`map[string]*ContributorData` type in the cache, this works for the
memory cache but not for other caches such as Redis.
- The cache implementation for Redis would convert this map via
`fmt.Sprintf` to an string, which would simply print the pointer and not
the value of the pointer. Storing pointers is a no-go as this will get
GC-ed eventually within a few minutes. Therefore store everything with
json, that does properly store the value of the pointers.
- Adds unit test that verifies JSON is being used.
- Resolves https://codeberg.org/forgejo/forgejo/issues/3158
2024-04-11 13:01:33 +02:00
Renovate Bot
1d383a6354 Update dependency @playwright/test to v1.43.0 2024-04-11 10:05:56 +00:00
Earl Warren
998a431747
Do not update PRs based on events that happened before they existed
* Split TestPullRequest out of AddTestPullRequestTask
* A Created field is added to the Issue table
* The Created field is set to the time (with nano resolution) on creation
* Record the nano time repo_module.PushUpdateOptions is created by the hook
* The decision to update a pull request created before a commit was
  pushed is based on the time (with nano resolution) the git hook
  was run and the Created field

It ensures the following happens:

* commit C is pushed
* the git hook queues AddTestPullRequestTask for processing and returns with success
* TestPullRequest is not called yet
* a pull request P with commit C as the head is created
* TestPullRequest runs and ignores P because it was created after the commit was received

When the "created" column is NULL, no verification is done, pull
requests that were created before the column was created in the
database cannot be newer than the latest call to a git hook.

Fixes: https://codeberg.org/forgejo/forgejo/issues/2009
2024-04-11 11:16:23 +02:00
Earl Warren
f1c1a1e877
models: reserve v11 for backporting release blocker 2024-04-11 11:13:28 +02:00
Earl Warren
f672a63ae7
[RENOVATE] bitnami/minio upgrades are rare
It is used in the CI to verify the S3 backend works. It has no
security or feature requirements and upgrading would only be required
when a major version is published, which cannot be deduced from the
version number.

Making that upgrade available from the dashboard and dealt with when
and if it gets the attention of a developer, even if once a year, is
good enough.
2024-04-11 10:59:40 +02:00
Earl Warren
656554e247 Merge pull request 'Update dependency @eslint-community/eslint-plugin-eslint-comments to v4.3.0' (#3151) from renovate/eslint-community-eslint-plugin-eslint-comments-4.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3151
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-11 08:49:51 +00:00
Earl Warren
0355f63a48
[CI] backport upgrade to git-backporting@v4.8.0
* no-auto-squash: true so it DTRT for merged & squashed PRs
* target-branch-pattern: replaces the ad-hoc logic to determine the
  target branch name

It also now supports backporting to multiple branches. This is not
going to be immediately useful but will greatly help in three months
when there are two releases receiving backports.
2024-04-11 10:15:38 +02:00
Earl Warren
7af114aebe Merge pull request '[TESTS] disable test failure on log.Error for now (part 2)' (#3154) from earl-warren/forgejo:wip-transient-errors into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3154
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-11 06:40:12 +00:00
Earl Warren
fd62033b98
[TESTS] disable test failure on log.Error for now (part 2)
Fixes: https://codeberg.org/forgejo/forgejo/issues/3153
2024-04-11 07:36:59 +02:00
Renovate Bot
37f7c899a5 Update dependency @eslint-community/eslint-plugin-eslint-comments to v4.3.0 2024-04-11 00:06:13 +00:00