]> source.dussan.org Git - gitea.git/log
gitea.git
15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 13 Jul 2023 00:29:39 +0000 (00:29 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoRemove `git.FileBlame` (#25841)
Jason Song [Wed, 12 Jul 2023 17:07:29 +0000 (01:07 +0800)]
Remove `git.FileBlame` (#25841)

The `FileBlame` function looks strange, it has `revision` as argument
but doesn't use it.

Since the function never be used, I think we could just remove it.

If anyone thinks it should be kept, please help fix `revision`.

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoFix empty project displayed in issue sidebar (#25802)
yp05327 [Wed, 12 Jul 2023 14:10:35 +0000 (23:10 +0900)]
Fix empty project displayed in issue sidebar (#25802)

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/1ab476dc-2f9b-4c85-9e87-105fc73af1ee)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/786f984d-5c27-4eff-b3d9-159f68034ce4)

This issue comes from the change in #25468.
`LoadProject` will always return at least one record, so we use
`ProjectID` to check whether an issue is linked to a project in the old
code.
As other `issue.LoadXXX` functions, we need to check the return value
from `xorm.Session.Get`.

In recent unit tests, we only test `issueList.LoadAttributes()` but
don't test `issue.LoadAttributes()`. So I added a new test for
`issue.LoadAttributes()` in this PR.

---------

Co-authored-by: Denys Konovalov <privat@denyskon.de>
15 months agoUpdate blog links (#25843)
HesterG [Wed, 12 Jul 2023 11:35:07 +0000 (19:35 +0800)]
Update blog links (#25843)

As title. Permalinks for lastest version of blog has changed, update the
blog links.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoFix margin on the `new/edit milestone` page (#25801)
puni9869 [Wed, 12 Jul 2023 10:36:56 +0000 (16:06 +0530)]
Fix margin on the `new/edit milestone` page (#25801)

There is some distortion in desktop and mobile ui for new/edit milestone
page.
Fixing the new/edit milestone page for desktop and mobile ui

Design background
https://uxplanet.org/primary-secondary-action-buttons-c16df9b36150
https://balsamiq.com/learn/articles/button-design-best-practices/

<details>
  <summary>Screen shots</summary>

Before:

![image](https://github.com/go-gitea/gitea/assets/80308335/c8627679-da2d-465f-bc8f-978d7b836919)

![image](https://github.com/go-gitea/gitea/assets/80308335/43b54599-2856-440a-a13c-08bb3cedf35c)

After

![image](https://github.com/go-gitea/gitea/assets/80308335/85ca3d32-4842-41bc-8647-aa4222b9cc06)

![image](https://github.com/go-gitea/gitea/assets/80308335/c00e87c4-e64e-4b18-aa42-d26c3942a21b)

</details>

---------

Co-authored-by: Denys Konovalov <privat@denyskon.de>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoDo not "guess" the file encoding/BOM when using API to upload files (#25828)
wxiaoguang [Wed, 12 Jul 2023 09:58:27 +0000 (17:58 +0800)]
Do not "guess" the file encoding/BOM when using API to upload files (#25828)

Related issue: #18368

It doesn't seem right to "guess" the file encoding/BOM when using API to
upload files.

The API should save the uploaded content as-is.

15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 12 Jul 2023 00:32:23 +0000 (00:32 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoShow correct SSL Mode on "install page" (#25818)
wxiaoguang [Tue, 11 Jul 2023 22:09:23 +0000 (06:09 +0800)]
Show correct SSL Mode on "install page" (#25818)

15 months agoFix incorrect oldest sort in project list (#25806)
yp05327 [Tue, 11 Jul 2023 18:47:50 +0000 (03:47 +0900)]
Fix incorrect oldest sort in project list (#25806)

sort type `oldest` should be `Asc`.
Added a test for this.

15 months agoFix the error message when the token is incorrect (#25701)
caicandong [Tue, 11 Jul 2023 02:04:28 +0000 (10:04 +0800)]
Fix the error message when the token is incorrect (#25701)

we refactored `userIDFromToken` for the token parsing part into a new
function `parseToken`. `parseToken` returns the string `token` from
request, and a boolean `ok` representing whether the token exists or
not. So we can distinguish between token non-existence and token
inconsistency in the `verfity` function, thus solving the problem of no
proper error message when the token is inconsistent.
close #24439
related #22119

---------

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoExclude default branch from pushed branch hint (#25795)
Lunny Xiao [Mon, 10 Jul 2023 11:18:55 +0000 (19:18 +0800)]
Exclude default branch from pushed branch hint (#25795)

When pushing to default branch, no pushing hint should be prompt.
Fix #25778

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoFor API attachments, use API URL (#25639)
Lunny Xiao [Mon, 10 Jul 2023 09:31:19 +0000 (17:31 +0800)]
For API attachments, use API URL (#25639)

Fix #25257

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoFix WORK_DIR for docker (root) image (#25738)
wxiaoguang [Mon, 10 Jul 2023 08:26:07 +0000 (16:26 +0800)]
Fix WORK_DIR for docker (root) image (#25738)

Fix #25726

#17846 chose an incorrect WORK_DIR path for docker root image.

Gitea's work-path was already used as the base path for various paths
(like AppDataPath), so, the work-path should be mounted to a volume in a
docker image.

Now, for docker root image, it's unavoidable to mix the
WorkPath/CustomPath/AppDataPath in the same directory ("/data/gitea"),
because some of them have already been mixed.

Some directories in the screenshot are for "CustomPath" , while others
are for "AppDataPath", due to the technical debts in old code:

```
CUSTOM_PATH="/data/gitea"
APP_DATA_PATH = /data/gitea
```

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/9f0648ac-f731-4a08-9f26-1af01a1824b1)

</details>

This PR is breaking but this is the only way at the moment to avoid
users losing their data accidently

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoAvoid amending the Rebase and Fast-forward merge if there is no message template...
wxiaoguang [Mon, 10 Jul 2023 08:12:50 +0000 (16:12 +0800)]
Avoid amending the Rebase and Fast-forward merge if there is no message template (#25779)

Related #22669. Close #25177

After the fix:

![image](https://github.com/go-gitea/gitea/assets/2114189/0e900927-ea72-4f8f-bde6-5ed927cb02f4)

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoShow edit title button on commits tab of PR, too (#25791)
sebastian-sauer [Mon, 10 Jul 2023 07:05:59 +0000 (09:05 +0200)]
Show edit title button on commits tab of PR, too (#25791)

All 3 tabs of the PR (Conversation, Commits and Files changed) should
show the edit title button.

Before this commit the edit button was not shown on commits tab

Screenshots:
After:

![image](https://github.com/go-gitea/gitea/assets/1135157/d04c700c-dffc-4bcd-8108-cb64838af0c6)

Before:

![image](https://github.com/go-gitea/gitea/assets/1135157/b6795ad3-c994-461c-98aa-a7331c3e3877)

Just for reference the edit button in files changed tab:

![image](https://github.com/go-gitea/gitea/assets/1135157/5750640d-489f-4a71-8144-543ef42afb42)

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoMake "install page" respect environment config (#25648)
wxiaoguang [Sun, 9 Jul 2023 22:43:37 +0000 (06:43 +0800)]
Make "install page" respect environment config (#25648)

Replace #25580

Fix #19453

The problem was: when users set "GITEA__XXX__YYY" , the "install page"
doesn't respect it.

So, to make the result consistent and avoid surprising end users, now
the "install page" also writes the environment variables to the config
file.

And, to make things clear, there are enough messages on the UI to tell
users what will happen.

There are some necessary/related changes to `environment-to-ini.go`:

* The "--clear" flag is removed and it was incorrectly written there.
The "clear" operation should be done if INSTALL_LOCK=true
* The "--prefix" flag is removed because it's never used, never
documented and it only causes inconsistent behavior.

![image](https://github.com/go-gitea/gitea/assets/2114189/12778ee4-3fb5-4664-a73a-41ebbd77cd5b)

15 months agoEnable H014 and H023 djlint rules (#25786)
silverwind [Sun, 9 Jul 2023 20:33:25 +0000 (22:33 +0200)]
Enable H014 and H023 djlint rules (#25786)

Enable these rules:

- H014 | More than 2 blank lines.
- H023 | Do not use entity references.

There are more potential rules to enable but they are blocked by bugs in
the linter:

- https://github.com/Riverside-Healthcare/djLint/issues/711
- https://github.com/Riverside-Healthcare/djLint/issues/712

15 months agoRestructure issue list template, styles (#25750)
Denys Konovalov [Sun, 9 Jul 2023 19:38:01 +0000 (21:38 +0200)]
Restructure issue list template, styles (#25750)

This PR does various modifications on the issue list shared template:
- restructure layout to achieve better responsiveness
-  fix various style issues
- restructure styles (better result with less code :)
- remove numerous `gt-*` patches and other unneeded classes -> use
existing css classes

<details>
<summary>Before:</summary>

![Bildschirmfoto vom 2023-07-07
14-35-00](https://github.com/go-gitea/gitea/assets/47871822/5301fc80-d58b-41c2-8090-5867e2e8459c)
![Bildschirmfoto vom 2023-07-07
14-35-19](https://github.com/go-gitea/gitea/assets/47871822/d36ab691-7dc4-44bb-a8f6-a4105a2a6777)
![Bildschirmfoto vom 2023-07-07
14-35-43](https://github.com/go-gitea/gitea/assets/47871822/0762c852-eb40-4b00-8757-c5dbfd2ae569)
</details>

<details>
<summary>After:</summary>

![Bildschirmfoto vom 2023-07-07
14-32-04](https://github.com/go-gitea/gitea/assets/47871822/0ac42d36-f98f-451a-b556-70c913d19df8)
![Bildschirmfoto vom 2023-07-07
14-31-32](https://github.com/go-gitea/gitea/assets/47871822/520fac9c-33e3-4290-bfe1-6e941f1100f8)
![Bildschirmfoto vom 2023-07-07
14-31-14](https://github.com/go-gitea/gitea/assets/47871822/05ad46bb-3c67-403d-85b8-d12d64f99c59)

</details>

---------

Co-authored-by: silverwind <me@silverwind.io>
15 months agoFix notification list bugs (#25781)
wxiaoguang [Sun, 9 Jul 2023 18:42:31 +0000 (02:42 +0800)]
Fix notification list bugs (#25781)

Fix #25627

1. `ctx.Data["Link"]` should use relative URL but not AppURL
2. The `data-params` is incorrect because it doesn't contain "page". JS
can simply use "window.location.search" to construct the AJAX URL
3. The `data-xxx` and `id` in notification_subscriptions.tmpl were
copied&pasted, they don't have affect.

15 months agoRevert package access change from #23879 (#25707)
KN4CK3R [Sun, 9 Jul 2023 13:00:07 +0000 (15:00 +0200)]
Revert package access change from #23879 (#25707)

Fixes (?) #25538
Fixes https://codeberg.org/forgejo/forgejo/issues/972

Regression #23879

#23879 introduced a change which prevents read access to packages if a
user is not a member of an organization.

That PR also contained a change which disallows package access if the
team unit is configured with "no access" for packages. I don't think
this change makes sense (at the moment). It may be relevant for private
orgs. But for public or limited orgs that's useless because an
unauthorized user would have more access rights than the team member.
This PR restores the old behaviour "If a user has read access for an
owner, they can read packages".

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoMake route middleware/handler mockable (#25766)
wxiaoguang [Sun, 9 Jul 2023 12:25:53 +0000 (20:25 +0800)]
Make route middleware/handler mockable (#25766)

To mock a handler:

```go
web.RouteMock(web.MockAfterMiddlewares, func(ctx *context.Context) {
// ...
})
defer web.RouteMockReset()
```

It helps:

* Test the middleware's behavior (assert the ctx.Data, etc)
* Mock the middleware's behavior (prepare some context data for handler)
* Mock the handler's response for some test cases, especially for some
integration tests and e2e tests.

15 months agoUpdate tool dependencies, lock govulncheck and actionlint (#25655)
silverwind [Sun, 9 Jul 2023 11:58:06 +0000 (13:58 +0200)]
Update tool dependencies, lock govulncheck and actionlint (#25655)

- Update all tool dependencies
- Lock `govulncheck` and `actionlint` to their latest tags

---------

Co-authored-by: 6543 <m.huber@kithara.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoTest if container blob is accessible before mounting (#22759)
KN4CK3R [Sun, 9 Jul 2023 11:24:43 +0000 (13:24 +0200)]
Test if container blob is accessible before mounting (#22759)

related #16865

This PR adds an accessibility check before mounting container blobs.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
15 months agoAlways pass 6-digit hex color to monaco (#25780)
silverwind [Sun, 9 Jul 2023 10:17:22 +0000 (12:17 +0200)]
Always pass 6-digit hex color to monaco (#25780)

Monaco can not deal with color formats other than 6-digit hex, so we
convert the colors for it via new
[`tinycolor2`](https://github.com/bgrins/TinyColor) dependency (5kB
minzipped).

Also, with the addition of the module, we can replace the existing
`hexToRGBColor` usage, I verified it is compatible with the current
tests before removing the function.

Fixes: https://github.com/go-gitea/gitea/issues/25770
15 months agoFix the wrong default branch name displayed by checkout (#25777)
hiifong [Sun, 9 Jul 2023 09:09:06 +0000 (17:09 +0800)]
Fix the wrong default branch name displayed by checkout (#25777)

Related: #22743

Before:

![image](https://github.com/go-gitea/gitea/assets/89133723/3cec886c-589c-41a8-86af-a08b62b8adef)

After:

![image](https://github.com/go-gitea/gitea/assets/89133723/74ee8adf-fca7-42a0-a67a-ecaa0ba91b4a)

15 months agoTweak repo topics bar (#25769)
silverwind [Sat, 8 Jul 2023 18:12:30 +0000 (20:12 +0200)]
Tweak repo topics bar (#25769)

Minor tweaks to repo topics:

- Use gap instead of margin to align "Manage Topics" when no topics
present
- Add margin to description instead

Before:

<img width="1232" alt="Screenshot 2023-07-08 at 13 08 15"
src="https://github.com/go-gitea/gitea/assets/115237/a5d3586c-6cbf-4b74-8137-11d91f2cbb45">
<img width="1233" alt="Screenshot 2023-07-08 at 13 08 05"
src="https://github.com/go-gitea/gitea/assets/115237/59b18d93-e4cb-4f2b-9bc2-d6aa63f93827">

After:

<img width="1232" alt="Screenshot 2023-07-08 at 13 08 42"
src="https://github.com/go-gitea/gitea/assets/115237/470d42ad-3f7e-40f9-b0a1-203b4af77eb9">
<img width="1231" alt="Screenshot 2023-07-08 at 13 08 32"
src="https://github.com/go-gitea/gitea/assets/115237/42d18048-748c-4a3f-ab89-3403866cef34">

---------

15 months agodocs: rootless docker ssh's default port is 2222 (#25771)
leavesster [Sat, 8 Jul 2023 15:38:35 +0000 (23:38 +0800)]
docs: rootless docker ssh's default port is 2222 (#25771)

15 months agoRepository Archived text title center align (#25767)
puni9869 [Sat, 8 Jul 2023 10:57:17 +0000 (16:27 +0530)]
Repository Archived text title center align (#25767)

Archive text title center align

<details>
  <summary>Screen shots</summary>

 Before

![image](https://github.com/go-gitea/gitea/assets/80308335/90182367-4d06-4fc8-b7aa-21c21225d2bd)

After

![image](https://github.com/go-gitea/gitea/assets/80308335/3dcc0d0d-75f4-415d-afbf-03921075b4db)

![image](https://github.com/go-gitea/gitea/assets/80308335/317d74f8-0ae9-4dc7-9508-1833d2d4f327)

BTW On github

![image](https://github.com/go-gitea/gitea/assets/80308335/1801fd2d-1803-4ee6-8856-ef2f623df2b4)

</details>

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoUpdate JS dependencies, misc tweaks (#25768)
silverwind [Sat, 8 Jul 2023 10:26:35 +0000 (12:26 +0200)]
Update JS dependencies, misc tweaks (#25768)

- Update all JS dependencies minus stylelint because of
https://github.com/elirasza/stylelint-stylistic/issues/12
- Misc tweaks to eslint and stylelint configs
- Tested Monaco and Mermaid

15 months agoClarify "text-align" CSS helpers, fix clone button padding (#25763)
wxiaoguang [Sat, 8 Jul 2023 09:53:56 +0000 (17:53 +0800)]
Clarify "text-align" CSS helpers, fix clone button padding (#25763)

Changes:

* Rename gt-tl/gt-tc/gt-tr to gt-text-left/gt-text-center/gt-text-right
* The gt-ab and gt-br-0 are removed because they are not needed anymore
* Fix the clone dropdown button padding by ":not(.icon)"

Before:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/eb030633-622c-4ca7-8e88-ce010d9f51a6)

</details>

After:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/64c09403-bf21-439c-88f1-780b34ccab6b)

</details>

Fixes #25758

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoSwitch to `vite-string-plugin` (#25762)
silverwind [Sat, 8 Jul 2023 04:56:12 +0000 (06:56 +0200)]
Switch to `vite-string-plugin` (#25762)

Switch to
[`vite-string-plugin`](https://github.com/silverwind/vite-string-plugin)
to load SVGs as string during tests. The plugin will also be useful once
we switch to vite.

15 months agoNewly pushed branches hints on repository home page (#25715)
Lunny Xiao [Sat, 8 Jul 2023 03:19:00 +0000 (11:19 +0800)]
Newly pushed branches hints on repository home page (#25715)

This PR will display a pull request creation hint on the repository home
page when there are newly created branches with no pull request. Only
the recent 6 hours and 2 updated branches will be displayed.

Inspired by #14003
Replace #14003
Resolves #311
Resolves #13196
Resolves #23743

co-authored by @kolaente

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>