Commit Graph

19005 Commits (517a367abea52fc96a1a8002c87bc20b8528dcd3)
 

Author SHA1 Message Date
GiteaBot cbf933eb4e [skip ci] Updated translations via Crowdin 2 weeks ago
wxiaoguang 4d399e717d
Fix some broken route handlers (#33268)
Some mistakes introduced by recent refactoring PRs (some sidebar
dropdowns doesn't work)
2 weeks ago
wxiaoguang 1299fdb084
Add a confirm dialog for "sync fork" (#33270)
Try to quickly fix #33264
2 weeks ago
wxiaoguang 5eff19a77a
Fix sidebar milestone link (#33269)
Fix  #33266
2 weeks ago
Lunny Xiao 6410c34b7f
Refactor ref type (#33242)
Major changes:

1. do not sync ".keep" file during tests
2. fix incorrect route handler and empty repo handling (backported as #33253 with tests)
3. do not use `RepoRef`: most of the calls are abuses.
4. Use `git.RefType` instead of a new type definition `RepoRefType` on `context`.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 weeks ago
yp05327 3a749fc816
Fix 500 error when error occurred in migration page (#33256)
The template should be `repo/migrate/{service type}`
But input element `service` is not in the form.

Related: #33081

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 weeks ago
yp05327 4672ddcdd7
Fix missing license when sync mirror (#33255)
Fix #33222
2 weeks ago
wxiaoguang a98a836e76
Support public code/issue access for private repositories (#33127)
Close #8649, close #639 (will add "anonymous access" in following PRs)
2 weeks ago
Kemal Zebari ecd463c2f1
Validate that the tag doesn't exist when creating a tag via the web (#33241)
Found while investigating #33210.

This line no longer makes sense because the form field "TagName" is
required, so this would mean that this code path would never be covered.
Because it isn't covered, we end up going down the "update release"
logic where we eventually set `Release.IsTag` to false (meaning it will
now be treated as a release instead of a tag).

This snapshot rewrites the condition to ensure that we aren't trying to
create a tag that already exists.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 weeks ago
GiteaBot 58ac17c005 [skip ci] Updated translations via Crowdin 2 weeks ago
silverwind 98d7e04767
Switch back to `vue-tsc` (#33248)
It supports Typescript 5.7 now, so we can switch back to the official
version.
3 weeks ago
Michael B. a90af22003
Let API create and edit system webhooks, attempt 2 (#33180)
This PR fixes inconsistencies between system and default webhooks in the
Gitea API. (See also #26418)
- A system webhook is a webhook that captures events for all
repositories.
- A default webhook is copied to a new repository when it is created. 

Before this PR `POST /api/v1/admin/hooks/` creates default webhooks (if
not configured otherwise) and `GET /api/v1/admin/hooks/` returns system
webhooks.

The PR introduces an optional query parameter to `GET
/api/v1/admin/hooks/` to enable selecting if either default, system or
both kind of webhooks should be retrieved. By default the flag is set to
return system webhooks keep current behaviour.

## Examples

### System Webhooks

#### Create

```
POST /api/v1/admin/hooks/

{
  "type": "gitea",
  "active": false,
  "branch_filter": "*",
  "events": [ "create", "..." ],
  "config": {
    "url": "http://...",
    "content_type": "json",
    "secret": "secret",
    "is_system_webhook": true // <-- controls hook type
  }
}
```

#### List
```
GET/api/v1/admin/hooks?type=system //type argument is optional here since it's the default
```

#### Others
The other relevant endpoints work as expected by referencing the hook by
id
```
GET /api/v1/admin/hooks/:id
PATCH /api/v1/admin/hooks/:id
DELETE /api/v1/admin/hooks/:id
```


### Default Webhooks

#### Create
```
POST /api/v1/admin/hooks/

{
  "type": "gitea",
  "active": false,
  "branch_filter": "*",
  "events": [ "create", "..." ],
  "config": {
    "url": "http://...",
    "content_type": "json",
    "secret": "secret",
    "is_system_webhook": false // optional, as false is the default value
  }
}
```

#### List
```
GET/api/v1/admin/hooks?type=default
```

#### Others
The other relevant endpoints work as expected by referencing the hook by
id
```
GET /api/v1/admin/hooks/:id
PATCH /api/v1/admin/hooks/:id
DELETE /api/v1/admin/hooks/:id
```
3 weeks ago
wxiaoguang 348b7074c8
Fix incorrect ref "blob" (#33240)
1. "blob" is not a "ref", it shouldn't (and not unable to) be handled by
`RepoRefByType`
2. the `/blob/{sha}` handle should use the path param "sha" directly
3 weeks ago
wxiaoguang 2ea929a952
Refactor RefName (#33234)
And fix some FIXMEs
3 weeks ago
wxiaoguang 81352542fd
Refactor context RefName and RepoAssignment (#33226)
The `ctx.Repo.RefName` was used to be a "short name", it causes a lot of
ambiguity.

This PR does some refactoring and use `RefFullName` to replace the
legacy `RefName`, and simplify RepoAssignment
3 weeks ago
GiteaBot 604365efd7 [skip ci] Updated translations via Crowdin 3 weeks ago
wxiaoguang c0751ef116
Fix upload file form (#33230)
Fix #33228
3 weeks ago
Lunny Xiao be4e961240
Fix mirror bug (#33224)
Fix #33200

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 weeks ago
wxiaoguang 9024b79933
Remove unused CSS styles and move some styles to proper files (#33217) 3 weeks ago
wxiaoguang a068462ac0
Refactor context repository (#33202) 3 weeks ago
GiteaBot a7e750414c [skip ci] Updated translations via Crowdin 3 weeks ago
Lunny Xiao fd7d393c67
Fix unpin hint on the pinned pull requests (#33207) 3 weeks ago
TheFox0x7 8c6d7076b7
fix(cache): cache test triggered by non memory cache (#33220)
Change SlowCacheThreshold to 30 milliseconds so it doesn't trigger on
non memory cache

Closes: https://github.com/go-gitea/gitea/issues/33190
Closes: https://github.com/go-gitea/gitea/issues/32657
3 weeks ago
yp05327 5c150ce9b0
Update README.md (#33149)
~~Waiting for the upload of screenshots~~
I have a good idea about the screenshots. I will do it later.

---------

Co-authored-by: Gary Wang <git@blumia.net>
3 weeks ago
Harry Vince d7ec23febf
Fix editor markdown not incrementing in a numbered list (#33187)
Amended the logic for newPrefix in the MarkdownEditor to resolve
incorrect number ordering.

Fixes #33184

Attached screenshot of fixed input similar to issue 
<img width="175" alt="Screenshot 2025-01-09 at 23 59 24"
src="https://github.com/user-attachments/assets/dfa23cf1-f3db-4b5e-99d2-a71bbcb289a8"
/>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 weeks ago
Lunny Xiao d3083d2198
Some small refactors (#33144) 3 weeks ago
Chai-Shi e5f3c16587
Fix sync fork for consistency (#33147)
Fixes #33145

An integration test could be added.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 weeks ago
techknowlogick 189e7409b7
Use updated path to s6-svscan after alpine upgrade (#33185)
Fix #33163

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 weeks ago
wxiaoguang 65aae0912a
Fix raw file API ref handling (#33172)
Fix #33164 and add more tests
3 weeks ago
GiteaBot 8f8ad8e272 [skip ci] Updated translations via Crowdin 3 weeks ago
wxiaoguang 5b31077b68
Fix ACME panic (#33178)
Fix #33177, Manually tested:

````
1.7364311850484018e+09	info	maintenance	started background certificate maintenance	{"cache": "0x1400ca64180"}
1.736431185054049e+09	info	obtain	acquiring lock	{"identifier": "example.com"}
1.736431185058073e+09	info	obtain	lock acquired	{"identifier": "example.com"}
1.736431185058133e+09	info	obtain	obtaining certificate	{"identifier": "example.com"}
````
3 weeks ago
Lunny Xiao 39d51e7c82
Automerge supports deleting branch automatically after merging (#32343)
Resolve #32341 
~Depends on #27151~

- [x] It will display a checkbox of deleting the head branch on the pull
request view page when starting an auto-merge task.
- [x] Add permission check before deleting the branch
- [x] Add delete branch comment for those closing pull requests because
of head branch or base branch was deleted.
- [x] Merge `RetargetChildrenOnMerge` and `AddDeletePRBranchComment`
into `service.DeleteBranch`.
3 weeks ago
yp05327 2298ff2152
Fix branch dropdown not display ref name (#33159)
Before:

![image](https://github.com/user-attachments/assets/899d25a9-80e9-48d5-a820-79c911c858e9)
After:

![image](https://github.com/user-attachments/assets/cf2a7407-909a-41db-9957-19d9214af57e)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 weeks ago
hiifong 5f679c1c59
Add .run to gitignore (#33175)
![image](https://github.com/user-attachments/assets/340a6c2a-8575-4ef9-be75-84af8af82b93)
3 weeks ago
wxiaoguang a5043af8ea
Fix assignee list overlapping in Issue sidebar (#33176)
Fix  #33170

![image](https://github.com/user-attachments/assets/714cebdc-ee76-43e3-9ece-a189f8ecb17a)

![image](https://github.com/user-attachments/assets/cbb58425-42b4-41ee-ba3c-7efbd24607dc)
3 weeks ago
TheFox0x7 68ca73b716
Fix pam auth test regression (#33169)
fixes: https://github.com/go-gitea/gitea/issues/33168
3 weeks ago
yp05327 88366f280e
Move repo size to sidebar (#33155)
![image](https://github.com/user-attachments/assets/8b14dbb7-ec36-4596-a6aa-72c14d93309d)
3 weeks ago
Lunny Xiao ba5e3a5161
Fix fuzz test (#33156) 3 weeks ago
TheFox0x7 2a02734f93
Refactor older tests to use testify (#33140)
Refactor checks to use assert/require
Use require.Eventually for waiting in elastic and meilisearch tests
Use require to exit early instead of assert
3 weeks ago
GiteaBot fa9191b7b9 [skip ci] Updated translations via Crowdin 3 weeks ago
yp05327 e177239529
Fix typo in gitea downloader test and add missing codebase in `ToGitServiceType` (#33146) 3 weeks ago
wxiaoguang 9c00e065a1
Fix form width (#33151)
Fix #33150
3 weeks ago
yp05327 124079871b
Convert github.com/xanzy/go-gitlab into gitlab.com/gitlab-org/api/client-go (#33126)
Fix #32985
3 weeks ago
wxiaoguang 386c1ed908
Refactor HTMLFormat, update chroma render, fix js error (#33136)
A small refactor to improve HTMLFormat, to help to prevent low-level
mistakes.

And fix #33141, fix #33139
3 weeks ago
Lunny Xiao 67aeb1f896
Add missed transaction on setmerged (#33079)
Follow #33045. There are two updates on `Set Merged`, which should be in
one transaction.
This also introduced some refactors for changeissuestatus to make it
more clear.
3 weeks ago
Rowan Bohde a8e7caedfa
add submodule diff links (#33097)
This adds links to submodules in diffs, similar to the existing link
when viewing a repo at a specific commit. It does this by expanding diff
parsing to recognize changes to submodules, and find the specific refs
that are added, deleted or changed.

Related #25888

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 weeks ago
GiteaBot ec84687df9 [skip ci] Updated translations via Crowdin 3 weeks ago
yp05327 32d45ee069
Update status check for all supported on.pull_request.types in Gitea (#33117)
Thanks @Zettat123
Follow #33116
Fix #33051

on.pull_request.types doc:

https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request

on.pull_request.types added in this PR:
```
assigned, unassigned, review_requested, review_request_removed, milestoned, demilestoned, labeled, unlabeled
```

unsupported types in Gitea:
```
// Unsupported activity types:
// converted_to_draft, ready_for_review, locked, unlocked, auto_merge_enabled, auto_merge_disabled, enqueued, dequeued
```

TODO:
- [x] add test
3 weeks ago
yp05327 0d7d2ed39d
Support the new exit code for `git remote` subcommands for git version >=2.30.0 (#33129)
Fix #32889

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 weeks ago
wxiaoguang 34dfc25b83
Make git clone URL could use current signed-in user (#33091)
close #33086

* Add a special value for "SSH_USER" setting: `(DOER_USERNAME)`
* Improve parseRepositoryURL and add tests (now it doesn't have hard
dependency on some setting values)

Many changes are just adding "ctx" and "doer" argument to functions.

By the way, improve app.example.ini, remove all `%(key)s` syntax, it
only makes messy and no user really cares about it.

Document: https://gitea.com/gitea/docs/pulls/138
3 weeks ago