Commit Graph

19053 Commits (717991640291fd9ea151eb7f14e35ad252f1fd7c)
 

Author SHA1 Message Date
Kerwin Bryant 7179916402 fix 2 weeks ago
Kerwin Bryant 0aa1b867dd
Merge branch 'main' into add-file-tree-to-file-view-page 2 weeks ago
Kemal Zebari 2483a93fbc
Only allow admins to rename default/protected branches (#33276)
Currently, anyone with write permissions to a repo are able to rename
default or protected branches.

This change follows
[GitHub's](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/renaming-a-branch)
design by only allowing repo/site admins to change these branches.
However, it also follows are current design for protected branches and
only allows admins to modify branch names == branch protection rule
names. Glob-based rules cannot be renamed by anyone (as was already the
case, but we now catch `ErrBranchIsProtected` which we previously did
not catch, throwing a 500).
2 weeks ago
silverwind 4b21a6c792
Enable Typescript `noImplicitThis` (#33250)
- Enable https://www.typescriptlang.org/tsconfig/#noImplicitThis
- Wrap Vue Template-Syntax SFCs in
[`defineComponent`](https://vuejs.org/api/general#definecomponent) which
makes type inference and linter work better
- Move `createApp` calls outside the SFCs into separate files
- Use [`PropType`](https://vuejs.org/api/utility-types#proptype-t) where
appropriate
- Some top-level component properties changed order as dictated by the
linter
- Fix all tsc and lint issues that popped up during these refactors
2 weeks ago
wxiaoguang b15d01b0ce
Prepare for support performance trace (#33286)
For #32973
2 weeks ago
wxiaoguang 6659a381ea
Fix closed dependency title (#33285)
Fix #33283
2 weeks ago
Zettat123 d0962ce3da
Move some Actions related functions from `routers` to `services` (#33280)
Move the main logic of `generateTaskContext` and `findTaskNeeds` to the
`services` layer.

This is a part of #32751, since we need the git context and `needs` to
parse the concurrency expressions.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 weeks ago
wxiaoguang f6dbf0e7b3
Fix incorrect TagName/BranchName usages (#33279)
Add add a new test
2 weeks ago
Lunny Xiao bb82979191
remove duplicated code 2 weeks ago
Lunny Xiao 2d644fb4ce
make template simpler 2 weeks ago
Kerwin Bryant 20198ea5a2 fix 2 weeks ago
wxiaoguang fcd096231a
Simplify context ref name (#33267) 2 weeks ago
Kerwin Bryant c06f30d77a
Merge branch 'main' into add-file-tree-to-file-view-page 2 weeks ago
Kerwin Bryant 76c82b21a5 fix 2 weeks ago
GiteaBot cbf933eb4e [skip ci] Updated translations via Crowdin 2 weeks ago
Lunny Xiao ca964c1ce9 Merge branch 'main' into kerwin612-add-file-tree-to-file-view-page 2 weeks ago
Lunny Xiao 61be52be5d
finish submodule support 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
Kerwin Bryant b1193e0291 fix 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
Lunny Xiao 9dfdb4fc08
improvement 2 weeks ago
Kerwin Bryant abf95a76db fix 2 weeks ago
Kerwin Bryant 9400d52ee9 fix 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)
3 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>
3 weeks ago
Kerwin Bryant 459edfebcb fix 3 weeks ago
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 3 weeks ago
Lunny Xiao bdd78dfdcb
Use the old infrustructure about getting refullname 3 weeks ago
Kerwin Bryant 4f90719901
Merge branch 'main' into add-file-tree-to-file-view-page 3 weeks ago
GiteaBot 58ac17c005 [skip ci] Updated translations via Crowdin 3 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
Lunny Xiao 4890434b1e
some improvements 3 weeks ago
Lunny Xiao 0b441325a9 Merge branch 'main' into kerwin612-add-file-tree-to-file-view-page 3 weeks ago
Kerwin Bryant a55548feb2 fix 3 weeks ago
Kerwin Bryant fe212908b1 fix 3 weeks ago
wxiaoguang 2ea929a952
Refactor RefName (#33234)
And fix some FIXMEs
3 weeks ago
Kerwin Bryant dc63b48493 fix 3 weeks ago
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 3 weeks ago
Lunny Xiao ab98bfba9d
Fix bug 3 weeks ago
Kerwin Bryant c0e2fd2e7d fix 3 weeks ago
Lunny Xiao 67a749f52c
Some renames and use type instead of isFile 3 weeks ago
Lunny Xiao 3c863223c5
Fix bug 3 weeks ago
Lunny Xiao 616fe58df0
Remove unused code 3 weeks ago
Lunny Xiao eff3568d31 Merge branch 'main' into kerwin612-add-file-tree-to-file-view-page 3 weeks ago