Commit Graph

19514 Commits

Author SHA1 Message Date
Lunny Xiao
497b83b75d
Fix migration pull request title too long (#34577)
Fix #34294
2025-06-04 15:45:45 +00:00
badhezi
79cc369892
Fix issue label delete incorrect labels webhook payload (#34575)
Fixes https://github.com/go-gitea/gitea/issues/34560
explanation of the bug in the issue

setting `issue.isLabelsLoaded = false` before calling `deleteIssueLabel`
guarantee we will load the new state of the labels into the issue object
before sending it in the webhook.
2025-06-03 18:50:53 +00:00
metiftikci
fe57ee3074
fixed incorrect page navigation with up and down arrow on last item of dashboard repos (#34570)
Previously, pressing the down arrow key on the last item of a list would
incorrectly load the latest page when not release key. This commit
corrects the logic to ensure that the next page is loaded as intended.
2025-06-03 17:55:09 +00:00
Lunny Xiao
4e471487fb
Remove unnecessary duplicate code (#34552)
`GetIssuesLastCommitStatus` will revoke `GetIssuesAllCommitStatus` but
it has been invoked. The `CommitStatus` template variable has never been
used in notification subscription page so that it could be removed.
2025-06-03 16:27:29 +00:00
silverwind
375dab1111
Make pull request and issue history more compact (#34588)
Reduced spacing around history entries and inside the commits list, also fixed unequal horizontal spacing inside the commit badge.
2025-06-03 16:00:39 +00:00
wxiaoguang
2a1585b32e
Refactor some tests (#34580)
1. use `test.MockVariableValue` as much as possible
2. avoid `time.Sleep` as much as possible
2025-06-03 01:26:19 +00:00
Philip Peterson
c5e78fc7ad
Do not mutate incoming options to SearchRepositoryByName (#34553)
Similar to #34544, this PR changes the `opts` argument in
`SearchRepositoryByName()` to be passed by value instead of by pointer,
as its mutations do not escape the function scope and are not used
elsewhere. This simplifies reasoning about the function and avoids
unnecessary pointer usage.

This insight emerged during an initial attempt to refactor
`RenderUserSearch()`, which currently intermixes multiple concerns.

---------

Co-authored-by: Philip Peterson <philip-peterson@users.noreply.github.com>
2025-06-02 17:33:25 +00:00
Râu Cao
f48c0135a6
Fix/improve avatar sync from LDAP (#34573)
This fixes 3 issues I encountered when debugging problems with our LDAP sync:

1. The comparison of the hashed image data in `IsUploadAvatarChanged` is
wrong. It seems to be from before avatar hashing was changed and unified
in #22289. This results in the function always returning `true` for any
avatars, even if they weren't changed.
2. Even if there's no avatar to upload (i.e. no avatar available for the
LDAP entry), the upload function would still be called for every single
user, only to then fail, because the data isn't valid. This is
unnecessary.
3. Another small issue is that the comparison function (and thus hashing
of data) is called for every user, even if there is no avatar attribute
configured at all for the LDAP source. Thus, I switched the condition
nesting, so that no cycles are wasted when avatar sync isn't configured
in the first place.

I also added a trace log for when there is actually a new avatar being
uploaded for an existing user, which is now only shown when that is
actually the case.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-06-02 10:05:47 -07:00
wxiaoguang
e8d8984f7c
Fix some trivial problems (#34579) 2025-06-02 15:22:43 +00:00
badhezi
d5bbaee64e
Retain issue sort type when a keyword search is introduced (#34559)
Fixes #34523
2025-06-02 08:14:16 +00:00
Jim Lin
82ea2387e4
Always use an empty line to separate the commit message and trailer (#34512)
If the message from form.MergeMessageField is empty, we will miss a "\n"
between the title and the "Co-authored-by:" line. The title and message
should have a blank line between of them.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-06-02 06:29:16 +00:00
Kerwin Bryant
74858dc5ae
Fix line-button issue after file selection in file tree (#34574)
Fix the issue where the line-button fails to work after selecting a file
from the file tree.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-06-02 09:52:12 +08:00
GiteaBot
bb6377d080 [skip ci] Updated translations via Crowdin 2025-05-31 00:35:32 +00:00
Lunny Xiao
7149c9c55d
Fix doctor deleting orphaned issues attachments (#34142)
Fix the bug when deleting orphaned issues attachments. The attachments
maybe stored on other storages service rather than disk.
2025-05-30 05:06:03 +00:00
GiteaBot
07d802a815 [skip ci] Updated translations via Crowdin 2025-05-30 00:36:36 +00:00
badhezi
0cec4b84e2
Fix actions skipped commit status indicator (#34507)
Addresses https://github.com/go-gitea/gitea/issues/34500

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-05-28 11:36:21 -04:00
wxiaoguang
c6e2093f42
Clean up "file-view" related styles (#34558)
Move "file-view" and "code-view" related styles to their own file,
remove unnecessary `!important`
2025-05-28 21:43:59 +08:00
NorthRealm
4cb0c641ce
Add "View workflow file" to Actions list page (#34538)
This PR adds "View workflow file" to Actions list page, and replaces the
redundant link.

Related #34530

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-05-28 20:30:00 +08:00
Philip Peterson
b0936f4f41
Do not mutate incoming options to RenderUserSearch and SearchUsers (#34544)
This PR changes the `opts` argument in `SearchUsers()` to be passed by
value instead of by pointer, as its mutations do not escape the function
scope and are not used elsewhere. This simplifies reasoning about the
function and avoids unnecessary pointer usage.

This insight emerged during an initial attempt to refactor
`RenderUserSearch()`, which currently intermixes multiple concerns.

Co-authored-by: Philip Peterson <philip-peterson@users.noreply.github.com>
2025-05-27 19:36:02 +00:00
Lunny Xiao
498088c053
Add webhook assigning test and fix possible bug (#34420)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-05-27 18:53:27 +00:00
Lunny Xiao
24a51059d7
Fix possible nil description of pull request when migrating from CodeCommit (#34541)
Fix #34320
2025-05-27 11:25:34 -07:00
wxiaoguang
9f10885b21
Refactor commit reader (#34542) 2025-05-27 16:49:05 +00:00
Lunny Xiao
688da55f54
Split GetLatestCommitStatus as two functions (#34535)
Extract from #34531. This will reduce unnecessary count operation in
databases.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-05-26 19:00:22 +00:00
Lunny Xiao
ab9691291d
Don't display error log when .git-blame-ignore-revs doesn't exist (#34457)
Fix #34454
2025-05-26 17:09:14 +00:00
Markus Amshove
50d9565088
Add sort option recentclose for issues and pulls (#34525)
closes #34171 

Adds a new sort option `recentclose` for issues and pull requests which
will return items in a descending order of when they were closed
2025-05-26 16:37:38 +00:00
Bo-Yi Wu
11ee7ff3bf
fix: return 201 Created for CreateVariable API responses (#34517)
- Change CreateVariable API response status from 204 No Content to 201
Created
- Update related integration tests to expect 201 Created instead of 204
No Content

## ⚠️ BREAKING ⚠️

Change the response status code of the Create Variable API under both
Org and Repo levels to `201` instead of 204.

API SDK: https://gitea.com/gitea/go-sdk/pulls/713

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: appleboy <appleboy.tw@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2025-05-26 12:12:49 -04:00
NorthRealm
9b295e984a
Actions list (#34530)
Closes #34524

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-05-26 20:02:47 +08:00
GiteaBot
9d4ebc1f2c [skip ci] Updated translations via Crowdin 2025-05-26 00:37:55 +00:00
silverwind
8365365c9c
Run integration tests against postgres 14 (#34514)
postgres 12 is end of life since 6 months. 13 and above are still
supported but I think it's overall better if we test a more recent
version of postgres because that's what new users will be running on.

Ref: https://endoflife.date/postgresql
2025-05-23 04:40:21 +00:00
GiteaBot
4dd833ca9e [skip ci] Updated translations via Crowdin 2025-05-23 00:36:43 +00:00
Lunny Xiao
b595f81b79
Performance optimization for tags synchronization (#34355)
The tags synchronization is very slow for a non-mirror repository with
many tags especially forking. This PR make all repositories' tags
synchronization use the same function and remove the low performance
synchronization function. The commit count of tag now will not be stored
into database when syncing. Since the commits count will always be read
from cache or git data, the `NumCommits` in the release table will be
updated for the first read from git data.
2025-05-22 13:54:42 -07:00
Lunny Xiao
06ccda06c4
Fix possible panic (#34508) 2025-05-22 12:59:42 +00:00
GiteaBot
0d1d57c5bf [skip ci] Updated translations via Crowdin 2025-05-22 00:36:11 +00:00
GiteaBot
14bb8f7845 [skip ci] Updated translations via Crowdin 2025-05-21 00:37:21 +00:00
ChristopherHX
73f640fc15
Fix ephemeral runner deletion (#34447)
* repository deletion, delete ephemeral runners with active tasks as
well skips regular cleanup
* user deletion, delete ephemeral runners with active tasks as well
skips regular cleanup
* delete ephemeral runners once status changes to done
* You no longer see used ephemeral runners after the task is done
  * if you see one the cron job takes care of it
2025-05-20 15:42:31 +00:00
a1012112796
28dec9a27d
ui: add a default tab on repo header when migrating (#34503)
Signed-off-by: a1012112796 <1012112796@qq.com>
2025-05-20 11:14:18 -04:00
badhezi
0534eddd16
Use run-name and evaluate workflow variables (#34301)
This addresses https://github.com/go-gitea/gitea/issues/34247
depends on https://gitea.com/gitea/act/pulls/137

I couldn't find any previous implementation for `run-name` support on
workflows so I created one.

Key points:
All dispatched workflows, scheduled workflows and detected workflows
(from different hooks) will use and evaluate `run-name` if exists, with
the corresponding gitea context and variables. This will be used as the
Action run title and replace the default commit message being used
today.

Had to change act package jobparser (see link above)
and create two helpers
3a1320c70d/models/actions/utils.go (L86)
and
3a1320c70d/services/actions/context.go (L169)
to pass the correct types to
[GenerateGiteaContext](https://github.com/go-gitea/gitea/pull/34301/files#diff-9c9c27cb61a33e55ad33dc2c2e6a3521957a3e5cc50ddf652fdcd1def87b044dR86)
and
[WithGitContext](65c232c4a5/pkg/jobparser/jobparser.go (L84))
respectively.

<img width="1336" alt="Screenshot 2025-04-28 at 17 13 01"
src="https://github.com/user-attachments/assets/73cb03d0-23a0-4858-a466-bbf0748cea98"
/>
2025-05-20 02:24:10 +00:00
Bo-Yi Wu
d06eb8d801
feat(api): add date range filtering to commit retrieval endpoints (#34497)
- Add support for filtering commits by date range via new "since" and
"until" parameters
- Update API endpoints and command logic to handle the new parameters
for fetching commits within given dates
- Extend API documentation and Swagger specs to describe the new "since"
and "until" query parameters
- Refactor related function signatures and implementations to accept and
pass "since" and "until" values

---------

Signed-off-by: appleboy <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2025-05-19 18:57:58 -07:00
Adam Majer
9cfcc079c7
Export repo's manual merge settings (#34502) 2025-05-19 13:08:00 -04:00
GiteaBot
ec10c6ba5a [skip ci] Updated translations via Crowdin 2025-05-19 00:38:52 +00:00
ChristopherHX
d89eed998f
Fix edithook api can not update package, status and workflow_job events (#34495)
* the origin of this problem is duplicated code
2025-05-18 09:43:56 -07:00
Lunny Xiao
972381097c
Fix url validation in webhook add/edit API (#34492) 2025-05-17 20:05:55 +00:00
Ryo Hanafusa
b6c0667474
Add R-HNF to the TRANSLATORS file (#34494)
I would like to be added to the TRANSLATORS file.

Here are my related activities:
* https://crowdin.com/profile/R-HNF/activity
* commit: [skip ci] Updated translations via Crowdin
319d03fbc0

I also referred to the following PRs:
* #8451
* #8292
2025-05-17 09:58:27 -07:00
Lunny Xiao
e92c4f1808
Add missing setting load in dump-repo command (#34479)
Fix #34465
2025-05-16 14:35:20 +00:00
techknowlogick
6fbf0e6738
nix flake update (#34476) 2025-05-16 14:09:45 +00:00
ChristopherHX
59df03b554
Fix get / delete runner to use consistent http 404 and 500 status (#34480)
* previously deleting an already deleted runner returned http 500
* previously any database error for the get endpoint was http 404 and never 500
2025-05-16 06:44:29 +00:00
Sebastian Weigand
7b518bc6c7
Change "rejected" to "changes requested" in 3rd party PR review notification (#34481)
This PR changes 3rd party notifications wording on a PR review that
requests changes and can be considered a follow up for #5858 to also fix
#5857 in 3rd party notifications.

The difference in the actual notification would be the following:

```diff
- Pull request review rejected
+ Pull request review changes requested
```

While this is a simple string change at first look, it has a deeper UX
meaning.

# Motivation

We could observe that some developers are hesitant to press the "Request
changes" button since their peers first see that their changes were
rejected, thus a more appropriate wording that also falls in line with
the meaning and UI would be beneficial.

## Meaning

Pressing the `Request changes` button in a PR review means that as a
reviewer you are willing to merge the general change in a PR if changes
requested review comments are implemented.
Rejecting a PR on the other hand would be equivalent with closing it
since that change isn't welcome at all (e.g. out of scope feature).

## Sync with UI

The UI button says `request changes` and the other options 


![image](https://github.com/user-attachments/assets/3766cc89-40d7-4c5e-9ff7-a0e1f6991ea6)



## Considered Problems

This might break some automation for users who rely on string matching.
2025-05-15 23:56:26 -04:00
Lunny Xiao
c24f4b3d29
Add migrations tests (#34456)
Fix #34455

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-05-15 16:28:31 +00:00
wxiaoguang
bf338bb9e2
Fix project board view (#34470)
Fix #34469
2025-05-15 23:25:46 +08:00
GiteaBot
319d03fbc0 [skip ci] Updated translations via Crowdin 2025-05-15 00:35:31 +00:00