]> source.dussan.org Git - gitea.git/log
gitea.git
15 months agoTranslate untranslated string in issues list (#25759)
Maxim Slipenko [Fri, 7 Jul 2023 22:36:39 +0000 (01:36 +0300)]
Translate untranslated string in issues list (#25759)

15 months agoFix `ref` for workflows triggered by `pull_request_target` (#25743)
Zettat123 [Fri, 7 Jul 2023 19:22:03 +0000 (03:22 +0800)]
Fix `ref` for workflows triggered by `pull_request_target` (#25743)

Follow #25229

At present, when the trigger event is `pull_request_target`, the `ref`
and `sha` of `ActionRun` are set according to the base branch of the
pull request. This makes it impossible for us to find the head branch of
the `ActionRun` directly. In this PR, the `ref` and `sha` will always be
set to the head branch and they will be changed to the base branch when
generating the task context.

15 months agoMinify CSS with Lightning CSS (#25754)
silverwind [Fri, 7 Jul 2023 18:28:48 +0000 (20:28 +0200)]
Minify CSS with Lightning CSS (#25754)

Replace esbuild's rudimentary CSS minifier with [Lightning
CSS](https://github.com/parcel-bundler/lightningcss), which results in
around 4% smaller CSS bundle size, index.css goes from 608K to 584K.

The module is quite new but has active use in the Parcel bundler, and as
of yesterday is also under experimental support in Vite, so I trust it
that bugs will be sorted out quickly.

Before: `assets by path css/*.css 959 KiB`
After: `assets by path css/*.css 933 KiB`

I did give this a cursory test and everything seems to be in order.

15 months agoReformat some templates (#25756)
wxiaoguang [Fri, 7 Jul 2023 18:06:49 +0000 (02:06 +0800)]
Reformat some templates (#25756)

Only: indent/dedent/newline

15 months agoAdd open/closed field support for issue index (#25708)
techknowlogick [Fri, 7 Jul 2023 17:10:13 +0000 (13:10 -0400)]
Add open/closed field support for issue index (#25708)

A couple of notes:
* Future changes should refactor arguments into a struct
* This filtering only is supported by meilisearch right now
* Issue index number is bumped which will cause a re-index

15 months agoFix activity type match in `matchPullRequestEvent` (#25746)
Zettat123 [Fri, 7 Jul 2023 16:30:07 +0000 (00:30 +0800)]
Fix activity type match in `matchPullRequestEvent` (#25746)

Fix #25736
Caused by #24048

Right now we only check the activity type for `pull_request` event when
`types` is specified or there are no `types` and filter. If a workflow
only specifies filters but no `types` like this:
```
on:
  pull_request:
    branches: [main]
```
the workflow will be triggered even if the activity type is not one of
`[opened, reopened, sync]`. We need to check the activity type in this
case.

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoFollowing up fixes for "Fix inconsistent user profile layout across tabs" (#25739)
wxiaoguang [Fri, 7 Jul 2023 15:27:12 +0000 (23:27 +0800)]
Following up fixes for "Fix inconsistent user profile layout across tabs" (#25739)

Follow
https://github.com/go-gitea/gitea/pull/25625#issuecomment-1621577816

1. Fix the incorrect "project view" layout
2. Fix the "follow/unfollow" link on "packages" and "projects" tab

Before:

![image](https://github.com/go-gitea/gitea/assets/2114189/3b071235-c186-4097-8a19-dd90dcb2a344)

After:

![image](https://github.com/go-gitea/gitea/assets/2114189/d1d23cd7-28d8-43e3-9f68-03e8a34a9b97)

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoHide `add file` button for pull mirrors (#25748)
hiifong [Fri, 7 Jul 2023 13:36:14 +0000 (21:36 +0800)]
Hide `add file` button for pull mirrors (#25748)

I think hiding the add file button for mirror repositories that can keep the ui clean.

Before:

![image](https://github.com/go-gitea/gitea/assets/89133723/84ecf1a5-1a92-4bb1-b472-b4988a4441a9)

After:

![image](https://github.com/go-gitea/gitea/assets/89133723/95382e73-286b-4114-9997-456ed77e07ca)

15 months agoApply to became a maintainer. (#25745)
puni9869 [Fri, 7 Jul 2023 11:49:34 +0000 (17:19 +0530)]
Apply to became a maintainer. (#25745)

Hi Gitea Team,
I would like to apply as a maintainer.
I don't have that much in-depth knowledge of the codebase, but I would
like to help to review PRs for the beginning in my free time and
contribute in frontend, backend tasks and new proposals.

Here is my PR list:-
https://github.com/go-gitea/gitea/pulls?q=is%3Apr+author%3Apuni9869+is%3Amerged+

15 months agoFix broken translations for package documantion (#25742)
wxiaoguang [Fri, 7 Jul 2023 08:47:26 +0000 (16:47 +0800)]
Fix broken translations for package documantion (#25742)

The code was just copied&pasted, it causes problems now.

There are a lot (for every package) broken translations. eg:

```
# en-US
conda.documentation = For more information on the Conda registry, see
<a target="_blank" rel="noopener noreferrer" href="%s">the documentation</a>.

# fr-FR (and many languages)
conda.documentation=Pour plus d'informations sur le registre Conda, voir
<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/fr-fr/packages/conda/">la documentation</a>.
```

To resolve the problem fundamentally, use a general string, and trigger
the re-translating on Crowdin side.

And, it should really really really avoid introducing too much
copied&pasted code .......

15 months agoLess naked returns (#25713)
6543 [Fri, 7 Jul 2023 05:31:56 +0000 (07:31 +0200)]
Less naked returns (#25713)

just a step towards  #25655

and some related refactoring

15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 7 Jul 2023 00:30:02 +0000 (00:30 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoRemove unused code (#25734)
KN4CK3R [Thu, 6 Jul 2023 21:52:41 +0000 (23:52 +0200)]
Remove unused code (#25734)

The method is only used in the test. Found it because I changed the
fixtures and had a hard time fixing this test. My revenge is deleting it.

15 months agoFix commits table regression (#25710)
Denys Konovalov [Thu, 6 Jul 2023 21:07:57 +0000 (23:07 +0200)]
Fix commits table regression (#25710)

Fixes #25693

The commits table appearance fix in #25634 was incomplete and caused a
regression. This PR fixes that issue and removes some unneeded CSS
classes because of the proper fix.

<details>
<summary>Before</summary>

![Bildschirmfoto vom 2023-07-05
19-37-04](https://github.com/go-gitea/gitea/assets/47871822/4f680878-9612-443b-a0a3-b331369c912b)
![Bildschirmfoto vom 2023-07-05
19-38-56](https://github.com/go-gitea/gitea/assets/47871822/8826f246-6bde-4c33-9d10-172d11619908)

</details>

<details>
<summary>After</summary>

![Bildschirmfoto vom 2023-07-05
19-37-44](https://github.com/go-gitea/gitea/assets/47871822/0fe2d2cb-f706-41e0-b341-d1827a64b21a)
![Bildschirmfoto vom 2023-07-05
19-38-08](https://github.com/go-gitea/gitea/assets/47871822/2f29271c-7da5-44d7-bd9a-38a4bfdde219)

</details>

---------

Co-authored-by: silverwind <me@silverwind.io>
15 months agoFix inconsistent user profile layout across tabs (#25625)
puni9869 [Thu, 6 Jul 2023 18:59:24 +0000 (00:29 +0530)]
Fix inconsistent user profile layout across tabs (#25625)

Fix ::User Profile Page  Project Tab Have Inconsistent Layout and Style
Added the big_avator for consistency in the all header_items tabs.
Fixes: #24871
> ### Description
> in the user profile page the `Packages` and `Projects` tab have small
icons for user but other tabs have bigger profile picture with user
info:
>
> ### Screenshots
> ### **For Packages And Projects:**
>
![image](https://user-images.githubusercontent.com/25511175/240148601-2420d77b-ba25-4718-9ccb-c5d0d95e3079.png)
>
> ### **For Other Tabs:**
>
![image](https://user-images.githubusercontent.com/25511175/240148461-ce9636b3-fe11-4c46-a230-30d83eee5947.png)
>

## Before

![image](https://github.com/go-gitea/gitea/assets/80308335/975ad038-07ca-4b10-b75d-ccf259be7b9d)

 ## After changes
Project View
<img width="1394" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/95d181d7-8e61-496d-9899-7b825c91ad56">

Packages View
<img width="1378" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/7f5fd60f-6b18-4fa8-8c56-7b0d45d1a610">

## Org view for projects page
<img width="1385" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/6400dc89-a5ae-4f0a-831b-5b6efa020d89">

## Org view for packages page
<img width="1387" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/4e1e9ffe-1e4b-4334-8657-de11b5fd31d0">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
15 months agoSimplify the LFS GC logger usage (#25717)
wxiaoguang [Thu, 6 Jul 2023 16:52:41 +0000 (00:52 +0800)]
Simplify the LFS GC logger usage (#25717)

Remove unnecessary `if opts.Logger != nil` checks.

* For "CLI doctor" mode, output to the console's "logger.Info".
* For "Web Task" mode, output to the default "logger.Debug", to avoid
flooding the server's log in a busy production instance.

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoAllow/fix review (approve/reject) of empty PRs (#25690)
sebastian-sauer [Thu, 6 Jul 2023 15:33:04 +0000 (17:33 +0200)]
Allow/fix review (approve/reject) of empty PRs (#25690)

gitea allows to create empty PRs.

Currently when you need approvals for a merge, you have to manually add
/files to the url to get to the files tab to approve / reject the PR.

This PR allows to open the files tab via the normal tab / link and then
fixes the layout of the files tab.

**Screenshots:**

Before:

![image](https://github.com/go-gitea/gitea/assets/1135157/b5082e5e-8c32-4412-993e-b854905e96d3)

After:

![image](https://github.com/go-gitea/gitea/assets/1135157/1f5e056e-396f-4dfb-8d14-e17a2f6495d9)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoCorrect permissions for `.ssh` and `authorized_keys` (#25721)
Jason Song [Thu, 6 Jul 2023 15:00:38 +0000 (23:00 +0800)]
Correct permissions for `.ssh` and `authorized_keys` (#25721)

Set the correct permissions on the .ssh directory and authorized_keys
file, or sshd will refuse to use them and lead to clone/push/pull
failures.

It could happen when users have copied their data to a new volume and
changed the file permission by accident, and it would be very hard to
troubleshoot unless users know how to check the logs of sshd which is
started by s6.

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoSync branches when mirroring (#25722)
Lunny Xiao [Thu, 6 Jul 2023 11:18:37 +0000 (19:18 +0800)]
Sync branches when mirroring (#25722)

Caused by #22743

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
15 months agoDisable run user change in installation page (#22499)
Lunny Xiao [Thu, 6 Jul 2023 02:14:51 +0000 (10:14 +0800)]
Disable run user change in installation page (#22499)

The run user should not be changed on the installation page because it
will not be any effect to Gitea.

This PR disabled the input box of run user.

15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 6 Jul 2023 00:31:13 +0000 (00:31 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoShow correct naming for 1 comment (#25704)
Earl Warren [Wed, 5 Jul 2023 19:53:38 +0000 (21:53 +0200)]
Show correct naming for 1 comment (#25704)

- Resolves https://codeberg.org/forgejo/forgejo/issues/948

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoCheck `ctx.Written()` for `GetActionIssue` (#25698)
Jason Song [Wed, 5 Jul 2023 18:52:12 +0000 (02:52 +0800)]
Check `ctx.Written()` for `GetActionIssue` (#25698)

Fix #25697.

Just avoid panic, maybe there's another bug to trigger this case.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoChangelog for v1.19.4 (#25667) (#25709)
6543 [Wed, 5 Jul 2023 18:25:13 +0000 (20:25 +0200)]
Changelog for v1.19.4 (#25667) (#25709)

frontport  #25667

15 months agoRemove `feature` label from `feature request` issue template (#25696)
Lunny Xiao [Wed, 5 Jul 2023 08:58:56 +0000 (16:58 +0800)]
Remove `feature` label from `feature request` issue template (#25696)

We need a feature request process, so when a user submit a feature
proposal, it should not be marked as feature before it has been accept.

15 months agoFix tags header and pretty format numbers (#25624)
Lunny Xiao [Wed, 5 Jul 2023 04:11:42 +0000 (12:11 +0800)]
Fix tags header and pretty format numbers (#25624)

This caused by #23465

15 months agoFix position of org follow button (#25688)
silverwind [Wed, 5 Jul 2023 03:41:46 +0000 (05:41 +0200)]
Fix position of org follow button (#25688)

This has recently regressed it seems. Put it back into same position as
https://github.com/go-gitea/gitea/pull/24345.

15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 5 Jul 2023 00:31:02 +0000 (00:31 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoReplace `interface{}` with `any` (#25686)
silverwind [Tue, 4 Jul 2023 18:36:08 +0000 (20:36 +0200)]
Replace `interface{}` with `any` (#25686)

Result of running `perl -p -i -e 's#interface\{\}#any#g' **/*` and `make fmt`.

Basically the same [as golang did](https://github.com/golang/go/commit/2580d0e08d5e9f979b943758d3c49877fb2324cb).

15 months agoSeveral fixes for mobile UI (#25634)
Denys Konovalov [Tue, 4 Jul 2023 17:45:45 +0000 (19:45 +0200)]
Several fixes for mobile UI (#25634)

Resolves #25622

<details>
<summary>Screenshots</summary>

![Bildschirmfoto vom 2023-07-02
20-47-34](https://github.com/go-gitea/gitea/assets/47871822/a8a0bff6-9ae3-48f3-b008-00c196a3f8fd)
![Bildschirmfoto vom 2023-07-02
20-47-45](https://github.com/go-gitea/gitea/assets/47871822/172a0021-af74-4690-aa67-0e66688ce733)
![Bildschirmfoto vom 2023-07-02
20-48-37](https://github.com/go-gitea/gitea/assets/47871822/14572ebd-0106-4c8a-ba27-b6b631375ee6)
![Bildschirmfoto vom 2023-07-02
20-49-08](https://github.com/go-gitea/gitea/assets/47871822/7c0ba3aa-1712-482c-aae9-13394dbdaf8a)
![Bildschirmfoto vom 2023-07-02
20-50-28](https://github.com/go-gitea/gitea/assets/47871822/8bd68e26-099a-4abd-8817-16d52af13167)
![Bildschirmfoto vom 2023-07-02
20-51-46](https://github.com/go-gitea/gitea/assets/47871822/3beab8c6-3747-4829-be50-bafaed11000c)
![Bildschirmfoto vom 2023-07-02
20-54-12](https://github.com/go-gitea/gitea/assets/47871822/51f82ef3-a32c-4c27-9056-e8711ed469cc)

</details>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
15 months agoAdd elapsed time on debug for slow git commands (#25642)
Lunny Xiao [Tue, 4 Jul 2023 16:22:37 +0000 (00:22 +0800)]
Add elapsed time on debug for slow git commands (#25642)

To record which command is slow, this PR adds a debug log for slow git
operations.

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: delvh <dev.lh@web.de>
15 months agosome less naked returns (#25682)
6543 [Tue, 4 Jul 2023 15:52:33 +0000 (17:52 +0200)]
some less naked returns (#25682)

fix upcoming lint issues

15 months agoPrevent duplicate image loading (#25675)
delvh [Tue, 4 Jul 2023 14:43:02 +0000 (16:43 +0200)]
Prevent duplicate image loading (#25675)

Regression of #25672.

15 months agoAdd unit test for `HashAvatar` (#25662)
Earl Warren [Tue, 4 Jul 2023 12:43:38 +0000 (14:43 +0200)]
Add unit test for `HashAvatar` (#25662)

- Add 100% unit test for this function.

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
15 months agoFix the nil pointer when assigning issues to projects (#25665)
Zettat123 [Tue, 4 Jul 2023 10:26:24 +0000 (18:26 +0800)]
Fix the nil pointer when assigning issues to projects (#25665)

Fixes #25649
Caused by #25468

15 months agoActions list enhancements (#25601)
silverwind [Tue, 4 Jul 2023 09:59:47 +0000 (11:59 +0200)]
Actions list enhancements (#25601)

Various small enhancements to the actions list. Before and after:

<img width="1264" alt="Screenshot 2023-06-30 at 00 11 40"
src="https://github.com/go-gitea/gitea/assets/115237/bb4162ee-cdcf-4a73-b05e-f9521562edbb">
<img width="1264" alt="Screenshot 2023-06-30 at 00 09 51"
src="https://github.com/go-gitea/gitea/assets/115237/52a70ea9-4bb3-406e-904b-0fdaafde9582">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoFix issues indexer document mapping (#25619)
Jason Song [Tue, 4 Jul 2023 09:05:28 +0000 (17:05 +0800)]
Fix issues indexer document mapping (#25619)

Fix regression of #5363 (so long ago).

The old code definded a document mapping for `issueIndexerDocType`, and
assigned it to `BleveIndexerData` as its type. (`BleveIndexerData` has
been renamed to `IndexerData` in #25174, but nothing more.) But the old
code never used `BleveIndexerData`, it wrote the index with an anonymous
struct type. Nonetheless, bleve would use the default auto-mapping for
struct it didn't know, so the indexer still worked. This means the
custom document mapping was always dead code.

The custom document mapping is not useless, it can reduce index storage,
this PR brings it back and disable default mapping to prevent it from
happening again. Since `IndexerData`(`BleveIndexerData`) has JSON tags,
and bleve uses them first, so we should use `repo_id` as the field name
instead of `RepoID`.

I did a test to compare the storage size before and after this, with
about 3k real comments that were migrated from some public repos.

Before:

```text
[ 160]  .
├── [  42]  index_meta.json
├── [  13]  rupture_meta.json
└── [ 128]  store
    ├── [6.9M]  00000000005d.zap
    └── [256K]  root.bolt
```

After:

```text
[ 160]  .
├── [  42]  index_meta.json
├── [  13]  rupture_meta.json
└── [ 128]  store
    ├── [3.5M]  000000000065.zap
    └── [256K]  root.bolt
```

It saves about half the storage space.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoFix show more for image on diff page (#25672)
HesterG [Tue, 4 Jul 2023 08:36:27 +0000 (16:36 +0800)]
Fix show more for image on diff page (#25672)

Right now when clicking on loadmore on files change page, if the loaded
content is image, it will be always in load status:

https://github.com/go-gitea/gitea/assets/17645053/39e449b6-067a-474c-9443-9dd98d5bbfe2

This PR fixes this by adding `initImageDiff ` to `onShowMoreFiles `

After:

https://github.com/go-gitea/gitea/assets/17645053/87bbb13e-0064-4a6e-a7ad-0f0060eb8bff

15 months agoPrevent SVG shrinking (#25652)
silverwind [Tue, 4 Jul 2023 02:15:06 +0000 (04:15 +0200)]
Prevent SVG shrinking (#25652)

This will prevent the most common cases of SVG shrinking because lack of
space. I evaluated multiple options and this seems to be the one with
the least impact in size and processing cost, so I went with it.

Unfortunately, CSS can not dynamically convert `16` obtained from
`attr()` to `16px`, or else a generic solution for all sizes would have
been possible. But a solution is [in
sight](https://developer.mozilla.org/en-US/docs/Web/CSS/attr#type-or-unit)
with `attr(width px)` but no browser supports it currently.

15 months agoLog the real reason when authentication fails (but don't show the user) (#25414)
Lunny Xiao [Mon, 3 Jul 2023 22:39:38 +0000 (06:39 +0800)]
Log the real reason when authentication fails (but don't show the user) (#25414)

15 months agoAdd unit test for repository collaboration (#25640)
Earl Warren [Mon, 3 Jul 2023 21:41:14 +0000 (23:41 +0200)]
Add unit test for repository collaboration (#25640)

Add a few extra test cases and test functions for the collaboration
model to get everything covered by tests (except for error handling, as
we cannot suddenly mock errors from the database).

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/825
Co-authored-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoFix UI misalignment on user setting page (#25629)
wxiaoguang [Mon, 3 Jul 2023 20:38:06 +0000 (04:38 +0800)]
Fix UI misalignment on user setting page (#25629)

Fix #25628

Diff with ignoring space:
https://github.com/go-gitea/gitea/pull/25629/files?diff=unified&w=1

The "modal" shouldn't appear between "ui attached segment", otherwise
these segments lose margin-top.

After the fix:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/ac15e73d-4ca8-416a-950d-ffc912c6ab61)

![image](https://github.com/go-gitea/gitea/assets/2114189/eb431336-4d21-4e44-8beb-8919595a83c8)

![image](https://github.com/go-gitea/gitea/assets/2114189/dffaed88-5ba2-419d-a241-24cb200f757c)

![image](https://github.com/go-gitea/gitea/assets/2114189/e8c5a03e-e16a-4c94-a1a5-7845d4e1a824)

</details>

15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 3 Jul 2023 20:02:34 +0000 (20:02 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoCorrect translation wrong format (#25643)
Lunny Xiao [Mon, 3 Jul 2023 19:33:45 +0000 (03:33 +0800)]
Correct translation wrong format (#25643)

partially fix #25291

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
15 months agoAdd direct serving of package content (#25543)
KN4CK3R [Mon, 3 Jul 2023 13:33:28 +0000 (15:33 +0200)]
Add direct serving of package content (#25543)

Fixes #24723

Direct serving of content aka HTTP redirect is not mentioned in any of
the package registry specs but lots of official registries do that so it
should be supported by the usual clients.

15 months agoFix bug when change user name (#25637)
Lunny Xiao [Mon, 3 Jul 2023 10:05:59 +0000 (18:05 +0800)]
Fix bug when change user name (#25637)

Fix #25621

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoMake "cancel" buttons have proper type in modal forms (#25618)
wxiaoguang [Mon, 3 Jul 2023 06:04:50 +0000 (14:04 +0800)]
Make "cancel" buttons have proper type in modal forms (#25618)

Replace #25446, fix #25438

All "cancel" buttons which do not have "type" should not submit the
form, should not be triggered by "Enter".

This is a complete fix for all modal dialogs.

The major change is "modules/aria/modal.js", "devtest" related code is
for demo/test purpose.

15 months agoMake FindBranches have stable result (#25631)
wxiaoguang [Mon, 3 Jul 2023 04:11:32 +0000 (12:11 +0800)]
Make FindBranches have stable result (#25631)

See the comment

15 months agoDisplay branch commit status (#25608)
Lunny Xiao [Mon, 3 Jul 2023 03:32:21 +0000 (11:32 +0800)]
Display branch commit status (#25608)

Fix #10388

This PR adds a status icon for every branch which has a status check for
the latest commit on branch list page.

<img width="1313" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/727cd540-d03a-40c6-a7dd-e87c118af0ac">

15 months agouse css on labels (#25626)
derelm [Mon, 3 Jul 2023 02:33:28 +0000 (04:33 +0200)]
use css on labels (#25626)

Changes html to use CSS label class similar to
`templates/shared/actions/runner_list.tmpl`

15 months agoGet latest commit statuses from database instead of git data on dashboard for reposit...
Lunny Xiao [Mon, 3 Jul 2023 01:53:05 +0000 (09:53 +0800)]
Get latest commit statuses from database instead of git data on dashboard for repositories (#25605)

related #24638

15 months agoAdd log line anchor for action logs (#25532)
HesterG [Mon, 3 Jul 2023 01:08:49 +0000 (09:08 +0800)]
Add log line anchor for action logs (#25532)

Close #24593

Some behavior:

- If log step line in hash exists, expand the step and scroll to the log
line.
- If step exists but line not exists, the step will be expanded.
- If step not exists, stays on the job's page.

Some Notes:

- Changed mounted to async because need to await for first `loadJob` so
`currentJobStepsStates` can be initialized and used in
`hashChangeListener `.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoSupport displaying diff stats in PR tab bar (#25387)
hiifong [Mon, 3 Jul 2023 01:00:28 +0000 (09:00 +0800)]
Support displaying diff stats in PR tab bar (#25387)

Fix #25326

---------

Co-authored-by: silverwind <me@silverwind.io>
15 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 3 Jul 2023 00:30:17 +0000 (00:30 +0000)]
[skip ci] Updated licenses and gitignores

15 months agoMove some files under repo/setting (#25585)
Lunny Xiao [Sun, 2 Jul 2023 00:59:32 +0000 (08:59 +0800)]
Move some files under repo/setting (#25585)

There are too many files under `routers/web/repo` and the file
`routers/web/repo/setting.go` is too big.
This PR move all setting related routers' body functions under
`routers/web/repo/setting` and also split `routers/web/repo/setting.go`

15 months agoFollowing-up improvments for various PRs (#25620)
wxiaoguang [Sat, 1 Jul 2023 18:00:10 +0000 (02:00 +0800)]
Following-up improvments for various PRs (#25620)

For:

* #22743
* #25408
* #25412
* #25588

15 months agoSet SSH_AUTHORIZED_KEYS_BACKUP to false (#25412)
techknowlogick [Sat, 1 Jul 2023 04:07:48 +0000 (00:07 -0400)]
Set SSH_AUTHORIZED_KEYS_BACKUP to false (#25412)

This prevents the disk from overflowing with auth keys file

Fixes #17117

## ⚠️ BREAKING

This changes the default option for creating a backup of the authorized
key file when an update is made to default to false.

15 months agoFix bug of branches API with tests (#25578)
Lunny Xiao [Sat, 1 Jul 2023 02:52:52 +0000 (10:52 +0800)]
Fix bug of branches API with tests (#25578)

Fix #25558
Extract from #22743

This PR added a repository's check when creating/deleting branches via
API. Mirror repository and archive repository cannot do that.

15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 1 Jul 2023 00:32:07 +0000 (00:32 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoApplication as a maintainer (#25614)
Denys Konovalov [Fri, 30 Jun 2023 23:54:17 +0000 (01:54 +0200)]
Application as a maintainer (#25614)

Hi everyone,
as discussed in `#develop` I would like to apply as a maintainer.
I don't have that much in-depth knowledge of the codebase, but I would
like to help to review at least smaller PRs for the beginning.
Here is my PR list:
https://github.com/go-gitea/gitea/pulls?q=is%3Apr+author%3Adenyskon+is%3Amerged

15 months agoAdding branch-name copy to clipboard branches screen. (#25596)
puni9869 [Fri, 30 Jun 2023 18:16:17 +0000 (23:46 +0530)]
Adding  branch-name copy  to clipboard branches screen. (#25596)

Adding  branch-name copy  to clipboard and button in branches screen

Replaces #25569
Fixes #25120

New mocks:
<img width="876" alt="Screenshot 2023-06-30 at 12 01 41 AM"
src="https://github.com/go-gitea/gitea/assets/80308335/a34ab00f-5625-4529-ba17-f2bf7af58e2a">
<img width="822" alt="Screenshot 2023-06-30 at 12 03 59 AM"
src="https://github.com/go-gitea/gitea/assets/80308335/3a32dffc-52cd-49e1-a437-6d11d58d0939">

<img width="476" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/85e8f361-5cb7-45d4-aced-ad2523d54ab0">

15 months agoUse AfterCommitId to get commit for Viewed functionality (#25529)
sebastian-sauer [Fri, 30 Jun 2023 16:08:18 +0000 (18:08 +0200)]
Use AfterCommitId to get commit for Viewed functionality (#25529)

the PullHeadCommitID is not always available when the PR is merged.

Not sure if this is the best solution but in my simple tests it looks
like this fixes the problem - happy to get any feedback.

hopefully fixes https://github.com/go-gitea/gitea/issues/24813

15 months agoFix branch commit message too long problem (#25588)
Lunny Xiao [Fri, 30 Jun 2023 09:03:05 +0000 (17:03 +0800)]
Fix branch commit message too long problem (#25588)

When branch's commit CommitMessage is too long, the column maybe too
short.(TEXT 16K for mysql).
This PR will fix it to only store the summary because these message will
only show on branch list or possible future search?

15 months agoRestrict `[actions].DEFAULT_ACTIONS_URL` to only `github` or `self` (#25581)
Jason Song [Fri, 30 Jun 2023 07:26:36 +0000 (15:26 +0800)]
Restrict `[actions].DEFAULT_ACTIONS_URL` to only `github` or `self` (#25581)

Resolve #24789

## :warning: BREAKING :warning:

Before this, `DEFAULT_ACTIONS_URL` cound be set to any custom URLs like
`https://gitea.com` or `http://your-git-server,https://gitea.com`, and
the default value was `https://gitea.com`.

But now, `DEFAULT_ACTIONS_URL` supports only
`github`(`https://github.com`) or `self`(the root url of current Gitea
instance), and the default value is `github`.

If it has configured with a URL, an error log will be displayed and it
will fallback to `github`.

Actually, what we really want to do is always make it
`https://github.com`, however, this may not be acceptable for some
instances of internal use, so there's extra support for `self`, but no
more, even `https://gitea.com`.

Please note that `uses: https://xxx/yyy/zzz` always works and it does
exactly what it is supposed to do.

Although it's breaking, I belive it should be backported to `v1.20` due
to some security issues.

Follow-up on the runner side:

- https://gitea.com/gitea/act_runner/pulls/262
- https://gitea.com/gitea/act/pulls/70

15 months agoAdd API for changing Avatars (#25369)
JakobDev [Thu, 29 Jun 2023 23:22:55 +0000 (01:22 +0200)]
Add API for changing Avatars (#25369)

This adds an API for uploading and Deleting Avatars for of Users, Repos
and Organisations. I'm not sure, if this should also be added to the
Admin API.

Resolves #25344

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoread-only checkboxes don't appear and don't entirely act the way one might expect...
Ed Silkworth [Thu, 29 Jun 2023 22:16:53 +0000 (15:16 -0700)]
read-only checkboxes don't appear and don't entirely act the way one might expect (#25573)

This pull request fades read-only checkboxes and checkmark, and it makes
the checkboxes act more read-only/disabled by not changing the
border-color when clicked.

Examples using light mode:

| Before | After |
| - | - |
| ![Kapture 2023-06-28 at 00 20
45](https://github.com/go-gitea/gitea/assets/63764270/0899fd5c-18a9-4290-9ba9-d3cf71033cf8)
| ![Kapture 2023-06-28 at 00 23
12](https://github.com/go-gitea/gitea/assets/63764270/0db9be14-e16c-42ed-8fb1-999928fd1d25)
|
| ![Kapture 2023-06-28 at 00 25
22](https://github.com/go-gitea/gitea/assets/63764270/65c6c380-b928-4e6c-b403-3655d3565896)
| ![Kapture 2023-06-28 at 00 27
28](https://github.com/go-gitea/gitea/assets/63764270/d8c2a019-e07c-43a1-a7fa-93c0d4e01900)
|
| | read-only checkboxes and checkmark are faded<br>and the checkboxes
act more read-only/disabled |

Fixes/Closes/Resolves #25076

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoRedirect to package after version deletion (#25594)
KN4CK3R [Thu, 29 Jun 2023 17:01:14 +0000 (19:01 +0200)]
Redirect to package after version deletion (#25594)

Related #25559

Current behaviour:
1. Deletion of a package version
2. Redirect to the owners package list

New behaviour:
1. Deletion of a package version
2.1. If there are more versions available, redirect to the package again
2.2. If there are no versions available, redirect to the owners package
list

15 months agoUpdate emoji set to Unicode 15 (#25595)
isla w [Thu, 29 Jun 2023 16:29:48 +0000 (12:29 -0400)]
Update emoji set to Unicode 15 (#25595)

Update emoji set to Unicode 15 which was added upstream here:
https://github.com/github/gemoji/commit/cb5c514d472daf9b312c963987f4d7ee865c28fe

<img width="854" alt="Screenshot 2023-06-29 at 11 02 56 AM"
src="https://github.com/go-gitea/gitea/assets/1669571/7bfb663d-0804-4d23-a62d-f585a6783ca6">

---------

Co-authored-by: silverwind <me@silverwind.io>
15 months agoFix `lint-swagger` action (#25593)
silverwind [Thu, 29 Jun 2023 14:37:41 +0000 (16:37 +0200)]
Fix `lint-swagger` action (#25593)

- Add detection for swagger changes and run `lint-swagger` on it
- Remove `lint-swagger` from `lint-frontend`
- Remove `lint-md` from `lint-frontend`

15 months agoReplace fomantic divider module with our own (#25539)
silverwind [Thu, 29 Jun 2023 12:24:22 +0000 (14:24 +0200)]
Replace fomantic divider module with our own (#25539)

Should look exactly like before for normal dividers. "Horizontal" ones
look better because they no longer use image backgrounds.

<img width="917" alt="Screenshot 2023-06-27 at 19 07 56"
src="https://github.com/go-gitea/gitea/assets/115237/d97d8dec-6859-44a8-85ba-e4549b4dd9df">

<img width="914" alt="Screenshot 2023-06-27 at 19 05 58"
src="https://github.com/go-gitea/gitea/assets/115237/8bf98544-2d82-4ebf-ac68-d6dc237bd6b2">

<img width="1246" alt="Screenshot 2023-06-27 at 19 00 42"
src="https://github.com/go-gitea/gitea/assets/115237/36a6bb21-6029-4f53-8bee-535f55c66fed">

<img width="344" alt="Screenshot 2023-06-27 at 18 58 15"
src="https://github.com/go-gitea/gitea/assets/115237/a9e70aee-8e6b-4ea1-9e93-19c9f96aec6e">
<img width="823" alt="Screenshot 2023-06-27 at 18 56 22"
src="https://github.com/go-gitea/gitea/assets/115237/e7a497cd-f262-4683-8872-23c3c8cce32f">

<img width="330" alt="Screenshot 2023-06-27 at 19 21 11"
src="https://github.com/go-gitea/gitea/assets/115237/42f24149-a655-4c7e-bd26-8ab52db6446b">

15 months agoAdd documentation about supported workflow trigger events (#25582)
Zettat123 [Thu, 29 Jun 2023 11:45:53 +0000 (19:45 +0800)]
Add documentation about supported workflow trigger events (#25582)

Right now Gitea doesn't support all [Events that trigger
workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows).
This PR lists the supported events to help users write workflow files.

15 months agoSync branches into databases (#22743)
Lunny Xiao [Thu, 29 Jun 2023 10:03:20 +0000 (18:03 +0800)]
Sync branches into databases (#22743)

Related #14180
Related #25233
Related #22639
Close #19786
Related #12763

This PR will change all the branches retrieve method from reading git
data to read database to reduce git read operations.

- [x] Sync git branches information into database when push git data
- [x] Create a new table `Branch`, merge some columns of `DeletedBranch`
into `Branch` table and drop the table `DeletedBranch`.
- [x] Read `Branch` table when visit `code` -> `branch` page
- [x] Read `Branch` table when list branch names in `code` page dropdown
- [x] Read `Branch` table when list git ref compare page
- [x] Provide a button in admin page to manually sync all branches.
- [x] Sync branches if repository is not empty but database branches are
empty when visiting pages with branches list
- [x] Use `commit_time desc` as the default FindBranch order by to keep
consistent as before and deleted branches will be always at the end.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
15 months agoFix milestones deletion (#25583)
HesterG [Thu, 29 Jun 2023 08:17:18 +0000 (16:17 +0800)]
Fix milestones deletion (#25583)

Close #25557
Fix regression from #25315

`data-id` is still needed for deleting milestone.

15 months agoReduce table padding globally (#25568)
silverwind [Thu, 29 Jun 2023 04:40:03 +0000 (06:40 +0200)]
Reduce table padding globally (#25568)

Fomantic's tables have too much padding. Reduce it so we have more
information density in them. Especially the admin tables need this
because they are bursting already because of column count.

## Admin repolist before and after

<img width="909" alt="Screenshot 2023-06-28 at 20 27 55"
src="https://github.com/go-gitea/gitea/assets/115237/954c925c-8db5-47ce-ae51-a2168b857014">
<img width="897" alt="Screenshot 2023-06-28 at 20 36 03"
src="https://github.com/go-gitea/gitea/assets/115237/0bddc09a-9117-48b3-a17e-3d34c58d8d3d">

## Other tables

<img width="1230" alt="Screenshot 2023-06-28 at 20 36 22"
src="https://github.com/go-gitea/gitea/assets/115237/38f555b6-a7ce-416a-9f1f-706eaf18863b">
<img width="1236" alt="Screenshot 2023-06-28 at 20 26 37"
src="https://github.com/go-gitea/gitea/assets/115237/82b2878e-358c-4dc2-a6b4-c66e43cd2dfb">
<img width="1231" alt="Screenshot 2023-06-28 at 20 59 30"
src="https://github.com/go-gitea/gitea/assets/115237/c6a92e55-a3a3-4c80-9a0d-50aebb49886c">

Files table is unaffected because it has custom padding already.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoUse fetch form action for lock/unlock/pin/unpin on sidebar (#25380)
HesterG [Thu, 29 Jun 2023 04:16:04 +0000 (12:16 +0800)]
Use fetch form action for lock/unlock/pin/unpin on sidebar (#25380)

Before:

<img width="364" alt="Screen Shot 2023-06-20 at 11 59 11"
src="https://github.com/go-gitea/gitea/assets/17645053/ad284b7e-8d21-43be-b178-bbcfd37cb5bd">

Might trigger many posts when keep clicking the buttons above.

<img width="448" alt="Screen Shot 2023-06-20 at 11 52 28"
src="https://github.com/go-gitea/gitea/assets/17645053/a60aa6ac-af74-45e4-b13a-512b436b81b0">
<img width="678" alt="Screen Shot 2023-06-20 at 11 52 37"
src="https://github.com/go-gitea/gitea/assets/17645053/d6662700-3643-4cc7-a2ec-64e1c0f5fbdb">

After (PR sidebar, Same for issue):

https://github.com/go-gitea/gitea/assets/17645053/9df3ad1f-e29c-439b-8bde-e6b917d63cc6

For delete, it is using `base/modal_actions_confirm` subtemplate, and we
might need another general solution for this (maybe add another
attribute to the subtemplate or something)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoSupport downloading raw task logs (#24451)
Vitaliy Filippov [Thu, 29 Jun 2023 02:58:56 +0000 (05:58 +0300)]
Support downloading raw task logs (#24451)

Hi!
This pull request adds support for downloading raw task logs for Gitea
Actions, similar to Github Actions
It looks like the following:

![image](https://user-images.githubusercontent.com/945339/235376746-405d5019-710b-468b-8113-9e82eab8e752.png)

15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 29 Jun 2023 00:29:20 +0000 (00:29 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoSplit lfs size from repository size (#22900)
a1012112796 [Wed, 28 Jun 2023 22:41:02 +0000 (06:41 +0800)]
Split lfs size from repository size (#22900)

releated to #21820

- Split `Size` in repository table as two new colunms, one is `GitSize`
for git size, the other is `LFSSize` for lfs data. still store full size
in `Size` colunm.
- Show full size on ui, but show each of them by a `title`;  example:

![image](https://user-images.githubusercontent.com/25342410/218636251-e200f085-d7e7-4a25-9ff1-b586a63e07a9.png)

- Return full size in api response.

---------

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: DmitryFrolovTri <23313323+DmitryFrolovTri@users.noreply.github.com>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoUse correct response code in push mirror creation response in v1_json.tmpl (#25476)
Georg Dangl [Wed, 28 Jun 2023 22:00:19 +0000 (00:00 +0200)]
Use correct response code in push mirror creation response in v1_json.tmpl (#25476)

In the process of doing a bit of automation via the API, we've
discovered a _small_ issue in the Swagger definition. We tried to create
a push mirror for a repository, but our generated client raised an
exception due to an unexpected status code.

When looking at this function:

https://github.com/go-gitea/gitea/blob/3c7f5ed7b5bff347198cbb26492e6354ea42733b/routers/api/v1/repo/mirror.go#L236-L240

We see it defines `201 - Created` as response:

https://github.com/go-gitea/gitea/blob/3c7f5ed7b5bff347198cbb26492e6354ea42733b/routers/api/v1/repo/mirror.go#L260-L262

But it actually returns `200 - OK`:

https://github.com/go-gitea/gitea/blob/3c7f5ed7b5bff347198cbb26492e6354ea42733b/routers/api/v1/repo/mirror.go#L373

So I've just updated the Swagger definitions to match the code😀

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoDo not prepare oauth2 config if it is not enabled, do not write config in some sub...
wxiaoguang [Wed, 28 Jun 2023 21:30:06 +0000 (05:30 +0800)]
Do not prepare oauth2 config if it is not enabled, do not write config in some sub-commands (#25567)

Ref:

* https://github.com/go-gitea/gitea/issues/25377#issuecomment-1609757289

And some sub-commands like "generate" / "docs", they do not need to use
the ini config

15 months agoFix content holes in Actions task logs file (#25560)
Jason Song [Wed, 28 Jun 2023 17:07:29 +0000 (01:07 +0800)]
Fix content holes in Actions task logs file (#25560)

Fix #25451.

Bugfixes:
- When stopping the zombie or endless tasks, set `LogInStorage` to true
after transferring the file to storage. It was missing, it could write
to a nonexistent file in DBFS because `LogInStorage` was false.
- Always update `ActionTask.Updated` when there's a new state reported
by the runner, even if there's no change. This is to avoid the task
being judged as a zombie task.

Enhancement:
- Support `Stat()` for DBFS file.
- `WriteLogs` refuses to write if it could result in content holes.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoAlign language menu icon and fit the footer area (#25556)
wxiaoguang [Wed, 28 Jun 2023 14:57:50 +0000 (22:57 +0800)]
Align language menu icon and fit the footer area (#25556)

Close #25551

15 months agoFix bugs related to notification endpoints (#25548)
Zettat123 [Wed, 28 Jun 2023 14:26:56 +0000 (22:26 +0800)]
Fix bugs related to notification endpoints (#25548)

15 months agoAdd custom ansi colors and CSS variables for them (#25546)
silverwind [Wed, 28 Jun 2023 13:38:55 +0000 (15:38 +0200)]
Add custom ansi colors and CSS variables for them (#25546)

Use our existing color palette to map to the 16 basic ansi colors. This
is backwards-compatible because it aliases the existing color names.

Side note: I think the colors in `console.css` for console file
rendering are incomplete, but fixing those is out of scope here imo.

Before and after:

<img width="542" alt="Screenshot 2023-06-28 at 00 26 12"
src="https://github.com/go-gitea/gitea/assets/115237/86d41884-bc47-4e85-8aec-621eb7320f0b">

<img width="546" alt="Screenshot 2023-06-28 at 00 28 24"
src="https://github.com/go-gitea/gitea/assets/115237/39fa3b37-d49e-49b1-b6bc-390ac8ca24b2">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoUse flex instead of float for sort button and search input (#25519)
HesterG [Wed, 28 Jun 2023 12:10:36 +0000 (20:10 +0800)]
Use flex instead of float for sort button and search input (#25519)

Right now some sort buttons beside search input are unclickable because
#25338 removed `max-width` and the sort button is using float, sort
button is then covered by the `input`.

The way to fix this in this PR is changing the layout to `flex` and put
`input form` and sort `button` into `secondary menu`.

After:

<img width="1411" alt="Screen Shot 2023-06-26 at 16 40 52"
src="https://github.com/go-gitea/gitea/assets/17645053/63c12b17-793a-4ae7-bbda-f67b13b87212">

<img width="1428" alt="Screen Shot 2023-06-26 at 16 34 06"
src="https://github.com/go-gitea/gitea/assets/17645053/cb7d967e-355d-4cb0-955c-6139580fc17a">
<img width="716" alt="Screen Shot 2023-06-26 at 16 34 22"
src="https://github.com/go-gitea/gitea/assets/17645053/c74b5ef2-d46e-4487-8794-28bec984bb36">
<img width="1424" alt="Screen Shot 2023-06-26 at 16 34 32"
src="https://github.com/go-gitea/gitea/assets/17645053/8a5fdc05-a2c5-4ec4-979d-15a21501fe14">
<img width="1425" alt="Screen Shot 2023-06-26 at 16 35 21"
src="https://github.com/go-gitea/gitea/assets/17645053/eb73cd31-3914-4bc9-92ab-aba56f25128b">
<img width="1437" alt="Screen Shot 2023-06-26 at 16 36 14"
src="https://github.com/go-gitea/gitea/assets/17645053/1c3b4595-bb26-491f-aa68-60dc9ab22b84">

15 months agoFix sub-command log level (#25537)
wxiaoguang [Wed, 28 Jun 2023 06:02:06 +0000 (14:02 +0800)]
Fix sub-command log level (#25537)

More fix for #24981

* #24981

Close #22361

* #22361

There were many patches for Gitea's sub-commands to satisfy the facts:

* Some sub-commands shouldn't output any log, otherwise the git protocol
would be broken
* Sometimes the users want to see "verbose" or "quiet" outputs

That's a longstanding problem, and very fragile. This PR is only a quick
patch for the problem.

In the future, the sub-command system should be refactored to a clear
solution.

----

Other changes:

* Use `ReplaceAllWriters` to replace
`RemoveAllWriters().AddWriters(writer)`, then it's an atomic operation.
* Remove unnecessary `syncLevelInternal` calls, because
`AddWriters/addWritersInternal` already calls it.

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoUpdate JS dependencies and misc tweaks (#25540)
silverwind [Tue, 27 Jun 2023 19:44:17 +0000 (21:44 +0200)]
Update JS dependencies and misc tweaks (#25540)

- Update all JS dependencies
- Enable `declaration-property-unit-disallowed-list` to forbid `em` on
`line-height`
- Rename dependency update targets to `update-js` and `update-py` and
document them
- Remove margin on Asciicast viewer
- Tested Swagger, Katex, Asciicast

<img width="1243" alt="Screenshot 2023-06-27 at 19 51 05"
src="https://github.com/go-gitea/gitea/assets/115237/2d2722a0-2aa7-4f4c-b8bd-17e1f3637b78">

15 months agoChange `Regenerate Secret` button display (#25534)
KN4CK3R [Tue, 27 Jun 2023 15:20:52 +0000 (17:20 +0200)]
Change `Regenerate Secret` button display (#25534)

Fixes #25527

Preview:

![grafik](https://github.com/go-gitea/gitea/assets/1666336/a84ad1ba-43e6-42e5-a0e2-585fb226875d)

15 months agoFix rerun icon on action view component (#25531)
HesterG [Tue, 27 Jun 2023 14:34:33 +0000 (22:34 +0800)]
Fix rerun icon on action view component (#25531)

Right now rerun icon on action view component will not be seen when
duration text length is long, because the wrapper `job-brief-info` has a
fixed width, and the svg is squeezed. The way to fix this in this PR is
to change width to `fit-content` and exchange position of duration text
and rerun svg.

Before (rerun svg not shown on hover):

<img width="1401" alt="Screen Shot 2023-06-27 at 12 53 41"
src="https://github.com/go-gitea/gitea/assets/17645053/bb3f62ec-8c56-4dbc-96f1-718b50426d91">

After:

<img width="1409" alt="Screen Shot 2023-06-27 at 12 50 59"
src="https://github.com/go-gitea/gitea/assets/17645053/620aa02c-2326-408d-a763-453f48f42c40">

15 months agoFix admin-dl-horizontal (#25512)
wxiaoguang [Tue, 27 Jun 2023 09:14:45 +0000 (17:14 +0800)]
Fix admin-dl-horizontal (#25512)

![image](https://github.com/go-gitea/gitea/assets/2114189/fb731e07-da30-4470-8200-73b5ca8b78f1)

![image](https://github.com/go-gitea/gitea/assets/2114189/85930b6f-5df7-437f-863f-423f3b81dd26)

---------

Co-authored-by: HesterG <hestergong@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
15 months agoFix input `line-height` cutting off `g` (#25334)
hiifong [Tue, 27 Jun 2023 08:45:43 +0000 (16:45 +0800)]
Fix input `line-height` cutting off `g` (#25334)

Fix the incomplete display of input text
Before:

![image](https://github.com/go-gitea/gitea/assets/89133723/6bd8ca29-a096-46a8-bd23-fb833f45186f)

![image](https://github.com/go-gitea/gitea/assets/89133723/27e51e62-7150-45cd-8606-09317d462d70)
After:

![image](https://github.com/go-gitea/gitea/assets/89133723/8d0db5d3-d768-42b4-9a75-0b8816f0a299)

![image](https://github.com/go-gitea/gitea/assets/89133723/4193adc9-b635-4ed6-8e11-715ec5150563)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoAdd toasts to UI (#25449)
silverwind [Tue, 27 Jun 2023 02:45:24 +0000 (04:45 +0200)]
Add toasts to UI (#25449)

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

In some case like async success/error, it is useful to show toasts in UI.

15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 27 Jun 2023 00:29:26 +0000 (00:29 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoAdd `make poetry-update`, upgrade `djlint` (#25399)
silverwind [Mon, 26 Jun 2023 21:14:00 +0000 (23:14 +0200)]
Add `make poetry-update`, upgrade `djlint` (#25399)

[updates](https://github.com/silverwind/updates) now supports poetry as
well so we can use it for a new `make poetry-update` to update all
poetry dependencies.

15 months agoUse JSON response for "user/logout" (#25522)
wxiaoguang [Mon, 26 Jun 2023 19:36:10 +0000 (03:36 +0800)]
Use JSON response for "user/logout" (#25522)

The request sent to "user/logout" is from "link-action", it expects to
get JSON response.

15 months agoFix migrate page layout on mobile (#25507)
silverwind [Mon, 26 Jun 2023 09:57:36 +0000 (11:57 +0200)]
Fix migrate page layout on mobile (#25507)

Fixes: https://github.com/go-gitea/gitea/issues/25462
On supporting browsers, text in description is [wrapped
equally](https://caniuse.com/css-text-wrap-balance).

<img width="488" alt="Screenshot 2023-06-26 at 00 17 21"
src="https://github.com/go-gitea/gitea/assets/115237/cb8e3a50-6225-4a8c-a6c0-f35a17d2af76">

<img width="1254" alt="Screenshot 2023-06-26 at 00 14 51"
src="https://github.com/go-gitea/gitea/assets/115237/0885404e-973e-45ce-b41e-5cb265a4cd1e">

15 months agoAdd Adopt repository event and handler (#25497)
Lunny Xiao [Mon, 26 Jun 2023 06:59:15 +0000 (14:59 +0800)]
Add Adopt repository event and handler (#25497)

Fix #14304

---------

Co-authored-by: delvh <dev.lh@web.de>
15 months agoSupport `pull_request_target` event (#25229)
Zettat123 [Mon, 26 Jun 2023 06:33:18 +0000 (14:33 +0800)]
Support `pull_request_target` event (#25229)

Fix #25088

This PR adds the support for
[`pull_request_target`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target)
workflow trigger. `pull_request_target` is similar to `pull_request`,
but the workflow triggered by the `pull_request_target` event runs in
the context of the base branch of the pull request rather than the head
branch. Since the workflow from the base is considered trusted, it can
access the secrets and doesn't need approvals to run.

15 months agoFix CLI sub-command handling (#25501)
wxiaoguang [Mon, 26 Jun 2023 05:45:27 +0000 (13:45 +0800)]
Fix CLI sub-command handling (#25501)

A regression of #25330 : The nil "Action" should be treated as "help"

In old releases: `./gitea admin` show helps

After #25330: `./gitea admin` panics (although the code returned `nil`
if action is nil, but Golang's quirk is: nil in interface is not nil)

With this PR: `./gitea admin` shows helps as the old releases.

15 months agoDocument creating an API key from the CLI (#25504) (#25510)
techknowlogick [Mon, 26 Jun 2023 05:13:20 +0000 (01:13 -0400)]
Document creating an API key from the CLI (#25504) (#25510)

Frontport of #25504

Credit to @lonix1

Co-authored-by: lonix1 <40320097+lonix1@users.noreply.github.com>
Co-authored-by: delvh <dev.lh@web.de>