Commit Graph

18333 Commits

Author SHA1 Message Date
Lunny Xiao 791d7fc76a
Add issue comment when moving issues from one column to another of the project (#29311)
Fix #27278
Replace #27816

This PR adds a meta-comment for an issue when dragging an issue from one
column to another of a project.

<img width="600" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/5fc1d954-430e-4db0-aaee-a00006fa91f5">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: yp05327 <576951401@qq.com>
2024-08-09 01:29:02 +00:00
GiteaBot aa1055fe16 [skip ci] Updated translations via Crowdin 2024-08-09 00:27:50 +00:00
KN4CK3R 3862b31abb
Fix RPM resource leak (#31794)
Fixes a resource leak introduced by #27069.

- add defer
- move sign code out of `repository.go`
2024-08-08 09:43:04 +00:00
Jason Song de2787a493
Add `TAGS` to `TEST_TAGS` and fix bugs found with gogit (#31791)
Found at
https://github.com/go-gitea/gitea/pull/31790#issuecomment-2272898915

`unit-tests-gogit` never work since the workflow set `TAGS` with
`gogit`, but the Makefile use `TEST_TAGS`.

This PR adds the values of `TAGS` to `TEST_TAGS`, ensuring that setting
`TAGS` is always acceptable and avoiding confusion about which one
should be set.
2024-08-07 11:29:08 -04:00
Lunny Xiao df7f1c2ead
Fix protected branch files detection on pre_receive hook (#31778)
Fix #31738

When pushing a new branch, the old commit is zero. Most git commands
cannot recognize the zero commit id. To get the changed files in the
push, we need to get the first diverge commit of this branch. In most
situations, we could check commits one by one until one commit is
contained by another branch. Then we will think that commit is the
diverge point.

And in a pre-receive hook, this will be more difficult because all
commits haven't been merged and they actually stored in a temporary
place by git. So we need to bring some envs to let git know the commit
exist.
2024-08-06 13:32:49 +00:00
Exploding Dragon de175e3b06
Add signature support for the RPM module (#27069)
close  #27031

If the rpm package does not contain a matching gpg signature, the
installation will fail. See (#27031) , now auto-signing rpm uploads.

This option is turned off by default for compatibility.
2024-08-06 09:03:33 -04:00
Edip Emre Bodur 94cca8846e
Fix null requested_reviewer from API (#31773)
If the assign the pull request review to a team, it did not show the
members of the team in the "requested_reviewers" field, so the field was
null. As a solution, I added the team members to the array.

fix #31764
2024-08-05 10:59:53 +00:00
GiteaBot c649a04da1 [skip ci] Updated licenses and gitignores 2024-08-05 00:28:44 +00:00
Lunny Xiao 572aaebd96
Rename head branch of pull requests when renaming a branch (#31759)
Fix #31716
2024-08-04 03:21:42 +00:00
GiteaBot 0b7eb38b24 [skip ci] Updated translations via Crowdin 2024-08-04 00:30:13 +00:00
Lunny Xiao 976f78eb77
Fix wiki revision pagination (#31760)
Fix #31755
2024-08-03 18:35:55 +00:00
GiteaBot 2a1ed0cc11 [skip ci] Updated translations via Crowdin 2024-08-03 00:27:17 +00:00
silverwind 13439f119e
Update JS dependencies (#31766) 2024-08-02 21:28:12 +00:00
Lunny Xiao 237b981164
Upgrade bleve to 2.4.2 (#31762) 2024-08-02 19:32:31 +00:00
Kemal Zebari 0e3d8f8048
Remove unused code from models/repos/release.go (#31756)
These blocks aren't used anywhere else when doing a grep search.
2024-08-02 14:23:49 +00:00
Jason Song 687c118248
Clear up old Actions logs (#31735)
Part of #24256.

Clear up old action logs to free up storage space.

Users will see a message indicating that the log has been cleared if
they view old tasks.

<img width="1361" alt="image"
src="https://github.com/user-attachments/assets/9f0f3a3a-bc5a-402f-90ca-49282d196c22">

Docs: https://gitea.com/gitea/docs/pulls/40

---------

Co-authored-by: silverwind <me@silverwind.io>
2024-08-02 00:42:08 +00:00
wxiaoguang e3678356e1
Fix createElementFromAttrs bug (#31751)
The "false" value was not handled correctly, it would cause bugs in the
future (fortunately, this behavior is not used in code yet).
2024-08-01 19:06:03 +00:00
techknowlogick d1283524b1
bump vue-bar-graph (#31705) 2024-08-01 20:42:51 +03:00
Jason Song 21a73ae642
Use UTC as default timezone when schedule Actions cron tasks (#31742)
Fix #31657.

According to the
[doc](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onschedule)
of GitHub Actions, The timezone for cron should be UTC, not the local
timezone. And Gitea Actions doesn't have any reasons to change this, so
I think it's a bug.

However, Gitea Actions has extended the syntax, as it supports
descriptors like `@weekly` and `@every 5m`, and supports specifying the
timezone like `TZ=UTC 0 10 * * *`. So we can make it use UTC only when
the timezone is not specified, to be compatible with GitHub Actions, and
also respect the user's specified.

It does break the feature because the times to run tasks would be
changed, and it may confuse users. So I don't think we should backport
this.

## ⚠️ BREAKING ⚠️

If the server's local time zone is not UTC, a scheduled task would run
at a different time after upgrading Gitea to this version.
2024-08-01 10:02:46 +00:00
Jason Song 333c9ed8ca
Add permission description for API to add repo collaborator (#31744)
Fix #31552.
2024-08-01 09:33:40 +00:00
Jason Song a33e74d40d
Clarify Actions resources ownership (#31724)
Fix #31707.

Also related to #31715.

Some Actions resources could has different types of ownership. It could
be:

- global: all repos and orgs/users can use it.
- org/user level: only the org/user can use it.
- repo level: only the repo can use it.

There are two ways to distinguish org/user level from repo level:
1. `{owner_id: 1, repo_id: 2}` for repo level, and `{owner_id: 1,
repo_id: 0}` for org level.
2. `{owner_id: 0, repo_id: 2}` for repo level, and `{owner_id: 1,
repo_id: 0}` for org level.

The first way seems more reasonable, but it may not be true. The point
is that although a resource, like a runner, belongs to a repo (it can be
used by the repo), the runner doesn't belong to the repo's org (other
repos in the same org cannot use the runner). So, the second method
makes more sense.

And the first way is not user-friendly to query, we must set the repo id
to zero to avoid wrong results.

So, #31715 should be right. And the most simple way to fix #31707 is
just:

```diff
-	shared.GetRegistrationToken(ctx, ctx.Repo.Repository.OwnerID, ctx.Repo.Repository.ID)
+	shared.GetRegistrationToken(ctx, 0, ctx.Repo.Repository.ID)
```

However, it is quite intuitive to set both owner id and repo id since
the repo belongs to the owner. So I prefer to be compatible with it. If
we get both owner id and repo id not zero when creating or finding, it's
very clear that the caller want one with repo level, but set owner id
accidentally. So it's OK to accept it but fix the owner id to zero.
2024-08-01 09:04:04 +00:00
Jason Song 9e31b229bd
Exclude protected branches from recently pushed (#31748)
Resolve #31566.

Updates to protected branches often come from PR merges, and they are
unlikely to be used to create new PRs.

<img width="1346" alt="image"
src="https://github.com/user-attachments/assets/9ed72bd6-0303-435d-856c-184784104c6a">
<img width="1347" alt="image"
src="https://github.com/user-attachments/assets/c1a1df4b-1c16-4116-aea3-d452242119e0">
<img width="1336" alt="image"
src="https://github.com/user-attachments/assets/706034ad-d3c3-4853-a6b8-cbaf87c70ba0">
2024-08-01 10:21:28 +03:00
GiteaBot 7674eafe31 [skip ci] Updated translations via Crowdin 2024-08-01 00:31:07 +00:00
Jason Song 09b56fc069
Distinguish LFS object errors to ignore missing objects during migration (#31702)
Fix #31137.

Replace #31623 #31697.

When migrating LFS objects, if there's any object that failed (like some
objects are losted, which is not really critical), Gitea will stop
migrating LFS immediately but treat the migration as successful.

This PR checks the error according to the [LFS api
doc](https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md#successful-responses).

> LFS object error codes should match HTTP status codes where possible:
> 
> - 404 - The object does not exist on the server.
> - 409 - The specified hash algorithm disagrees with the server's
acceptable options.
> - 410 - The object was removed by the owner.
> - 422 - Validation error.

If the error is `404`, it's safe to ignore it and continue migration.
Otherwise, stop the migration and mark it as failed to ensure data
integrity of LFS objects.

And maybe we should also ignore others errors (maybe `410`? I'm not sure
what's the difference between "does not exist" and "removed by the
owner".), we can add it later when some users report that they have
failed to migrate LFS because of an error which should be ignored.
2024-07-31 10:29:48 +00:00
Jason Song 9ac57c957f
Improve names of cron jobs for Actions (#31736)
Before:

<img width="1641" alt="image"
src="https://github.com/user-attachments/assets/60fa3f3e-cf19-4903-b080-616aef28057b">

After:

<img width="1674" alt="image"
src="https://github.com/user-attachments/assets/b04fd01e-838d-45c3-9655-cb39a2f7d1f2">
2024-07-31 03:03:30 +00:00
GiteaBot 666c2b23b1 [skip ci] Updated translations via Crowdin 2024-07-31 00:23:19 +00:00
yp05327 75d0b61546
Fix the display of project type for deleted projects (#31732)
Fix: #31727
After:

![image](https://github.com/user-attachments/assets/1dfb4b31-3bd6-47f7-b126-650f33f453e2)
2024-07-30 04:37:43 +00:00
yp05327 0a11bce87f
Fix Null Pointer error for CommitStatusesHideActionsURL (#31731)
Fix https://github.com/go-gitea/gitea/pull/30156#discussion_r1695247028

Forgot fixing it in #31719
2024-07-30 02:56:25 +00:00
Jason Song f989f46438
Move `registerActionsCleanup` to `initActionsTasks` (#31721)
There's already `initActionsTasks`; it will avoid additional check for
if Actions enabled to move `registerActionsCleanup` into it.

And we don't really need `OlderThanConfig`.
2024-07-30 10:27:28 +08:00
Jason Song 81fa471119
Set owner id to zero when GetRegistrationToken for repo (#31725)
Fix #31707.

It's split from #31724.

Although #31724 could also fix #31707, it has change a lot so it's not a
good idea to backport it.
2024-07-29 18:46:45 +00:00
Bo-Yi Wu d39bce7f00
fix(api): owner ID should be zero when created repo secret (#31715)
- Change condition to include `RepoID` equal to 0 for organization
secrets

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-07-29 17:15:02 +00:00
Jason Song bf5ae79c51
Fix API endpoint for registration-token (#31722)
Partially fix #31707. Related to #30656
2024-07-29 16:45:24 +00:00
yp05327 7b388630ec
Fix loadRepository error when access user dashboard (#31719) 2024-07-29 06:51:02 +00:00
yp05327 e0a408e6f3
Add permission check when creating PR (#31033)
user should be a collaborator of the base repo to create a PR
2024-07-29 02:21:22 +00:00
Lunny Xiao d109923ed8
Make GetRepositoryByName more safer (#31712)
Fix #31708
2024-07-29 01:32:54 +00:00
GiteaBot 88decb6913 [skip ci] Updated licenses and gitignores 2024-07-29 00:28:39 +00:00
silverwind 5f526d7d3d
Run `go-install` in `deps-tools` in parallel (#31711)
`go install` is far too conservative in regards to parallel HTTP
requests, so we can run the commands in parallel to achieve a speedup.
2024-07-28 17:27:24 +00:00
Zettat123 7dec8de914
Hide the "Details" link of commit status when the user cannot access actions (#30156)
Fix #26685

If a commit status comes from Gitea Actions and the user cannot access
the repo's actions unit (the user does not have the permission or the
actions unit is disabled), a 404 page will occur after clicking the
"Details" link. We should hide the "Details" link in this case.

<img
src="https://github.com/go-gitea/gitea/assets/15528715/68361714-b784-4bb5-baab-efde4221f466"
width="400px" />
2024-07-28 23:11:40 +08:00
silverwind aa36989bd0
Enable `no-jquery/no-parse-html-literal` and fix violation (#31684)
Tested it, path segment creation works just like before.
2024-07-27 14:44:41 +00:00
GiteaBot a40192dc12 [skip ci] Updated translations via Crowdin 2024-07-27 00:27:00 +00:00
Shivaram Lingamneni e1cf760d2f
OIDC: case-insensitive comparison for auth scheme `Basic` (#31706)
@kylef pointed out on https://github.com/go-gitea/gitea/pull/31632 that
[RFC7617](https://www.rfc-editor.org/rfc/rfc7617.html#section-2)
mandates case-insensitive comparison of the scheme field `Basic`. #31632
copied a case-sensitive comparison from
https://github.com/go-gitea/gitea/pull/6293. This PR fixes both
comparisons.

The issue only affects OIDC, since the implementation for normal Gitea
endpoints is already correct:


930ca92d7c/services/auth/basic.go (L55-L58)
2024-07-26 19:51:45 +00:00
Zettat123 4b376a0ed9
Support `pull_request_target` event for commit status (#31703)
Fix [act_runner #573](https://gitea.com/gitea/act_runner/issues/573)

Before:

![image](https://github.com/user-attachments/assets/3944bf7f-7a60-4801-bcb3-5e158a180fda)

After:

![image](https://github.com/user-attachments/assets/cadac944-40bd-4537-a9d9-e702b8bc1ece)
2024-07-26 18:00:07 +08:00
silverwind 930ca92d7c
Add types to fetch,toast,bootstrap,svg (#31627)
Reduce `tsc` error count by 53. None of the changes has any runtime
effect.
2024-07-25 23:31:24 +00:00
Jason Song cabcca3d81
Run `detectWebAuthnSupport` only if necessary (#31691)
Follow #31676, which is not correct, see
https://github.com/go-gitea/gitea/pull/31676#issuecomment-2246658217

Fix #31675, regression of #31504.
2024-07-25 23:26:41 +00:00
Shivaram Lingamneni ecc8f2b047
add `username` to OIDC introspection response (#31688)
This field is specified as optional here:
https://datatracker.ietf.org/doc/html/rfc7662#section-2.2

It's used by some OIDC integrations, e.g.
https://emersion.fr/blog/2022/irc-and-oauth2/

Co-authored-by: Giteabot <teabot@gitea.io>
2024-07-25 12:36:05 +00:00
Adam Majer bae87dfb09
Add return type to GetRawFileOrLFS and GetRawFile (#31680)
Document return type for the endpoints that fetch specific files from a
repository. This allows the swagger generated code to read the returned
data.

Co-authored-by: Giteabot <teabot@gitea.io>
2024-07-25 14:06:19 +02:00
yp05327 cc044818c3
Support delete user email in admin panel (#31690)
![QQ_1721784609320](https://github.com/user-attachments/assets/23f08bf3-93f4-44d7-963d-10380ef8c1f1)

![QQ_1721784616403](https://github.com/user-attachments/assets/667cbd1e-5e21-4489-8d18-2a7be85190db)

![QQ_1721784626722](https://github.com/user-attachments/assets/495beb94-dfa2-481c-aa60-d5115cad1ae1)

---------

Co-authored-by: Jason Song <i@wolfogre.com>
2024-07-25 18:11:04 +08:00
Stanislas Dolcini d8f82cbc78
Use GetDisplayName() instead of DisplayName() to generate rss feeds (#31687)
Fixes #31491 The RSS feed converted ignored the setting used in the
application.
2024-07-25 17:33:02 +08:00
wxiaoguang 169031b7cf
Fix "Filter by commit" Dropdown (#31695)
Regression of #31281
Fix #31673
2024-07-25 01:48:51 +00:00
GiteaBot 7bd127522f [skip ci] Updated translations via Crowdin 2024-07-25 00:27:15 +00:00