]> source.dussan.org Git - gitea.git/log
gitea.git
4 months agoSync up deleted branches & action assets related cleanup documentation (#31022)
Kemal Zebari [Wed, 22 May 2024 14:39:46 +0000 (07:39 -0700)]
Sync up deleted branches & action assets related cleanup documentation (#31022)

Syncs up docs associated to actions and deleted branch cleanup i.e. in
custom/app.example.ini and the config cheat sheet.

4 months agoUpdate Actions documentation missing feature (#31034)
Lunny Xiao [Wed, 22 May 2024 14:06:22 +0000 (22:06 +0800)]
Update Actions documentation missing feature (#31034)

Fix
https://github.com/go-gitea/gitea/issues/25897#issuecomment-2117145391

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: yp05327 <576951401@qq.com>
4 months agoAdd nix flake for dev shell (#30967)
6543 [Wed, 22 May 2024 00:47:18 +0000 (02:47 +0200)]
Add nix flake for dev shell (#30967)

To try it you need **nix** installed `nix-daemon ` running and your user
has to be member of the **nix-users** group. Or use NixOS.

then by just:
```sh
nix develop -c $SHELL
```
a dedicated development environment with all needed packages will be
created.

4 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 22 May 2024 00:25:10 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

4 months agoFix wrong display of recently pushed notification (#25812)
yp05327 [Tue, 21 May 2024 17:00:35 +0000 (02:00 +0900)]
Fix wrong display of recently pushed notification (#25812)

There's a bug in #25715:
If user pushed a commit into another repo with same branch name, the
no-related repo will display the recently pushed notification
incorrectly.
It is simple to fix this, we should match the repo id in the sql query.

![image](https://github.com/go-gitea/gitea/assets/18380374/9411a926-16f1-419e-a1b5-e953af38bab1)
The latest commit is 2 weeks ago.

![image](https://github.com/go-gitea/gitea/assets/18380374/52f9ab22-4999-43ac-a86f-6d36fb1e0411)

The notification comes from another repo with same branch name:

![image](https://github.com/go-gitea/gitea/assets/18380374/a26bc335-8e5b-4b9c-a965-c3dc3fa6f252)

After:
In forked repo:

![image](https://github.com/go-gitea/gitea/assets/18380374/ce6ffc35-deb7-4be7-8b09-184207392f32)
New PR Link will redirect to the original repo:

![image](https://github.com/go-gitea/gitea/assets/18380374/7b98e76f-0c75-494c-9462-80cf9f98e786)
In the original repo:

![image](https://github.com/go-gitea/gitea/assets/18380374/5f6a821b-e51a-4bbd-9980-d9eb94a3c847)
New PR Link:

![image](https://github.com/go-gitea/gitea/assets/18380374/1ce8c879-9f11-4312-8c32-695d7d9af0df)

In the same repo:

![image](https://github.com/go-gitea/gitea/assets/18380374/64b56073-4d0e-40c4-b8a0-80be7a775f69)
New PR Link:

![image](https://github.com/go-gitea/gitea/assets/18380374/96e1b6a3-fb98-40ee-b2ee-648039fb0dcf)

08/15 Update:
Follow #26257, added permission check and logic fix mentioned in
https://github.com/go-gitea/gitea/pull/26257#discussion_r1294085203

2024/04/25 Update:
Fix #30611

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
4 months agouse existing oauth grant for public client (#31015)
Denys Konovalov [Tue, 21 May 2024 16:23:49 +0000 (18:23 +0200)]
use existing oauth grant for public client (#31015)

Do not try to create a new authorization grant when one exists already,
thus preventing a DB-related authorization issue.

Fix https://github.com/go-gitea/gitea/pull/30790#issuecomment-2118812426

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 months agoFix automerge will not work because of some events haven't been triggered (#30780)
Lunny Xiao [Tue, 21 May 2024 15:23:22 +0000 (23:23 +0800)]
Fix automerge will not work because of some events haven't been triggered (#30780)

Replace #25741
Close #24445
Close #30658
Close #20646
~Depends on #30805~

Since #25741 has been rewritten totally, to make the contribution
easier, I will continue the work in this PR. Thanks @6543

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
4 months agoDon't include link of deleted branch when listing branches (#31028)
Kemal Zebari [Tue, 21 May 2024 02:23:07 +0000 (19:23 -0700)]
Don't include link of deleted branch when listing branches (#31028)

From
https://github.com/go-gitea/gitea/issues/31018#issuecomment-2119622680.

This commit removes the link to a deleted branch name because it returns
a 404 while it is in this deleted state. GitHub also throws a 404 when
navigating to a branch link that was just deleted, but this deleted
branch is removed from the branch list after a page refresh. Since with
Gitea this deleted branch would be kept around for quite some time
(well, until the "cleanup deleted branches" cron job begins), it makes
sense to not have this as a link that users can navigate to.

4 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 21 May 2024 00:26:00 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

4 months agoRefactor sha1 and time-limited code (#31023)
wxiaoguang [Mon, 20 May 2024 15:12:50 +0000 (23:12 +0800)]
Refactor sha1 and time-limited code (#31023)

Remove "EncodeSha1", it shouldn't be used as a general purpose hasher
(just like we have removed "EncodeMD5" in #28622)

Rewrite the "time-limited code" related code and write better tests, the
old code doesn't seem quite right.

4 months agoReturn `access_denied` error when an OAuth2 request is denied (#30974)
Zettat123 [Mon, 20 May 2024 07:17:00 +0000 (15:17 +0800)]
Return `access_denied` error when an OAuth2 request is denied (#30974)

According to [RFC
6749](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1),
when the resource owner or authorization server denied an request, an
`access_denied` error should be returned. But currently in this case
Gitea does not return any error.

For example, if the user clicks "Cancel" here, an `access_denied` error
should be returned.

<img width="360px"
src="https://github.com/go-gitea/gitea/assets/15528715/be31c09b-4c0a-4701-b7a4-f54b8fe3a6c5"
/>

4 months agoAvoid 500 panic error when uploading invalid maven package file (#31014)
wxiaoguang [Mon, 20 May 2024 06:44:16 +0000 (14:44 +0800)]
Avoid 500 panic error when uploading invalid maven package file (#31014)

PackageDescriptor.Metadata might be nil (and maybe not only for maven).
This is only a quick fix.

The new `if` block is written intentionally to avoid unnecessary
indenting to the existing code.

4 months agoFix incorrect "blob excerpt" link when comparing files (#31013)
wxiaoguang [Mon, 20 May 2024 05:57:57 +0000 (13:57 +0800)]
Fix incorrect "blob excerpt" link when comparing files (#31013)

When comparing files between the base repo and forked repo, the "blob
excerpt" link should point to the forked repo, because the commit
doesn't exist in base repo.

Co-authored-by: Giteabot <teabot@gitea.io>
4 months agoFix project column title overflow (#31011)
wxiaoguang [Mon, 20 May 2024 05:21:01 +0000 (13:21 +0800)]
Fix project column title overflow (#31011)

By the way:
* Re-format the "color.go" to Golang code style
* Remove unused `overflow-y: scroll;` from `.project-column` because
there is `overflow: visible`

4 months agoFix data-race during testing (#30999)
wxiaoguang [Mon, 20 May 2024 04:35:38 +0000 (12:35 +0800)]
Fix data-race during testing (#30999)

Fix #30992

4 months agoFix "force private" logic (#31012)
wxiaoguang [Mon, 20 May 2024 00:56:45 +0000 (08:56 +0800)]
Fix "force private" logic (#31012)

When creating a repo, the "FORCE_PRIVATE" config option should be
respected, `readonly` doesn't work for checkbox, so it should use
`disabled` attribute.

4 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 20 May 2024 00:25:39 +0000 (00:25 +0000)]
[skip ci] Updated licenses and gitignores

4 months agoImprove reverse proxy documents and clarify the AppURL guessing behavior (#31003)
wxiaoguang [Sun, 19 May 2024 14:56:08 +0000 (22:56 +0800)]
Improve reverse proxy documents and clarify the AppURL guessing behavior (#31003)

Fix #31002

1. Mention Make sure `Host` and `X-Fowarded-Proto` headers are correctly passed to Gitea
2. Clarify the basic requirements and move the "general configuration" to the top
3. Add a comment for the "container registry"
4. Use 1.21 behavior if the reverse proxy is not correctly configured

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
4 months agoFix bug on avatar (#31008)
Lunny Xiao [Sun, 19 May 2024 04:58:39 +0000 (12:58 +0800)]
Fix bug on avatar (#31008)

Co-authored-by: silverwind <me@silverwind.io>
4 months agoClean up revive linter config, tweak golangci output (#30980)
silverwind [Sat, 18 May 2024 08:53:28 +0000 (10:53 +0200)]
Clean up revive linter config, tweak golangci output (#30980)

The `errorCode` and `warningCode` options were removed at some point,
they are not recognized by golangci-lint any more at least and they do
not match their published json schema. `confidence` and
`ignore-generated-header` are at the default value so does not need to
be configured.

https://golangci-lint.run/usage/linters/#revive

5 months agoSimplify mirror repository API logic (#30963)
wxiaoguang [Fri, 17 May 2024 16:07:41 +0000 (00:07 +0800)]
Simplify mirror repository API logic (#30963)

Fix #30921

5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 17 May 2024 00:25:42 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoUpgrade `tqdm` dependency (#30996)
silverwind [Thu, 16 May 2024 19:40:57 +0000 (21:40 +0200)]
Upgrade `tqdm` dependency (#30996)

Result of `make update-py`

Fixes: https://github.com/go-gitea/gitea/security/dependabot/65
5 months agoFix JS error when editing a merged PR's title (#30990)
wxiaoguang [Thu, 16 May 2024 13:04:25 +0000 (21:04 +0800)]
Fix JS error when editing a merged PR's title (#30990)

5 months agotemplate: `label` fix correct input id (#30987)
Frank Villaro-Dixon [Thu, 16 May 2024 06:36:31 +0000 (08:36 +0200)]
template: `label` fix correct input id (#30987)

Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
5 months agoPut web editor into a segment (#30966)
silverwind [Wed, 15 May 2024 14:54:34 +0000 (16:54 +0200)]
Put web editor into a segment (#30966)

Implement
https://github.com/go-gitea/gitea/pull/30707#issuecomment-2084126206

Diff without whitespace:
https://github.com/go-gitea/gitea/pull/30966/files?diff=unified&w=1

Might as well backport.

5 months agoCheck if the release is converted from the tag when updating the release (#30984)
Zettat123 [Wed, 15 May 2024 14:25:47 +0000 (22:25 +0800)]
Check if the release is converted from the tag when updating the release (#30984)

Call `notify_service.NewRelease` when a release is created
from an existing tag.

5 months agoSupports forced use of S3 virtual-hosted style (#30969)
dicarne [Wed, 15 May 2024 13:56:17 +0000 (21:56 +0800)]
Supports forced use of S3 virtual-hosted style (#30969)

Add a configuration item to enable S3 virtual-hosted style (V2) to solve
the problem caused by some S3 service providers not supporting path
style (V1).

5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 15 May 2024 00:25:44 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoRemove unnecessary double quotes on language file (#30977)
Lunny Xiao [Tue, 14 May 2024 23:06:12 +0000 (07:06 +0800)]
Remove unnecessary double quotes on language file (#30977)

The double quotes and the prefix/suffix space are unnecessary.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
5 months agoAlways load or generate oauth2 jwt secret (#30942)
wxiaoguang [Tue, 14 May 2024 14:21:38 +0000 (22:21 +0800)]
Always load or generate oauth2 jwt secret (#30942)

Fix #30923

5 months agoFilter out duplicate action(activity) items for a repository (#30957)
wxiaoguang [Tue, 14 May 2024 13:47:03 +0000 (21:47 +0800)]
Filter out duplicate action(activity) items for a repository (#30957)

Fix #20986

5 months agoProtected tag is no internal server error (#30962)
KN4CK3R [Tue, 14 May 2024 06:48:21 +0000 (08:48 +0200)]
Protected tag is no internal server error (#30962)

Fixes #30959

Adds an API test for protected tags.
Fix existing tag in combination with fixtures.

5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 14 May 2024 00:25:02 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoRestyle release list, fix branch dropdown (#30837)
silverwind [Mon, 13 May 2024 21:33:51 +0000 (23:33 +0200)]
Restyle release list, fix branch dropdown (#30837)

Fixes https://github.com/go-gitea/gitea/issues/30821 and restyles the
release list.

Desktop:

<img width="1199" alt="Screenshot 2024-05-02 at 20 46 10"
src="https://github.com/go-gitea/gitea/assets/115237/bee92423-d4a9-4b26-8301-3a1e09eef4cd">

Mobile:

<img width="443" alt="Screenshot 2024-05-02 at 20 46 21"
src="https://github.com/go-gitea/gitea/assets/115237/42ecbae5-bdb6-4b16-a0ee-9c64daede68d">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
5 months agofix: change npm scope registry (#30964)
james yang [Mon, 13 May 2024 14:05:56 +0000 (22:05 +0800)]
fix: change npm scope registry (#30964)

https://docs.npmjs.com/cli/v10/using-npm/scope#associating-a-scope-with-a-registry

5 months agoSupport using label names when changing issue labels (#30943)
Zettat123 [Mon, 13 May 2024 04:28:53 +0000 (12:28 +0800)]
Support using label names when changing issue labels (#30943)

Resolve #30917

Make the APIs for adding labels and replacing labels support both label
IDs and label names so the
[`actions/labeler`](https://github.com/actions/labeler) action can work
in Gitea.

<img width="600px"
src="https://github.com/go-gitea/gitea/assets/15528715/7835c771-f637-4c57-9ce5-e4fbf56fa0d3"
/>

5 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 13 May 2024 00:26:15 +0000 (00:26 +0000)]
[skip ci] Updated licenses and gitignores

5 months agoFix file path width in repo non-homepage view (#30951)
silverwind [Sun, 12 May 2024 04:02:25 +0000 (06:02 +0200)]
Fix file path width in repo non-homepage view (#30951)

Fixes: https://github.com/go-gitea/gitea/issues/30940
<img width="1310" alt="Screenshot 2024-05-11 at 20 48 41"
src="https://github.com/go-gitea/gitea/assets/115237/f163dfd4-1299-421f-a99e-cd0c793e0e3d">

5 months agoEnable `declaration-block-no-redundant-longhand-properties` (#30950)
silverwind [Sun, 12 May 2024 02:33:05 +0000 (04:33 +0200)]
Enable `declaration-block-no-redundant-longhand-properties` (#30950)

Enable
[`declaration-block-no-redundant-longhand-properties`](https://stylelint.io/user-guide/rules/declaration-block-no-redundant-longhand-properties/)
and autofix issues. The exclusions are because I find these two
shorthands to be harder to read.

5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 12 May 2024 00:27:35 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoMove reverproxyauth before session so the header will not be ignored even if user...
Lunny Xiao [Sat, 11 May 2024 14:55:49 +0000 (22:55 +0800)]
Move reverproxyauth before session so the header will not be ignored even if user has login (#27821)

When a user logout and then login another user, the reverseproxy auth
should be checked before session otherwise the old user is still login.

5 months agoUse CSS `inset` shorthand (#30939)
silverwind [Sat, 11 May 2024 14:28:56 +0000 (16:28 +0200)]
Use CSS `inset` shorthand (#30939)

Use [inset](https://developer.mozilla.org/en-US/docs/Web/CSS/inset)
shorthand instead of longhands. There may be more cases but these ones I
was able to definitely identify.

5 months agoRemove If Exist check on migration for mssql because that syntax required SQL server...
Lunny Xiao [Sat, 11 May 2024 14:16:09 +0000 (22:16 +0800)]
Remove If Exist check on migration for mssql because that syntax required SQL server 2016 (#30894)

Fix #30872

We will assume the database is consistent before executing the
migration. So the indexes should exist. Removing `IF EXIST` then is safe
enough.

---------

Co-authored-by: silverwind <me@silverwind.io>
5 months agoUpdate JS dependencies, add new eslint rules (#30840)
silverwind [Fri, 10 May 2024 18:53:43 +0000 (20:53 +0200)]
Update JS dependencies, add new eslint rules (#30840)

5 months agoFix some UI regressions for commit list (#30920)
wxiaoguang [Fri, 10 May 2024 12:58:05 +0000 (20:58 +0800)]
Fix some UI regressions for commit list (#30920)

Close #30919

---------

Co-authored-by: silverwind <me@silverwind.io>
5 months agoForbid deprecated `break-word` in CSS (#30934)
silverwind [Fri, 10 May 2024 12:25:49 +0000 (14:25 +0200)]
Forbid deprecated `break-word` in CSS (#30934)

Forbid
[deprecated](https://drafts.csswg.org/css-text-3/#word-break-property)
`break-word` and fix all occurences.

Regarding `overflow-wrap: break-word` vs `overflow-wrap: anywhere`:

Example of difference: https://jsfiddle.net/silverwind/1va6972r/

[Here](https://stackoverflow.com/questions/77651244) it says:

> The differences between normal, break-word and anywhere are only clear
if you are using width: min-content on the element containing the text,
and you also set a max-width. A pretty rare scenario.

I don't think this difference will make any practical impact as we are
not hitting this rare scenario.

5 months agoCheck if reverse proxy is correctly configured (#30890)
wxiaoguang [Fri, 10 May 2024 12:07:01 +0000 (20:07 +0800)]
Check if reverse proxy is correctly configured (#30890)

Follow #27011
Follow #30885

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
5 months agoRemove deprecated stuff for runners (#30930)
Jason Song [Fri, 10 May 2024 08:23:47 +0000 (16:23 +0800)]
Remove deprecated stuff for runners (#30930)

It's time (maybe somewhat late) to remove some deprecated stuff for the
runner.

- `x-runner-version`: runners needn't to report version in every
request, they will call `Declare`.
- `AgentLabels`: runners will report them as `Labels`.

5 months agoFix incorrect default branch when adopt a repository (#30912)
yp05327 [Thu, 9 May 2024 08:44:26 +0000 (17:44 +0900)]
Fix incorrect default branch when adopt a repository (#30912)

Fix #30521

we should sync branches first, then detect default branch, or
`git_model.FindBranchNames` will always return empty list, and the
detection will be wrong.

5 months agoAdd missing menu active item background back (#30897)
wxiaoguang [Wed, 8 May 2024 23:01:25 +0000 (07:01 +0800)]
Add missing menu active item background back (#30897)

Fix #30578

5 months agoFix misspelling of mergable (#30896)
yp05327 [Wed, 8 May 2024 16:11:43 +0000 (01:11 +0900)]
Fix misspelling of mergable (#30896)

https://github.com/go-gitea/gitea/pull/25812#issuecomment-2099833692
Follow #30573

5 months agoFix incorrect issue form (#30881)
wxiaoguang [Wed, 8 May 2024 15:39:13 +0000 (23:39 +0800)]
Fix incorrect issue form (#30881)

Fix #30864

5 months agoUpdate issue indexer after merging a PR (#30715)
Zettat123 [Wed, 8 May 2024 14:45:15 +0000 (22:45 +0800)]
Update issue indexer after merging a PR (#30715)

Fix #30684

5 months agoFix various problems around projects board view (#30696)
Lunny Xiao [Wed, 8 May 2024 13:44:57 +0000 (21:44 +0800)]
Fix various problems around projects board view (#30696)

# The problem
The previous implementation will start multiple POST requests from the
frontend when moving a column and another bug is moving the default
column will never be remembered in fact.

# What's changed

- [x] This PR will allow the default column to move to a non-first
position
- [x] And it also uses one request instead of multiple requests when
moving the columns
- [x] Use a star instead of a pin as the icon for setting the default
column action
- [x] Inserted new column will be append to the end
- [x] Fix #30701 the newly added issue will be append to the end of the
default column
- [x] Fix when deleting a column, all issues in it will be displayed
from UI but database records exist.
- [x] Add a limitation for columns in a project to 20. So the sorting
will not be overflow because it's int8.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoFix wrong transfer hint (#30889)
Lunny Xiao [Wed, 8 May 2024 13:17:11 +0000 (21:17 +0800)]
Fix wrong transfer hint (#30889)

Fix #30187

5 months agoRemove obsolete monaco workaround (#30893)
silverwind [Wed, 8 May 2024 02:42:33 +0000 (04:42 +0200)]
Remove obsolete monaco workaround (#30893)

This workaround is not neccessary any more since monaco 0.35.0.

Ref: https://github.com/microsoft/monaco-editor/issues/2962
Ref: https://github.com/microsoft/vscode/pull/173688

5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 8 May 2024 00:21:06 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoApply to become a maintainer (#30884)
Kemal Zebari [Tue, 7 May 2024 12:41:52 +0000 (05:41 -0700)]
Apply to become a maintainer (#30884)

Hello! After contributing for some time I am interested in taking a more
involved role as a maintainer. When time allows it, I plan to perform
code reviews, continue resolving/triaging issues, and engage with the
community to see if I can offer any useful insights. My current
interests are in backend work, but I plan to study the web frontend
architecture to see if I can contribute there as well.

Thanks for this awesome project. I hope I can both learn and contribute
to its continued success!

PR list:
https://github.com/go-gitea/gitea/pulls?q=is%3Apr+is%3Aclosed+author%3Akemzeb
Discord: kemzeb

5 months agoRefactor AppURL usage (#30885)
wxiaoguang [Tue, 7 May 2024 08:26:13 +0000 (16:26 +0800)]
Refactor AppURL usage (#30885)

Fix #30883
Fix #29591

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
5 months agoMove database operations of merging a pull request to post receive hook and add a...
Lunny Xiao [Tue, 7 May 2024 07:36:48 +0000 (15:36 +0800)]
Move database operations of merging a pull request to post receive hook and add a transaction (#30805)

Merging PR may fail because of various problems. The pull request may
have a dirty state because there is no transaction when merging a pull
request. ref
https://github.com/go-gitea/gitea/pull/25741#issuecomment-2074126393

This PR moves all database update operations to post-receive handler for
merging a pull request and having a database transaction. That means if
database operations fail, then the git merging will fail, the git client
will get a fail result.

There are already many tests for pull request merging, so we don't need
to add a new one.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoFix missing migrate actions artifacts (#30874)
Lunny Xiao [Tue, 7 May 2024 06:45:30 +0000 (14:45 +0800)]
Fix missing migrate actions artifacts (#30874)

The actions artifacts should be able to be migrate to the new storage
place.

5 months agoMake "sync branch" also sync object format and add tests (#30878)
wxiaoguang [Mon, 6 May 2024 17:02:30 +0000 (01:02 +0800)]
Make "sync branch" also sync object format and add tests (#30878)

5 months agoMake sure git version&feature are always prepared (#30877)
wxiaoguang [Mon, 6 May 2024 16:34:16 +0000 (00:34 +0800)]
Make sure git version&feature are always prepared (#30877)

Otherwise there would be more similar issues like #29287

5 months agoGet repo list with OrderBy alpha should respect owner too (#30784)
6543 [Mon, 6 May 2024 14:36:02 +0000 (16:36 +0200)]
Get repo list with OrderBy alpha should respect owner too (#30784)

instead of:
- zowner/gcode
- awesome/nul
- zowner/nul
- zowner/zzz

we will get:
- awesome/nul
- zowner/gcode
- zowner/nul
- zowner/zzz

5 months agoFix some UI problems (dropdown/container) (#30849)
wxiaoguang [Mon, 6 May 2024 07:17:22 +0000 (15:17 +0800)]
Fix some UI problems (dropdown/container) (#30849)

Follow #30345
Follow #30547

`ellipsis` / `white-space` shouldn't be put on the general dropdown components.

5 months agoFix some UI problems (install/checkbox) (#30854)
wxiaoguang [Mon, 6 May 2024 06:32:05 +0000 (14:32 +0800)]
Fix some UI problems (install/checkbox) (#30854)

Fix the space between the box and label for checkboxes, and fix incorrect usages in "repo-issue.js"

5 months agoHave time.js use UTC-related getters/setters (#30857)
Kemal Zebari [Mon, 6 May 2024 01:36:53 +0000 (18:36 -0700)]
Have time.js use UTC-related getters/setters (#30857)

Before this patch, we were using `Date` getter/setter methods that
worked with local time to get a list of Sundays that are in the range of
some start date and end date. The problem with this was that the Sundays
are in Unix epoch time and when we changed the "startDate" argument that
was passed to make sure it is on a Sunday, this change would be
reflected when we convert it to Unix epoch time. More specifically, I
observed that we may get different Unix epochs depending on your
timezone when the returned list should rather be timezone-agnostic.

This led to issues in US timezones that caused the contributor, code
frequency, and recent commit charts to not show any chart data. This fix
resolves this by using getter/setter methods that work with UTC since it
isn't dependent on timezones.

Fixes #30851.

---------

Co-authored-by: Sam Fisher <fisher@3echelon.local>
5 months agoDo not show monaco JS errors (#30862)
wxiaoguang [Sun, 5 May 2024 16:34:13 +0000 (00:34 +0800)]
Do not show monaco JS errors (#30862)

Fix #30861

5 months agoFix issue/PR title edit (#30858)
wxiaoguang [Sun, 5 May 2024 13:09:41 +0000 (21:09 +0800)]
Fix issue/PR title edit (#30858)

1. "enter" doesn't work (I think it is the last enter support for #14843)
2. if a branch name contains something like `&`, then the branch selector doesn't update

5 months agoAdd result check in TestAPIEditUser (#29674)
yp05327 [Sun, 5 May 2024 02:10:20 +0000 (11:10 +0900)]
Add result check in TestAPIEditUser (#29674)

Fix #29514
There are too many usage of `NewRequestWithValues`, so there's no need
to check all of them.
Just one is enough I think.

5 months agoUpdate README.md (#30856)
Neal Caffery [Sat, 4 May 2024 03:53:18 +0000 (11:53 +0800)]
Update README.md (#30856)

fix typo for the Docker README

5 months agoFix markdown URL parsing for commit ID (#30812)
wxiaoguang [Sat, 4 May 2024 01:48:16 +0000 (09:48 +0800)]
Fix markdown URL parsing for commit ID (#30812)

5 months agoImprove grep search (#30843)
wxiaoguang [Fri, 3 May 2024 09:13:48 +0000 (17:13 +0800)]
Improve grep search (#30843)

Reduce the context line number to 1, make "git grep" search respect the
include/exclude patter, and fix #30785

5 months agoDon't only list code-enabled repositories when using repository API (#30817)
Kemal Zebari [Fri, 3 May 2024 07:58:31 +0000 (00:58 -0700)]
Don't only list code-enabled repositories when using repository API (#30817)

We should be listing all repositories by default.

Fixes #28483.

5 months agoFix no edit history after editing issue's title and content (#30814)
yp05327 [Fri, 3 May 2024 06:11:51 +0000 (15:11 +0900)]
Fix no edit history after editing issue's title and content (#30814)

Fix #30807

reuse functions in services

5 months agoIgnore useless error message "broken pipe" (#30801)
wxiaoguang [Fri, 3 May 2024 02:39:36 +0000 (10:39 +0800)]
Ignore useless error message "broken pipe" (#30801)

Fix #30792

5 months agoFix JS error on pull request page (#30838)
silverwind [Fri, 3 May 2024 02:12:10 +0000 (04:12 +0200)]
Fix JS error on pull request page (#30838)

Fix this error seen on PR page, regression from
https://github.com/go-gitea/gitea/pull/30803:

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoFix body margin shifting with modals, fix error on project column edit (#30831)
silverwind [Fri, 3 May 2024 01:48:24 +0000 (03:48 +0200)]
Fix body margin shifting with modals, fix error on project column edit (#30831)

Fixes: https://github.com/go-gitea/gitea/issues/30816, regression from
https://github.com/go-gitea/gitea/pull/30723.
Fixes: https://github.com/go-gitea/gitea/pull/30815, regression from
https://github.com/go-gitea/gitea/pull/30723.

Fomantic [expects a
callback](https://github.com/fomantic/Fomantic-UI/blob/59d9b409879ad9413ea0a3efa4ab2e51017ad9b9/src/definitions/modules/modal.js#L530-L534)
to be called during `hide` which we did not do, so it could never remove
the margin it added to `body`.

I do observe the body content shifting to right by 1px when modal opens,
but this is a bug that existed on v1.21 as well, so not a regression.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoImprove repo button row layout (#30668)
silverwind [Thu, 2 May 2024 19:10:49 +0000 (21:10 +0200)]
Improve repo button row layout (#30668)

Since there is now a second `<input>` in the repo buttons, we can make a
better-looking layout with no empty space, except on mobile.

Also I fixed one bug with focus border on clone panel.

## Large

<img width="1163" alt="Screenshot 2024-04-23 at 22 25 22"
src="https://github.com/go-gitea/gitea/assets/115237/8135a572-aa67-4672-ad49-b76b06890b52">

## Medium
<img width="870" alt="Screenshot 2024-04-23 at 22 25 34"
src="https://github.com/go-gitea/gitea/assets/115237/9e93f61c-3315-4a78-8328-8cefad5b50fa">

## Mobile
<img width="416" alt="Screenshot 2024-04-23 at 22 25 52"
src="https://github.com/go-gitea/gitea/assets/115237/859e341f-807a-48e6-8bcf-31715963216c">

5 months agorefactor: merge ListActionTasks func to action.go file (#30811)
Bo-Yi Wu [Thu, 2 May 2024 17:43:29 +0000 (01:43 +0800)]
refactor: merge ListActionTasks func to action.go file (#30811)

Just merge actions.go file to action.go

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
5 months agoPrevent automatic OAuth grants for public clients (#30790)
Archer [Thu, 2 May 2024 17:05:59 +0000 (19:05 +0200)]
Prevent automatic OAuth grants for public clients (#30790)

This commit forces the resource owner (user) to always approve OAuth 2.0
authorization requests if the client is public (e.g. native
applications).

As detailed in [RFC 6749 Section 10.2](https://www.rfc-editor.org/rfc/rfc6749.html#section-10.2),

> The authorization server SHOULD NOT process repeated authorization
requests automatically (without active resource owner interaction)
without authenticating the client or relying on other measures to ensure
that the repeated request comes from the original client and not an
impersonator.

With the implementation prior to this patch, attackers with access to
the redirect URI (e.g., the loopback interface for
`git-credential-oauth`) can get access to the user account without any
user interaction if they can redirect the user to the
`/login/oauth/authorize` endpoint somehow (e.g., with `xdg-open` on
Linux).

Fixes #25061.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 months agoCatch and handle unallowed file type errors in issue attachment API (#30791)
Kemal Zebari [Thu, 2 May 2024 16:33:31 +0000 (09:33 -0700)]
Catch and handle unallowed file type errors in issue attachment API (#30791)

Before, we would just throw 500 if a user passes an attachment that is
not an allowed type. This commit catches this error and throws a 422
instead since this should be considered a validation error.

5 months agoFix incorrect message id for releaes email (#30825)
wxiaoguang [Thu, 2 May 2024 15:24:21 +0000 (23:24 +0800)]
Fix incorrect message id for releaes email (#30825)

Make generateMessageIDForRelease outputs the same format as
generateMessageIDForIssue (old `createReference`)

5 months agoAdd hover outline to heatmap squares (#30828)
silverwind [Thu, 2 May 2024 14:56:17 +0000 (16:56 +0200)]
Add hover outline to heatmap squares (#30828)

Makes it easier to use because you see which square is currently
hovered:

<img width="314" alt="Screenshot 2024-05-02 at 15 38 20"
src="https://github.com/go-gitea/gitea/assets/115237/3a15dad1-2259-4f28-9fae-5cf6ad3d8798">

I did try a `scoped` style for this, but that did not work for some
reason.

5 months agoRemove external API calls in `TestPassword` (#30716)
silverwind [Thu, 2 May 2024 14:43:23 +0000 (16:43 +0200)]
Remove external API calls in `TestPassword` (#30716)

The test had a dependency on `https://api.pwnedpasswords.com` which
caused many failures on CI recently:

```
--- FAIL: TestPassword (2.37s)
    pwn_test.go:41: Get "https://api.pwnedpasswords.com/range/e6b6a": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
FAIL
coverage: 82.9% of statements
```

5 months agoUpgrade chi-binding (#30826)
Lunny Xiao [Thu, 2 May 2024 14:09:38 +0000 (22:09 +0800)]
Upgrade chi-binding (#30826)

Front port #30742

5 months agoImprove context popup rendering (#30824)
silverwind [Thu, 2 May 2024 13:42:33 +0000 (15:42 +0200)]
Improve context popup rendering (#30824)

Before, lot of empty space when no labels or body:

<img width="281" alt="Screenshot 2024-05-02 at 13 51 29"
src="https://github.com/go-gitea/gitea/assets/115237/8a980ccd-d53c-43a3-a059-dc8c614621e1">

After, empty space collapsed:

<img width="306" alt="Screenshot 2024-05-02 at 13 51 16"
src="https://github.com/go-gitea/gitea/assets/115237/8d9c154d-5de1-43d0-8536-afd9194d99b3">

All `<p>` (unsuitable) and `<small>` (discouraged in favor of css) tags
are removed.

5 months agoFix activity heat map padding & locale (#30823)
wxiaoguang [Thu, 2 May 2024 13:22:55 +0000 (21:22 +0800)]
Fix activity heat map padding & locale (#30823)

Fix #30808

---------

Co-authored-by: silverwind <me@silverwind.io>
5 months agoFix issue card layout (#30800)
wxiaoguang [Thu, 2 May 2024 11:19:44 +0000 (19:19 +0800)]
Fix issue card layout (#30800)

Fix #30788

5 months agoFix branch selector UI (#30803)
wxiaoguang [Thu, 2 May 2024 10:45:23 +0000 (18:45 +0800)]
Fix branch selector UI (#30803)

Fix  #30802

5 months agoFix rounded border for segment followed by pagination (#30809)
silverwind [Thu, 2 May 2024 09:25:55 +0000 (11:25 +0200)]
Fix rounded border for segment followed by pagination (#30809)

Fixes https://github.com/go-gitea/gitea/issues/30673, specifically
https://github.com/go-gitea/gitea/issues/30673#issuecomment-2085329812.

5 months agoSkip gzip for some well-known compressed file types (#30796)
wxiaoguang [Thu, 2 May 2024 02:27:25 +0000 (10:27 +0800)]
Skip gzip for some well-known compressed file types (#30796)

Co-authored-by: silverwind <me@silverwind.io>
5 months agoFix markdown rendering when mentioning users (#30795)
wxiaoguang [Thu, 2 May 2024 01:00:46 +0000 (09:00 +0800)]
Fix markdown rendering when mentioning users (#30795)

5 months agoFix bleve fuzziness (#30799)
wxiaoguang [Wed, 1 May 2024 12:32:52 +0000 (20:32 +0800)]
Fix bleve fuzziness (#30799)

Fix #30797
Fix #30317

5 months agoDon't have `redis-cluster` as possible cache/session adapter in docs (#30794)
Kemal Zebari [Wed, 1 May 2024 05:33:40 +0000 (22:33 -0700)]
Don't have `redis-cluster` as possible cache/session adapter in docs (#30794)

This is because it doesn't exist as an adapter. The `redis` adapter
already handles Redis cluster configurations.

Fixes #30534.

5 months agoAdd API endpoints for getting action jobs status (#26673)
Chester [Wed, 1 May 2024 01:40:23 +0000 (09:40 +0800)]
Add API endpoints for getting action jobs status (#26673)

Sample of response, it is similar to Github actions

ref
https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository

``` json
{
    "workflow_runs": [
        {
            "id": 3,
            "name": "Explore-Gitea-Actions",
            "head_branch": "main",
            "head_sha": "6d8d29a9f7a01ded8f8aeb64341cb31ee1ab5f19",
            "run_number": 3,
            "event": "push",
            "display_title": "More job",
            "status": "success",
            "workflow_id": "demo2.yaml",
            "url": "/chester/test/actions/runs/3",
            "created_at": "2023-08-22T13:41:33-04:00",
            "updated_at": "2023-08-22T13:41:37-04:00",
            "run_started_at": "2023-08-22T13:41:33-04:00"
        },
        {
            "id": 2,
            "name": "Explore-Gitea-Actions",
            "head_branch": "main",
            "head_sha": "6d8d29a9f7a01ded8f8aeb64341cb31ee1ab5f19",
            "run_number": 2,
            "event": "push",
            "display_title": "More job",
            "status": "success",
            "workflow_id": "demo.yaml",
            "url": "/chester/test/actions/runs/2",
            "created_at": "2023-08-22T13:41:30-04:00",
            "updated_at": "2023-08-22T13:41:33-04:00",
            "run_started_at": "2023-08-22T13:41:30-04:00"
        },
        {
            "id": 1,
            "name": "Explore-Gitea-Actions",
            "head_branch": "main",
            "head_sha": "e5369ab054cae79899ba36e45ee82811a6e0acd5",
            "run_number": 1,
            "event": "push",
            "display_title": "Add job",
            "status": "failure",
            "workflow_id": "demo.yaml",
            "url": "/chester/test/actions/runs/1",
            "created_at": "2023-08-22T13:15:21-04:00",
            "updated_at": "2023-08-22T13:18:10-04:00",
            "run_started_at": "2023-08-22T13:15:21-04:00"
        }
    ],
    "total_count": 3
}
```

---------

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
5 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 1 May 2024 00:26:38 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

5 months agoImprove logout from worker (#30775)
wxiaoguang [Tue, 30 Apr 2024 15:35:42 +0000 (23:35 +0800)]
Improve logout from worker (#30775)

A quick fix for #30756

5 months agoRework and fix stopwatch (#30732)
silverwind [Tue, 30 Apr 2024 14:52:46 +0000 (16:52 +0200)]
Rework and fix stopwatch (#30732)

Fixes https://github.com/go-gitea/gitea/issues/30721 and overhauls the
stopwatch. Time is now shown inside the "dot" icon and on both mobile
and desktop. All rendering is now done by `<relative-time>`, the
`pretty-ms` dependency is dropped.

Desktop:
<img width="557" alt="Screenshot 2024-04-29 at 22 33 27"
src="https://github.com/go-gitea/gitea/assets/115237/3a46cdbf-6af2-4bf9-b07f-021348badaac">

Mobile:
<img width="640" alt="Screenshot 2024-04-29 at 22 34 19"
src="https://github.com/go-gitea/gitea/assets/115237/8a2beea7-bd5d-473f-8fff-66f63fd50877">

Note for tippy:
Previously, tippy instances defaulted to "menu" theme, but that theme is
really only meant for `.ui.menu`, so it was not optimal for the
stopwatch popover.

This introduces a unopinionated `default` theme that has no padding and
should be suitable for all content. I reviewed all existing uses and
explicitely set the desired `theme` on all of them.