Commit Graph

16917 Commits

Author SHA1 Message Date
Giteabot 93e105a228
fix: rendering internal file links in org () ()
Backport  by @ankitrgadiya

The internal links to other files in the repository were not rendering
with the Src Prefix (/src/branch-name/file-path). This commit fixes that
by using the `SrcLink` as base if available.

Resolves 

Co-authored-by: Ankit R Gadiya <git@argp.in>
2024-03-10 18:29:17 +01:00
Lunny Xiao e8b6d28ab9
Fix bug hidden on CI and make ci failed if tests failure () ()
Backport  

The tests on migration tests failed but CI reports successfully


https://github.com/go-gitea/gitea/actions/runs/7364373807/job/20044685969#step:8:141

This PR will fix the bug on migrations and also the CI hidden behaviour.

The reason is on the Makefile

`GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test
$(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(MIGRATE_TEST_PACKAGES)` will
return the error exit code.

But

`for pkg in $(shell $(GO) list
code.gitea.io/gitea/models/migrations/...); do \
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test
$(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
	done`

will not work.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2024-03-09 09:44:02 +00:00
silverwind 346b662305
Don't show AbortErrors on logout () ()
Backport https://github.com/go-gitea/gitea/pull/29639.

When logging out of Gitea, a error toast can be seen for a split second.
I don't know why or how it happens but I found it it's an `AbortError`
(related to
[AbortController#abort](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)),
so let's hide it.
2024-03-09 17:22:18 +08:00
Giteabot 25b0c99a41
Use more specific selector for `name` links () ()
Backport  by @silverwind

Followup https://github.com/go-gitea/gitea/pull/29305. As per discussion
in https://github.com/go-gitea/gitea/pull/29666#discussion_r1517506422,
make this selector only search in the current `.markup` document, as
there can be multiples displayed at the same time.

@DanielMatiasCarvalho maybe you can review.

Co-authored-by: silverwind <me@silverwind.io>
2024-03-09 08:40:05 +08:00
Giteabot bfc7c8a598
Fix user-defined markup links targets () ()
Backport  by @DanielMatiasCarvalho

This seeks to fix the bug reported on issue . 

Cause: 
ID's with custom characters (- , _ , etc.), were not linking correctly
in the Markdown file when rendered in the browser because the ID in the
respective destinies would be different than the one in anchor, while
for IDs with only letters, the ID would be the same.

Fix:
It was suggested that to fix this bug, it should more or less like
GitHub does it. While in gitea the anchors would be put in HTML like
this:
```
<p dir="auto"><a href="#user-content-_toc152597800" rel="nofollow">Review</a></p>
<p dir="auto"><a href="#user-content-_toc152597802" rel="nofollow">Staging</a></p>
<p dir="auto"><a href="#user-content-_toc152597803" rel="nofollow">Development</a></p>
<p dir="auto"><a href="#user-content-_toc152597828" rel="nofollow">Testing</a></p>
<p dir="auto"><a href="#user-content-_toc152597829" rel="nofollow">Unit-tests</a></p>

```
In GitHub, the same anchor's href properties would be the same without
"user-content-" trailing behind.

So my code made sure to change those anchors, so it would not include
"user-content-" and then add respective Event Listeners so it would
scroll into the supposed places.

Fixes: 

Co-authored-by: DC <106393991+DanielMatiasCarvalho@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
2024-03-08 16:53:36 +00:00
Giteabot 1f89763744
Fix commit_status problem when testing () ()
Backport  by @charles7668

Close 

fix 

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
2024-03-08 16:04:23 +00:00
Lunny Xiao a129c0c06c
Fix 500 when deleting account with incorrect password or unsupported login type () ()
Fix 
Backport 

Co-authored-by: Jason Song <i@wolfogre.com>
2024-03-08 15:43:57 +01:00
yp05327 bd7de0c4e4
Add empty repo check in DetectAndHandleSchedules () ()
Backport 
2024-03-08 09:50:04 +00:00
Giteabot 6651d2d87a
Fix incorrect rendering csv file when file size is larger than UI.CSV.MaxFileSize () ()
Backport  by @yp05327

Fix 

Co-authored-by: yp05327 <576951401@qq.com>
2024-03-08 09:13:58 +00:00
Giteabot 76b6754c3a
Fixing the issue when status check per rule matches multiple actions () ()
Backport  by @charles7668

Close 
rule
```
Test / Build*
Test / Build *
Test / Build 2*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)
rule2
```
Test / Build*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)

rule3
```
Test / Build*
Test / Build 1*
NotExist*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/f6a5e832-2e1b-4049-915b-45bec5ef070c)

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
2024-03-08 13:24:32 +08:00
Giteabot 0b5a4e7db4
Use strict protocol check when redirect () ()
Backport  by wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-03-07 03:53:33 +00:00
silverwind b6a2b9594a
Update Twitter Logo () ()
Backport https://github.com/go-gitea/gitea/pull/29621
<img width="430" alt="image"

src="https://github.com/go-gitea/gitea/assets/115237/9cf7b0a3-406b-4dd6-ab3d-d31a96b9335a">
2024-03-06 17:41:23 +01:00
Giteabot 6ee58a0ac2
Avoid issue info panic () ()
Backport  by wxiaoguang

Fix 

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-03-06 13:33:29 +00:00
wxiaoguang 2f1eb619bc
Avoid unexpected panic in graceful manager () ()
Backport 
2024-03-06 11:00:21 +00:00
Giteabot 9db426ad8c
Fix wrong line number in code search result () ()
Backport  by @yp05327

Fix 

Before:
The result is a table and all line numbers are all in one row.

![image](https://github.com/go-gitea/gitea/assets/18380374/7a18b354-e257-4f57-a5ca-f6d37378edf6)

![image](https://github.com/go-gitea/gitea/assets/18380374/98416e11-89b5-4b4f-920b-91bcf041a87f)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/f189e436-9046-4431-926a-cd0deb58e8f1)

![image](https://github.com/go-gitea/gitea/assets/18380374/07d213ed-2401-4b7f-b951-5df7dc776af4)

~~Updated:~~
~~added `active` class to the target line.~~

![image](https://github.com/go-gitea/gitea/assets/18380374/0b274e48-048a-4c66-ba95-df515212ec08)

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-03-06 10:05:41 +01:00
techknowlogick a8277cfc8f
bump protobuf module () ()
backport 
2024-03-06 13:16:35 +08:00
Lunny Xiao 5667ef9aab
Add missing database transaction for new issue () ()
When creating an issue, inserting issue, assign users and set project
should be in the same transaction.

Backport 
2024-03-05 16:37:55 +00:00
wxiaoguang 02df269d24
Make "/user/login" page redirect if the current user has signed in () ()
Backport 
2024-03-05 21:03:45 +08:00
wxiaoguang 4ef7e496b8
Add a trailing slash to dashboard links () ()
Backport 
2024-03-04 13:50:55 +08:00
Giteabot b519e4750b
Fix workflow trigger event IssueChangeXXX bug () ()
Backport  by @yp05327

Bugs from 
Follow 

partly fix 

Co-authored-by: yp05327 <576951401@qq.com>
2024-03-04 04:34:46 +08:00
Giteabot b84303ef6e
Fix 500 when pushing release to an empty repo () ()
Backport  by @lng2020

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

22b4f0c09f/routers/api/v1/repo/release.go (L241)

Co-authored-by: Nanguan Lin <nanguanlin6@gmail.com>
2024-03-03 17:10:22 +00:00
wxiaoguang 2b059f493e
Only use supported sort order for "explore/users" page () ()
Backport 

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

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

Removing the "sort orders" could also be a good solution, while IMO at
the moment keeping the "create time" and "name" orders is also fine, in
case some users would like to find a target user in the search result,
the "sort order" might help.
2024-03-03 02:28:45 +00:00
Giteabot 5ca2971ccb
Fix incorrect cookie path for AppSubURL () ()
Backport 
Regression of 

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-03-03 08:54:33 +08:00
Giteabot 63ec6facea
gitea.service: Remove syslog.target () ()
Backport  by @C0rn3j

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


6aa8d43ade/NEWS (L72-L73)

Co-authored-by: Martin <spleefer90@gmail.com>
2024-03-03 00:57:10 +01:00
Giteabot 971eab18fa
Fix incorrect redirection when creating a PR fails () ()
Backport  by wxiaoguang

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-03-02 20:01:19 +00:00
Giteabot 86cd94cba6
Fix queue worker incorrectly stopped when there are still more items in the queue () ()
Backport 

Without `case <-t.C`, the workers would stop incorrectly, the test won't
pass. For the worse case, there might be only one running worker
processing the queue items for long time because other workers are
stopped. The root cause is related to the logic of doDispatchBatchToWorker.
It isn't a serious problem at the moment, so keep it as-is.
2024-03-02 19:40:06 +00:00
Giteabot 8723389028
Fix incorrect relative/absolute URL usages () ()
Backport  by wxiaoguang

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-03-02 18:00:15 +00:00
Giteabot 401cc394d5
Fix incorrect subpath in links () ()
Backport  by wxiaoguang

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-03-02 12:26:54 +00:00
Giteabot 3a8877c058
Fix issue link does not support quotes () () ()
Backport  by @charles7668

Close 

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

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
2024-03-02 19:37:45 +08:00
Giteabot a86d9337e9
Fix issue & comment history bugs () ()
Backport  by @wxiaoguang

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-03-02 08:45:48 +08:00
Giteabot 8d08558783
Set pre-step status to `skipped` if job is skipped () ()
Backport  by @sillyguodong

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

before:

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

after:

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

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
2024-03-01 14:51:54 +01:00
Giteabot 730cd2dee4
Update FAQ about git hook problems () ()
Backport  by @wolfogre

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

Co-authored-by: Jason Song <i@wolfogre.com>
2024-02-29 22:36:00 +08:00
Giteabot 65b9ffe3c0
Improve contrast on blame timestamp, fix double border () ()
Backport  by @silverwind

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

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

Co-authored-by: silverwind <me@silverwind.io>
2024-02-29 08:51:42 +00:00
Giteabot c293e34df0
Fix wrong test usage of `AppSubURL` () ()
Backport  by @KN4CK3R

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

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-02-29 14:40:35 +08:00
Giteabot 9abba8c11a
Fix/Improve `processWindowErrorEvent` () ()
Backport  by @silverwind

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

Co-authored-by: silverwind <me@silverwind.io>
2024-02-29 01:22:53 +01:00
Giteabot 5477728282
Fix counter display number incorrectly displayed on the page () ()
Backport  by @charles7668

issue : 

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

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

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

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
2024-02-28 23:13:49 +01:00
Giteabot b43ce53a23
Fix workflow trigger event bugs () ()
Backport  by @Zettat123

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

Co-authored-by: Zettat123 <zettat123@gmail.com>
2024-02-28 21:24:51 +01:00
Giteabot 222f93822e
Fix URL calculation in clone input box () ()
Backport  by @silverwind

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

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

Co-authored-by: silverwind <me@silverwind.io>
2024-02-28 15:25:53 +00:00
Giteabot eabcfd3f7d
The job should always run when `if` is `always()` () ()
Backport  by @Zettat123

Fix 

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

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

Co-authored-by: Zettat123 <zettat123@gmail.com>
2024-02-28 12:22:31 +01:00
Giteabot 2df38af752
Fix missed return () ()
Backport  by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2024-02-27 23:33:03 +08:00
Lunny Xiao dc48eb070b
Fix template bug () ()
Fix 
Backport 
2024-02-27 11:11:38 +00:00
Jason Song 06dc26167a
Update docs about `DEFAULT_ACTIONS_URL` () ()
Backport .

Follow .
2024-02-27 18:16:08 +08:00
Giteabot 9456deb512
Not trigger all jobs any more, when re-running the first job () ()
Backport  by @sillyguodong

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

Caused by .

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
2024-02-27 16:18:49 +08:00
Giteabot c758a8afba
Ignore empty repo for CreateRepository in action notifier () ()
Backport  by @yp05327

Fix 

Co-authored-by: yp05327 <576951401@qq.com>
2024-02-26 09:59:12 +00:00
Giteabot 83327e043a
Fix incorrect tree path value for patch editor () ()
Backport  by wxiaoguang

Regression of . When submitting the form,
EditRepoFileForm.TreePath is marked as "Required", so the value can't be
empty. The value is not used by backend, so use a meaningful dummy value
for it.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-02-26 09:26:23 +00:00
Lunny Xiao 78cb09deda
Change log for 1.21.7 ()
This is an emergency release to fix the bug .

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-02-26 15:39:21 +08:00
Giteabot 0f35cb5a2a
Add missing space () ()
Backport  by @KN4CK3R

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-02-26 00:08:44 +08:00
Giteabot 0b3d6c399c
enforce maxlength in frontend () ()
Backport  by @zokkis

Set maxlength attribute in frontend

to long file-name

![image](https://github.com/go-gitea/gitea/assets/72873130/15111614-55ab-4583-acb2-15c25997601d)

![image](https://github.com/go-gitea/gitea/assets/72873130/4105ddd8-4973-4da8-b3ab-4cfae1b45554)
(same for branch-name and commit-summary)

Co-authored-by: Tim-Niclas Oelschläger <72873130+zokkis@users.noreply.github.com>
2024-02-25 14:56:44 +00:00
Giteabot f98a1b851c
Users with `read` permission of pull requests can be assigned too () ()
Backport  by @lunny

This PR will also keep the consistent between list assigned users and
check assigned users.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2024-02-24 17:42:33 +01:00
Giteabot e75594f7a6
Do not double close reader () ()
Backport  by @KN4CK3R

Fixes 

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-02-24 12:08:06 +00:00