Commit graph

18435 commits

Author SHA1 Message Date
oliverpool
4706b644f8
[TESTS] deliver webhooks on localhost
(cherry picked from commit bd97bd875d)
2024-04-01 16:36:04 +02:00
oliverpool
b6dccc0fd4
populate testlogger ignoreList
(cherry picked from commit 0532a91b1a)
2024-04-01 16:36:04 +02:00
oliverpool
966faddee4
[TESTS] prevent overriding testlogger when calling mainApp
(cherry picked from commit 5785ae72c7)
2024-04-01 16:36:04 +02:00
Earl Warren
c01935e9d0 Merge pull request '[v7.0/forgejo] Highlight signed tags like signed commits' (#2950) from bp-v7.0/forgejo-bc08007-432ff7d-cd19564 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2950
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-01 14:29:24 +00:00
Gergely Nagy
4dd475dfe5 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-04-01 13:42:11 +00:00
Gergely Nagy
923035e418 Highlight signed tags like signed commits
This makes signed tags show a badge in the tag list similar to signed
commits in the commit list, and a more verbose block when viewing a
single tag. Works for both GPG and SSH signed tags.

Fixes #1316.

Work sponsored by @glts.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-01 13:42:11 +00:00
Gergely Nagy
9ecd041975 An integration test for SSH signed tags
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-01 13:42:11 +00:00
forgejo-backport-action
9f80081795 [v7.0/forgejo] [REFACTOR] git attribute: test proper cancellation and unify nul-byte reader (#2939)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/2906

Following #2763 (refactor of git check-attr)
and #2866 (wrong log.Error format in check-attr)

- refactors the `nul-byte` reader to be used in both the streaming and one-off cases.
- add test for some failure cases
- don't log the error returned by `cmd.Run`, but return it to the `CheckPath` caller (which can then decide what to do with it).

This should solve the following flaky `log.Error` (or at least move it to the caller, instead of being inside a random goroutine):

https://codeberg.org/forgejo/forgejo/actions/runs/9541/jobs/5#jobstep-7-839

> FATAL ERROR: log.Error has been called: 2024/03/28 14:30:33 ...it/repo_attribute.go:313:func2() [E] Unable to open checker for 3fa2f829675543ecfc16b2891aebe8bf0608a8f4. Error: failed to run attr-check. Error: exit status 128
        Stderr: fatal: this operation must be run in a work tree

Co-authored-by: oliverpool <git@olivier.pfad.fr>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2939
Reviewed-by: oliverpool <oliverpool@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-01 06:44:46 +00:00
Gusted
4cb3f331a2 Merge pull request '[v7.0/forgejo] [BUG] Consistent styling for Sort filter' (#2938) from bp-v7.0/forgejo-b7d55de into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2938
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-31 21:30:51 +00:00
Gusted
fd8f51f2b6 [BUG] Consistent styling for Sort filter
- The dropdowns that contain filters for issues and pull requests are
currently not styled with the `small` class, which causes a smaller font
size to be set. Remove it for the `Sort` filter to make it consistent
and make it _more_ readable.
- Resolves #2914
2024-03-31 20:59:35 +00:00
Earl Warren
e628d0e54b Merge pull request '[v7.0/forgejo] Fix New issue button position consistency' (#2930) from bp-v7.0/forgejo-892fc82 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2930
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-31 09:45:48 +00:00
Earl Warren
ece5c97931 Merge pull request '[v7.0/forgejo] English improvements' (#2929) from bp-v7.0/forgejo-d183d32 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2929
2024-03-31 09:11:47 +00:00
0ko
b9dbd93ebc Fix New issue button consistency
Fixes https://codeberg.org/forgejo/forgejo/issues/2613
Based on https://codeberg.org/forgejo/forgejo/issues/2613#issuecomment-1654709

- add new class `list-header-issues`;
- add rules that fix button position;
- use variable to keep the vertical offset constant;
- fix gap for edit button.

Co-authored-by: Gusted <gusted@noreply.codeberg.org>
2024-03-31 08:20:16 +00:00
0ko
66d1cd89d1 [I18N] English improvements 2024-03-31 08:17:16 +00:00
Earl Warren
45f39ce839 Merge pull request '[v7.0/forgejo] Fix accessibility and translatability of repo explore counters' (#2919) from bp-v7.0/forgejo-cbd067e into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2919
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-31 07:57:10 +00:00
Earl Warren
f0a2da40ff Merge pull request '[v7.0/forgejo] [CI] backport: show event information for debug purposes' (#2927) from bp-v7.0/forgejo-7aa686d into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2927
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-31 07:56:28 +00:00
Earl Warren
60a82b0890 Merge pull request '[v7.0/forgejo] [BUG] Fix selector inner radius' (#2921) from bp-v7.0/forgejo-177d8e7 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2921
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-31 07:56:02 +00:00
Earl Warren
6b560544fb Merge pull request '[v7.0/forgejo] [REFACTOR] add Icon to webhook.Interface' (#2928) from bp-v7.0/forgejo-69115ba-120fa61 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2928
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-31 07:55:11 +00:00
Earl Warren
4a4bd75989 Merge pull request '[v7.0/forgejo] [RELEASE] GITEA_VERSION is a fallback for FORGEJO_VERSION' (#2922) from bp-v7.0/forgejo-869795a into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2922
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-31 07:24:29 +00:00
oliverpool
84eeab59af [REFACTOR] add Icon to webhook.Interface 2024-03-31 07:20:19 +00:00
oliverpool
7f03fdf9f9 [REFACTOR] use Icon from interface in webhook list 2024-03-31 07:20:18 +00:00
Earl Warren
6b2d02528f Merge pull request '[v7.0/fogejo] [I18N] Translations update from Weblate (#2841)' (#2926) from earl-warren/forgejo:wip-i18n-backport into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2926
2024-03-31 07:09:28 +00:00
Earl Warren
92acbb0a8e [CI] backport: show event information for debug purposes
It will help figure out why two runs of testing happen when a backport
PR is open.

Refs: https://codeberg.org/forgejo/forgejo/pulls/2922
Refs: https://codeberg.org/forgejo/forgejo/issues/2009
2024-03-31 07:01:34 +00:00
Codeberg Translate
5503db386e
[I18N] Translations update from Weblate (#2841)
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: Wuzzy <Wuzzy@users.noreply.translate.codeberg.org>
Co-authored-by: kita <kita@users.noreply.translate.codeberg.org>
Co-authored-by: Fjuro <Fjuro@users.noreply.translate.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: yeziruo <yeziruo@users.noreply.translate.codeberg.org>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: Kaede Fujisaki <ledyba@users.noreply.translate.codeberg.org>
Co-authored-by: cherryb <cherryb@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2841
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
(cherry picked from commit 03cac08b1d)
2024-03-31 08:34:41 +02:00
Earl Warren
005a9c7850 [RELEASE] GITEA_VERSION is a fallback for FORGEJO_VERSION
Existing Forgejo packages may rely on setting GITEA_VERSION to specify
the version to build if:

* they do not build from the git repository with the proper tag
* they build from a source tarbal that does not have a VERSION file

With 7.0 the logic of setting the version was modified in the
`[RELEASE] Gitea version is for interoperability only` commit and
ignores this variable which creates an unecessary breaking change.

If GITEA_VERSION is set, the versions will be set on 7.0 exactly as
they would have with version before and included 1.21.

* If GITEA_VERSION is not set, all versions are the same
* If GITEA_VERSION is set, there is a distinction between the version
  set in the binary are returned by the Gitea API and the
  version returned by the Forgejo API which includes metadata.

Before:

$ make GITEA_VERSION=7.0.0 show-version-full
7.0.0-dev-1809-cd6fa771ab+gitea-1.22.0
$ make GITEA_VERSION=7.0.0 show-version-api
7.0.0-dev-1809-cd6fa771ab+gitea-1.22.0

After:

$ make GITEA_VERSION=7.0.0 show-version-full
7.0.0
$ make GITEA_VERSION=7.0.0 show-version-api
7.0.0+gitea-1.22.0
2024-03-30 22:39:37 +00:00
Earl Warren
d0dccaec66 Merge pull request '[v7.0/forgejo] [BUG] Don't color dot literal color names' (#2918) from bp-v7.0/forgejo-80f22ab into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2918
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 22:38:16 +00:00
0ko
ea0e8caa6f Fix selector inner radius
- Fixes https://codeberg.org/forgejo/forgejo/issues/2835
2024-03-30 22:35:38 +00:00
0ko
9b4d32446c Fix accessibility and translatability of repo explore counters
Progression of: 9e69ef9c51
Regression of: 65e190ae8b (diff-8d94e33cfe70fa6443d059b9c34e3f8064514816)
2024-03-30 22:27:38 +00:00
Earl Warren
ce5f1b942f Merge pull request '[v7.0/forgejo] [CI] allow backports to be launched on merged pull requests' (#2904) from bp-v7.0/forgejo-d8ab364 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2904
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 22:23:02 +00:00
Gusted
e428231b38 [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 22:12:40 +00:00
Gusted
03df59ec95 Merge pull request '[v7.0/forgejo] [BUG] Render emojis in labels in issue info popup' (#2907) from bp-v7.0/forgejo-ddc2417 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2907
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 16:07:12 +00:00
Gusted
a1bce73f5c [BUG] Render emojis in labels in issue info popup
- Currently emojis that are part of the label's name aren't rendered
when shown in the popup that you get when you hover over issue
references.
- This patch fixes that by rendering the emoji.
- Adds CSS to not make the emoji big in the label.
- Resolves #1531
2024-03-30 14:31:06 +00:00
Earl Warren
19f7eb657b [CI] allow backports to be launched on merged pull requests
The intention was good initially but the expression was wrong for two
reasons:

* When a pull_request event is received for a labeled action, the
  match should be github.event.action == 'label_updated' and not
  'labeled'
* The event does not have a github.event.label field and
  contains(github.event.label.name, 'backport/v') will always be
  false.

Since the expression is only evaluated in the context of a merged pull
request, either because it was just closed or because it was labeled
after the fact, the only verification that is needed is to assert that
there is at least one `backport/v*` label.
2024-03-30 13:19:01 +00:00
Earl Warren
659452a1bc Merge pull request 'Improve look of user profiles' (#2875) from 0ko/forgejo:profile-card-bg into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2875
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-30 10:19:12 +00:00
Earl Warren
053ab13f99 Merge pull request '[CI] backport strategy must fail when it conflicts' (#2896) from earl-warren/forgejo:wip-ci-backport into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2896
2024-03-30 10:13:15 +00:00
Earl Warren
2e3ea3e045 Merge pull request 'Update module github.com/opencontainers/image-spec to v1.1.0' (#2858) from renovate/github.com-opencontainers-image-spec-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2858
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-30 09:54:35 +00:00
0ko
951a276174 Improve look of user profiles
- use more standard backgounds for user card and readme
- add proper border to user card
2024-03-30 14:40:50 +05:00
Earl Warren
ffdba30a62
[CI] backport strategy must fail when it conflicts
strategy: ort

The strategy is changed from "recursive" to "ort", which is the
default for git >= 2.43.2 and claims to reduce the likelyhood of
conflicts according to man git-merge:

> This has been reported to result in fewer merge conflicts without
> causing mismerges...

strategy-option: find-renames

The default option are the same for both strategies and "theirs" will:

> This option forces conflicting hunks to be auto-resolved
> cleanly by favoring their version.

"their" being whatever is not in the commits being cherry-picked.

In the context of Forgejo backports, this is not what is desired:
whenever a conflict happens it needs to be manually resolved and
prefering whatever is in the stable branch will not lead to a sane
backport.

It is changed back to "find-renames" which is documented to be the
default:

> Turn on rename detection, optionally setting the similarity
> threshold. This is the default.

Fixes: https://codeberg.org/forgejo/forgejo/issues/2886
2024-03-30 10:34:23 +01:00
Earl Warren
91b745a5b6 Merge pull request '[gitea] week 14 cherry-pick' (#2872) from earl-warren/forgejo:wip-gitea-cherry-pick into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2872
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 08:01:06 +00:00
Earl Warren
8f10247585
[BUG] Fix Ctrl+Enter on editor (followup)
s/$editContentZone/editContentZone/

because the variable was renamed by

Remove jQuery `.attr` from the code comments (#30112)
2024-03-30 07:17:32 +01:00
Yarden Shoham
d8fa9b1580
Remove jQuery from the user search form in admin page (#29151)
- Switched to plain JavaScript
- Tested the form and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit a8748eedae3518550bd43fd592d206df2bea6bef)

Conflicts:
	web_src/js/features/admin/users.js
	prefer Gitea version and discard jQuery specific fixes from
	Forbid jQuery `.prop` and fix related issues (#29832)
2024-03-30 07:17:32 +01:00
Lunny Xiao
459b1b20fe
Fix migration v292 (#30153)
Fix https://github.com/go-gitea/gitea/pull/29874#discussion_r1542227686

- The migration of v292 will miss many projects. These projects will
have no default board. This PR introduced a new migration number and
removed v292 migration.

- This PR also added the missed transactions on project-related
operations.

- Only `SetDefaultBoard` will remove duplicated defaults but not in
`GetDefaultBoard`

(cherry picked from commit 40cdc84b368cce8328b4b49ea5ecf1c5fa040300)
2024-03-30 07:17:32 +01:00
Paweł Bogusławski
ade559edb7
Adjust VS Code debug filename match in .gitignore (#30158)
(cherry picked from commit 9585e19bb4386691760f741e23fba56cbfca8afb)
2024-03-30 07:17:32 +01:00
Kemal Zebari
23676bfea7
Prevent re-review and dismiss review actions on closed and merged PRs (#30065)
Resolves #29965.

---
Manually tested this by:
- Following the
[installation](https://docs.gitea.com/next/installation/install-with-docker#basics)
guide (but built a local Docker image instead)
- Creating 2 users, one who is the `Owner` of a newly-created repository
and the other a `Collaborator`
- Had the `Collaborator` create a PR that the `Owner` reviews
- `Collaborator` resolves conversation and `Owner` merges PR

And with this change we see that we can no longer see re-request review
button for the `Owner`:

<img width="1351" alt="Screenshot 2024-03-25 at 12 39 18 AM"
src="https://github.com/go-gitea/gitea/assets/60799661/bcd9c579-3cf7-474f-a51e-b436fe1a39a4">

(cherry picked from commit 242b331260925e604150346e61329097d5731e77)
2024-03-30 07:17:32 +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
Yarden Shoham
ca1c90dc83
Bump @github/relative-time-element to v4.4.0 (#30154)
I tested and all timestamps work as before.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit eca4c485343069fc3e59f0dba7823cc13b5ab1d8)
2024-03-30 07:17:32 +01:00
silverwind
bcfb7e0356
Migrate font-family to tailwind (#30118)
Enable us to use tailwind's
[`font-family`](https://tailwindcss.com/docs/font-family) classes as
well as remove `gt-mono` in favor of `tw-font-mono`. I also merged the
"compensation" to one selector, previously this was two different values
0.9em and 0.95em. I did not declare a `serif` font because I don't think
there will ever be a use case for those. Command ran:

```sh
perl -p -i -e 's#gt-mono#tw-font-mono#g' web_src/js/**/* templates/**/*

(cherry picked from commit 226a82a9396dc94f362ba27bd1c9318630df74b4)
2024-03-30 07:17:32 +01:00
YR Chen
2813425488
Move from max( id ) to max( index ) for latest commit statuses (#30076)
This PR replaces the use of `max( id )`, and instead using ``max(
`index` )`` for determining the latest commit status. Building business
logic over an `auto_increment` primary key like `id` is risky and
there’re already plenty of discussions on the Internet.

There‘s no guarantee for `auto_increment` values to be monotonic,
especially upon failures or with a cluster. In the specific case, we met
the problem of commit statuses being outdated when using TiDB as the
database. As [being
documented](https://docs.pingcap.com/tidb/stable/auto-increment),
`auto_increment` values assigned to an `insert` statement will only be
monotonic on a per server (node) basis.

Closes #30074.

(cherry picked from commit 7443a10fc3d722d3326a0cb7b15b208f907c72d7)
2024-03-30 07:17:31 +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
silverwind
47c61f909c
Drag-and-drop improvements for projects and issue pins (#29875)
1. Add "grabbing" cursor while dragging items:

![](https://github.com/go-gitea/gitea/assets/115237/c60845ff-7544-4215-aeaa-408e8c4ef03a)

2. Make project board only drag via their header, not via their whole
body.

![](https://github.com/go-gitea/gitea/assets/115237/62c27f3d-993a-481d-9cc3-b6226b4c5d61)

3. Fix some cursor problems in projects
4. Move shared options into `createSortable`.

(cherry picked from commit 7fda109aba6cd077343edef086b2f2ff60124f78)
2024-03-30 07:17:31 +01:00