Commit graph

17160 commits

Author SHA1 Message Date
silverwind
90537783ff
Fix incorrect SVGs (#30087)
Just the SVG fixes from https://github.com/go-gitea/gitea/pull/30086 for
v1.21 branch.

(cherry picked from commit 03f29db46dbaa4cacca875cfe6b1c0b012a93406)
2024-04-03 12:30:19 +02:00
Giteabot
40fba39dc1
Fix misuse of TxContext (#30061) (#30062)
Backport #30061 by @wolfogre

Help #29999, or its tests cannot pass.

Also, add some comments to clarify the usage of `TxContext`.

I don't check all usages of `TxContext` because there are too many
(almost 140+). It's a better idea to replace them with `WithTx` instead
of checking them one by one. However, that may be another refactoring
PR.

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit 78795dd5663b7d8df4620bd50c74a7d71606f1d2)
2024-04-03 12:23:40 +02:00
Giteabot
5e5574c7b3
Respect DEFAULT_ORG_MEMBER_VISIBLE setting when adding creator to org (#30013) (#30035)
Backport #30013 by @DrMaxNix

This PR adds `setting.Service.DefaultOrgMemberVisible` value to dataset
of user when the initial org creator is being added to the created org.

Fixes #30012.

Co-authored-by: DrMaxNix <mail@drmaxnix.de>
(cherry picked from commit e321b8a849087d736a96275d5960f9b1446c95ba)
2024-04-03 12:23:23 +02:00
wxiaoguang
b22be0c03f
Escape paths for find file correctly (#30026) (#30031)
Backport #30026

(cherry picked from commit 2172b38d505fa9586edf5da0d4aad7307dc92b7d)
2024-04-03 12:22:52 +02:00
wxiaoguang
7c8f1d7b20
Remove duplicate option in admin screen and now-unused translation keys (#28492) (#30024)
Backport #28492
Fix #30019

Co-authored-by: The Magician <142242365+TheMagician23@users.noreply.github.com>
(cherry picked from commit 01f736f68c5620957419c609bbf78f8e5ce76359)
2024-04-03 12:21:39 +02:00
Lunny Xiao
fccb34c389
Fix the bug that user may logout if GetUserByID return unknow error (#29964)
backport #29962

This PR fixed a bug when the user switching pages too fast, he will
logout automatically.

The reason is that when the error is context cancelled, the previous
code think user hasn't login then the session will be deleted. Now it
will return the errors but not think it's not login.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit c03b1e28544ee60c72f9dc7d9f362753bb3d778c)
2024-04-03 12:13:28 +02:00
HEREYUA
456a33e8bb
Solving the issue of UI disruption when the review is deleted without refreshing (#29951) (#29968)
backport #29951

(cherry picked from commit 3ff3c5ba780bc1b01004b9d0f8b4d56dd1aa9820)
2024-04-03 12:12:30 +02:00
wxiaoguang
c1ec79aeaf
Fix loadOneBranch panic (#29938) (#29939)
Backport #29938

Try to fix #29936

Far from ideal, but still better than panic.

(cherry picked from commit b4a6c6fd7a4ed8e018d27fcdb5203fa04becdddb)
2024-04-03 12:11:19 +02:00
Gusted
59bc466ad5 Merge pull request '[v1.21/forgejo] [BUG] Don't delete inactive emails explicitly' (#2885) from bp-v1.21/forgejo-190383d into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2885
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-29 17:20:50 +00:00
Gusted
fb4c42deb2
[BUG] Don't delete inactive emails explicitly
- `user_model.DeleteInactiveEmailAddresses` related code was added in
Gogs as part to delete inactive users, however since then the related
code to delete users has changed and this code now already delete email
addresses of the user, it's therefore not needed anymore to
`DeleteInactiveEmailAddresses`.
- The call to `DeleteInactiveEmailAddresses` can actually cause issues.
As the associated user might not have been deleted, because it
was not older than the specified `olderThan` argument. Therefore causing
a database inconsistency and lead to internal server errors if the user
tries to activate their account.
- Adds unit test to verify correct behavior (fails without this patch).
2024-03-29 17:50:13 +01:00
Gusted
033c7ce685 Merge pull request '[v1.21/forgejo] [BUG] Detect protected branch on branch rename' (#2827) from bp-v1.21/forgejo-0f79122 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2827
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-26 20:54:41 +00:00
Gusted
611610c3c4
[BUG] Detect protected branch on branch rename
- If a branch cannot be renamed due to a protected branch rule, show
this error in the UI instead of throwing an internal server error.
- Add integration test (also simplify the existing one).
- Resolves #2751
2024-03-26 21:09:53 +01:00
Earl Warren
fa6b3edf99 Merge pull request '[BUG] Fix Ctrl+Enter on editor' (#2825) from gusted/forgejo-bp-2810 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2825
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-26 16:00:57 +00:00
Gusted
f4e526ff07
[BUG] Fix Ctrl+Enter on editor
- Backport of #2810
- Add event listener for the `ce-quick-submit` event, which will be
triggered if `Ctrl+Enter` is pressed on a text area.
- Regression of 5cc0801de9
- Resolves #2762

(cherry picked from commit 9db76036bb)
2024-03-26 16:04:11 +01:00
Earl Warren
4092c544ca Merge pull request '[SEMVER] 6.0.8+0-gitea-1.21.8' (#2720) from earl-warren/forgejo:wip-v1.21-semver into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2720
2024-03-22 08:32:31 +00:00
Earl Warren
9028d061cc Merge pull request '[gitea] v1.21 cherry-pick' (#2716) from earl-warren/forgejo:wip-v1.21-gitea-cherry-pick into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2716
2024-03-22 07:41:50 +00:00
Earl Warren
586b5c6459
[SEMVER] 6.0.8+0-gitea-1.21.8 2024-03-22 08:00:05 +01:00
Earl Warren
df98757424
Fix invalid link of the commit status when ref is tag (#29752) (#29908) (step 2)
UpdateRepositoryUnits was moved to repo_service by a refactor that was
not cherry-picked. (Fix schedule tasks bugs (#28691) (#28780))
2024-03-21 17:28:36 +01:00
yp05327
2051763969
Fix invalid link of the commit status when ref is tag (#29752) (#29908)
Backport #29752

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit aae96cc62b6e6642fa1ef3dcacb716d32f5652b9)
2024-03-21 17:09:50 +01:00
Giteabot
120a173e24
Fix PR creation via api between branches of same repo with head field namespaced (#26986) (#29857)
Backport #26986 by @norohind

Fix #20175

Current implementation of API does not allow creating pull requests
between branches of the same
repo when you specify *namespace* (owner of the repo) in `head` field in
http request body.

---------

Co-authored-by: norohind <60548839+norohind@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 408c92938ba6f38eea1210cae2c485e1f19d4982)
2024-03-21 17:09:50 +01:00
Giteabot
ee87a652e9
Editor error message misleading due to re-used key. (#29859) (#29876)
Backport #29859 by @buckybytes

The error message:

`editor.file_changed_while_editing = The file contents have changed
since you started editing. <a target="_blank" rel="noopener noreferrer"
href="%s">Click here</a> to see them or <strong>Commit Changes
again</strong> to overwrite them.`

Is re-used in inappropriate contexts. The link in the key goes to a 404
when the key is used in a situation where the file contents have not
changed.

Added two new keys to differentiate commit id mismatch and push out of
date conditions.

Co-authored-by: buckybytes <158571971+buckybytes@users.noreply.github.com>
(cherry picked from commit 00ea9af8e118790a186b4cf78a0ce85ce986bf1d)
2024-03-21 17:09:50 +01:00
Giteabot
c060cf0e54
Fix user id column case (#29863) (#29867)
Backport #29863 by @lng2020

Sometimes the column name is case-sensitive and it may cause 500.

Co-authored-by: Nanguan Lin <nanguanlin6@gmail.com>
(cherry picked from commit c044510ca8bed67cb2d50ba741b3d0b520aa3c43)
2024-03-21 17:09:50 +01:00
Giteabot
07da773418
fix double border and border-radius on empty action steps (#29845) (#29850)
Backport #29845 by @silverwind

Before, double border-bottom and incorrect border-radius:

<img width="914" alt="Screenshot 2024-03-16 at 14 46 31"
src="https://github.com/go-gitea/gitea/assets/115237/6ea63c42-754c-420c-a0f5-c889a8507d9f">

After, both fixed:

<img width="917" alt="Screenshot 2024-03-16 at 14 45 59"
src="https://github.com/go-gitea/gitea/assets/115237/9d3f2dba-6b22-441d-8e99-5809d5f1f1c0">

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 8242c3c88c43bec4905bd689dbb05f7f64e2c3d7)
2024-03-21 17:09:50 +01:00
6543
a876ac2c79
Make meilisearch do exact search for issues (#29740 & #29671) (#29846)
Backport https://github.com/go-gitea/gitea/pull/29740 (based on #29671
...)

(cherry picked from commit 0cbbcf20e3f83413a88fe3d436451d707639fe55)
2024-03-21 17:09:50 +01:00
Giteabot
655302fc96
Fix for attribute not pointing to the ID of the color picker (#29813) (#29815)
Backport #29813 by @yardenshoham

It didn't include the word picker.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 47dc4598a305ea1e6017803b95c7c60d0be64784)
2024-03-21 17:09:50 +01:00
Earl Warren
510b2ff70e
Update Chroma to v2.13.0 (#29732) (#29805) (step 2)
go mod tidy was missing but compensated in Gitea by another commit merged
afterwards. It is skipped in Forgejo, reason why this is necessary.
2024-03-21 17:09:00 +01:00
Lunny Xiao
1952c3a0a5
Update Chroma to v2.13.0 (#29732) (#29805)
Backport #29732

This adds new lexers and includes some fixes. See
https://github.com/alecthomas/chroma/releases/tag/v2.13.0 for the full
changelog.

Co-authored-by: JakobDev <jakobdev@gmx.de>
(cherry picked from commit 31ab839a6587ea93edfec4d0147282c689d3e312)
2024-03-21 09:38:01 +01:00
Giteabot
6fcea1208d
Fix Safari spinner rendering (#29801) (#29802)
Backport #29801 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/29041
Fixes: https://github.com/go-gitea/gitea/pull/29713

Any of the `width: *-content` properties seem to workaround this Webkit
bug, this one seemed most suitable.

Before:
<img width="184" alt="Screenshot 2024-03-14 at 22 29 58"
src="https://github.com/go-gitea/gitea/assets/115237/6effc5f0-bc64-4752-be74-9c43b3974407">

After:
<img width="177" alt="Screenshot 2024-03-14 at 22 30 30"
src="https://github.com/go-gitea/gitea/assets/115237/5de244d7-6b46-428e-957c-4b10f53e2441">

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit df23ec0f8b490bee49dc0e7944b529f3ede35301)
2024-03-21 09:37:30 +01:00
Giteabot
0dcc9b8466
Fix missing translation on milestons (#29785) (#29789)
Backport #29785 by @lunny

Caused by #26569
Fix #29778

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit e03cf66e8b537430d24665b647b5af5716d182ee)
2024-03-21 09:36:50 +01:00
wxiaoguang
b68fa8ee09
Fix incorrect package link method calls in templates (#29580) (#29764)
Backport #29580
Fix #29562
Fix #29762
Follow  #29531

(cherry picked from commit bb2640c485071088dd91e47fb510c44e028624fa)
2024-03-21 09:29:05 +01:00
Giteabot
73498c1622
Suppress error from monaco-editor (#29684) (#29758)
Backport #29684 by @silverwind

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

I see no way for us to catch this error, so downgrade it until
https://github.com/microsoft/monaco-editor/issues/4325 is fixed, which
will likely take a few weeks to propagate up from vscode.

The entries in `updates.config.js` will make
[`updates`](https://github.com/silverwind/updates) not upgrade these
anymore and I think it's good documentation as well to have the reasons
why we don't upgrade these dependencies.

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 462ae88fc2e6295a9376855627ad2a824a6c8f1d)
2024-03-21 09:28:37 +01:00
Giteabot
fefe6062b0
Improve CSV rendering (#29638) (#29744)
Backport #29638 by @silverwind

Before:

<img width="1332" alt="Screenshot 2024-03-06 at 21 42 17"
src="https://github.com/go-gitea/gitea/assets/115237/0ea07eee-31f8-4783-bd56-37bd8396f00d">

After:
<img width="1336" alt="Screenshot 2024-03-06 at 21 41 58"
src="https://github.com/go-gitea/gitea/assets/115237/eb7f9cc9-587f-4e3b-92bd-cc67ca639963">

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 12b429c0d151178f1dcdb349dc297fdc9b773364)
2024-03-21 09:25:32 +01:00
Lunny Xiao
02ac89c01d
Use Get but not Post to get actions artifacts (#29734) (#29737)
backport #29734

(cherry picked from commit 8c31456a879797e7247d2cbf65b53fd16939c91d)
2024-03-21 09:25:14 +01:00
Giteabot
4543d70216
Fix inconsistent rendering of block mathematical expressions (#29677) (#29711)
Backport #29677 by @yp05327

Fix #28735

GitHub render `\```math\``` ` as a block now.
Add `display` class will render it as a block.

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/2a1c20c7-438e-4ab1-8c66-cf91c8343087)

![image](https://github.com/go-gitea/gitea/assets/18380374/b81b8a93-8bca-46a5-b7db-e0d2f53e1342)

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 4bfc43ef8de7c5e42f9502aa23075ee5fe04b26b)
2024-03-21 09:24:31 +01:00
Gusted
5fa3381787 Merge pull request '[BUG] Fix manual merge button' (#2697) from gusted/forgejo-bp-2696 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2697
Reviewed-by: Otto <otto@codeberg.org>
2024-03-19 19:26:58 +00:00
Gusted
c70719c59c
[BUG] Fix manual merge button
- Backport of #2696
- Add `form-fetch-action` to indicate that this form POST to an link
that returns JSON and thus should be handled by Javascript code.
- Found by @fnetx
- Regression of https://codeberg.org/forgejo/forgejo/pulls/1793

(cherry picked from commit 9551c1a6f8)
2024-03-19 19:43:58 +01:00
oliverpool
0774e04d6b Merge pull request '[GITEA] Enable mocked HTTP responses for GitLab migration test (backport to v1.21)' (#2667) from wetneb/forgejo:windows-cloning-v1.21 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2667
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-15 19:19:27 +00:00
Gusted
b06e953395 Merge pull request '[BUG] Use correct head commit for CODEOWNER' (#2672) from gusted/forgejo-bp-2658 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2672
Reviewed-by: Otto <otto@codeberg.org>
2024-03-15 15:36:38 +00:00
Gusted
02c9304247 Merge pull request '[BUG] Display error message if doer is unable to fork' (#2671) from gusted/forgejo-bp-2649 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2671
Reviewed-by: Otto <otto@codeberg.org>
2024-03-15 15:05:53 +00:00
Gusted
d1cebb0e88
[BUG] Use correct head commit for CODEOWNER
Backport of #2658

Regression of #2507, which switched the HEAD from `pr.GetGitRefName()`
to `pr.HeadCommitID` but it had to be `prInfo.HeadCommitID`. Resolves #2656
I was able to reproduce this locally with _some_ pull requests, haven't
been able to get a reproducer trough integration testing.

(cherry picked from commit a4cc37b46a)
2024-03-15 15:43:37 +01:00
Shiny Nematoda
730cc56080
[BUG] Display error message if doer is unable to fork
- Backport of #2649
- Resolves #2504

(cherry picked from commit 773048afa1)
2024-03-15 15:14:28 +01:00
Antonin Delpeuch
f609d00e1b [GITEA] Enable mocked HTTP responses for GitLab migration test 2024-03-15 12:58:50 +01:00
Earl Warren
bd71bdda26 Merge pull request '[gitea] v1.21 cherry-pick' (#2621) from earl-warren/forgejo:wip-v1.21-gitea-cherry-pick into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2621
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-03-12 23:17:05 +00:00
oliverpool
d9418651af [BUG 1.21] prevent error 500 on /user/settings/security when SignedUser has a linked account from a deactivated authentication source (#2626)
This should fix #2266.

This has apparently be fixed in `main` https://github.com/go-gitea/gitea/pull/27798 (but quite a big PR, which was not backported). I should likely push the test to the main branch as well.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2626
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>
2024-03-11 14:10:51 +00:00
silverwind
4f9b761a06
Don't show AbortErrors on logout (#29639) (#29667)
Backport https://github.com/go-gitea/gitea/pull/29639.

When logging out of Gitea, a error toast can be seen for a split second.
I don't know why or how it happens but I found it it's an `AbortError`
(related to
[AbortController#abort](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)),
so let's hide it.

(cherry picked from commit 346b66230519955fc831e75a9cc6175621d63b02)
2024-03-10 18:45:59 +07:00
Giteabot
ac05e205ba
Use more specific selector for name links (#29679) (#29681)
Backport #29679 by @silverwind

Followup https://github.com/go-gitea/gitea/pull/29305. As per discussion
in https://github.com/go-gitea/gitea/pull/29666#discussion_r1517506422,
make this selector only search in the current `.markup` document, as
there can be multiples displayed at the same time.

@DanielMatiasCarvalho maybe you can review.

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 25b0c99a41e9024d439deaa55be7ba87f6cd557f)
2024-03-10 18:45:59 +07:00
Giteabot
03caefbb02
Fix user-defined markup links targets (#29305) (#29666)
Backport #29305 by @DanielMatiasCarvalho

This seeks to fix the bug reported on issue #29196.

Cause:
ID's with custom characters (- , _ , etc.), were not linking correctly
in the Markdown file when rendered in the browser because the ID in the
respective destinies would be different than the one in anchor, while
for IDs with only letters, the ID would be the same.

Fix:
It was suggested that to fix this bug, it should more or less like
GitHub does it. While in gitea the anchors would be put in HTML like
this:
```
<p dir="auto"><a href="#user-content-_toc152597800" rel="nofollow">Review</a></p>
<p dir="auto"><a href="#user-content-_toc152597802" rel="nofollow">Staging</a></p>
<p dir="auto"><a href="#user-content-_toc152597803" rel="nofollow">Development</a></p>
<p dir="auto"><a href="#user-content-_toc152597828" rel="nofollow">Testing</a></p>
<p dir="auto"><a href="#user-content-_toc152597829" rel="nofollow">Unit-tests</a></p>

```
In GitHub, the same anchor's href properties would be the same without
"user-content-" trailing behind.

So my code made sure to change those anchors, so it would not include
"user-content-" and then add respective Event Listeners so it would
scroll into the supposed places.

Fixes: #29196

Co-authored-by: DC <106393991+DanielMatiasCarvalho@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit bfc7c8a5985825ec28f3feefe1d050ec52525097)
2024-03-10 18:45:59 +07:00
Giteabot
e811f3b185
Fix commit_status problem when testing (#29672) (#29675)
Backport #29672 by @charles7668

Close #29661

fix #29656

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
(cherry picked from commit 1f897637441a9a5c43e01b84e374d836d9260a00)
2024-03-10 18:45:59 +07:00
Lunny Xiao
66061d2828
Fix 500 when deleting account with incorrect password or unsupported login type (#29579) (#29656)
Fix #26210
Backport #29579

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit a129c0c06c91e4994244138687be135dddd4c00d)
2024-03-10 18:45:59 +07:00
Giteabot
e151e04673
Fix incorrect rendering csv file when file size is larger than UI.CSV.MaxFileSize (#29653) (#29663)
Backport #29653 by @yp05327

Fix #29506

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 6651d2d87aa4af96bf2c992e3ecae6a290d07496)
2024-03-10 18:45:59 +07:00