19041 Commits

Author SHA1 Message Date
Kerwin Bryant
c06f30d77a
Merge branch 'main' into add-file-tree-to-file-view-page 2025-01-15 09:48:17 +08:00
Kerwin Bryant
76c82b21a5 fix 2025-01-15 01:29:48 +00:00
GiteaBot
cbf933eb4e [skip ci] Updated translations via Crowdin 2025-01-15 00:31:44 +00:00
Lunny Xiao
ca964c1ce9 Merge branch 'main' into kerwin612-add-file-tree-to-file-view-page 2025-01-14 12:29:47 -08:00
Lunny Xiao
61be52be5d
finish submodule support 2025-01-14 12:24:16 -08:00
wxiaoguang
4d399e717d
Fix some broken route handlers (#33268)
Some mistakes introduced by recent refactoring PRs (some sidebar
dropdowns doesn't work)
2025-01-14 19:03:02 +00:00
wxiaoguang
1299fdb084
Add a confirm dialog for "sync fork" (#33270)
Try to quickly fix #33264
2025-01-14 18:30:43 +00:00
wxiaoguang
5eff19a77a
Fix sidebar milestone link (#33269)
Fix  #33266
2025-01-14 13:01:53 -05:00
Kerwin Bryant
b1193e0291 fix 2025-01-14 08:16:16 +00:00
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>
2025-01-14 15:35:34 +08:00
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>
2025-01-14 06:29:44 +00:00
yp05327
4672ddcdd7
Fix missing license when sync mirror (#33255)
Fix #33222
2025-01-14 05:44:12 +00:00
Lunny Xiao
9dfdb4fc08
improvement 2025-01-13 19:50:06 -08:00
Kerwin Bryant
abf95a76db fix 2025-01-14 03:38:14 +00:00
Kerwin Bryant
9400d52ee9 fix 2025-01-14 03:36:19 +00:00
wxiaoguang
a98a836e76
Support public code/issue access for private repositories (#33127)
Close #8649, close #639 (will add "anonymous access" in following PRs)
2025-01-14 01:53:34 +00:00
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>
2025-01-14 09:27:35 +08:00
Kerwin Bryant
459edfebcb fix 2025-01-14 01:21:54 +00:00
Lunny Xiao
fe656586f5 Merge branch 'add-file-tree-to-file-view-page' of github.com:kerwin612/gitea into kerwin612-add-file-tree-to-file-view-page 2025-01-13 17:12:13 -08:00
Lunny Xiao
bdd78dfdcb
Use the old infrustructure about getting refullname 2025-01-13 17:11:57 -08:00
Kerwin Bryant
4f90719901
Merge branch 'main' into add-file-tree-to-file-view-page 2025-01-14 08:33:55 +08:00
GiteaBot
58ac17c005 [skip ci] Updated translations via Crowdin 2025-01-14 00:31:05 +00:00
silverwind
98d7e04767
Switch back to vue-tsc (#33248)
It supports Typescript 5.7 now, so we can switch back to the official
version.
2025-01-13 21:57:52 +01:00
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
```
2025-01-13 17:17:39 +00:00
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
2025-01-13 16:27:11 +08:00
Lunny Xiao
4890434b1e
some improvements 2025-01-12 23:00:40 -08:00
Lunny Xiao
0b441325a9 Merge branch 'main' into kerwin612-add-file-tree-to-file-view-page 2025-01-12 22:43:42 -08:00
Kerwin Bryant
a55548feb2 fix 2025-01-13 06:14:27 +00:00
Kerwin Bryant
fe212908b1 fix 2025-01-13 06:09:01 +00:00
wxiaoguang
2ea929a952
Refactor RefName (#33234)
And fix some FIXMEs
2025-01-13 14:01:53 +08:00
Kerwin Bryant
dc63b48493 fix 2025-01-13 05:55:23 +00:00
Lunny Xiao
cac5f1cbf3 Merge branch 'add-file-tree-to-file-view-page' of github.com:kerwin612/gitea into kerwin612-add-file-tree-to-file-view-page 2025-01-12 21:43:29 -08:00
Lunny Xiao
ab98bfba9d
Fix bug 2025-01-12 21:43:24 -08:00
Kerwin Bryant
c0e2fd2e7d fix 2025-01-13 05:41:46 +00:00
Lunny Xiao
67a749f52c
Some renames and use type instead of isFile 2025-01-12 21:35:36 -08:00
Lunny Xiao
3c863223c5
Fix bug 2025-01-12 21:14:43 -08:00
Lunny Xiao
616fe58df0
Remove unused code 2025-01-12 20:58:17 -08:00
Lunny Xiao
eff3568d31 Merge branch 'main' into kerwin612-add-file-tree-to-file-view-page 2025-01-12 20:54:57 -08:00
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
2025-01-13 01:07:05 +00:00
GiteaBot
604365efd7 [skip ci] Updated translations via Crowdin 2025-01-13 00:34:26 +00:00
wxiaoguang
c0751ef116
Fix upload file form (#33230)
Fix #33228
2025-01-13 03:39:15 +08:00
Lunny Xiao
be4e961240
Fix mirror bug (#33224)
Fix #33200

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-01-12 18:46:37 +08:00
wxiaoguang
9024b79933
Remove unused CSS styles and move some styles to proper files (#33217) 2025-01-12 05:16:22 +00:00
wxiaoguang
a068462ac0
Refactor context repository (#33202) 2025-01-12 03:39:46 +00:00
GiteaBot
a7e750414c [skip ci] Updated translations via Crowdin 2025-01-12 00:35:53 +00:00
Lunny Xiao
fd7d393c67
Fix unpin hint on the pinned pull requests (#33207) 2025-01-12 00:05:33 +00:00
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
2025-01-12 04:33:43 +08:00
Kerwin Bryant
d4a99e53c8 fix 2025-01-10 14:05:34 +00:00
Kerwin Bryant
62ecf34b99
Merge branch 'main' into add-file-tree-to-file-view-page 2025-01-10 21:13:39 +08:00
Kerwin Bryant
c2670dbb81 fix 2025-01-10 09:11:57 +00:00