Commit graph

18864 commits

Author SHA1 Message Date
wxiaoguang
c5d6cb5b52
Clean up log messages (#30313)
`log.Xxx("%v")` is not ideal, this PR adds necessary context messages.
Remove some unnecessary logs.

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 83f83019ef3471b847a300f0821499b3896ec987)

Conflicts:
	- modules/util/util.go
          Conflict resolved by picking `util.Iif` from 654cfd1dfbd3f3f1d94addee50b6fe2b018a49c3
(cherry picked from commit 492d116b2a468991f44d6d37ec33f918ccbe4514)

Conflicts:
	modules/util/util.go
	trivial context conflict as the commit is picked from https://codeberg.org/forgejo/forgejo/pulls/3212
2024-04-15 16:11:14 +02:00
Earl Warren
78944bb709 Merge pull request '[v7.0/forgejo] fix(actions): the trigger user of a schedule is the action user' (#3216) from bp-v7.0/forgejo-c3e2c25 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3216
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-14 18:34:20 +00:00
Earl Warren
35b129e984 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
(cherry picked from commit c3e2c25359)
2024-04-14 17:36:48 +00:00
forgejo-backport-action
1b8fd7b17b [v7.0/forgejo] [BUG] Fix code search in explore reporting as git grep even with indexer enabled (#3204)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/3173

regression caused in porting #2813 🫣

see https://codeberg.org/forgejo/forgejo/pulls/2688#issuecomment-1692750

Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3204
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>
2024-04-14 14:21:31 +00:00
0ko
ef0ab3cdaf Merge pull request 'Fix box rounding on dashboard (F7.0)' (#3202) from 0ko/forgejo:box-dash-v7 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3202
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-13 07:17:33 +00:00
0ko
5420b630f5 Fix box rounding on dashboard (F7.0)
Regression of 4711d3311b (diff-1daf5eae3896bddcde764fc8a88dc3fd0c0ea21a).
2024-04-13 10:44:19 +05:00
Earl Warren
f075579c95 Merge pull request '[v7.0/forgejo] Fix inline permalinks across repo; closes #2965' (#3198) from bp-v7.0/forgejo-1d1c013 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3198
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-12 23:40:43 +00:00
Earl Warren
88b6164f84 Merge pull request '[v7.0/forgejo] [BUG] Fix for PyPi Registry PEP 503 Compliance' (#3197) from bp-v7.0/forgejo-14badb3-303b95a into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3197
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-12 23:07:36 +00:00
Mai-Lapyst
dbf1d06ff6 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>
(cherry picked from commit 1d1c0131bb)
2024-04-12 22:38:57 +00:00
Zottelchen
bb7b211c0c Update tests/integration/api_packages_pypi_test.go
(cherry picked from commit 14badb37fe)
2024-04-12 22:23:58 +00:00
Zottelchen
aad193c4a6 Update templates/api/packages/pypi/simple.tmpl
(cherry picked from commit 303b95a1c1)
2024-04-12 22:23:58 +00:00
Earl Warren
caa6b4a34d Merge pull request '[v7.0/forgejo] Fix the settings tab highlighting' (#3195) from bp-v7.0/forgejo-65ed86e into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3195
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-12 22:19:16 +00:00
Earl Warren
9656408102 Merge pull request '[v7.0/forgejo] [BUG] Render correct label link' (#3196) from bp-v7.0/forgejo-7a97c05 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3196
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-12 22:18:59 +00:00
Gusted
0c71afea31 [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

(cherry picked from commit 7a97c05206)
2024-04-12 20:47:23 +00:00
Gergely Nagy
fd5abfd244 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>
(cherry picked from commit 65ed86e396)
2024-04-12 20:46:24 +00:00
Earl Warren
89d751ef1b Merge pull request '[v7.0/forgejo] Update forgejo/forgejo-build-publish action to v5' (#3186) from bp-v7.0/forgejo-d7ae60a into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3186
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-12 13:55:47 +00:00
Renovate Bot
ce2b1643f9 Update forgejo/forgejo-build-publish action to v5
(cherry picked from commit d7ae60ae91)
2024-04-12 12:23:15 +00:00
Earl Warren
e4f160eed2 Merge pull request '[v7.0/forgejo] Do not update PRs based on events that happened before they existed' (#3164) from earl-warren/forgejo:wip-v7.0-superfluous into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3164
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-12 09:14:02 +00:00
Earl Warren
50822f361e
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
(cherry picked from commit 998a431747)

Conflicts:
	models/forgejo_migrations/migrate.go
	see https://codeberg.org/forgejo/forgejo/pulls/3165#issuecomment-1755941
	services/pull/pull.go
	trivial conflicts
2024-04-12 10:41:19 +02:00
Earl Warren
ce8bfa25fb Merge pull request '[v7.0/forgejo] [BUG] Handle bigger files in git grep' (#3168) from bp-v7.0/forgejo-668709a into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3168
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-11 19:48:58 +00:00
0ko
5ab76ec570 Merge pull request '[v7.0/forgejo] Remove unused translation' (#3174) from bp-v7.0/forgejo-f7aca6e into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3174
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-11 16:12:59 +00:00
Gusted
62a925b758 Remove unused translation
- Remove `enable_update_checker_helper` translation key which became
obsolete with #278

(cherry picked from commit f7aca6ed21)
2024-04-11 15:07:08 +00:00
0ko
fa06bf5e81 Merge pull request 'Backport Translations update from Weblate (#3064)' (#3169) from 0ko/forgejo:backport-translations-2024-04-v7 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3169
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-11 14:53:53 +00:00
Gusted
b203e535e5 [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

(cherry picked from commit 668709a33f)
2024-04-11 13:32:01 +00:00
Codeberg Translate
fbaba7ed54 [I18N] Translations update from Weblate (#3064)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

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

Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: WithLithum <WithLithum@users.noreply.translate.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: adaaa <adaaa@users.noreply.translate.codeberg.org>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: Panagiotis \"Ivory\" Vasilopoulos <git@n0toose.net>
Co-authored-by: Kita Ikuyo <searinminecraft@courvix.com>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: hankskyjames777 <hankskyjames777@users.noreply.translate.codeberg.org>
Co-authored-by: Wuzzy <Wuzzy@users.noreply.translate.codeberg.org>
Co-authored-by: Anonymous <anonymous@users.noreply.translate.codeberg.org>
Co-authored-by: emansije <emansije@users.noreply.translate.codeberg.org>
Co-authored-by: Xinayder <Xinayder@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3064
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-04-11 18:31:56 +05:00
Gusted
db56ccf993 Merge pull request '[v7.0/forgejo] [BUG] Store JSON in contributors commit cache' (#3161) from bp-v7.0/forgejo-4c8b67c into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3161
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-11 13:12:11 +00:00
Gusted
d60152587c [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

(cherry picked from commit 4c8b67c4b2)
2024-04-11 12:06:19 +00:00
Earl Warren
b519ae39d7 Merge pull request '[v7.0/forgejo] [BUG] Fix tooltip for 1000+ stars/forks' (#3148) from bp-v7.0/forgejo-3e9a97b into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3148
Reviewed-by: Otto <otto@codeberg.org>
2024-04-11 05:11:12 +00:00
Gusted
3344ef3511 [BUG] Fix tooltip for 1000+ stars/forks
- The tooltip attribute should be inside the `<a>` element not outside of it.
- Regression of 854164f40b

(cherry picked from commit 3e9a97b9ce)
2024-04-10 22:35:21 +00:00
Earl Warren
60e28c9dda Merge pull request '[v7.0/forgejo] Update checker setting updates' (#3146) from bp-v7.0/forgejo-e498069 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3146
2024-04-10 21:44:39 +00:00
0ko
71efe9b8fc Update checker setting updates
- revert c53f802778
- enable by default on install page
- save checkbox state between form submissions

Resolves https://codeberg.org/forgejo/forgejo/issues/2859

(cherry picked from commit e498069fd5)
2024-04-10 20:55:35 +00:00
Earl Warren
f1016e8ddd Merge pull request '[v7.0/forgejo] Remove redundant / deadcode error check' (#3145) from bp-v7.0/forgejo-9862f28 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3145
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-10 18:51:08 +00:00
Gusted
711838a4df Remove error check
- This error check was made redudant by 375fd15fbf

(cherry picked from commit 9862f28ac5)
2024-04-10 17:43:57 +00:00
Earl Warren
666432d15b Merge pull request '[v1.22/gitea] week 15 cherry pick to v7.0' (#3113) from earl-warren/forgejo:wip-v7.0-gitea-cherry-pick into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3113
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-10 05:00:07 +00:00
Earl Warren
c63b347a0b Merge pull request '[v7.0/forgejo] [BUG] webhook: fix admin-hooks and add more tests' (#3131) from bp-v7.0/forgejo-9a94019-e0b5f2d-c1f7c49-7d95cf6 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3131
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-09 23:01:34 +00:00
oliverpool
01dc275a19 webhook: add admin-hooks tests
(cherry picked from commit 9a94019db4)
2024-04-09 21:57:34 +00:00
oliverpool
660e450e6d webhook: fix admin-hooks new dropdowns
(cherry picked from commit e0b5f2d59b)
2024-04-09 21:57:34 +00:00
oliverpool
457370bfce webhook: add admin-hooks new list test
(cherry picked from commit c1f7c49804)
2024-04-09 21:57:34 +00:00
oliverpool
373200e986 webhook: add org tests
(cherry picked from commit 7d95cf6472)
2024-04-09 21:57:34 +00:00
Earl Warren
f3a4134049 Merge pull request '[v7.0/forgejo] Made "no key to sign this commit with" error clearer' (#3117) from bp-v7.0/forgejo-53dadee into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3117
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-08 20:29:48 +00:00
Laxystem
a752d000ff Made "no key to sign this commit with" error more clear
(cherry picked from commit 53dadee350)
2024-04-08 19:08:39 +00:00
Earl Warren
4732cc82be Merge pull request '[v7.0/forgejo] [PORT] Refactor dropzone (#30232)' (#3112) from bp-v7.0/forgejo-c1ac3e5 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3112
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-08 10:22:34 +00:00
Earl Warren
9811e363bd Merge pull request '[v7.0/forgejo] [PORT] gitea#29953: Fix:the rounded corners of the folded file are not displayed correctly' (#3111) from bp-v7.0/forgejo-43122ca into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3111
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-08 10:16:01 +00:00
Giteabot
82b2b9790e
Add gap to commit status details (#30284) (#30290)
Backport #30284 by @silverwind

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit d09ddb52501a0342cc07df8ae312b847ebd98d96)
2024-04-08 11:51:51 +02:00
Giteabot
8a9b57500c
Commit-Dropdown: Show Author of commit if available (#30272) (#30285)
Backport #30272 by @sebastian-sauer

As in commits page we show the author of the commit in the commits
dropdown and not the committer.

Commits Page:
![Screenshot from 2024-04-03
22-34-41](https://github.com/go-gitea/gitea/assets/1135157/1c7c5c19-6d0a-4176-8a87-7bca6a0c6dc8)

and the same contents in our dropdown:

![image](https://github.com/go-gitea/gitea/assets/1135157/aa094af2-c369-47ac-9c27-ca208d1d03f0)

fixes #29588

Co-authored-by: sebastian-sauer <sauer.sebastian@gmail.com>
(cherry picked from commit c8570b73afb443f8e4f07f0a26939f1ab5c18f94)
2024-04-08 11:51:15 +02:00
wxiaoguang
294cb4f19b [PORT] Refactor dropzone (#30232)
Simplify code and use `.files` elements

(cherry picked from commit ca297a90fb1fec5b270fad1a3e575916510e7385)

Conflicts:
	web_src/js/features/repo-legacy.js
(cherry picked from commit c1ac3e5891)
2024-04-08 09:50:53 +00:00
Giteabot
e83b6c7cd2
Close file in the Upload func (#30262) (#30270)
Co-authored-by: guangwu <guoguangwu@magic-shield.com>
(cherry picked from commit f45df3e3f9255e5adc68f14c4e18c1e26a301a64)
2024-04-08 11:50:17 +02:00
Giteabot
39bc868092
Fixes #27605: inline math blocks can't be preceeded/followed by alphanumerical characters (#30175) (#30251)
Backport #30175 by @jmlt2002

- Inline math blocks couldn't be preceeded or succeeded by
alphanumerical characters due to changes introduced in PR #21171.
Removed the condition that caused this (precedingCharacter condition)
and added a new exit condition of the for-loop that checks if a specific
'$' was escaped using '\' so that the math expression can be rendered as
intended.
- Additionally this PR fixes another bug where math blocks of the type
'$xyz$abc$' where the dollar sign was not escaped by the user, generated
an error (shown in the screenshots below)
- Altered the tests to accomodate for the changes

Former behaviour (from try.gitea.io):

![image](https://github.com/go-gitea/gitea/assets/114936010/8f0cbb21-321d-451c-b871-c67a8e1e9235)

Fixed behaviour (from my local build):

![image](https://github.com/go-gitea/gitea/assets/114936010/5c22687c-6f11-4407-b5e7-c14b838bc20d)

(Edit) Source code for the README.md file:
```
$x$ -$x$ $x$-

a$xa$ $xa$a 1$xb$ $xb$1

$a a$b b$

a$b $a a$b b$

$a a\$b b$
```

Signed-off-by: João Tiago <joao.leal.tintas@tecnico.ulisboa.pt>
Co-authored-by: João Tiago <114936010+jmlt2002@users.noreply.github.com>
(cherry picked from commit ac65aeecbd42ed30cc0838b3fad12b58daadf3ad)
2024-04-08 11:49:51 +02:00
KN4CK3R
d9442b09b5
Fix missing 0 prefix of GPG key id (#30245)
Fixes #30235

If the key id "front" byte has a single digit, `%X` is missing the 0
prefix.
` 38D1A3EADDBEA9C` instead of
`038D1A3EADDBEA9C`
When using the `IssuerFingerprint` slice `%X` is enough but I changed it
to `%016X` too to be consistent.

(cherry picked from commit eb505b128c7b9b2459f2a5d20b5740017125178b)

Conflicts:
	- models/asymkey/gpg_key_commit_verification.go
          Ported the change to models/asymkey/gpg_key_object_verification.go
(cherry picked from commit 63904e2f97)
2024-04-08 11:46:40 +02:00
Giteabot
e40ab6d0bd
Fix spacing in issue navbar (#30238) (#30242)
Backport #30238 by @silverwind

Create a new `issue-navbar` class specifically for this bar, previous
class used in many places and I thought I had them all removed, but not
this one.

Fixes: https://github.com/go-gitea/gitea/issues/30226

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 39322d9fc4644d2ede3efe3a9c4efee2e493d4cd)
2024-04-08 11:44:09 +02:00