Commit graph

4642 commits

Author SHA1 Message Date
Michael Kriese
bc72fd7f46
feat: improve nuget nuspec api 2024-04-05 23:39:45 +02:00
Gusted
2d9afd0c21
[CHORE] Remove Microsoft SQL Server Support
- Per https://codeberg.org/forgejo/discussions/issues/122
2024-04-05 23:37:36 +02:00
Earl Warren
8205ed9495 Merge pull request '[FEAT] sourcehut webhooks' (#3022) from oliverpool/forgejo:webhook_7_sourcehut into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3022
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-05 19:23:54 +00:00
oliverpool
ed9dd0e62a [FEAT] sourcehut webhooks 2024-04-05 10:20:40 +02:00
Gusted
b0cd0ebb91
[BUG] Fix crash in issue forms
- Fix a crash in the issue forms, because `ctx.Ctx` was trying to be
accessed, however this is not set in all contexts thus could result to NPE.
- Adds integration test.
- Resolves #3011
2024-04-04 15:54:06 +02:00
Earl Warren
ba35934824 Merge pull request '[BUG] Center icon and callout text' (#3010) from gusted/forgejo-center-icon into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3010
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-04 12:10:27 +00:00
Gusted
6ffae461d4
[BUG] Center icon and callout text
- Wrap the icon and callout into a seperate `<p>` which has `display:
flex; align-items: center` set. To center the icon with the callout text.
- Resolves #3006
2024-04-03 22:26:19 +02:00
Gergely Nagy
66ac657159
Add Pronouns to the User and UserSettings api structs
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-03 15:17:15 -05:00
hazycora
f8e48e066a
add pronoun field to user profiles 2024-04-03 15:11:17 -05:00
Earl Warren
efd0f0f224 Merge pull request 'Port archived labels visual filter' (#2887) from 0ko/forgejo:lable-archive-bw into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2887
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-03 20:06:39 +00:00
Earl Warren
2a006e850e Merge pull request '[FEAT] Mark database errors in tests as failure' (#2972) from gusted/forgejo-log-db into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2972
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-02 14:47:32 +00:00
Earl Warren
3aad608649 Merge pull request '[BUG] Use correct template for commitmail error' (#2973) from gusted/forgejo-fix-committmail into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2973
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-02 14:45:54 +00:00
Gusted
27f39047c1
[BUG] Use correct template for commitmail error
- Use the correct template that was given when there's an error in
retrieving which git identity should be used.
- Remove the error from the exception list.
2024-04-02 15:08:53 +02:00
Gusted
2dabd202ce
[FEAT] Mark database errors in tests as failure
- If the database returns a error in integration tests, it should be
marked as a failure of the test.
- Ref: https://codeberg.org/forgejo/forgejo/issues/2962 (this should
help with logging the SQL that is resulting in the error).
2024-04-02 14:40:31 +02:00
oliverpool
cef39b2940 [TESTS] fix flack git check-attr flacky subtest 2024-04-02 11:56:48 +02:00
Earl Warren
385bcca788 Merge pull request 'Data size unit localization' (#2528) from 0ko/forgejo:sizelocalize into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2528
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-01 19:31:26 +00:00
Earl Warren
ec091b59af Merge pull request '[FEAT] Configure if protected branch rule should apply to admins' (#2867) from gusted/forgejo-protectedbranch-admins into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2867
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-01 19:28:29 +00:00
Earl Warren
8194d7d760 Merge pull request 'Make pprof labels conformant with prometheus spec' (#2933) from thefox/forgejo:pprof_fix into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2933
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-01 18:08:43 +00:00
Earl Warren
2e744dc991 Merge pull request 'Render inline file permalinks' (#2669) from Mai-Lapyst/forgejo:markup-add-filepreview into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2669
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-01 13:57:01 +00:00
Earl Warren
b9a1d5c2be Merge pull request 'Highlight signed tags like signed commits' (#2534) from algernon/forgejo:message-in-a-bottle-ctrl-w-tag into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2534
2024-04-01 13:38:55 +00:00
0ko
1060b7cfa8 Add opacity and grayscale to archived labels
Co-authored-by: Gusted <gusted@noreply.codeberg.org>
2024-04-01 17:46:02 +05:00
0ko
cab47bbb0e [I18N] Improve translatability of archived labels
Allow any position and writing style of `(Archived)`.
2024-04-01 17:46:02 +05:00
0ko
4b09dd11ec [GITEA] Apply changes to archived labels
This is a squashed result of conflict resolution for the following commits from Gitea:
- 36de5b299b
- 9a93b1816e
- 712e19fa6f
- 83850cc479

It is lacking CSS rule for archived labels, though.

Changes in this commit are authored by:
- 6543
- delvh
- silverwind
2024-04-01 17:46:02 +05:00
oliverpool
62148859b9 [TESTS] disable test failure on log.Error for now 2024-04-01 11:00:32 +02:00
Earl Warren
4d7a57a9f3 Merge pull request '[REFACTOR] git attribute: test proper cancellation and unify nul-byte reader' (#2906) from oliverpool/forgejo:git_attr_error into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2906
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-01 05:58:37 +00:00
Earl Warren
a60b34a451
[TESTS] do not include line numbers in the error whitelist
They are bound to change. The worst that can happen is that the same
error happens somewhere else and is ignored although it should
not. Which is not worse than the previous situation which was to
ignore all errors anyway.

Also be more liberal about what is ignored. Some error messages are
very long and may contain elements with some variance. It is enough to
have an ignored that is specific.
2024-03-31 23:32:49 +02:00
0ko
c2d137d1f2 Rename ByteSize to ReadableSize 2024-03-31 20:17:12 +05:00
TheFox0x7
c8f515dff7
[FIX] make pprof labels conformant with prometheus spec 2024-03-31 17:07:14 +02:00
Earl Warren
99842e9ff5 Merge pull request '[TESTS] prevent overriding testlogger when calling mainApp' (#2846) from oliverpool/forgejo:non_failing_test into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2846
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-31 13:50:20 +00:00
oliverpool
0bb7758cb0 git attribute: test proper cancellation and unify nul-byte reader 2024-03-31 08:44:09 +02:00
Earl Warren
e0421b28bf Merge pull request '[FEAT] Use 'Text' instead of 'Plaintext'' (#2833) from eo/forgejo:patch-1 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2833
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 22:21:14 +00:00
oliverpool
0532a91b1a populate testlogger ignoreList 2024-03-30 22:50:54 +01:00
0ko
dae95f473e Deprecate usage of FileSize in templates 2024-03-30 21:10:47 +05:00
0ko
075e0de142 Add unit test for TrSize 2024-03-30 21:10:47 +05:00
0ko
29cc80d849 Provide a way to translate data units 2024-03-30 21:10:47 +05:00
Gergely Nagy
cd19564acc
models/asymkey: Implement Tag verification
This is, in large part, a refactoring: we rename `CommitVerification` to
`ObjectVerification`, and adjust `ParseObjectWithSignature` (previously
`ParseCommitWithSignature`) to work on an object, rather than a commit.

This in turn, lets us implement `ParseTagWithSignature` on top of it, so
commit & tag signature verification will share most of the code.

Work sponsored by @glts.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-30 16:22:05 +01:00
Leo Heitmann Ruiz
afcff0eebd Fix 2024-03-30 15:23:48 +01:00
Gusted
80f22ab0d8
[BUG] Don't color dot literal color names
- Colordots are generated for colors in inline code, such as `red`,
`rgb(255, 0, 124)`, `#ffaabb` and `hsl(124, 52%, 50%)`. However this
shouldn't be doon for literal color names as these can be too common
assiocated with non-color related stuff _and matches the behavior of
some other forge_.
- Move the regexes from bluemonday to Forgejo and do the checking
ourselves.
- Adds unit tests.
- Resolves https://codeberg.org/Codeberg/Community/issues/1510
2024-03-30 14:30:41 +01:00
silverwind
3ccb0c2512
Render code tags in commit messages (#30146)
Extend https://github.com/go-gitea/gitea/pull/21432 to commit messages.
Color is changed because the markup code block bg does not offer enough
contrast on varying backgrounds.

<img width="568" alt="Screenshot 2024-03-27 at 19 52 55"
src="https://github.com/go-gitea/gitea/assets/115237/ddc9307e-f32f-4e97-8b88-91f88ced2a36">
<img width="573" alt="Screenshot 2024-03-27 at 19 53 33"
src="https://github.com/go-gitea/gitea/assets/115237/14b30fd2-bf28-46b8-9e82-eb60a28f6bf2">
<img width="422" alt="Screenshot 2024-03-27 at 19 53 01"
src="https://github.com/go-gitea/gitea/assets/115237/a12136b5-c02b-460c-9830-f830542987ae">
<img width="397" alt="Screenshot 2024-03-27 at 19 53 27"
src="https://github.com/go-gitea/gitea/assets/115237/c9f05d81-c73e-468e-98e9-e5929bc0da3e">
<img width="333" alt="Screenshot 2024-03-27 at 19 53 07"
src="https://github.com/go-gitea/gitea/assets/115237/06b5a9f9-f95d-46b6-8c57-df0b02555652">
<img width="279" alt="Screenshot 2024-03-27 at 19 53 21"
src="https://github.com/go-gitea/gitea/assets/115237/b06a0afc-ddd8-48ae-b557-a6dc47802e68">

(cherry picked from commit e40fc75bac65933f2ed3de8fbc5fb336195b59f5)
2024-03-30 07:17:32 +01:00
delvh
06645e7d46
Remember login for a month by default (#30150)
Previously, the default was a week.
As most instances don't set the setting, this leads to a bad user
experience by default.

## ⚠️ Breaking

If your instance requires a high level of security,
you may want to set `[security].LOGIN_REMEMBER_DAYS` so that logins are
not valid as long.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit 0d5abe3454c73f11d90d2809af0949a0e0636c22)
2024-03-30 07:17:31 +01:00
Lunny Xiao
9ca245ad96
Use db.ListOptions directly instead of Paginator interface to make it easier to use and fix performance of /pulls and /issues (#29990)
This PR uses `db.ListOptions` instead of `Paginor` to make the code
simpler.
And it also fixed the performance problem when viewing /pulls or
/issues. Before the counting in fact will also do the search.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 3f26fe2fa2c7141c9e622297e50a70f3e0003e4d)
2024-03-30 07:17:29 +01:00
Gusted
79b7089360
[FEAT] Configure if protected branch rule should apply to admins
- Currently protected branch rules do not apply to admins, however in
some cases (like in the case of Forgejo project) you might also want to
apply these rules to admins to avoid accidental merges.
- Add new option to configure this on a per-rule basis.
- Adds integration tests.
- Resolves #65
2024-03-29 00:21:49 +01:00
Gusted
1ebf4abddc
[BUG] Use correct format
- `%w` is to wrap errors, but can only be used by `fmt.Errorf`. Instead
use `%v` to display the error.
- Regression of #2763

Before:
[E] failed to run attr-check. Error: %!w(*exec.ExitError=&{0xc006568e28 []})
Stderr: fatal: this operation must be run in a work tree

After:
[E] failed to run attr-check. Error: exit status 128
Stderr: fatal: this operation must be run in a work tree
2024-03-28 22:27:53 +01:00
Shiny Nematoda
db7e6948a1 replace IfZero with cmp.Or 2024-03-28 11:58:26 +00:00
Shiny Nematoda
a38260aed9 Revert "cherry pick only IfZero from (#29755)"
This reverts commit 82851f429a.
2024-03-28 11:46:41 +00:00
Earl Warren
1684f0e5bf Merge pull request '[PERFORMANCE] git check-attr on bare repo if supported' (#2763) from oliverpool/forgejo:check_attr_bare into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2763
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-28 11:14:52 +00:00
oliverpool
3c81f7478c [PERFORMANCE] git check-attr on bare repo if supported 2024-03-28 10:52:51 +01:00
Earl Warren
327deee2d7 Merge pull request '[PORT] Support repo code search without setting up an indexer (gitea#29998)' (#2813) from snematoda/port-git-grep into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2813
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-28 08:15:47 +00:00
wxiaoguang
eb21829800 Fix git grep search limit, add test (#30071)
Fix #30069
2024-03-28 07:48:35 +00:00
Shiny Nematoda
82851f429a cherry pick only IfZero from (#29755)
original commit:
  Author: wxiaoguang <wxiaoguang@gmail.com>
  Date:   Thu Mar 14 09:10:51 2024 +0800

  Add test for webhook (#29755)

  Follow #29690
2024-03-28 05:21:52 +00:00
wxiaoguang
1e7a6483b8 Support repo code search without setting up an indexer (#29998)
By using git's ability, end users (especially small instance users) do
not need to enable the indexer, they could also benefit from the code
searching feature.

Fix #29996

![image](https://github.com/go-gitea/gitea/assets/2114189/11b7e458-88a4-480d-b4d7-72ee59406dd1)

![image](https://github.com/go-gitea/gitea/assets/2114189/0fe777d5-c95c-4288-a818-0427680805b6)

---------

Co-authored-by: silverwind <me@silverwind.io>
2024-03-28 05:16:51 +00:00
Mai-Lapyst
6e98bacbbd
Format code 2024-03-28 05:42:25 +01:00
Mai-Lapyst
16a8658878
Update test 2024-03-28 04:20:13 +01:00
oliverpool
5785ae72c7 [TESTS] prevent overriding testlogger when calling mainApp 2024-03-27 22:54:13 +01:00
oliverpool
9c3611ec50 [REFACTOR] simplify checkHookType 2024-03-27 22:26:55 +01:00
Mai-Lapyst
7e0014dd13
Fix formating & remove commented out code 2024-03-27 18:43:55 +01:00
oliverpool
8dfbbfef07 [REFACTOR] webhook matrix endpoints 2024-03-27 15:38:38 +01:00
Earl Warren
e41e18f87e Merge pull request '[REFACTOR] webhook.Handler interface' (#2758) from oliverpool/forgejo:webhook_2_interface into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2758
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-27 13:45:04 +00:00
Earl Warren
ac672fc3ff Merge pull request '[ACTIONS] port scheduled actions from Gitea' (#2826) from earl-warren/forgejo:wip-gitea-schedule into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2826
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-27 06:23:56 +00:00
Leo Heitmann Ruiz
c340e02078 "Plaintext" => "Text" 2024-03-26 22:25:34 +01:00
Leo Heitmann Ruiz
4f43b7338b "Plaintext" => "Text" 2024-03-26 22:01:53 +01:00
Earl Warren
8339b24d61 Merge pull request '[gitea] week 13 cherry-pick' (#2769) from earl-warren/forgejo:wip-gitea-cherry-pick into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2769
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-26 18:45:57 +00:00
6543
ab5f0b7558
Determine fuzziness of bleve indexer by keyword length (#29706)
also bleve did match on fuzzy search and the other way around. this also fix that bug.

(cherry picked from commit b9c57fb78e8e0d80d786d8e1da433b6c7ebf2f1c)

Conflicts:
	tests/integration/repo_search_test.go
	simple conflict resolution in the tests
2024-03-26 19:04:27 +01:00
Lunny Xiao
196c8772a8
Use db.ListOptionsAll instead of db.ListOptions{ListAll: true} (#29995)
(cherry picked from commit f8ab9dafb7a173a35e9308f8f784735b0f822439)

Conflicts:
	routers/web/repo/fork.go
	trivial context conflict, the file does not exist in Forgejo
2024-03-26 19:04:27 +01:00
wxiaoguang
d4ea1c2559
Fix some pending problems (#29985)
These changes are quite independent and trivial, so I don't want to open
too many PRs.

* https://github.com/go-gitea/gitea/pull/29882#discussion_r1529607091
    * the `f.Close` should be called properly
* the error message could be more meaningful
(https://github.com/go-gitea/gitea/pull/29882#pullrequestreview-1942557935)
*
https://github.com/go-gitea/gitea/pull/29859#pullrequestreview-1942324716
    * the new translation strings don't take arguments
* https://github.com/go-gitea/gitea/pull/28710#discussion_r1443778807
    * stale for long time
*  #28140
    * a form was forgotten to be changed to work with backend code

(cherry picked from commit 226231ea27d4f2b0f09fa4efb39501507613b284)

Conflicts:
	templates/repo/issue/view_content/pull.tmpl
	discarded because unexplained
	templates/status/404.tmpl
	implemented differently in Forgejo
2024-03-26 19:04:26 +01:00
wxiaoguang
e5920b4a62
Refactor StringsToInt64s (#29967)
And close #27176

(cherry picked from commit cdb4d1a8db096d60dba04728924dab85def45b19)
2024-03-26 19:04:26 +01:00
Lunny Xiao
d92c2048b3
Performance improvements for pull request list page (#29900)
This PR will avoid load pullrequest.Issue twice in pull request list
page. It will reduce x times database queries for those WIP pull
requests.

Partially fix #29585

---------

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

Conflicts:
	models/activities/notification_list.go
	moved to models/activities/notification.go
2024-03-26 19:04:26 +01:00
wxiaoguang
0710de9d0d
Fix loadOneBranch panic (#29938)
Try to fix #29936

Far from ideal, but still better than panic.

(cherry picked from commit 21151474e36eecc5b808963b924cd27ec34e0608)
2024-03-26 19:04:26 +01:00
Jason Song
06db43f858
Show Actions post step when it's running (#29926)
The post step was always waiting, even if all steps were done. Then,
once the task was done, the post step became success immediately.

Before:

<img width="915" alt="xnip_240320_120228"
src="https://github.com/go-gitea/gitea/assets/9418365/00347430-f998-4c43-917a-bf6dd6d0e333">

After:

<img width="905" alt="xnip_240320_120443"
src="https://github.com/go-gitea/gitea/assets/9418365/a419b111-17c2-4029-a022-c761cc419091">

(cherry picked from commit 35cfd98e121005f90f6d0d55d9a69e37d7990010)
2024-03-26 19:04:25 +01:00
coldWater
664052fb0b
Fix missing error check of bufio.Scanner (#29882)
maybe more

(cherry picked from commit 0e183d81fc5283f9d2047472de580e4f04a046c1)
2024-03-26 19:04:25 +01:00
Nanguan Lin
40c9fa43cd
Remove unused error in graceful manager (#29871)
As title.

(cherry picked from commit 1f0d31ce8fdfc8c32f84e4e0801c2d04b727bbd8)
2024-03-26 19:04:25 +01:00
0ko
8c4445ad3a [I18N] Add missing translation for more_items
- Resolves https://codeberg.org/forgejo/forgejo/issues/2818
- Removes entry for test ignorelist
2024-03-26 22:39:46 +05:00
Gergely Nagy
40c357bbc5 Rename CommitGPGSignature to ObjectSignature
`CommitGPGSignature` was originally made to store information about a
commit's GPG signature. Nowadays, it is used to store information about
SSH signatures too, and not just commit signatures, but tag signatures
too.

As such, rename it to `ObjectSignature`, because that describes what it
does a whole lot better.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-26 08:09:36 +00:00
Gergely Nagy
26ed995290 modules/git: Recognize SSH signed tags too
Just like commits, tags can be signed with either an OpenPGP, or with an
SSH key. While the latter is supported already, SSH-signed tags have not
been. This patch teaches the git module to recognize and handle
SSH-signed tags too.

This will stop the signatures appearing in release notes, but are
currently unused otherwise.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-26 08:09:36 +00:00
Zettat123
cf78141bdd
Fix an actions schedule bug (#28942)
In #28691, schedule plans will be deleted when a repo's actions unit is
disabled. But when the unit is enabled, the schedule plans won't be
created again.

This PR fixes the bug. The schedule plans will be created again when the
actions unit is re-enabled

(cherry picked from commit adc3598a75)
2024-03-25 16:27:32 +01:00
Lunny Xiao
3b3747ffe8
Fix schedule tasks bugs (#28691)
Fix #28157

This PR fix the possible bugs about actions schedule.

- Move `UpdateRepositoryUnit` and `SetRepoDefaultBranch` from models to
service layer
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when actions unit has been disabled
or global disabled.
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when default branch changed.

(cherry picked from commit 97292da960)

Conflicts:
	modules/actions/github.go
	routers/web/repo/setting/default_branch.go
	routers/web/repo/setting/setting.go
	services/repository/branch.go
	services/repository/setting.go
	tests/integration/actions_trigger_test.go
2024-03-25 16:25:02 +01:00
Earl Warren
623c79dfd2
Revert "[ACTIONS] on.schedule: the event is always "schedule""
This reverts commit 403bb4bf48.
2024-03-25 16:07:17 +01:00
Mai-Lapyst
2b6546adc9
Add setting to restrict count of lines being displayed & only highlight those lines 2024-03-25 16:05:01 +01:00
Mai-Lapyst
069d87b80f
Remove unneeded case for a trailing dot 2024-03-25 14:33:54 +01:00
oliverpool
702152bfde [REFACTOR] webhook.Handler interface 2024-03-24 10:35:06 +01:00
Earl Warren
5a18b74632 Merge pull request '[TESTS] fail when log.Error is called' (#2657) from oliverpool/forgejo:fail_test_on_log_error into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2657
2024-03-24 07:28:31 +00:00
oliverpool
639ac7a131 workergroup: gracefully exit on close(popItemErr) 2024-03-24 07:12:31 +01:00
oliverpool
ca209a04b1 log.Error on missing translation 2024-03-24 07:11:18 +01:00
oliverpool
e43c6cd9df fail test when log.Error is called
except for some specific messages (to make the test pass for now)
2024-03-24 07:11:18 +01:00
Earl Warren
0bfd4ca532 Merge pull request 'Allow users to hide all "Add more units..." hints' (#2533) from algernon/forgejo:less-is-more into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2533
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-24 05:42:37 +00:00
Earl Warren
af0bb6e68a Merge pull request '[port] gitea#29833: Refactor markdown attention render' (#2747) from algernon/forgejo:gitea/port/29833/refactor into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2747
2024-03-23 19:44:45 +00:00
Gergely Nagy
d571a2c202
Remove some more dead code from the markup sanitizer
This removes some more dead code from the markup sanitizer:

- Allowing unlabelled labels is no longer neccessary as of
  41e8b834af.
- Allowing `style` attributes on `span` and `p` are no longer necessary,
  `bluemonday` allows them by default now.

Selectively cherry picked from commit 66902d89e567ab1ae6dfb828636999c61ff0149e.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-23 17:16:22 +01:00
Earl Warren
b5775f6d6e Merge pull request 'modules/markup/markdown/ast: Drop IsColorPreview' (#2746) from algernon/forgejo:gitea/cherry-pick/29833/dead-code-removal into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2746
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-23 15:25:08 +00:00
Earl Warren
155d79473d Merge pull request 'Add newly added languages' (#2724) from 0ko/forgejo:i18n-2024-03 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2724
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-23 15:00:17 +00:00
Gergely Nagy
58d4af8fdb
Refactor the GitHub Legacy callout renderer too
Following up on the previous commit, change the GitHub Legacy callout
renderer to render the same as the refactored modern renderer.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-23 15:38:43 +01:00
wxiaoguang
ec2201a3da
Refactor markdown attention render (#29833)
* Remove some deadcode
* Use 2-word name for CSS class names
* Remove "gt-*" rules for sanitizer

The UI doesn't change much.

(cherry picked from commit 66902d89e567ab1ae6dfb828636999c61ff0149e)
2024-03-23 15:38:43 +01:00
Gergely Nagy
8af8682f7d
modules/markup/markdown/ast: Drop IsColorPreview
The function isn't used anywhere, it's dead code. Remove it.

Partially cherry picked from commit 46c3f3b9e81e25c3ed08ba6c5bfeb8802b3ba1fd.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-23 14:47:15 +01:00
Earl Warren
a631e5c249 Merge pull request 'Don't use <br /> in alert block (#29650)' (#2741) from algernon/forgejo:gitea/port/29650-dont-use-br-in-alert-block into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2741
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-23 13:46:40 +00:00
Yarden Shoham
20446ac6b3
Don't use <br /> in alert block (#29650)
- Follows https://github.com/go-gitea/gitea/pull/29121

When I implemented alert blocks I was always testing the markdown in
issue comments. I used `<br />` for line breaks and it looked good. I
have since learned that the markdown on README files doesn't allow these
tags. So a comment with

```md
> [!NOTE]
> If you're interested in using our APIs, we have experimental support with [documentation](https://try.gitea.io/api/swagger).
```

looked like this in a comment

![image](https://github.com/go-gitea/gitea/assets/20454870/96b1de01-2c87-4d4f-83dd-98192b83e9d0)
but looked like this in a README

![image](https://github.com/go-gitea/gitea/assets/20454870/474b636d-dd7a-4b7f-ba27-643803c71aa3)

So I changed how we render the alert block by having the alert itself
have a dedicated paragraph, so line breaks happen naturally between
paragraphs.

![image](https://github.com/go-gitea/gitea/assets/20454870/474b636d-dd7a-4b7f-ba27-643803c71aa3)

![image](https://github.com/go-gitea/gitea/assets/20454870/167a8d37-9a44-4479-9340-5dc80347b595)

![image](https://github.com/go-gitea/gitea/assets/20454870/2f99fec0-98ff-4ba8-97fe-b4567041ae79)

![image](https://github.com/go-gitea/gitea/assets/20454870/ffdeae11-fb06-4d00-b497-eae135f0d7ad)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
2024-03-23 12:18:40 +01:00
wxiaoguang
44221a3cd7
Customizable "Open with" applications for repository clone (#29320)
Users could customize the "clone" menu with their own application URLs on the admin panel.

Replace #22378
Close #21121
Close #22149
2024-03-23 11:58:54 +01:00
Gergely Nagy
3123725ff3
Revert "[GITEA] Configurable clone methods"
This reverts commit 1d8bca07f3.
2024-03-23 11:58:54 +01:00
0ko
404101931a [I18N] Language selector: bg, fil, eo, sl
Resolves https://codeberg.org/forgejo/forgejo/issues/2422
2024-03-22 15:59:56 +05:00
oliverpool
5c248adcf1 [CI] workerqueue attempt to fix flacky test 2024-03-22 08:52:16 +01:00
Gergely Nagy
36147f580c
Allow users to hide all "Add more units..." hints
Repositories displaying an "Add more..." tab on the header is a neat way
to let people discover they can enable more units. However, displaying
it all the time for repository owners, even when they deliberately do
not want to enable more units gets noisy very fast.

As such, this patch introduces a new setting which lets people disable
this hint under the appearance settings.

Fixes #2378.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-21 08:15:51 +01:00
oliverpool
9b3bfd0585 [CI] attempt to fix flacky test 2024-03-20 11:06:44 +01:00