]> source.dussan.org Git - gitea.git/log
gitea.git
18 months agoFix diff tree height and adjust target file style (#23616)
silverwind [Wed, 22 Mar 2023 20:32:27 +0000 (21:32 +0100)]
Fix diff tree height and adjust target file style (#23616)

Extract from https://github.com/go-gitea/gitea/pull/23553, just the
parts that fix the diff tree height and the change to the file `:target`
style.

Fixes: https://github.com/go-gitea/gitea/issues/23593
18 months agoIntroduce path Clean/Join helper functions, partially backport&refactor (#23495)...
wxiaoguang [Wed, 22 Mar 2023 11:56:20 +0000 (19:56 +0800)]
Introduce path Clean/Join helper functions, partially backport&refactor (#23495) (#23607)

Backport #23495, partially backport&refactor

The `modules/options` files are just copied from 1.20 to 1.19

18 months agoRemove conflicting CSS rules on notifications, improve notifications table (#23565...
Giteabot [Tue, 21 Mar 2023 21:04:01 +0000 (17:04 -0400)]
Remove conflicting CSS rules on notifications, improve notifications table (#23565) (#23621)

Backport #23565 by @silverwind

Dropdowns on `/notifications/subscriptions` before and after:

<img width="157" alt="Screenshot 2023-03-18 at 20 37 12"
src="https://user-images.githubusercontent.com/115237/226133906-e4ad6a0a-de24-4324-8e1d-94081d23fe85.png">
<img width="152" alt="Screenshot 2023-03-18 at 20 41 29"
src="https://user-images.githubusercontent.com/115237/226134038-c3946c32-a424-4b92-ad15-890e1036cafe.png">

These selectors are meant to target the notification list which I
improved:

<img width="1145" alt="Screenshot 2023-03-19 at 01 52 11"
src="https://user-images.githubusercontent.com/115237/226147907-1c35736a-4bc9-4698-9813-21a20a1d2106.png">
<img width="1148" alt="Screenshot 2023-03-19 at 01 54 17"
src="https://user-images.githubusercontent.com/115237/226147920-626dbd84-11d3-48db-a177-6d808e3212c0.png">

18 months agoFix pagination on `/notifications/watching` (#23564) (#23603)
Giteabot [Tue, 21 Mar 2023 20:10:47 +0000 (16:10 -0400)]
Fix pagination on `/notifications/watching` (#23564) (#23603)

Backport #23564 by @silverwind

The `q` parameter was not rendered in pagination links because
`context.Pagination:AddParam` checks for existance of the parameter in
`ctx.Data` where it was absent. Added the parameter there to fix it.

Co-authored-by: silverwind <me@silverwind.io>
18 months agofix submodule is nil panic (#23588) (#23601)
Giteabot [Tue, 21 Mar 2023 01:39:40 +0000 (21:39 -0400)]
fix submodule is nil panic (#23588) (#23601)

Backport #23588 by @viletyy

#23587
submodule path is nil
It is panic a nil error

Co-authored-by: 来自村里的小螃蟹 <yystopf@163.com>
18 months agoImprove template error reporting (#23396) (#23600)
Giteabot [Mon, 20 Mar 2023 21:53:45 +0000 (17:53 -0400)]
Improve template error reporting (#23396) (#23600)

Backport #23396 by @zeripath

There are multiple duplicate reports of errors during template rendering
due to broken custom templates.

Unfortunately the error returned here is somewhat difficult for users to
understand and it doesn't return the context of the error.

This PR attempts to parse the error returned by the template renderer to
add in some further context including the filename of the template AND
the preceding lines within that template file.

Ref #23274

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
18 months agoPolyfill the window.customElements (#23592) (#23595)
wxiaoguang [Mon, 20 Mar 2023 18:52:05 +0000 (02:52 +0800)]
Polyfill the window.customElements (#23592) (#23595)

Backport #23592

Close #23590

It seems that some browsers don't support customElements

18 months agoAdd CHANGELOG for 1.19.0 (#23583) (#23586) v1.19.0
Giteabot [Mon, 20 Mar 2023 08:34:28 +0000 (04:34 -0400)]
Add CHANGELOG for 1.19.0 (#23583) (#23586)

Backport #23583 by @delvh

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
18 months agoFix backport #23336 (#23584)
yp05327 [Mon, 20 Mar 2023 07:37:20 +0000 (16:37 +0900)]
Fix backport #23336 (#23584)

18 months agoFix dropdown icon misalignment when using fomantic icon (#23558) (#23577)
wxiaoguang [Mon, 20 Mar 2023 02:44:15 +0000 (10:44 +0800)]
Fix dropdown icon misalignment when using fomantic icon (#23558) (#23577)

Backport #23558

There are still many dropdowns using fomantic icon. For example: new
issue with issue template.

Avoid polluting the fomantic styles.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
18 months agoAdd `.patch` to `attachment.ALLOWED_TYPES` (#23580) (#23582)
Giteabot [Sun, 19 Mar 2023 20:48:44 +0000 (16:48 -0400)]
Add `.patch` to `attachment.ALLOWED_TYPES` (#23580) (#23582)

Backport #23580 by @silverwind

Updated this default to GitHub's latest, adding the `.patch` file
extension to allowed types.

Co-authored-by: silverwind <me@silverwind.io>
18 months agoMatch api migration behavior to web behavior (#23552) (#23573)
Giteabot [Sun, 19 Mar 2023 07:30:02 +0000 (03:30 -0400)]
Match api migration behavior to web behavior (#23552) (#23573)

Backport #23552 by @atomaka

When attempting to migrate a repository via the API endpoint comments
are always included. This can create a problem if your source repository
has issues or pull requests but you do not want to import them into
Gitea that displays as something like:

> Error 500: We were unable to perform the request due to server-side
problems. 'comment references non existent IssueIndex 4

There are only two ways to resolve this:
1. Migrate using the web interface
2. Migrate using the API including at issues or pull requests.

This PR matches the behavior of the API migration router to the web
migration router.

Co-authored-by: Andrew Tomaka <atomaka@atomaka.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
18 months agoFix some broken css (#23560) (#23567)
Giteabot [Sun, 19 Mar 2023 01:37:16 +0000 (21:37 -0400)]
Fix some broken css (#23560) (#23567)

Backport #23560 by @wxiaoguang

1. The "close" inside "modal" are likely broken for long time
    * There is no var called `--body-color`
    * There is no `fullscreen modal`
* The `.ui.modal > .close.inside` doesn't seem to match most icons. It
only matches a few like "fork-repo-modal" or "adopt repo". Other places
are just buggy code copied again and again.
2. Convert the legacy `&:hover` LESS syntax to CSS syntax

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <leon@kske.dev>
18 months agoFix sticky header in diff view (#23554) (#23568)
Giteabot [Sun, 19 Mar 2023 00:29:16 +0000 (20:29 -0400)]
Fix sticky header in diff view (#23554) (#23568)

Backport #23554 by @silverwind

Ressurection of #23549.

Fix regression
https://github.com/go-gitea/gitea/pull/23513#issuecomment-1474356817
from #23271.
The previous sticky CSS did assume the content is always 2 rows, but
since that PR, it's single-row above 993px width.
Adjust the sticky offset to match and add a small tweak that hides
content behind the `border-radius`.

Single row:
<img width="1264" alt="Screenshot 2023-03-17 at 21 33 05"
src="https://user-images.githubusercontent.com/115237/226034050-a04b131d-fd3f-45c0-bc72-413738a59825.png">

Double row:
<img width="1243" alt="Screenshot 2023-03-17 at 21 32 53"
src="https://user-images.githubusercontent.com/115237/226034163-2f1c6aa9-fc72-432f-bc46-9a7119da8677.png">

Co-authored-by: silverwind <me@silverwind.io>
19 months agoFix JS error on compare page (#23551) (#23566)
Giteabot [Sat, 18 Mar 2023 21:48:13 +0000 (17:48 -0400)]
Fix JS error on compare page (#23551) (#23566)

Backport #23551 by @silverwind

Fix regression from https://github.com/go-gitea/gitea/pull/23271. This
code apparently runs on the compare page where there is no review button
so check for existance of both button and content.

<img width="1226" alt="Screenshot 2023-03-17 at 21 42 47"
src="https://user-images.githubusercontent.com/115237/226040001-ec097edd-d926-4c80-9962-526f9b7eff19.png">

Fixes #23562

Co-authored-by: silverwind <me@silverwind.io>
19 months ago Fix `aria.js` bugs: incorrect role element problem, mobile focus problem, tippy...
wxiaoguang [Sat, 18 Mar 2023 16:14:19 +0000 (00:14 +0800)]
 Fix `aria.js` bugs: incorrect role element problem, mobile focus problem, tippy problem (#23450) (#23486)

Before: the `aria.js` is still buggy in some cases.

After: tested with AppleVoice, Android TalkBack (I tested it with 1.19
again)

* Fix incorrect dropdown init code
* Fix incorrect role element (the menu role should be on the `$menu`
element, but not on the `$focusable`)
* Fix the focus-show-click-hide problem on mobile. Now the language menu
works as expected
* Fix incorrect dropdown template function setting
* Clarify the logic in aria.js
* Fix incorrect tippy `setProps` after `destroy`
* Improve comments
* Implement the layout proposed by #19861

19 months agoImrove scroll behavior to hash issuecomment(scroll position, auto expand if file...
Giteabot [Sat, 18 Mar 2023 02:59:18 +0000 (22:59 -0400)]
Imrove scroll behavior to hash issuecomment(scroll position, auto expand if file is folded, and on refreshing) (#23513) (#23540)

Backport #23513 by @HesterG

Close #23466
Right now on pull request "files Changed" tab, if a file is viewed, when
the comments' links are visited, the comment will not be shown as the
file is folded after viewed. This PR is to improve the behavior, to make
the comment seen even the related file is folded, like on github.

And right now scroll position will be remembered and hence it won’t
scroll to hashed comment after refreshing, this PR also adjust the
scroll position remembering behavior: When there is hash comment in url,
do not remember the scroll position.

Before:

https://user-images.githubusercontent.com/17645053/225512079-6cf79581-9346-44cf-95d6-06919642e6a8.mov

After:

https://user-images.githubusercontent.com/17645053/225523753-3f6728f2-977b-4ed0-a65c-63dcef2ace80.mov

Update - long comment's behavior after using `scrollTop ` (Comment div
scroll to the position which is 30px below the diff header, or 30px
below top on conversation tab):

https://user-images.githubusercontent.com/17645053/225614460-0602c1a6-229c-41f4-84d2-334e78251486.mov

Co-authored-by: Hester Gong <hestergong@gmail.com>
19 months agoFix diff detail buttons wrapping, use tippy for review box (#23271) (#23546)
Giteabot [Fri, 17 Mar 2023 18:52:04 +0000 (14:52 -0400)]
Fix diff detail buttons wrapping, use tippy for review box (#23271) (#23546)

Backport #23271 by @silverwind

Fix visual regression introduced by
https://github.com/go-gitea/gitea/pull/22986.

Before:
<img width="1277" alt="image"
src="https://user-images.githubusercontent.com/115237/222792814-d70c2173-0c7c-4db2-8839-95be63cdc8ee.png">
<img width="649" alt="image"
src="https://user-images.githubusercontent.com/115237/222792989-9b1f5e12-becd-40cc-b02c-e9f59a8e72a4.png">

After:
<img width="1274" alt="image"
src="https://user-images.githubusercontent.com/115237/222792769-e7a9702f-4b6a-46c4-9385-da103ed4dff0.png">
<img width="565" alt="image"
src="https://user-images.githubusercontent.com/115237/222793084-6de6482b-11dc-4d38-b514-15884d20e140.png">

Co-authored-by: silverwind <me@silverwind.io>
19 months agoFix review comment context menu clipped bug (#23523) (#23543)
wxiaoguang [Fri, 17 Mar 2023 18:00:17 +0000 (02:00 +0800)]
Fix review comment context menu clipped bug (#23523) (#23543)

Backport #23523, Close #23517

There is no "dropdown menu" for image/csv view, so we could only add the
"overflow-x: scroll" to the image/csv view.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoRefactor merge/update git command calls (#23366) (#23544)
wxiaoguang [Fri, 17 Mar 2023 16:16:22 +0000 (00:16 +0800)]
Refactor merge/update git command calls (#23366) (#23544)

Backport #23366

* Remove unnecessary ToTrustedCmdArgs calls
* The `signArg` couldn't be empty, it's either `-S{keyID}` or
`--no-gpg-sign`.

19 months agoUse octicon-verified for gpg signatures (#23529) (#23536)
Giteabot [Fri, 17 Mar 2023 15:39:31 +0000 (11:39 -0400)]
Use octicon-verified for gpg signatures (#23529) (#23536)

Backport #23529 by @silverwind

Before:
<img width="292" alt="Screenshot 2023-03-16 at 23 40 47"
src="https://user-images.githubusercontent.com/115237/225768871-43e11ced-e340-4c88-b756-25f9f7076fd2.png">
<img width="288" alt="Screenshot 2023-03-16 at 23 51 05"
src="https://user-images.githubusercontent.com/115237/225770071-b51f3ed6-ef14-421b-a5bc-6a26e808d404.png">

After:
<img width="291" alt="Screenshot 2023-03-16 at 23 40 37"
src="https://user-images.githubusercontent.com/115237/225768864-ea4956c7-8c57-4148-9d89-c818991a7538.png">
<img width="281" alt="image"
src="https://user-images.githubusercontent.com/115237/225769978-0b9c6c52-9a13-4c23-b13e-8a8a692abf43.png">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoIncrease horizontal page padding (#23507) (#23537)
Giteabot [Fri, 17 Mar 2023 13:01:47 +0000 (09:01 -0400)]
Increase horizontal page padding (#23507) (#23537)

Backport #23507 by @silverwind

Add a bit more empty space on left and right side of page content for a
more pleasant viewing experience. Also tweaked the mobile navbar to
match.

Before:
<img width="1276" alt="Screenshot 2023-03-16 at 00 58 23"
src="https://user-images.githubusercontent.com/115237/225473942-f544106f-1b61-456a-99fb-3ba136cabc8d.png">

After:
<img width="1270" alt="Screenshot 2023-03-16 at 00 58 37"
src="https://user-images.githubusercontent.com/115237/225473959-8b555359-a08d-48e1-9476-2710aabb1166.png">

Mobile Navbar:
<img width="673" alt="Screenshot 2023-03-16 at 01 05 12"
src="https://user-images.githubusercontent.com/115237/225473966-adccef2b-4d34-44ed-8c75-d4ca46d96cf3.png">

Co-authored-by: silverwind <me@silverwind.io>
19 months agoUse `<nav>` instead of `<div>` in the global navbar (#23125) (#23533)
Giteabot [Fri, 17 Mar 2023 05:28:17 +0000 (01:28 -0400)]
Use `<nav>` instead of `<div>` in the global navbar (#23125) (#23533)

Backport #23125 by @delvh

Furthermore improved/deleted some comments in the template.
The appearance did not change.

Co-authored-by: delvh <leon@kske.dev>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoHandle missing `README` in create repos API (#23387) (#23510)
Zettat123 [Fri, 17 Mar 2023 01:04:52 +0000 (09:04 +0800)]
Handle missing `README` in create repos API (#23387) (#23510)

Backport #23387
Close #22934

In `/user/repos` API (and other APIs related to creating repos), user
can specify a readme template for auto init. At present, if the
specified template does not exist, a `500` will be returned . This PR
improved the logic and will return a `400` instead of `500`.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoReplace Less with CSS (#23508)
silverwind [Fri, 17 Mar 2023 01:04:39 +0000 (02:04 +0100)]
Replace Less with CSS (#23508)

Backport https://github.com/go-gitea/gitea/pull/23481,
https://github.com/go-gitea/gitea/pull/23504 and
https://github.com/go-gitea/gitea/pull/23520 to 1.19, just so we have an
easier time with future backports.

Seems to work on a basic level. There was a merge conflict in
`RepoActionView.vue`, otherwise it merged cleanly.

---------

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
19 months agoMake time tooltips interactive (#23526) (#23527)
Giteabot [Thu, 16 Mar 2023 21:23:11 +0000 (17:23 -0400)]
Make time tooltips interactive (#23526) (#23527)

Backport #23526 by @silverwind

Fixes https://codeberg.org/forgejo/forgejo/issues/511

<img width="379" alt="Screenshot 2023-03-16 at 20 23 10"
src="https://user-images.githubusercontent.com/115237/225731294-4c6e4f44-bdcc-4c8c-86e2-49f7c03b377d.png">

Co-authored-by: silverwind <me@silverwind.io>
19 months agoUpdate act (#23512) (#23518)
Jason Song [Thu, 16 Mar 2023 14:33:11 +0000 (22:33 +0800)]
Update act (#23512) (#23518)

Backport #23512.

Update replace:
```diff
- replace github.com/nektos/act => gitea.com/gitea/act v0.234.2-0.20230131074955-e46ede1b1744
+ replace github.com/nektos/act => gitea.com/gitea/act v0.243.1
```

Update require:
```diff
- github.com/nektos/act v0.0.0
+ github.com/nektos/act v0.2.43
```

Actually, `v0.2.43` doesn't work, it will be replaced by `gitea/act`, so
it's OK to put any version here. But `gitea/act` is based on
`nektos/act`, so keeping the right upstream version will make security
dependabot help.

BTW, the [security
report](https://github.com/go-gitea/gitea/security/dependabot/20) is
false positive, we don't use the artifact server in act, see #22738.

19 months agoUpdate path to docs theme file (#23502) (#23505)
Giteabot [Wed, 15 Mar 2023 21:04:27 +0000 (17:04 -0400)]
Update path to docs theme file (#23502) (#23505)

Backport #23502 by @techknowlogick

The branch name for the theme was updated to main

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoDisable sending email after push a commit to a closed PR (#23462) (#23492)
Giteabot [Wed, 15 Mar 2023 10:20:51 +0000 (06:20 -0400)]
Disable sending email after push a commit to a closed PR (#23462) (#23492)

Backport #23462 by @sillyguodong

Close #23440
Cause by #23189
In #23189, we should insert a comment record into db when pushing a
commit to the PR, even if the PR is closed.
But should skip sending any notification in this case.

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
19 months agoFix 'View File' button in code search (#23478) (#23483)
Giteabot [Wed, 15 Mar 2023 09:34:05 +0000 (05:34 -0400)]
Fix 'View File' button in code search (#23478) (#23483)

Backport #23478 by @silverwind

- Right-align 'View File' button
- Add 'role' attribute to button link

Before:
<img width="1148" alt="Screenshot 2023-03-14 at 22 02 16"
src="https://user-images.githubusercontent.com/115237/225135954-f06153ec-c222-441e-98ba-0177afff3a7a.png">

After:
<img width="1150" alt="Screenshot 2023-03-14 at 22 02 33"
src="https://user-images.githubusercontent.com/115237/225135966-323cb695-05ef-4b83-a8ef-05f2b1887090.png">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
19 months agoBump webpack from 5.75.0 to 5.76.0 (#23484) (#23487)
Giteabot [Wed, 15 Mar 2023 06:21:59 +0000 (02:21 -0400)]
Bump webpack from 5.75.0 to 5.76.0 (#23484) (#23487)

Backport #23484 by @dependabot[bot]

Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to
5.76.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/webpack/webpack/releases">webpack's
releases</a>.</em></p>
<blockquote>
<h2>v5.76.0</h2>
<h2>Bugfixes</h2>
<ul>
<li>Avoid cross-realm object access by <a
href="https://github.com/Jack-Works"><code>@​Jack-Works</code></a> in <a
href="https://redirect.github.com/webpack/webpack/pull/16500">webpack/webpack#16500</a></li>
<li>Improve hash performance via conditional initialization by <a
href="https://github.com/lvivski"><code>@​lvivski</code></a> in <a
href="https://redirect.github.com/webpack/webpack/pull/16491">webpack/webpack#16491</a></li>
<li>Serialize <code>generatedCode</code> info to fix bug in asset module
cache restoration by <a
href="https://github.com/ryanwilsonperkin"><code>@​ryanwilsonperkin</code></a>
in <a
href="https://redirect.github.com/webpack/webpack/pull/16703">webpack/webpack#16703</a></li>
<li>Improve performance of <code>hashRegExp</code> lookup by <a
href="https://github.com/ryanwilsonperkin"><code>@​ryanwilsonperkin</code></a>
in <a
href="https://redirect.github.com/webpack/webpack/pull/16759">webpack/webpack#16759</a></li>
</ul>
<h2>Features</h2>
<ul>
<li>add <code>target</code> to <code>LoaderContext</code> type by <a
href="https://github.com/askoufis"><code>@​askoufis</code></a> in <a
href="https://redirect.github.com/webpack/webpack/pull/16781">webpack/webpack#16781</a></li>
</ul>
<h2>Security</h2>
<ul>
<li><a
href="https://github.com/advisories/GHSA-3rfm-jhwj-7488">CVE-2022-37603</a>
fixed by <a
href="https://github.com/akhilgkrishnan"><code>@​akhilgkrishnan</code></a>
in <a
href="https://redirect.github.com/webpack/webpack/pull/16446">webpack/webpack#16446</a></li>
</ul>
<h2>Repo Changes</h2>
<ul>
<li>Fix HTML5 logo in README by <a
href="https://github.com/jakebailey"><code>@​jakebailey</code></a> in <a
href="https://redirect.github.com/webpack/webpack/pull/16614">webpack/webpack#16614</a></li>
<li>Replace TypeScript logo in README by <a
href="https://github.com/jakebailey"><code>@​jakebailey</code></a> in <a
href="https://redirect.github.com/webpack/webpack/pull/16613">webpack/webpack#16613</a></li>
<li>Update actions/cache dependencies by <a
href="https://github.com/piwysocki"><code>@​piwysocki</code></a> in <a
href="https://redirect.github.com/webpack/webpack/pull/16493">webpack/webpack#16493</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/Jack-Works"><code>@​Jack-Works</code></a> made
their first contribution in <a
href="https://redirect.github.com/webpack/webpack/pull/16500">webpack/webpack#16500</a></li>
<li><a href="https://github.com/lvivski"><code>@​lvivski</code></a> made
their first contribution in <a
href="https://redirect.github.com/webpack/webpack/pull/16491">webpack/webpack#16491</a></li>
<li><a
href="https://github.com/jakebailey"><code>@​jakebailey</code></a> made
their first contribution in <a
href="https://redirect.github.com/webpack/webpack/pull/16614">webpack/webpack#16614</a></li>
<li><a
href="https://github.com/akhilgkrishnan"><code>@​akhilgkrishnan</code></a>
made their first contribution in <a
href="https://redirect.github.com/webpack/webpack/pull/16446">webpack/webpack#16446</a></li>
<li><a
href="https://github.com/ryanwilsonperkin"><code>@​ryanwilsonperkin</code></a>
made their first contribution in <a
href="https://redirect.github.com/webpack/webpack/pull/16703">webpack/webpack#16703</a></li>
<li><a href="https://github.com/piwysocki"><code>@​piwysocki</code></a>
made their first contribution in <a
href="https://redirect.github.com/webpack/webpack/pull/16493">webpack/webpack#16493</a></li>
<li><a href="https://github.com/askoufis"><code>@​askoufis</code></a>
made their first contribution in <a
href="https://redirect.github.com/webpack/webpack/pull/16781">webpack/webpack#16781</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0">https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/webpack/webpack/commit/97b1718720c33f1b17302a74c5284b01e02ec001"><code>97b1718</code></a>
Merge pull request <a
href="https://redirect.github.com/webpack/webpack/issues/16781">#16781</a>
from askoufis/loader-context-target-type</li>
<li><a
href="https://github.com/webpack/webpack/commit/b84efe6224b276bf72e4c5e2f4e76acddfaeef07"><code>b84efe6</code></a>
Merge pull request <a
href="https://redirect.github.com/webpack/webpack/issues/16759">#16759</a>
from ryanwilsonperkin/real-content-hash-regex-perf</li>
<li><a
href="https://github.com/webpack/webpack/commit/c98e9e001441b165c7ed4845700839730b505833"><code>c98e9e0</code></a>
Merge pull request <a
href="https://redirect.github.com/webpack/webpack/issues/16493">#16493</a>
from piwysocki/patch-1</li>
<li><a
href="https://github.com/webpack/webpack/commit/5f34acfbc074da6cc09f48944d7f2b4273ffb3f8"><code>5f34acf</code></a>
feat: Add <code>target</code> to <code>LoaderContext</code> type</li>
<li><a
href="https://github.com/webpack/webpack/commit/b7fc4d876deb958d7ee81ecc00a312e39a354a44"><code>b7fc4d8</code></a>
Merge pull request <a
href="https://redirect.github.com/webpack/webpack/issues/16703">#16703</a>
from ryanwilsonperkin/ryanwilsonperkin/fix-16160</li>
<li><a
href="https://github.com/webpack/webpack/commit/63ea82da4d4e4242b6a6285fc937f0684f264fe8"><code>63ea82d</code></a>
Merge branch 'webpack:main' into patch-1</li>
<li><a
href="https://github.com/webpack/webpack/commit/4ba225225b1348c8776ca5b5fe53468519413bc0"><code>4ba2252</code></a>
Merge pull request <a
href="https://redirect.github.com/webpack/webpack/issues/16446">#16446</a>
from akhilgkrishnan/patch-1</li>
<li><a
href="https://github.com/webpack/webpack/commit/1acd6350be3d74d4ac70b64cbbc60f27724b618b"><code>1acd635</code></a>
Merge pull request <a
href="https://redirect.github.com/webpack/webpack/issues/16613">#16613</a>
from jakebailey/ts-logo</li>
<li><a
href="https://github.com/webpack/webpack/commit/302eb37fe19ed7ca60eaf895aca4f9da9dfd7931"><code>302eb37</code></a>
Merge pull request <a
href="https://redirect.github.com/webpack/webpack/issues/16614">#16614</a>
from jakebailey/html5-logo</li>
<li><a
href="https://github.com/webpack/webpack/commit/cfdb1dfe59b33bf7441b8a8e4fc58d75e4f54cee"><code>cfdb1df</code></a>
Improve performance of hashRegExp lookup</li>
<li>Additional commits viewable in <a
href="https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~evilebottnawi">evilebottnawi</a>, a new
releaser for webpack since your current version.</p>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=webpack&package-manager=npm_and_yarn&previous-version=5.75.0&new-version=5.76.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the
default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as
the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as
the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the
default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/go-gitea/gitea/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
19 months agoConvert GitHub event on actions and fix some pull_request events. (#23037) (#23471)
Giteabot [Wed, 15 Mar 2023 02:43:10 +0000 (22:43 -0400)]
Convert GitHub event on actions and fix some pull_request events. (#23037) (#23471)

Backport #23037 by @lunny

Follow #22680

Partially Fix #22958, on pull_request, `opened`, `reopened`,
`synchronize` supported, `edited` hasn't been supported yet because
Gitea doesn't trigger that events.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: yp05327 <576951401@qq.com>
19 months agoFix due date being wrong on issue list (#23475) (#23477)
Giteabot [Wed, 15 Mar 2023 01:40:43 +0000 (21:40 -0400)]
Fix due date being wrong on issue list (#23475) (#23477)

Backport #23475 by @yardenshoham

Exactly like #22302 but in the issue list page

Co-authored-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoScoped label display and documentation tweaks (#23430) (#23433)
Giteabot [Tue, 14 Mar 2023 23:58:38 +0000 (19:58 -0400)]
Scoped label display and documentation tweaks (#23430) (#23433)

Backport #23430 by @brechtvl

* Fix scoped label left and right part breaking across lines.
* Remove slanted divider in scoped label display, make it straight.
After using this for a while, this feels more visually noisy than
helpful.
* Reduce contrast between scope and item to reduce probability of
unreadable text on background.
* Change documentation to remove mention of non-exclusive scoped labels.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
19 months agoRemove wrongly added column on migration test fixtures (#23456) (#23470)
Giteabot [Tue, 14 Mar 2023 20:09:52 +0000 (16:09 -0400)]
Remove wrongly added column on migration test fixtures (#23456) (#23470)

Backport #23456 by @lunny

Fix https://drone.gitea.io/go-gitea/gitea/69418/3/8
Migration fixtures are in `models/migrations/fixtures`, every folder
will be used only by the test with the same name.
For `Test_DeleteOrphanedIssueLabels`, the fixture should keep consistent
as the database structure at that time. So the newly added `exclusive`
is not right. Just revert the change in
https://github.com/go-gitea/gitea/pull/22585/files#diff-f8db9cbbaa10bf7b27eb726884454db821a4b4f8cb9a0d50435555908761bbcb

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoMake branches list page operations remember current page (#23420) (#23460)
Giteabot [Tue, 14 Mar 2023 12:51:14 +0000 (08:51 -0400)]
Make branches list page operations remember current page (#23420) (#23460)

Backport #23420 by @wxiaoguang

Close #23411

Always pass "page" query parameter to backend, and make backend respect
it.

The `ctx.FormInt("limit")` is never used, so removed.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agotest_env: hardcode major go version in use (#23464)
techknowlogick [Tue, 14 Mar 2023 08:12:14 +0000 (04:12 -0400)]
test_env: hardcode major go version in use (#23464)

19 months agoFix missing commit status in PR which from forked repo (#23351) (#23453)
Giteabot [Tue, 14 Mar 2023 00:11:31 +0000 (20:11 -0400)]
Fix missing commit status in PR which from forked repo (#23351) (#23453)

Backport #23351 by @sillyguodong

close: #23347

### Reference and Inference
According to Github REST API
[doc](https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#list-commit-statuses-for-a-reference):
1. The `Drone CI` that can create some commit status by
[API](https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#create-a-commit-status)
is enabled in `go-gitea/gitea`. So I tried to call the API to get a
commit status list of a PR which is commited to upstream
repo(`go-gitea/gitea`). As a result, the API returned a array of commit
status.

![image](https://user-images.githubusercontent.com/33891828/223913371-313d047a-5e2e-484c-b13e-dcd38748703e.png)
2. Then I tried to call the API to get commit status list of the
reference which of the `SHA` is the same as step 1 in the repo which is
forked from `go-gitea/gitea`. But I got a empty array.

![image](https://user-images.githubusercontent.com/33891828/223930827-17a64d3c-f466-4980-897c-77fe386c4d3b.png)

So, I believe it that:
1. The commit status is not shared between upstream repo and forked
repo.
2. The coomit status is bound to a repo that performs actions. (Gitea's
logic is the same)

### Cause
During debugging, I found it that commit status are not stored in the DB
as expected.
So, I located the following code:

https://github.com/go-gitea/gitea/blob/8cadd51bf295e6ff36ac36efed68cc5de34c9382/services/actions/commit_status.go#L18-L26
When I create a PR, the type of `event` is `pull request`, not `push`.
So the code return function directly.

### Screenshot

![image](https://user-images.githubusercontent.com/33891828/223939339-dadf539c-1fdd-40c4-96e9-2e4fa733f531.png)

![image](https://user-images.githubusercontent.com/33891828/223939519-edb02bf0-2478-4ea5-9366-be85468f02db.png)

![image](https://user-images.githubusercontent.com/33891828/223939557-ec6f1375-5536-400e-8987-fb7d2fd452fa.png)

### Other
In this PR, I also fix the problem of missing icon which represents
running in PRs list.

![image](https://user-images.githubusercontent.com/33891828/223939898-2a0339e4-713f-4c7b-9d99-2250a43f3457.png)

![image](https://user-images.githubusercontent.com/33891828/223939979-037a975f-5ced-480c-bac7-0ee00ebfff4b.png)

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
19 months agoPurge API comment (#23451) (#23452)
Giteabot [Mon, 13 Mar 2023 20:46:18 +0000 (16:46 -0400)]
Purge API comment (#23451) (#23452)

Backport #23451 by @jolheiser

This PR just adds the `purge` query parameter to the swagger docs for
admin user delete.

I considered using the same verbiage we have in the UI, but that seemed
more verbose than descriptions we use elsewhere in swagger. I'm fine if
that's preferred, though, just let me know. 🙂

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
19 months agoSupport reflogs (#22451) (#23438)
Giteabot [Mon, 13 Mar 2023 12:20:10 +0000 (08:20 -0400)]
Support reflogs (#22451) (#23438)

Backport #22451 by @philip-peterson

This PR adds support for reflogs on all repositories. It does this by
adding a global configuration entry.

Implements #14865

Signed-off-by: Philip Peterson <philip.c.peterson@gmail.com>
Co-authored-by: Philip Peterson <philip-peterson@users.noreply.github.com>
19 months agoFix actions frontend bugs (pagination, long name alignment) and small simplify (...
Giteabot [Mon, 13 Mar 2023 07:09:00 +0000 (03:09 -0400)]
Fix actions frontend bugs (pagination, long name alignment) and small simplify (#23370) (#23436)

Backport #23370 by @HesterG

1 Right now on actions page, the action list will not be aligned if
commit message is long. In this PR, the changes are:
- The branch tag is moved to bottom row
- Width percentage is given to make them aligned
- Show "..." if commit is longer than two lines.
- Align the status icon with the commit message with baseline

 Before:
<img width="1068" alt="截屏2023-03-08 12 23 22"
src="https://user-images.githubusercontent.com/17645053/223628534-6b9472cb-29f5-40a3-9714-c5152553049e.png">

 After:
<img width="756" alt="截屏2023-03-08 13 34 28"
src="https://user-images.githubusercontent.com/17645053/223628571-da94698b-0e0a-43e3-ae82-34d8c780e5ba.png">

2 Right now the actions list's pagination is not working properly
because Param is not passed to pagination template, in this PR Param
Strings are passed to the pager

Before:
<img width="1176" alt="截屏2023-03-08 12 23 50"
src="https://user-images.githubusercontent.com/17645053/223629207-8b67ce74-2342-4259-bc81-036e37752716.png">

After:
<img width="1343" alt="截屏2023-03-08 13 11 54"
src="https://user-images.githubusercontent.com/17645053/223629321-4f538f8a-45dc-4d6f-ae60-2c82680ae3e7.png">

3 A small simplify in `RepoActionView.vue` .

Co-authored-by: Hester Gong <hestergong@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoShow edit/close/delete button on organization wide repositories (#23388) (#23429)
Giteabot [Sun, 12 Mar 2023 14:17:25 +0000 (10:17 -0400)]
Show edit/close/delete button on organization wide repositories (#23388) (#23429)

Backport #23388 by @yp05327

A part of https://github.com/go-gitea/gitea/pull/22865

Co-authored-by: yp05327 <576951401@qq.com>
19 months agoPreserve file size when creating attachments (#23406) (#23426)
Giteabot [Sun, 12 Mar 2023 11:45:39 +0000 (07:45 -0400)]
Preserve file size when creating attachments (#23406) (#23426)

Backport #23406 by @baez90

When creating attachments (issue, release, repo) the file size (being
part of the multipart file header) is passed through the chain of
creating an attachment to ensure the MinIO client can stream the file
directly instead of having to read it to memory completely at first.

Fixes #23393

Co-authored-by: Peter <peter.kurfer@googlemail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoUse buildkit for docker builds (#23415) (#23424)
Giteabot [Sat, 11 Mar 2023 22:11:23 +0000 (17:11 -0500)]
Use buildkit for docker builds (#23415) (#23424)

19 months agoFix and move "Use this template" button (#23398) (#23408)
Giteabot [Fri, 10 Mar 2023 17:41:04 +0000 (12:41 -0500)]
Fix and move "Use this template" button (#23398) (#23408)

Backport #23398

Before:
<img width="1157" alt="Screenshot 2023-03-09 at 23 21 25"
src="https://user-images.githubusercontent.com/115237/224174168-869966cc-fa59-4231-b449-23bd9db12862.png">

After:
<img width="1145" alt="Screenshot 2023-03-09 at 23 24 34"
src="https://user-images.githubusercontent.com/115237/224174173-7f5b9c22-44c4-4eed-990c-da49d749eb0e.png">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoAdd missing tabs to org projects page (#22705) (#23412)
Giteabot [Fri, 10 Mar 2023 16:08:28 +0000 (11:08 -0500)]
Add missing tabs to org projects page (#22705) (#23412)

Backport #22705 by @yp05327

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

Context Data `IsOrganizationMember` and `IsOrganizationOwner` is used to
control the visibility of `people` and `team` tab.

https://github.com/go-gitea/gitea/blob/2871ea08096cba15546f357d0ec473734ee9d8be/templates/org/menu.tmpl#L19-L40

And because of the reuse of user projects page, User Context is changed
to Organization Context. But the value of `IsOrganizationMember` and
`IsOrganizationOwner` are not being given.

I reused func `HandleOrgAssignment` to add them to the ctx, but may have
some unnecessary variables, idk whether it is ok.

I found there is a missing `PageIsViewProjects` at create project page.

Co-authored-by: yp05327 <576951401@qq.com>
19 months agoHandle OpenID discovery URL errors a little nicer when creating/editing sources ...
Giteabot [Fri, 10 Mar 2023 14:29:28 +0000 (09:29 -0500)]
Handle OpenID discovery URL errors a little nicer when creating/editing sources (#23397) (#23403)

Backport #23397

When there is an error creating a new openIDConnect authentication
source try to handle the error a little better.

Close #23283

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
19 months agoFix broken Chroma CSS styles (#23174) (#23402)
Giteabot [Fri, 10 Mar 2023 11:45:07 +0000 (06:45 -0500)]
Fix broken Chroma CSS styles (#23174) (#23402)

Backport #23174

The CSS styles in Gitea themes are out-of-sync of Chroma's styles.

This PR introduces a `chroma-style-diff.go` tool to compare the diff.
The missing CSS styles have been added manually. They are left as empty
to reduce arguments because there was no color for them before.

And this PR fixes #22348, with just 2 lines changed: `.chroma .kt & .n`,
these colors are taken from GitHub.

It's good enough for #22348

![image](https://user-images.githubusercontent.com/2114189/221551941-0d27d11d-e71e-498f-8e88-92b558fe4a18.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
19 months agoRefactor and tidy-up the merge/update branch code (#22568) (#23365)
Giteabot [Fri, 10 Mar 2023 03:15:39 +0000 (22:15 -0500)]
Refactor and tidy-up the merge/update branch code (#22568) (#23365)

Backport #22568

The merge and update branch code was previously a little tangled and had
some very long functions. The functions were not very clear in their
reasoning and there were deficiencies in their logging and at least one
bug in the handling of LFS for update by rebase.

This PR substantially refactors this code and splits things out to into
separate functions. It also attempts to tidy up the calls by wrapping
things in "context"s. There are also attempts to improve logging when
there are errors.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: delvh <dev.lh@web.de>
19 months agoRename `canWriteUnit` to `canWriteProjects` (#23386) (#23399)
Giteabot [Fri, 10 Mar 2023 02:21:12 +0000 (21:21 -0500)]
Rename `canWriteUnit` to `canWriteProjects` (#23386) (#23399)

Backport #23386

A part of https://github.com/go-gitea/gitea/pull/22865

Co-authored-by: yp05327 <576951401@qq.com>
19 months agoFix incorrect NotFound conditions in org/projects.go (#23384) (#23395)
Giteabot [Thu, 9 Mar 2023 19:56:31 +0000 (14:56 -0500)]
Fix incorrect NotFound conditions in org/projects.go (#23384) (#23395)

Backport #23384

A part of https://github.com/go-gitea/gitea/pull/22865

user/org project's `RepoID` is always 0, we need to check `OwnerID`

Co-authored-by: yp05327 <576951401@qq.com>
19 months agoSet `X-Gitea-Debug` header once (#23361) (#23381)
Giteabot [Wed, 8 Mar 2023 22:33:05 +0000 (17:33 -0500)]
Set `X-Gitea-Debug` header once (#23361) (#23381)

19 months agoFix panic when getting notes by ref (#23372) (#23377)
Giteabot [Wed, 8 Mar 2023 20:17:31 +0000 (15:17 -0500)]
Fix panic when getting notes by ref (#23372) (#23377)

Backport #23372

Fix #23357 .

Now the `/repos/{owner}/{repo}/git/notes/{sha}` API supports getting
notes by a ref or sha
(https://try.gitea.io/api/swagger#/repository/repoGetNote). But the
`GetNote` func can only accept commit ID.

https://github.com/go-gitea/gitea/blob/a12f5757372f751d25f9e5ca1f168f6920ded894/modules/git/notes_nogogit.go#L18

So we need to convert the query parameter to commit ID before calling
`GetNote`.

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoPass context to avatar for projects view (#23359) (#23378)
delvh [Wed, 8 Mar 2023 17:57:09 +0000 (18:57 +0100)]
Pass context to avatar for projects view (#23359) (#23378)

Backport of #23359.

Previously, a 500 response was returned when

- an issue had assignees
- the issue was assigned to a project
- you tried to view this project

19 months ago Fix incorrect display for comment context menu (#23343) (#23344)
wxiaoguang [Wed, 8 Mar 2023 15:18:53 +0000 (23:18 +0800)]
 Fix incorrect display for comment context menu (#23343) (#23344)

Backport #23343

Fix a regression of #23014: the `a` couldn't be used here because
Fomantic UI has style conflicts: `.ui.comments .comment .actions a {
display: inline-block; }`

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoDo not recognize text files as audio (#23355) (#23368)
Giteabot [Wed, 8 Mar 2023 08:03:05 +0000 (03:03 -0500)]
Do not recognize text files as audio (#23355) (#23368)

Backport #23355

Close #17108

This PR uses a trick (removing the ID3 tag) to detect the content again
to to see whether the content is text type.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoFix adding of empty class name (#23352) (#23360)
Giteabot [Tue, 7 Mar 2023 22:15:19 +0000 (17:15 -0500)]
Fix adding of empty class name (#23352) (#23360)

Backport #23352

This PR is to fix the error shown below. The reason is because
[`class-name`
prop](https://github.com/go-gitea/gitea/blob/main/web_src/js/components/ActionRunStatus.vue#L6)
given to `svg` component has a space, and classList cannot add empty
string.

https://user-images.githubusercontent.com/17645053/223346720-c7f9de43-5e69-4ecf-93c0-90bf04090693.mov

Co-authored-by: Hester Gong <hestergong@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoFix various ImageDiff/SVG bugs (#23312) (#23358)
Giteabot [Tue, 7 Mar 2023 13:38:13 +0000 (08:38 -0500)]
Fix various ImageDiff/SVG bugs (#23312) (#23358)

Backport #23312

Replace #23310, Close #19733

And fix various UI problems, including regressions from #22959 #22950
and more.

## SVG Detection

The old regexp may mismatch non-SVG files. This PR adds new tests for
those cases.

## UI Changes

### Before

![image](https://user-images.githubusercontent.com/2114189/222967716-f6ad8721-f46a-4a3f-9eb0-a89e488d3436.png)

![image](https://user-images.githubusercontent.com/2114189/222967780-8af8981a-e69d-4304-9dc4-0235582fa4f4.png)

### After

![image](https://user-images.githubusercontent.com/2114189/222967575-c21c23d4-0200-4e09-aac3-57895e853000.png)

![image](https://user-images.githubusercontent.com/2114189/222967585-8b8da262-bc96-441a-9851-8d3845f2659d.png)

![image](https://user-images.githubusercontent.com/2114189/222967595-58d9bea5-6df4-41fa-bf8a-86704117959d.png)

![image](https://user-images.githubusercontent.com/2114189/222967608-38757c1a-b8bd-4ebf-b7a8-3b30edb7f303.png)

![image](https://user-images.githubusercontent.com/2114189/222967623-9849a339-6fae-4484-8fa5-939e2fdacbf5.png)

![image](https://user-images.githubusercontent.com/2114189/222967633-4383d7dd-62ba-47a3-8c10-86f7ca7757ae.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoRefactor `setting.Database.UseXXX` to methods (#23354) (#23356)
Giteabot [Tue, 7 Mar 2023 12:11:44 +0000 (07:11 -0500)]
Refactor `setting.Database.UseXXX` to methods (#23354) (#23356)

Backport #23354

Replace #23350.

Refactor `setting.Database.UseMySQL` to
`setting.Database.Type.IsMySQL()`.

To avoid mismatching between `Type` and `UseXXX`.

This refactor can fix the bug mentioned in #23350, so it should be
backported.

Co-authored-by: Jason Song <i@wolfogre.com>
19 months agoFix cannot reopen after pushing commits to a closed PR (#23189) (#23324)
sillyguodong [Tue, 7 Mar 2023 10:47:23 +0000 (18:47 +0800)]
Fix cannot reopen after pushing commits to a closed PR (#23189) (#23324)

Backport: #23189
Close: #22784

1. On GH, we can reopen a PR which was closed before after pushing
commits. After reopening PR, we can see the commits that were pushed
after closing PR in the time line. So the case of
[issue](https://github.com/go-gitea/gitea/issues/22784) is a bug which
needs to be fixed.

2. After closing a PR and pushing commits, `headBranchSha` is not equal
to `sha`(which is the last commit ID string of reference). If the
judgement exists, the button of reopen will not display. So, skip the
judgement if the status of PR is closed.

![image](https://user-images.githubusercontent.com/33891828/222037529-651fccf9-0bba-433e-b2f0-79c17e0cc812.png)

3. Even if PR is already close, we should still insert comment record
into DB when we push commits.
So we should still call  function `CreatePushPullComment()`.

https://github.com/go-gitea/gitea/blob/067b0c2664d127c552ccdfd264257caca4907a77/services/pull/pull.go#L260-L282
So, I add a switch(`includeClosed`) to the
`GetUnmergedPullRequestsByHeadInfo` func to control whether the status
of PR must be open. In this case, by setting `includeClosed` to `true`,
we can query the closed PR.

![image](https://user-images.githubusercontent.com/33891828/222621045-bb80987c-10c5-4eac-aa0c-1fb9c6aefb51.png)

4. In the loop of comments, I use the`latestCloseCommentID` variable to
record the last occurrence of the close comment.
In the go template, if the status of PR is closed, the comments whose
type is `CommentTypePullRequestPush(29)` after `latestCloseCommentID`
won't be rendered.

![image](https://user-images.githubusercontent.com/33891828/222058913-c91cf3e3-819b-40c5-8015-654b31eeccff.png)
e.g.
1). The initial status of the PR is opened.

![image](https://user-images.githubusercontent.com/33891828/222453617-33c5093e-f712-4cd6-8489-9f87e2075869.png)
2). Then I click the button of `Close`. PR is closed now.

![image](https://user-images.githubusercontent.com/33891828/222453694-25c588a9-c121-4897-9ae5-0b13cf33d20b.png)
3). I try to push a commit to this PR, even though its current status is
closed.

![image](https://user-images.githubusercontent.com/33891828/222453916-361678fb-7321-410d-9e37-5a26e8095638.png)
But in comments list, this commit do not display.This is as expected :)

![image](https://user-images.githubusercontent.com/33891828/222454169-7617a791-78d2-404e-be5e-77d555f93313.png)
4). Click the `Reopen` button, the commit which is pushed after closing
PR display now.

![image](https://user-images.githubusercontent.com/33891828/222454533-897893b6-b96e-4701-b5cb-b1800f382b8f.png)

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoFix PR view misalignment caused by long name file (#23321) (#23335)
Giteabot [Tue, 7 Mar 2023 03:11:55 +0000 (22:11 -0500)]
Fix PR view misalignment caused by long name file (#23321) (#23335)

Backport #23321

Close #23248

The UI after this PR:

https://user-images.githubusercontent.com/17645053/223009758-7f0c9f12-d346-4cb2-a605-729fddce732f.mov

Co-authored-by: Hester Gong <hestergong@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoUpdate documentation for the new YAML label file format (#23020) (#23341)
Giteabot [Mon, 6 Mar 2023 23:52:29 +0000 (18:52 -0500)]
Update documentation for the new YAML label file format  (#23020) (#23341)

Backport #23020

update documentation to include an overview of the yaml label template
that is part of PR #22976

Signed-off-by: Jon Roadley-Battin <jon.roadleybattin@gmail.com>
Co-authored-by: JonRB <4564448+eeyrjmr@users.noreply.github.com>
Co-authored-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
19 months agoRemove unnecessary space on link (#23334) (#23340)
Giteabot [Mon, 6 Mar 2023 21:35:51 +0000 (16:35 -0500)]
Remove unnecessary space on link (#23334) (#23340)

Backport #23334

The action run title has a blank. This PR removes it.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoFix incorrect redirect link of delete org project (#23327) (#23339)
Giteabot [Mon, 6 Mar 2023 21:05:42 +0000 (16:05 -0500)]
Fix incorrect redirect link of delete org project (#23327) (#23339)

Backport #23327

A part of https://github.com/go-gitea/gitea/pull/22865/commits

The old code will cause 500 error.

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
19 months agoFix incorrect project links and use symlink icon for org-wide projects (#23325) ...
Giteabot [Mon, 6 Mar 2023 19:48:04 +0000 (14:48 -0500)]
Fix incorrect project links and use symlink icon for org-wide projects (#23325) (#23336)

Backport #23325

Fix displaying same projects icons between user/repo projects.
And fix incorrect projects links.
A part of https://github.com/go-gitea/gitea/pull/22865.

![image](https://user-images.githubusercontent.com/18380374/223044279-7b620ff1-d88a-4146-97e6-531bbf269761.png)

![image](https://user-images.githubusercontent.com/18380374/223044390-42911e3f-1f6b-439f-8441-4f3ebf99ea13.png)

![image](https://user-images.githubusercontent.com/18380374/223044437-5cad5391-0f95-4c8b-b0a3-32e263e2854f.png)

Co-authored-by: yp05327 <576951401@qq.com>
19 months agoScoped labels: don't require holding alt key to remove (#23303) (#23331)
Giteabot [Mon, 6 Mar 2023 18:59:53 +0000 (13:59 -0500)]
Scoped labels: don't require holding alt key to remove (#23303) (#23331)

Backport #23303

Alt doesn't work on all browsers, the simplest solution for v1.19 is to
just not require it and toggle the label by just clicking.

Part of #22974

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
19 months agoFix broken code editor diff preview (#23307) (#23320)
Giteabot [Mon, 6 Mar 2023 18:05:35 +0000 (13:05 -0500)]
Fix broken code editor diff preview (#23307) (#23320)

Backport #23307

Close #23265, the code editor diff preview has been broken for long
time.

* Fix the regression for `data-line-num`
    * `.code-diff` is necessary to show the line number
* Fix the regression for #12434
* The diff:
[12434](https://github.com/go-gitea/gitea/pull/12434/files?diff=unified&w=1)
    * It hides the Type(4) (aka HunkHeader)  for unexpected cases.

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

Before: see the issue #23265

After:

![image](https://user-images.githubusercontent.com/2114189/222942810-286dc9af-0b39-4e9d-8585-8c299b881241.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoAdd context when rendering labels or emojis (#23281) (#23319)
Giteabot [Mon, 6 Mar 2023 16:32:40 +0000 (11:32 -0500)]
Add context when rendering labels or emojis (#23281) (#23319)

Backport #23281

This branch continues the work of #23092 and attempts to rid the
codebase of any `nil` contexts when using a `RenderContext`.

Anything that renders markdown or does post processing may call
`markup.sha1CurrentPatternProcessor()`, and this runs
`git.OpenRepository()`, which needs a context. It will panic if the
context is `nil`. This branch attempts to _always_ include a context
when creating a `RenderContext` to prevent future crashes.

Co-authored-by: Jonathan Tran <jon@allspice.io>
19 months agoProperly flush unique queues on startup (#23154) (#23201)
Giteabot [Mon, 6 Mar 2023 14:35:07 +0000 (09:35 -0500)]
Properly flush unique queues on startup (#23154) (#23201)

Backport #23154

There have been a number of reports of PRs being blocked whilst being
checked which have been difficult to debug. In investigating #23050 I
have realised that whilst the Warn there is somewhat of a miscall there
was a real bug in the way that the LevelUniqueQueue was being restored
on start-up of the PersistableChannelUniqueQueue.

Next there is a conflict in the setting of the internal leveldb queue
name - This wasn't being set so it was being overridden by other unique
queues.

This PR fixes these bugs and adds a testcase.

Thanks to @brechtvl  for noticing the second issue.

Fix #23050
and others

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: delvh <leon@kske.dev>
19 months agoUpdate hacking-on-gitea-zh_cn documentation (#23315) (#23323)
Giteabot [Mon, 6 Mar 2023 10:44:02 +0000 (05:44 -0500)]
Update hacking-on-gitea-zh_cn documentation (#23315) (#23323)

Backport #23315

This PR fix outdated hacking-on-gitea-zh_cn documentation.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Jason Song <i@wolfogre.com>
19 months agoChange interactiveBorder to fix popup preview (#23169) (#23314)
Giteabot [Mon, 6 Mar 2023 08:45:43 +0000 (03:45 -0500)]
Change interactiveBorder to fix popup preview  (#23169) (#23314)

Backport #23169

Close #23073.
Used the solution as reference to the reply:
https://github.com/go-gitea/gitea/issues/23073#issuecomment-1440124609
Here made the change inside the `contextpopup.js` because this is where
the popup component is created and tippy configuration is given.

Co-authored-by: Hester Gong <hestergong@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoScoped labels: set aria-disabled on muted Exclusive option for a11y (#23306) (#23311)
Giteabot [Sun, 5 Mar 2023 15:05:11 +0000 (10:05 -0500)]
Scoped labels: set aria-disabled on muted Exclusive option for a11y (#23306) (#23311)

Backport #23306

It is convenient to be able to toggle off this option after removing /
from the name. This ensures the muted state is communicated to blind
users even when the input is not fully disabled.

Part of #22974

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoAdd basic documentation for labels, including scoped labels (#23304) (#23309)
Giteabot [Sun, 5 Mar 2023 12:38:46 +0000 (07:38 -0500)]
Add basic documentation for labels, including scoped labels (#23304) (#23309)

Backport #23304

Part of #22974

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: delvh <dev.lh@web.de>
19 months agoFix various bugs for "install" page (#23194) (#23286) v1.19.0-rc1
Giteabot [Sun, 5 Mar 2023 10:59:58 +0000 (05:59 -0500)]
Fix various bugs for "install" page (#23194) (#23286)

Backport #23194

## TLDR

* Fix the broken page / broken image problem when click "Install"
* Fix the Password Hash Algorithm display problem for #22942
* Close #20089
* Close #23183
* Close #23184

## Details

### The broken page / broken image problem when clicking on "Install"
(Redirect failed after install - #23184)

Before: when clicking on "install", all new requests will fail, because the
server has been restarted. Users just see a broken page with broken
images, sometimes the server is not ready but the user would have been
redirect to "/user/login" page, then the users see a new broken page
(connection refused or something wrong ...)

After: only check InstallLock=true for necessary handlers, and sleep for
a while before restarting the server, then the browser has enough time
to load the "post-install" page. And there is a script to check whether
"/user/login" is ready, the user will only be redirected to the login
page when the server is ready.

### During new instance setup fill 'Gitea Base URL' with
window.location.origin - #20089

If the "app_url" input contains `localhost` (the default value from
config), use current window's location href as the `app_url` (aka
ROOT_URL)

### Fix the Password Hash Algorithm display problem for "Provide the
ability to set password hash algorithm parameters #22942"

Before: the UI shows `pbkdf2$50000$50`

<details>

![image](https://user-images.githubusercontent.com/2114189/221917143-e1e54798-1698-4fee-a18d-00c48081fc39.png)

</details>

After: the UI shows `pbkdf2`

<details>

![image](https://user-images.githubusercontent.com/2114189/221916999-97a15be8-2ebb-4a01-bf93-dac18e354fcc.png)

</details>

### GET data: net::ERR_INVALID_URL #23183

Cause by empty `data:` in `<link rel="manifest"
href="data:{{.ManifestData}}">`

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoSupport sanitising the URL by removing extra slashes in the URL (#21333) (#23300)
Giteabot [Sun, 5 Mar 2023 07:14:12 +0000 (02:14 -0500)]
Support sanitising the URL by removing extra slashes in the URL (#21333) (#23300)

Backport #21333

Changes in this PR :

Strips incoming request URL of additional slashes (/). For example an
input like

`https://git.data.coop//halfd/new-website.git` is translated to
`https://git.data.coop/halfd/new-website.git`

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

Fix #23242

Co-authored-by: Sandeep Bhat <sandyethadka@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <leon@kske.dev>
19 months agoupdate to mermaid v10 (#23178) (#23299)
Giteabot [Sun, 5 Mar 2023 07:13:50 +0000 (02:13 -0500)]
update to mermaid v10 (#23178) (#23299)

Backport #23178

fix #23153

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <leon@kske.dev>
19 months agoRe-add accidentally removed `hacking-on-gitea.zh-cn.md` (#23297) (#23305)
Giteabot [Sun, 5 Mar 2023 01:09:58 +0000 (20:09 -0500)]
Re-add accidentally removed `hacking-on-gitea.zh-cn.md` (#23297) (#23305)

19 months agoFix code wrap for unbroken lines (#23268) (#23293)
Giteabot [Sat, 4 Mar 2023 19:55:12 +0000 (14:55 -0500)]
Fix code wrap for unbroken lines (#23268) (#23293)

Backport #23268

## The Problem

`overflow-wrap: break-word` doesn't work well for unbroken lines. Use
`overflow-wrap: anywhere` instead, and remove legacy alias `word-wrap`

## Before

![image](https://user-images.githubusercontent.com/2114189222743939-5f38d9e4-18d8-4ae0-8078-4b3a59195a30.png)

## After

![image](https://user-images.githubusercontent.com/2114189/222743833-0e0cfdbb-7b2e-420d-99f9-b1b45dde521a.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
19 months agoFill head commit to in payload when notifying push commits for mirroring (#23215...
Giteabot [Sat, 4 Mar 2023 18:02:50 +0000 (13:02 -0500)]
Fill head commit to in payload when notifying push commits for mirroring (#23215) (#23292)

Backport #23215

Just like what has been done when pushing manually:

https://github.com/go-gitea/gitea/blob/7a5af25592003ddc3017fcd7b822a3e02fc40ef6/services/repository/push.go#L225-L226

Before:

<img width="448" alt="image"
src="https://user-images.githubusercontent.com/9418365/222100123-cd4839d1-2d4d-45f7-7a0-0cbc73162b44.png">

After:

<img width="448" alt="image"
src="https://user-images.githubusercontent.com/9418365/222100225-3c5bb65-7ab9-41e2-8e39-9d84c23c352d.png">

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoAvoid panic caused by broken payload when creating commit status (#23216) (#23294)
Giteabot [Sat, 4 Mar 2023 14:23:49 +0000 (09:23 -0500)]
Avoid panic caused by broken payload when creating commit status (#23216) (#23294)

Backport #23216

When creating commit status for Actons jobs, a payload with nil
`HeadCommit` will cause panic.

Reported at:
https://gitea.com/gitea/act_runner/issues/28#issuecomment-732166

Although the `HeadCommit` probably can not be nil after #23215,
`CreateCommitStatus` should protect itself, to avoid being broken in the
future.

In addition, it's enough to print error log instead of returning err
when `CreateCommitStatus` failed.

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: delvh <dev.lh@web.de>
19 months agoFix GetFilesChangedBetween if the file name may be escaped (#23272) (#23279)
Giteabot [Sat, 4 Mar 2023 05:38:31 +0000 (00:38 -0500)]
Fix GetFilesChangedBetween if the file name may be escaped (#23272) (#23279)

Backport #23272

The code for GetFilesChangedBetween uses `git diff --name-only
base..head` to get the names of files changed between base and head
however this forgets that git will escape certain values.

This PR simply switches to use `-z` which has the `NUL` character as the
separator.

Ref https://github.com/go-gitea/gitea/pull/22568#discussion_r1123138096

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoUse correct README link to render the README (#23152) (#23264)
Giteabot [Sat, 4 Mar 2023 05:38:11 +0000 (00:38 -0500)]
Use correct README link to render the README (#23152) (#23264)

Backport #23152

`renderReadmeFile` needs `readmeTreelink` as parameter but gets
`treeLink`.
The values of them look like as following:
`treeLink`:  `/{OwnerName}/{RepoName}/src/branch/{BranchName}`
`readmeTreelink`:
`/{OwnerName}/{RepoName}/src/branch/{BranchName}/{ReadmeFileName}`

`path.Dir` in

https://github.com/go-gitea/gitea/blob/8540fc45b11eff9a73753ca139f8ea5c38509bf5/routers/web/repo/view.go#L316
should convert `readmeTreelink` into
`/{OwnerName}/{RepoName}/src/branch/{BranchName}` instead of the current
`/{OwnerName}/{RepoName}/src/branch`.

Fixes #23151

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
19 months agoFix commit retrieval by tag (#21804) (#23266)
Giteabot [Fri, 3 Mar 2023 19:42:46 +0000 (14:42 -0500)]
Fix commit retrieval by tag (#21804) (#23266)

Backport #21804

It is not correct to return tag data when commit data is requested, so
remove the hacky code that overwrote parts of a commit with parts of a
tag.

This fixes commit retrieval by tag for both the latest commit in the UI
and the commit info on tag webhook events.

Fixes: https://github.com/go-gitea/gitea/issues/21687
Replaces: https://github.com/go-gitea/gitea/pull/21693

<img width="324" alt="Screenshot 2022-11-13 at 15 26 37"
src="https://user-images.githubusercontent.com/115237/201526975-736c6ea7-ad6a-467a-a823-9a63d6ecb718.png">

<img width="789" alt="image"
src="https://user-images.githubusercontent.com/115237/201526876-90a13ffc-1e5c-4d76-911b-f1ae51e8eaab.png">

Co-authored-by: silverwind <me@silverwind.io>
19 months agoRevert relative links to absolute links in mail templates (#23267) (#23269)
Giteabot [Fri, 3 Mar 2023 17:41:00 +0000 (12:41 -0500)]
Revert relative links to absolute links in mail templates (#23267) (#23269)

Backport #23267

Follow #21986 , fix regression.

The mail templates should always use `AppURL` (the full absolute URL)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoUse async await to fix empty quote reply at first time (#23168) (#23256)
Giteabot [Thu, 2 Mar 2023 22:36:21 +0000 (17:36 -0500)]
Use async await to fix empty quote reply at first time (#23168) (#23256)

Backport #23168

The reason why quote reply is empty is when quote reply is clicked, it
triggers the click function on `.comment-form-reply` button, and when
the first time this function is triggered, easyMDE for the reply has not
yet initialized, so that click handler of `.quote-reply` button in
`repo-legacy.js` got an `undefined` as easyMDE, and the following lines
which put quoted reply into the easyMDE is not executed.
The workaround in this PR is to pass the replied content to
'.comment-form-reply' button if easyMDE is not yet initialized (quote
reply first clicked) and put the replied content into it the after
easyMDE is created.
Now quote reply on first click:

https://user-images.githubusercontent.com/17645053/221452823-fc699d50-1649-4af1-952e-f04fc8d2978e.mov

<br />

Update:
The above change is not appropriate as stated in the
[comment](https://github.com/go-gitea/gitea/pull/23168#issuecomment-1445562284)
Use await instead

Close #22075.
Close #23247.

Co-authored-by: HesterG <hestergong@gmail.com>
19 months agoFix switched citation format (#23250) (#23253)
Giteabot [Thu, 2 Mar 2023 20:05:10 +0000 (15:05 -0500)]
Fix switched citation format (#23250) (#23253)

Backport #23250

Due to switched input parameters, the citation texts for Bibtex and Apa
were switched.
This pull request fixes #23244

Co-authored-by: Blender Defender <contact.blenderdefender@gmail.com>
19 months agoFix missed `.hide` class (#23208) (#23237)
Giteabot [Thu, 2 Mar 2023 17:45:42 +0000 (12:45 -0500)]
Fix missed `.hide` class (#23208) (#23237)

Backport #23208

https://github.com/go-gitea/gitea/pull/22950 removed `hide` class, and
use `gt-hidden`
But there are some missed `hide`....

Co-authored-by: yp05327 <576951401@qq.com>
19 months agoAllow `<video>` in MarkDown (#22892) (#23236)
Giteabot [Thu, 2 Mar 2023 16:49:05 +0000 (11:49 -0500)]
Allow `<video>` in MarkDown (#22892) (#23236)

Backport #22892

As you can imagine, for the Blender development process it is rather
nice to be able to include videos in issues, pull requests, etc.

This PR allows the `<video>` HTML tag to be used in MarkDown, with the
`src`, `autoplay`, and `controls` attributes.

## Help Needed

To have this fully functional, personally I feel the following things
are still missing, and would appreciate some help from the Gitea team.

### Styling

Some CSS is needed, but I couldn't figure out which of the LESS files
would work. I tried `web_src/less/markup/content.less` and
`web_src/less/_base.less`, but after running `make` the changes weren't
seen in the frontend.

This I would consider a minimal set of CSS rules to be applied:

```css
video {
  max-width: 100%;
  max-height: 100vh;
}
```

### Default Attributes

It would be fantastic if Gitea could add some default attributes to the
`<video>` tag. Basically `controls` should always be there, as there is
no point in disallowing scrolling through videos, looping them, etc.

### Integration with the attachments system

Another thing that could be added, but probably should be done in a
separate PR, is the integration with the attachments system. Dragging in
a video should attach it, then generate the appropriate MarkDown/HTML.

Co-authored-by: Sybren <122987084+drsybren@users.noreply.github.com>
19 months agoClose the temp file when dumping database to make the temp file can be deleted on...
Giteabot [Thu, 2 Mar 2023 16:47:07 +0000 (11:47 -0500)]
Close the temp file when dumping database to make the temp file can be deleted on Windows (#23249) (#23251)

Backport #23249

There was no `dbDump.Close()` before, Windows doesn't like to delete
opened files.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoFix incorrect checkbox behaviors in the dashboard repolist's filter (#23147) (#23205)
Giteabot [Thu, 2 Mar 2023 07:12:33 +0000 (02:12 -0500)]
Fix incorrect checkbox behaviors in the dashboard repolist's filter (#23147) (#23205)

Backport #23147

Co-author: yp05327 , this PR is based on yp05327's #22813.

The problems of the old DashboardRepoList / repolist.tmpl:

* It mixes many different frameworks together
* It "just works", bug on bug
* It uses many anti-pattern of Vue

This PR:

* Fix bugs and close #22800
* Decouple the "checkbox" elements from Fomantic UI (only use CSS
styles)
* Simplify the HTML layout
* Simplify JS logic
* Make it easier to refactor the DashboardRepoList into a pure Vue
component in the future.

### Screenshots

#### Default

![image](https://user-images.githubusercontent.com/2114189/221355768-a3eb5b23-85b4-4e3d-b906-844d8b15539d.png)

####  Click "Archived" to make it checked

![image](https://user-images.githubusercontent.com/2114189/221355777-9a104ddf-52a7-4504-869a-43a73827d802.png)

####  Click "Archived" to make it intermediate

![image](https://user-images.githubusercontent.com/2114189/221355802-0f67a073-67ad-4e92-84a6-558c432103a5.png)

####  Click "Archived" to make it unchecked

![image](https://user-images.githubusercontent.com/2114189/221355810-acf1d9d8-ccce-47fe-a02e-70cf4e666331.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoOrder pull request conflict checking by recently updated, for each push (#23220)...
Giteabot [Thu, 2 Mar 2023 05:12:41 +0000 (00:12 -0500)]
Order pull request conflict checking by recently updated, for each push (#23220) (#23225)

Backport #23220

When a change is pushed to the default branch and many pull requests are
open for that branch, conflict checking can take some time.

Previously it would go from oldest to newest pull request. Now
prioritize pull requests that are likely being actively worked on or
prepared for merging.

This only changes the order within one push to one repository, but the
change is trivial and can already be quite helpful for smaller Gitea
instances where a few repositories have most pull requests. A global
order would require deeper changes to queues.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoAdd loading yaml label template files (#22976) (#23232)
Giteabot [Thu, 2 Mar 2023 02:57:34 +0000 (21:57 -0500)]
Add loading yaml label template files (#22976) (#23232)

Backport #22976

Extract from #11669 and enhancement to #22585 to support exclusive
scoped labels in label templates

* Move label template functionality to label module
* Fix handling of color codes
* Add Advanced label template

Co-authored-by: Lauris BH <lauris@nix.lv>
19 months agoDo not create commit graph for temporary repos (#23219) (#23229)
Giteabot [Wed, 1 Mar 2023 23:53:41 +0000 (18:53 -0500)]
Do not create commit graph for temporary repos (#23219) (#23229)

Backport #23219

When fetching remotes for conflict checking, skip unnecessary and
potentially slow writing of commit graphs.

In a test with the Blender repository, this reduces conflict checking
time for one pull request from about 2s to 0.1s.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
19 months agoUse the correct selector to hide the checkmark of selected labels on clear (#23224...
Giteabot [Wed, 1 Mar 2023 20:59:36 +0000 (15:59 -0500)]
Use the correct selector to hide the checkmark of selected labels on clear (#23224) (#23228)

Backport #23224

Regression of #10107
(https://github.com/go-gitea/gitea/pull/10107/files#diff-a15e36f2f9c13339f7fdd38bc2887db2ff2945cb8434464318ab9105fcc846bdR460)

Fix #22222

Before: the "clear" action couldn't remove these check marks.

![image](https://user-images.githubusercontent.com/2114189/222212998-c9f33459-b71d-4e80-8588-2935f3b7050c.png)

After: the "clear" action can remove these  check marks.

![image](https://user-images.githubusercontent.com/2114189/222213048-2be98ed0-cac0-4e27-b72c-1dd0ac2637d5.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoChange button text for commenting and closing an issue at the same time (#23135)...
Yarden Shoham [Tue, 28 Feb 2023 22:54:24 +0000 (00:54 +0200)]
Change button text for commenting and closing an issue at the same time (#23135) (#23182)

Backport #23135

Close  #10468

Without SimpleMDE/EasyMDE, using Simple Textarea, the button text could
be changed when content changes.

After introducing SimpleMDE/EasyMDE, there is no code for updating the
button text.

![image](https://user-images.githubusercontent.com/2114189/221334034-8d556cd5-1136-4ba0-8faa-a65ffadd7fb7.png)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoFix Fomantic UI's `touchstart` fastclick, always use `click` for click events (#23065...
wxiaoguang [Tue, 28 Feb 2023 22:53:45 +0000 (06:53 +0800)]
Fix Fomantic UI's `touchstart` fastclick, always use `click` for click events (#23065) (#23195)

Backport #23065

Using `touchstart` for `click` events is a black magic for mobile
browsers (Google: `fastclick`).

However, it causes many UX problems if the fastclick is used without
careful design.

Fomantic UI uses this fastclick for its `dimmer` and `dropdown`, it
makes mobile users feel strange when they "touch" the dropdown menu.

This PR uses a simple patch to fix that behavior. Then the Fomantic
dropdown only uses `click` for click events.

This PR is simple enough and won't cause hidden bugs even if the patch
doesn't work. In the future, if there are more patches for Fomantic UI,
the patches could be placed in a directory like
`web_src/fomantic/patches/001-fix-click-touchstart`, etc.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoPass `--global` when calling `git config --get`, for consistency with `git config...
Giteabot [Tue, 28 Feb 2023 22:53:15 +0000 (17:53 -0500)]
Pass `--global` when calling `git config --get`, for consistency with `git config --set` (#23157) (#23199)

Backport #23157

This arose out of #22451; it seems we are checking using non-global
settings to see if a config value is set, in order to decide whether to
call another global(-indeed) configuration command. This PR changes it
so that both the check and the set are for global configuration.

Co-authored-by: Philip Peterson <philip-peterson@users.noreply.github.com>
19 months agoMake `gitea serv` respect git binary home (#23138) (#23197)
Giteabot [Tue, 28 Feb 2023 22:46:23 +0000 (17:46 -0500)]
Make `gitea serv` respect git binary home (#23138) (#23197)

Backport #23138

Close #23137

The old code is too old (8-9 years ago)

Let's try to execute the git commands from git bin home directly.

The verb has been checked above, it could only be:
* git-upload-pack
* git-upload-archive
* git-receive-pack
* git-lfs-authenticate

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoAvoid too long names for actions (#23162) (#23190)
Yarden Shoham [Tue, 28 Feb 2023 12:42:40 +0000 (14:42 +0200)]
Avoid too long names for actions (#23162) (#23190)

Backport #23162

The name of the job or step comes from the workflow file, while the name
of the runner comes from its registration. If the strings used for these
names are too long, they could cause db issues.

Co-authored-by: Jason Song <i@wolfogre.com>
19 months agoAdd InsecureSkipVerify to Minio Client for Storage (#23166) (#23177)
Yarden Shoham [Mon, 27 Feb 2023 22:29:17 +0000 (00:29 +0200)]
Add InsecureSkipVerify to Minio Client for Storage (#23166) (#23177)

Backport #23166

Allows using Minio with untrusted certificates

Closes #23128

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>