]> source.dussan.org Git - gitea.git/log
gitea.git
7 months agoUpdate Twitter Logo (#29621)
silverwind [Wed, 6 Mar 2024 05:21:39 +0000 (06:21 +0100)]
Update Twitter Logo (#29621)

<img width="430" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/9cf7b0a3-406b-4dd6-ab3d-d31a96b9335a">

7 months agoFix 500 error when adding PR comment (#29622)
wxiaoguang [Wed, 6 Mar 2024 05:09:38 +0000 (13:09 +0800)]
Fix 500 error when adding PR comment (#29622)

7 months agoRun editorconfig-checker on `locale_en-US.ini` (#29608)
silverwind [Wed, 6 Mar 2024 01:48:14 +0000 (02:48 +0100)]
Run editorconfig-checker on `locale_en-US.ini` (#29608)

Will prevent trailing whitespace etc being introduced in this file.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agobump protobuf module (#29617)
techknowlogick [Wed, 6 Mar 2024 01:35:29 +0000 (20:35 -0500)]
bump protobuf module (#29617)

7 months agoAdd ac claim for old docker/build-push-action@v3 / current buildx gha cache (#29584)
ChristopherHX [Tue, 5 Mar 2024 17:34:42 +0000 (18:34 +0100)]
Add ac claim for old docker/build-push-action@v3 / current buildx gha cache (#29584)

Also resolves a warning for current releases

```
| ##[group]GitHub Actions runtime token ACs
| ##[warning]Cannot parse GitHub Actions Runtime Token ACs: "undefined" is not valid JSON
| ##[endgroup]
====>
| ##[group]GitHub Actions runtime token ACs
| ##[endgroup]
```
\* this is an error in v3

References in the docker org:
-
https://github.com/docker/build-push-action/blob/831ca179d3cf91cf0c90ca465a408fa61e2129a2/src/main.ts#L24
-
https://github.com/docker/actions-toolkit/blob/7d8b4dc6694df35a06fae786427672ce27a8c18d/src/github.ts#L61

No known official action of GitHub makes use of this claim.

Current releases throw an error when configure to use actions cache
```
| ERROR: failed to solve: failed to configure gha cache exporter: invalid token without access controls
| ##[error]buildx failed with: ERROR: failed to solve: failed to configure gha cache exporter: invalid token without access controls
```

7 months agoSkip email domain check when admins edit user emails (#29609)
Zettat123 [Tue, 5 Mar 2024 16:51:56 +0000 (00:51 +0800)]
Skip email domain check when admins edit user emails (#29609)

Follow #29522

Administrators should be able to set a user's email address even if the
email address is not in `EMAIL_DOMAIN_ALLOWLIST`

7 months agoImprove natural sort (#29611)
wxiaoguang [Tue, 5 Mar 2024 15:13:35 +0000 (23:13 +0800)]
Improve natural sort (#29611)

Hugely simplify the code, and add more tests (only new approach could
pass)

7 months agoAdd empty repo check in `DetectAndHandleSchedules` (#29606)
yp05327 [Tue, 5 Mar 2024 14:47:07 +0000 (23:47 +0900)]
Add empty repo check in `DetectAndHandleSchedules` (#29606)

![image](https://github.com/go-gitea/gitea/assets/18380374/e6081301-bd3e-4cf6-ba4e-e574348dffb4)

7 months agoFix contributor graphs mobile layout and responsiveness (#29597)
silverwind [Tue, 5 Mar 2024 14:21:52 +0000 (15:21 +0100)]
Fix contributor graphs mobile layout and responsiveness (#29597)

Also removed a unneeded and actually conflicting class name
`stats-table`.

Fixes: https://github.com/go-gitea/gitea/issues/29192
<img width="445" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/787804ed-6ba4-437f-b314-f23cbe2edf7a">

7 months agoSkip email domain check when admin users adds user manually (#29522)
Zettat123 [Tue, 5 Mar 2024 05:55:47 +0000 (13:55 +0800)]
Skip email domain check when admin users adds user manually (#29522)

Fix #27457

Administrators should be able to manually create any user even if the
user's email address is not in `EMAIL_DOMAIN_ALLOWLIST`.

7 months agoReplace more `gt-` with `tw-`, update frontend docs (#29595)
silverwind [Tue, 5 Mar 2024 05:29:32 +0000 (06:29 +0100)]
Replace more `gt-` with `tw-`, update frontend docs (#29595)

Tested a few things, all working fine. Not sure if the chinese machine
translation is good.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRemove unnecessary ctxData for "attachments" template (#29600)
wxiaoguang [Tue, 5 Mar 2024 04:59:16 +0000 (12:59 +0800)]
Remove unnecessary ctxData for "attachments" template (#29600)

The "attachments" template never uses it

7 months agoAdjust tailwind content globs (#29596)
silverwind [Tue, 5 Mar 2024 04:31:29 +0000 (05:31 +0100)]
Adjust tailwind content globs (#29596)

Tailwind content is not going to appear in `web_src/css`,
`web_src/fomantic` or `web_src/svg` or the JSON templates, so we don't
need to have tailwind scan these directories which will speed up the
build.

---------

Co-authored-by: delvh <dev.lh@web.de>
7 months agoUse flex wrap to layout the PR update button (#29590)
wxiaoguang [Tue, 5 Mar 2024 03:03:14 +0000 (11:03 +0800)]
Use flex wrap to layout the PR update button (#29590)

Follow #29418

I think using "flex-wrap: wrap" here is better than hard-coding the screen width.

By using "flex-wrap: wrap", the UI layouts automatically for various
widths (even if in some languages, the sentence might be pretty long)

7 months agoMake "/user/login" page redirect if the current user has signed in (#29583)
wxiaoguang [Tue, 5 Mar 2024 02:12:03 +0000 (10:12 +0800)]
Make "/user/login" page redirect if the current user has signed in (#29583)

Fix #29582 and maybe more.
Maybe fix #29116

7 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 5 Mar 2024 00:23:19 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

7 months agoFix projects mode bugs (#29593)
Denys Konovalov [Mon, 4 Mar 2024 20:49:21 +0000 (21:49 +0100)]
Fix projects mode bugs (#29593)

Fix for regressions introduced by #28805

Enabled projects on repos created before the PR weren't detected. Also,
the way projects mode was detected in settings didn't match the way it
was detected on permission check, which leads to confusion.

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoRegenerate fomantic lockfile and build it with our browserslist (#29560)
silverwind [Mon, 4 Mar 2024 20:24:12 +0000 (21:24 +0100)]
Regenerate fomantic lockfile and build it with our browserslist (#29560)

1. Make fomantic build use [our
browserslist](https://github.com/go-gitea/gitea/blob/e3524c63d6d42865ea8288af89b372544d35474b/package.json#L99).
I found no other way than to sed-replace into it's js, the normal
browserlist config files do not work. The effect of this change is the
removal of some uneeded CSS vendor prefixes.
2. Regenerate `web_src/fomantic/package-lock.json`, this might shut up
some security scanners.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoDo not exceed display for the PR page buttons on smaller screens (#29418)
charles [Mon, 4 Mar 2024 14:41:53 +0000 (22:41 +0800)]
Do not exceed display for the PR page buttons on smaller screens (#29418)

Fixes #29189.

This is the result after the fix at a width of 768 pixels.

![圖片](https://github.com/go-gitea/gitea/assets/30816317/626d06b3-fd5b-4392-84e1-1191c965aff5)

7 months agoAdd aria-label to the navbar menu button (#29587)
wxiaoguang [Mon, 4 Mar 2024 14:31:59 +0000 (22:31 +0800)]
Add aria-label to the navbar menu button (#29587)

7 months agoDocument that all unmerged feature PRs will be moved to next milestone when the featu...
Lunny Xiao [Mon, 4 Mar 2024 13:51:12 +0000 (21:51 +0800)]
Document that all unmerged feature PRs will be moved to next milestone when the feature freeze time comes (#29578)

Some contributors may be surprised when moving the feature PRs to the
next release when the feature freeze time comes. So this PR documents
the habits we have done for feature freeze so people expect the
maintainers' behaviors. We are sorry for disturbing you with the
milestones changes.

A feature freeze announcement should be published 2 or 3 weeks before
the feature freeze by maintainers.

7 months agoMake admin pages wider because of left sidebar added and some tables become too narro...
Lunny Xiao [Mon, 4 Mar 2024 13:48:59 +0000 (21:48 +0800)]
Make admin pages wider because of left sidebar added and some tables become too narrow (#29581)

Fix #25939

screenshots

<img width="1895" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/937eb28d-bb7d-4765-b580-bc991d61f467">

7 months agoRefactor star/watch button (#29576)
wxiaoguang [Mon, 4 Mar 2024 12:56:34 +0000 (20:56 +0800)]
Refactor star/watch button (#29576)

1. Use "star/unstart", but not `{{if}}un{{}}star{{}}` (the same to "watch/unwatch")
2. Use "not-mobile" for hiding the elements on mobile

7 months agoRemove unnecessary SanitizeHTML from code (#29575)
wxiaoguang [Mon, 4 Mar 2024 12:02:45 +0000 (20:02 +0800)]
Remove unnecessary SanitizeHTML from code (#29575)

* "mail/issue/default.tmpl": the body is rendered by backend
`markdown.RenderString() HTML`, it has been already sanitized
* "repo/settings/webhook/base_list.tmpl": "Description" is prepared by
backend `ctx.Tr`, it doesn't need to be sanitized

7 months agoAdd missing database transaction for new issue (#29490)
Lunny Xiao [Mon, 4 Mar 2024 11:24:02 +0000 (19:24 +0800)]
Add missing database transaction for new issue (#29490)

When creating an issue, inserting issue, assign users and set project
should be in the same transaction.

7 months agoFix incorrect package link method calls in templates (#29580)
wxiaoguang [Mon, 4 Mar 2024 10:57:30 +0000 (18:57 +0800)]
Fix incorrect package link method calls in templates (#29580)

Fix #29562
Follow  #29531

7 months agoMove some asymkey functions to service layer (#28894)
Lunny Xiao [Mon, 4 Mar 2024 08:57:39 +0000 (16:57 +0800)]
Move some asymkey functions to service layer (#28894)

After the moving, all models will not depend on `util.Rename` so that I
can do next step refactoring.

7 months agoAdd user blocking (#29028)
KN4CK3R [Mon, 4 Mar 2024 08:16:03 +0000 (09:16 +0100)]
Add user blocking (#29028)

Fixes #17453

This PR adds the abbility to block a user from a personal account or
organization to restrict how the blocked user can interact with the
blocker. The docs explain what's the consequence of blocking a user.

Screenshots:

![grafik](https://github.com/go-gitea/gitea/assets/1666336/4ed884f3-e06a-4862-afd3-3b8aa2488dc6)

![grafik](https://github.com/go-gitea/gitea/assets/1666336/ae6d4981-f252-4f50-a429-04f0f9f1cdf1)

![grafik](https://github.com/go-gitea/gitea/assets/1666336/ca153599-5b0f-4b4a-90fe-18bdfd6f0b6b)

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
7 months agoAllow options to disable user ssh keys configuration from the interface on app.ini...
Lunny Xiao [Mon, 4 Mar 2024 07:50:21 +0000 (15:50 +0800)]
Allow options to disable user ssh keys configuration from the interface on app.ini (#29447)

Follow #29275
Extract from #20549
Fix #24716

---------

Co-authored-by: delvh <dev.lh@web.de>
7 months agoInline the `css-variables-parser` dependency (#29571)
silverwind [Mon, 4 Mar 2024 05:55:17 +0000 (06:55 +0100)]
Inline the `css-variables-parser` dependency (#29571)

Get rid of the `postcss@7` dependency by inlining this simple function.

7 months agoReplace some `gt-` classes with `tw-` (#29570)
silverwind [Mon, 4 Mar 2024 03:33:20 +0000 (04:33 +0100)]
Replace some `gt-` classes with `tw-` (#29570)

Replace 18 `gt-` prefixes with `tw-` with perl replacement. I manually
checked them all with `rg` afterwards.

7 months agoEnable/disable owner and repo projects independently (#28805)
Denys Konovalov [Mon, 4 Mar 2024 02:56:52 +0000 (03:56 +0100)]
Enable/disable owner and repo projects independently (#28805)

Part of #23318

Add menu in repo settings to allow for repo admin to decide not just if
projects are enabled or disabled per repo, but also which kind of
projects (repo-level/owner-level) are enabled. If repo projects
disabled, don't show the projects tab.

![grafik](https://github.com/go-gitea/gitea/assets/47871822/b9b43fb4-824b-47f9-b8e2-12004313647c)

---------

Co-authored-by: delvh <dev.lh@web.de>
7 months agoAdd an trailing slash to dashboard links (#29555)
wxiaoguang [Mon, 4 Mar 2024 01:02:51 +0000 (09:02 +0800)]
Add an trailing slash to dashboard links (#29555)

Fix #29533, and add some tests for "base/paginate.tmpl"

7 months agoExtend issue template yaml engine (#29274)
6543 [Mon, 4 Mar 2024 00:37:00 +0000 (01:37 +0100)]
Extend issue template yaml engine (#29274)

Add new option:

`visible`: witch can hide a specific field of the form or the created
content afterwards

It is a string array witch can contain `form` and `content`. If only
`form` is present, it wont show up in the created issue afterwards and
the other way around. By default it sets both except for markdown

As they are optional and github don't have any similar thing, it is non
breaking and also do not conflict with it.

With this you can:
- define "post issue creation" elements like a TODO list to track an
issue state
- make sure to have a checkbox that reminds the user to check for a
thing but dont have it in the created issue afterwards
- define markdown for the created issue (was the downside of using yaml
instead of md in the past)
 - ...

## Demo

```yaml
name: New Contribution
description: External Contributor creating a pull

body:
- type: checkboxes
  id: extern-todo
  visible: [form]
  attributes:
    label: Contribution Guidelines
    options:
      - label: I checked there exist no similar feature to be extended
        required: true
      - label: I did read the CONTRIBUTION.MD
        required: true
- type: checkboxes
  id: intern-todo
  visible: [content]
  attributes:
    label: Maintainer Check-List
    options:
      - label: Does this pull follow the KISS principe
      - label: Checked if internal bord was notifyed
# ....
```
[Demo
Video](https://cloud.obermui.de/s/tm34fSAbJp9qw9z/download/vid-20240220-152751.mkv)

---
*Sponsored by Kithara Software GmbH*

---------

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
7 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 4 Mar 2024 00:24:22 +0000 (00:24 +0000)]
[skip ci] Updated licenses and gitignores

7 months agoFix workflow trigger event IssueChangeXXX bug (#29559)
yp05327 [Sun, 3 Mar 2024 18:37:41 +0000 (03:37 +0900)]
Fix workflow trigger event IssueChangeXXX bug (#29559)

Bugs from #29308
Follow #29467

partly fix #29558

7 months agoFix 500 when pushing release to an empty repo (#29554)
Nanguan Lin [Sun, 3 Mar 2024 16:49:05 +0000 (00:49 +0800)]
Fix 500 when pushing release to an empty repo (#29554)

As title.
The former code directly used `ctx.Repo.GitRepo`, causing 500.

https://github.com/go-gitea/gitea/blob/22b4f0c09f1de5e581929bd10f39833d30d2c482/routers/api/v1/repo/release.go#L241

7 months agoUpdate js and py dependencies, bump python (#29561)
silverwind [Sun, 3 Mar 2024 16:23:14 +0000 (17:23 +0100)]
Update js and py dependencies, bump python (#29561)

- Update js and py dependencies excluding `@mcaptcha/vanilla-glue`,
`eslint-plugin-array-func`
- Update stylelint config
- Require python 3.10 and use 3.12 on CI, bump setup-python as well
- Tested markdown toolbar, charts, clipboard, swagger ui, vue

7 months agoFilter Repositories by type (#29231)
Tim-Niclas Oelschläger [Sun, 3 Mar 2024 10:18:34 +0000 (11:18 +0100)]
Filter Repositories by type (#29231)

Filter Repositories by type (resolves #1170, #1318)

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/74e6be62-9010-4ab4-8f9b-bd8afbebb8fb)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/e4d85ed6-7864-4150-8d72-5194dac1293f)

7 months agoBreaking summary for template refactoring (#29395)
wxiaoguang [Sun, 3 Mar 2024 04:57:22 +0000 (12:57 +0800)]
Breaking summary for template refactoring (#29395)

https://github.com/go-gitea/gitea/pull/29395

7 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 3 Mar 2024 00:25:22 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

7 months agoFix incorrect cookie path for AppSubURL (#29534)
wxiaoguang [Sun, 3 Mar 2024 00:14:12 +0000 (08:14 +0800)]
Fix incorrect cookie path for AppSubURL (#29534)

Regression of #24107

7 months agogitea.service: Remove syslog.target (#29550)
Martin [Sat, 2 Mar 2024 23:44:43 +0000 (00:44 +0100)]
gitea.service: Remove syslog.target (#29550)

Remove syslog.target from service file, this target hasn't existed for
over a decade.

https://github.com/systemd/systemd/blob/6aa8d43ade72e24c9426e604f7fc4b7582b9db7c/NEWS#L72-L73

7 months agoAdd option to set language in admin user view (#28449)
6543 [Sat, 2 Mar 2024 21:55:02 +0000 (22:55 +0100)]
Add option to set language in admin user view (#28449)

![image](https://github.com/go-gitea/gitea/assets/24977596/be7e3f92-af3f-4628-b4ed-abf6439687f3)
`/admin/users/<UserID>/edit`

![image](https://github.com/go-gitea/gitea/assets/24977596/906af0dd-cceb-4ed9-9cd9-32c71ae1bf71)
`/admin/users/<UserID>`

---
*Sponsored by Kithara Software GmbH*

7 months agoFix elipsis button not working if the last commit loading is deferred (#29544)
Yarden Shoham [Sat, 2 Mar 2024 19:31:59 +0000 (21:31 +0200)]
Fix elipsis button not working if the last commit loading is deferred (#29544)

Before this change, if we had more than 200 entries being deferred in
loading, the entire table would get replaced thus losing any event
listeners attached to the elements within the table, such as the elipsis
button and commit list with tippy.

With this change we remove the previous javascript code that replaced
the table and use htmx to replace the table.

htmx attributes added:
- `hx-indicator="tr.notready td.message span"`: attach the loading
spinner to the files whose last commit is still being loaded
- `hx-trigger="load"` trigger the request-replace behavior as soon as
possible
- `hx-swap="morph"`: use the idiomorph morphing algorithm, this is the
thing that makes it so the elipsis button event listener is kept during
the replacement, fixing the bug because we don't actually replace the
table, only modifying it
- `hx-post="{{.LastCommitLoaderURL}}"`: make a post request to this url
to get the table with all of the commit information

As part of this change I removed the handling of partial replacement in
the case we have less than 200 "not ready" files. The first reason is
that I couldn't make htmx replace only a subset of returned elements,
the second reason is that we have a cache implemented in the backend
already so the only cost added is that we query the cache a few times
(which is sure to be populated due to the initial request), and the last
reason is that since the last refactor of this functionality that
removed jQuery we don't properly send the "not ready" entries as the
backend expects `FormData` with `f[]` and we send a JSON with `f` so we
always query for all rows anyway.

# Before

![before](https://github.com/go-gitea/gitea/assets/20454870/482ebfec-66c5-40cc-9c1e-e3b3bfe1bbc1)

# After

![after](https://github.com/go-gitea/gitea/assets/20454870/454c517e-3a4e-4006-a49f-99cc56e0fd60)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix incorrect relative/absolute URL usages (#29531)
wxiaoguang [Sat, 2 Mar 2024 17:38:38 +0000 (01:38 +0800)]
Fix incorrect relative/absolute URL usages (#29531)

Add two "HTMLURL" methods for PackageDescriptor.
And rename "FullWebLink" to "VersionWebLink"

7 months agoAdd support for API blob upload of release attachments (#29507)
KN4CK3R [Sat, 2 Mar 2024 17:02:01 +0000 (18:02 +0100)]
Add support for API blob upload of release attachments (#29507)

Fixes #29502

Our endpoint is not Github compatible.

https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset

---------

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoFix queue worker incorrectly stopped when there are still more items in the queue...
wxiaoguang [Sat, 2 Mar 2024 16:07:54 +0000 (00:07 +0800)]
Fix queue worker incorrectly stopped when there are still more items in the queue (#29532)

Without `case <-t.C`, the workers would stop incorrectly, the test won't
pass. For the worse case, there might be only one running worker
processing the queue items for long time because other workers are
stopped. The root cause is related to the logic of doDispatchBatchToWorker.
It isn't a serious problem at the moment, so keep it as-is.

7 months agoremove util.OptionalBool and related functions (#29513)
6543 [Sat, 2 Mar 2024 15:42:31 +0000 (16:42 +0100)]
remove util.OptionalBool and related functions (#29513)

and migrate affected code

_last refactoring bits to replace **util.OptionalBool** with
**optional.Option[bool]**_

7 months agoRename Action.GetDisplayName to GetActDisplayName (#29540)
wxiaoguang [Sat, 2 Mar 2024 15:30:18 +0000 (23:30 +0800)]
Rename Action.GetDisplayName to GetActDisplayName (#29540)

To avoid conflicting with User.GetDisplayName, because there is no data
type in template.

And it matches other methods like GetActFullName / GetActUserName

7 months agoMake PR form use toast to show error message (#29545)
wxiaoguang [Sat, 2 Mar 2024 15:05:07 +0000 (23:05 +0800)]
Make PR form use toast to show error message (#29545)

![image](https://github.com/go-gitea/gitea/assets/2114189/b7a14ed6-db89-4f21-a590-66cd33307233)

7 months agoFix a bug returning 404 when display a single tag with no release (#29466)
Lunny Xiao [Sat, 2 Mar 2024 14:03:39 +0000 (22:03 +0800)]
Fix a bug returning 404 when display a single tag with no release (#29466)

Partially caused by #29149

When use

```go
releases, err := getReleaseInfos(ctx, &repo_model.FindReleasesOptions{
ListOptions: db.ListOptions{Page: 1, PageSize: 1},
RepoID:      ctx.Repo.Repository.ID,
TagNames:    []string{ctx.Params("*")},
// only show draft releases for users who can write, read-only users shouldn't see draft releases.
IncludeDrafts: writeAccess,
})
```
replace
```go
release, err := repo_model.GetRelease(ctx, ctx.Repo.Repository.ID, ctx.Params("*"))
```
It missed `IncludeTags: true,`. That means this bug will be occupied only when the release is a tag.
This PR will fix

 - Get the right tag record when it's not a release
 - Display correct tag tab but not release tag when it's a tag.
- The button will bring the tag name to the new page when it's a single tag page
- the new page will automatically hide the release target inputbox when the tag name is pre filled. This should be backport to v1.21.

7 months agoAdd a check for when the command is canceled by the program on Window… (#29538)
charles [Sat, 2 Mar 2024 13:38:34 +0000 (21:38 +0800)]
Add a check for when the command is canceled by the program on Window… (#29538)

Close #29509

Windows, unlike Linux, does not have signal-specified exit codes.
Therefore, we should add a Windows-specific check for Windows. If we
don't do this, the logs will always show a failed status, even though
the command actually works correctly.

If you check the Go source code in exec_windows.go, you will see that it
always returns exit code 1.

![image](https://github.com/go-gitea/gitea/assets/30816317/9dfd7c70-9995-47d9-9641-db793f58770c)

The exit code 1 does not exclusively signify a SIGNAL KILL; it can
indicate any issue that occurs when a program fails.

7 months agoFix incorrect redirection when creating a PR fails (#29537)
wxiaoguang [Sat, 2 Mar 2024 12:45:14 +0000 (20:45 +0800)]
Fix incorrect redirection when creating a PR fails (#29537)

This is only a quick fix to make it easier to backport.

After this PR gets merged, I will propose a new PR to fix the FIXME.

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/98d1d5c4-2e79-4a75-80e9-76fd898986e0)

</details>

7 months agoFix incorrect subpath in links (#29535)
wxiaoguang [Sat, 2 Mar 2024 12:02:34 +0000 (20:02 +0800)]
Fix incorrect subpath in links (#29535)

* `$referenceUrl`: it is constructed by "Issue.Link", which already has
the "AppSubURL"
* `window.location.href`: AppSubURL could be empty string, so it needs
the trailing slash

7 months agoFix issue link does not support quotes (#29484) (#29487)
charles [Sat, 2 Mar 2024 09:54:46 +0000 (17:54 +0800)]
Fix issue link does not support quotes (#29484) (#29487)

Close #29484

![圖片](https://github.com/go-gitea/gitea/assets/30816317/b27e6e16-67e0-469c-8e04-30180c585890)

7 months agoRemove jQuery AJAX from the repo tag edit form (#29526)
Yarden Shoham [Sat, 2 Mar 2024 09:29:04 +0000 (11:29 +0200)]
Remove jQuery AJAX from the repo tag edit form (#29526)

- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo tag edit form functionality and it works as before

# Demo using `fetch` instead of jQuery AJAX

![action](https://github.com/go-gitea/gitea/assets/20454870/11126bc4-1666-44ae-8644-a6351da43514)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoActions Artifacts v4 backend (#28965)
ChristopherHX [Sat, 2 Mar 2024 09:12:17 +0000 (10:12 +0100)]
Actions Artifacts v4 backend (#28965)

Fixes #28853

Needs both https://gitea.com/gitea/act_runner/pulls/473 and
https://gitea.com/gitea/act_runner/pulls/471 on the runner side and
patched `actions/upload-artifact@v4` / `actions/download-artifact@v4`,
like `christopherhx/gitea-upload-artifact@v4` and
`christopherhx/gitea-download-artifact@v4`, to not return errors due to
GHES not beeing supported yet.

7 months agoRemove jQuery AJAX from common global functions (#29528)
Yarden Shoham [Sat, 2 Mar 2024 08:48:14 +0000 (10:48 +0200)]
Remove jQuery AJAX from common global functions (#29528)

- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the locale change functionality and it works as before
- Tested the delete button functionality and it works as before

# Demo using `fetch` instead of jQuery AJAX

![action](https://github.com/go-gitea/gitea/assets/20454870/8a024f75-c2a5-4bff-898d-ca751d2489f1)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoAllow options to disable user gpg keys configuration from the interface on app.ini...
Lunny Xiao [Sat, 2 Mar 2024 01:21:01 +0000 (09:21 +0800)]
Allow options to disable user gpg keys configuration from the interface on app.ini (#29486)

Follow #29447
Fix #29454
Extract from #20549

7 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 2 Mar 2024 00:22:27 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

7 months agoFix issue & comment history bugs (#29525)
wxiaoguang [Fri, 1 Mar 2024 16:46:02 +0000 (00:46 +0800)]
Fix issue & comment history bugs (#29525)

* Follow #17746: `HasIssueContentHistory` should use expr builder to
make sure zero value (0) be respected.
* Add "doer" check to make sure `canSoftDeleteContentHistory` only be
called by sign-in users.

7 months agoFix incorrect diff expander for deletion of last lines in a file (#29501)
silverwind [Fri, 1 Mar 2024 16:12:21 +0000 (17:12 +0100)]
Fix incorrect diff expander for deletion of last lines in a file (#29501)

Fixes: https://github.com/go-gitea/gitea/issues/29498
I don't quite understand this code, but this change does seem to fix the
issue and I tested a number of diffs with it and saw no issue. The
function gets such value if last line is an addition:

```
  LastLeftIdx: (int) 0,
  LastRightIdx: (int) 47,
  LeftIdx: (int) 47,
  RightIdx: (int) 48,
```

If it's a deletion, it gets:

```
  LastLeftIdx: (int) 47,
  LastRightIdx: (int) 0,
  LeftIdx: (int) 48,
  RightIdx: (int) 47,
```

So I think it's correct to make this check respect both left and right
side.

7 months agoIgnore `__debug_bin*` which is generated by vscode when debugging (#29524)
sillyguodong [Fri, 1 Mar 2024 14:18:35 +0000 (22:18 +0800)]
Ignore `__debug_bin*` which is generated by vscode when debugging (#29524)

When debugging in VSCode now, the executable file generated will come
with a random string attached.

7 months agoSet pre-step status to `skipped` if job is skipped (#29489)
sillyguodong [Fri, 1 Mar 2024 13:23:53 +0000 (21:23 +0800)]
Set pre-step status to `skipped` if job is skipped (#29489)

close #27496
1. Set pre-step (Set up job) status to `skipped` if job is skipped.
2. Apart from pre-step, the other steps should also be set to `skipped`.
The status of other steps are reported from the runner side. This will
be completed by this PR: https://gitea.com/gitea/act_runner/pulls/500

before:

![image](https://github.com/go-gitea/gitea/assets/33891828/4bac2ba9-66de-4679-b7ed-fbae459c0c54)

after:

![image](https://github.com/go-gitea/gitea/assets/33891828/ead4871a-4e0f-4bb1-9fb4-37f4fdb78dfc)

7 months agoUse a predictiable fork URL to allow forking repositories without providing a repo...
wxiaoguang [Fri, 1 Mar 2024 12:52:30 +0000 (20:52 +0800)]
Use a predictiable fork URL to allow forking repositories without providing a repo ID (#29519)

Close #29512

The "fork" URL:

* Before: `/repo/fork/{RepoID}`
* After: `/{OwnerName}/{RepoName}/fork`

7 months agoAdding back missing options to app.example.ini (#29511)
Origami404 [Fri, 1 Mar 2024 12:01:24 +0000 (20:01 +0800)]
Adding back missing options to app.example.ini (#29511)

In the refactoring of the configuration file #15807,
some lines were accidentally deleted:

DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH = false
ENABLE_PUSH_CREATE_USER = false
ENABLE_PUSH_CREATE_ORG = false

Fix #29510

---------

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRefactor the "attachments" sub-template data key to RenderedContent (#29517)
wxiaoguang [Fri, 1 Mar 2024 10:56:29 +0000 (18:56 +0800)]
Refactor the "attachments" sub-template data key to RenderedContent (#29517)

The value passed into "attachments" sub-template is from
"RedneredContent", so use the same name for consistent. And it makes
readers easy to know its data type.

7 months agoRename Str2html to SanitizeHTML and clarify its behavior (#29516)
wxiaoguang [Fri, 1 Mar 2024 10:16:19 +0000 (18:16 +0800)]
Rename Str2html to SanitizeHTML and clarify its behavior (#29516)

Str2html was abused a lot. So use a proper name for it: SanitizeHTML

And add some tests to show its behavior.

7 months agoAdd admin API route for managing user's badges (#23106)
techknowlogick [Fri, 1 Mar 2024 08:23:28 +0000 (03:23 -0500)]
Add admin API route for managing user's badges (#23106)

Fix #22785

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoRefactor some Str2html code (#29397)
wxiaoguang [Fri, 1 Mar 2024 07:11:51 +0000 (15:11 +0800)]
Refactor some Str2html code (#29397)

This PR touches the most interesting part of the "template refactoring".

1. Unclear variable type. Especially for "web/feed/convert.go":
sometimes it uses text, sometimes it uses HTML.
2. Assign text content to "RenderedContent" field, for example: `
project.RenderedContent = project.Description` in web/org/projects.go
3. Assign rendered content to text field, for example: `r.Note =
rendered content` in web/repo/release.go
4. (possible) Incorrectly calling `{{Str2html
.PackageDescriptor.Metadata.ReleaseNotes}}` in
package/content/nuget.tmpl, I guess the name Str2html misleads
developers to use it to "render string to html", but it only sanitizes.
if ReleaseNotes really contains HTML, then this is not a problem.

7 months agoMove migration functions to services layer (#29497)
Lunny Xiao [Fri, 1 Mar 2024 02:23:00 +0000 (10:23 +0800)]
Move migration functions to services layer (#29497)

7 months agoDon’t comment when locking (#29508)
techknowlogick [Fri, 1 Mar 2024 01:43:42 +0000 (20:43 -0500)]
Don’t comment when locking (#29508)

This reduces the number of emails/notifications on outdated issues.

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
7 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 1 Mar 2024 00:27:12 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

7 months agomigrate some more "OptionalBool" to "Option[bool]" (#29479)
6543 [Thu, 29 Feb 2024 18:52:49 +0000 (19:52 +0100)]
migrate some more "OptionalBool" to "Option[bool]" (#29479)

just some refactoring bits towards replacing **util.OptionalBool** with
**optional.Option[bool]**

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoUpdate FAQ about git hook problems (#29495)
Jason Song [Thu, 29 Feb 2024 14:16:02 +0000 (22:16 +0800)]
Update FAQ about git hook problems (#29495)

Close
https://github.com/go-gitea/gitea/issues/29338#issuecomment-1970363817

7 months agoLighten text colors on dark theme for increased contrast (#29481)
silverwind [Thu, 29 Feb 2024 05:11:11 +0000 (06:11 +0100)]
Lighten text colors on dark theme for increased contrast (#29481)

Improve contrast by lightening the text colors in dark theme by around
35%. Additionally, share some variables that had the same or similar
color, which will ease future theme creation.

7 months agoFix wrong test usage of `AppSubURL` (#29459)
KN4CK3R [Thu, 29 Feb 2024 03:39:24 +0000 (04:39 +0100)]
Fix wrong test usage of `AppSubURL` (#29459)

The tests use an invalid `setting.AppSubURL`. The wrong behaviour
disturbs other PRs like #29222 and #29427.

7 months agoImprove contrast on blame timestamp, fix double border (#29482)
silverwind [Thu, 29 Feb 2024 02:00:33 +0000 (03:00 +0100)]
Improve contrast on blame timestamp, fix double border (#29482)

Before, double border on top, bad contrast on dark:
<img width="155" alt="Screenshot 2024-02-29 at 02 06 17"
src="https://github.com/go-gitea/gitea/assets/115237/fc0f1e08-a5ce-47ed-9eb6-135eed5a1abb">
<img width="126" alt="Screenshot 2024-02-29 at 02 07 28"
src="https://github.com/go-gitea/gitea/assets/115237/38ae8483-8d9b-484c-8909-d4466131ea16">

After, no double border on top, good contrast:
<img width="154" alt="Screenshot 2024-02-29 at 02 20 20"
src="https://github.com/go-gitea/gitea/assets/115237/ad91282b-e9f5-4f41-8f5e-6ba28db3beac">
<img width="147" alt="Screenshot 2024-02-29 at 02 20 38"
src="https://github.com/go-gitea/gitea/assets/115237/7ee2ec92-e72a-4981-aec3-98fc8e579bae">

7 months agoFix/Improve `processWindowErrorEvent` (#29407)
silverwind [Wed, 28 Feb 2024 22:20:53 +0000 (23:20 +0100)]
Fix/Improve `processWindowErrorEvent` (#29407)

- `e.error` can be undefined in some cases which would raise an error
inside this error handler, fixed that.
- The displayed message mentions looking into the console, but in my
case of error from `ResizeObserver` there was nothing there, so add this
logging. I think this logging was once there but got lost during
refactoring.

7 months agoApply compact padding to small buttons with svg icons (#29471)
silverwind [Wed, 28 Feb 2024 20:26:12 +0000 (21:26 +0100)]
Apply compact padding to small buttons with svg icons (#29471)

The buttons on the repo release tab were larger in height than on other
tabs because one of them contained the RSS icon which stretched the
button height by 3px. Workaround this problem by applying the "compact"
padding to any such button. They are within 0.4px in height now to
non-icon buttons.

Before:

<img width="406" alt="Screenshot 2024-02-28 at 15 30 23"
src="https://github.com/go-gitea/gitea/assets/115237/805bb93a-6fe4-40a0-82d1-03001bee8ecf">

After:

<img width="407" alt="Screenshot 2024-02-28 at 15 38 43"
src="https://github.com/go-gitea/gitea/assets/115237/27707588-890f-4852-ab08-105a57eda880">

For comparison, button on issue tab:

<img width="452" alt="Screenshot 2024-02-28 at 15 31 46"
src="https://github.com/go-gitea/gitea/assets/115237/74ac13d5-d016-49ba-9dd9-40ed32a748e9">

7 months agoFix counter display number incorrectly displayed on the page (#29448)
charles [Wed, 28 Feb 2024 20:23:49 +0000 (04:23 +0800)]
Fix counter display number incorrectly displayed on the page (#29448)

issue : #28239

The counter number script uses the 'checkbox' attribute to determine
whether an item is selected or not.

However, the input event only increments the counter value, and when
more items are displayed, it does not update all previously loaded
items.

As a result, the display becomes incorrect because it triggers the
update counter script, but checkboxes that are selected without the
'checked' attribute are not counted

7 months agoFix incorrect user location link on profile page (#29474)
wxiaoguang [Wed, 28 Feb 2024 16:03:06 +0000 (00:03 +0800)]
Fix incorrect user location link on profile page (#29474)

Fix #29472. Regression of #29236, a "if" check was missing.

7 months agoFix workflow trigger event bugs (#29467)
Zettat123 [Wed, 28 Feb 2024 15:35:04 +0000 (23:35 +0800)]
Fix workflow trigger event bugs (#29467)

1. Fix incorrect `HookEventType` for issue-related events in
`IssueChangeAssignee`
2. Add `case "types"` in the `switch` block in `matchPullRequestEvent`
to avoid warning logs

7 months agoFix URL calculation in clone input box (#29470)
silverwind [Wed, 28 Feb 2024 15:04:04 +0000 (16:04 +0100)]
Fix URL calculation in clone input box (#29470)

Ported the function as-is and added comments so we don't forget about
this in the future.

Fixes: https://github.com/go-gitea/gitea/issues/29462
7 months agoRemove jQuery from the "find file" page (#29456)
Yarden Shoham [Wed, 28 Feb 2024 14:11:54 +0000 (16:11 +0200)]
Remove jQuery from the "find file" page (#29456)

- Switched to plain JavaScript
- Tested the file searching functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/8ceef0ed-ab87-448c-8b9b-9b5c0cd8bebd)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoMove generate from module to service (#29465)
Lunny Xiao [Wed, 28 Feb 2024 13:40:36 +0000 (21:40 +0800)]
Move generate from module to service (#29465)

7 months agoThe job should always run when `if` is `always()` (#29464)
Zettat123 [Wed, 28 Feb 2024 10:54:44 +0000 (18:54 +0800)]
The job should always run when `if` is `always()` (#29464)

Fix #27906

According to GitHub's
[documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds),
a job should always run when its `if` is `always()`

> If you would like a job to run even if a job it is dependent on did
not succeed, use the `always()` conditional expression in
`jobs.<job_id>.if`.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoRecolor dark theme to blue shade (#29283)
silverwind [Wed, 28 Feb 2024 10:16:15 +0000 (11:16 +0100)]
Recolor dark theme to blue shade (#29283)

Now uses the same primary color as light theme. The secondary colors are
shifted towards a slightly blue shade. Could maybe desaturate a bit
more, but overall I think I'm happy with it.

Fixes: https://github.com/go-gitea/gitea/issues/27097
<img width="1343" alt="Screenshot 2024-02-27 at 22 21 46"
src="https://github.com/go-gitea/gitea/assets/115237/4163c393-b469-4a53-8f4b-1c33aa04f3ac">
<img width="581" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/e621f7f8-5679-4605-bf42-3d5ff1071e1e">
<img width="581" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/20e66493-2457-482b-b8f1-e5710934e189">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoLet ctx.FormOptionalBool() return optional.Option[bool] (#29461)
6543 [Wed, 28 Feb 2024 05:39:12 +0000 (06:39 +0100)]
Let ctx.FormOptionalBool() return optional.Option[bool] (#29461)

just some refactoring bits towards replacing **util.OptionalBool** with
**optional.Option[bool]**

7 months agoImplement actions badge svgs (#28102)
Nanguan Lin [Tue, 27 Feb 2024 17:56:18 +0000 (01:56 +0800)]
Implement actions badge svgs (#28102)

replace #27187
close #23688
The badge has two parts: label(workflow name) and message(action
status). 5 colors are provided with 7 statuses.
Color mapping:
```go
var statusColorMap = map[actions_model.Status]string{
actions_model.StatusSuccess:   "#4c1",    // Green
actions_model.StatusSkipped:   "#dfb317", // Yellow
actions_model.StatusUnknown:   "#97ca00", // Light Green
actions_model.StatusFailure:   "#e05d44", // Red
actions_model.StatusCancelled: "#fe7d37", // Orange
actions_model.StatusWaiting:   "#dfb317", // Yellow
actions_model.StatusRunning:   "#dfb317", // Yellow
actions_model.StatusBlocked:   "#dfb317", // Yellow
}
```
preview:

![1](https://github.com/go-gitea/gitea/assets/70063547/5465cbaf-23cd-4437-9848-2738c3cb8985)

![2](https://github.com/go-gitea/gitea/assets/70063547/ec393d26-c6e6-4d38-b72c-51f2494c5e71)

![3](https://github.com/go-gitea/gitea/assets/70063547/3edb4fdf-1b08-4a02-ab2a-6bdd7f532fb2)

![4](https://github.com/go-gitea/gitea/assets/70063547/8c189de2-2169-4251-b115-0e39a52f3df8)

![5](https://github.com/go-gitea/gitea/assets/70063547/3fe22c73-c2d7-4fec-9ea4-c501a1e4e3bd)

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: delvh <dev.lh@web.de>
7 months agoFix missed return (#29450)
Lunny Xiao [Tue, 27 Feb 2024 15:09:13 +0000 (23:09 +0800)]
Fix missed return (#29450)

7 months agoUse tailwind instead of `gt-[wh]-` helper classes (#29423)
Lunny Xiao [Tue, 27 Feb 2024 14:31:41 +0000 (22:31 +0800)]
Use tailwind instead of `gt-[wh]-` helper classes (#29423)

Follow #29357
- Replace `gt-w-*` -> `tw-w-*` and remove `gt-w-*`
- Replace `gt-h-*` -> `tw-h-*` and remove `gt-h-*`

7 months agoLock issues and pulls faster (#29436)
6543 [Tue, 27 Feb 2024 11:51:51 +0000 (12:51 +0100)]
Lock issues and pulls faster (#29436)

also point to the docs to explain why we do so

followup to  #29433

7 months agoAllow to change primary email before account activation (#29412)
wxiaoguang [Tue, 27 Feb 2024 10:55:13 +0000 (18:55 +0800)]
Allow to change primary email before account activation (#29412)

7 months agoUpdate docs about `DEFAULT_ACTIONS_URL` (#29442)
Jason Song [Tue, 27 Feb 2024 09:18:35 +0000 (17:18 +0800)]
Update docs about `DEFAULT_ACTIONS_URL` (#29442)

Follow #25581.

7 months agoOnly use supported sort order for "explore/users" page (#29430)
wxiaoguang [Tue, 27 Feb 2024 09:10:51 +0000 (17:10 +0800)]
Only use supported sort order for "explore/users" page (#29430)

Thanks to inferenceus : some sort orders on the "explore/users" page
could list users by their lastlogintime/updatetime.

It leaks user's activity unintentionally. This PR makes that page only
use "supported" sort orders.

Removing the "sort orders" could also be a good solution, while IMO at
the moment keeping the "create time" and "name" orders is also fine, in
case some users would like to find a target user in the search result,
the "sort order" might help.

![image](https://github.com/go-gitea/gitea/assets/2114189/ce5c39c1-1e86-484a-80c3-33cac6419af8)

7 months agoNot trigger all jobs any more, when re-running the first job (#29439)
sillyguodong [Tue, 27 Feb 2024 07:40:21 +0000 (15:40 +0800)]
Not trigger all jobs any more, when re-running the first job (#29439)

Previously, it will be treated as "re-run all jobs" when `jobIndex ==
0`. So when you click re-run button on the first job, it triggers all
the jobs actually.

7 months agoMove context from modules to services (#29440)
Lunny Xiao [Tue, 27 Feb 2024 07:12:22 +0000 (15:12 +0800)]
Move context from modules to services (#29440)

Since `modules/context` has to depend on `models` and many other
packages, it should be moved from `modules/context` to
`services/context` according to design principles. There is no logic
code change on this PR, only move packages.

- Move `code.gitea.io/gitea/modules/context` to
`code.gitea.io/gitea/services/context`
- Move `code.gitea.io/gitea/modules/contexttest` to
`code.gitea.io/gitea/services/contexttest` because of depending on
context
- Move `code.gitea.io/gitea/modules/upload` to
`code.gitea.io/gitea/services/context/upload` because of depending on
context

7 months agoApply tailwindcss rules with `!important` (#29437)
silverwind [Tue, 27 Feb 2024 03:04:46 +0000 (04:04 +0100)]
Apply tailwindcss rules with `!important` (#29437)

As per discussion in https://github.com/go-gitea/gitea/pull/29423, I
think this is the right way that does not burden developers having to
think about CSS precedence which should be irrelevant with an atomic CSS
framework.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>