Commit Graph

1534 Commits (ca964c1ce97b265026552afadd42a488940308aa)

Author SHA1 Message Date
Lunny Xiao ca964c1ce9 Merge branch 'main' into kerwin612-add-file-tree-to-file-view-page 2 months ago
Lunny Xiao 61be52be5d
finish submodule support 2 months 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 months ago
Lunny Xiao 9dfdb4fc08
improvement 2 months ago
wxiaoguang a98a836e76
Support public code/issue access for private repositories (#33127)
Close #8649, close #639 (will add "anonymous access" in following PRs)
2 months 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 months ago
Kerwin Bryant 4f90719901
Merge branch 'main' into add-file-tree-to-file-view-page 2 months 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
2 months ago
Lunny Xiao 0b441325a9 Merge branch 'main' into kerwin612-add-file-tree-to-file-view-page 2 months ago
wxiaoguang 2ea929a952
Refactor RefName (#33234)
And fix some FIXMEs
2 months ago
Lunny Xiao 67a749f52c
Some renames and use type instead of isFile 2 months ago
Lunny Xiao 616fe58df0
Remove unused code 2 months ago
Lunny Xiao eff3568d31 Merge branch 'main' into kerwin612-add-file-tree-to-file-view-page 2 months 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
2 months ago
Lunny Xiao be4e961240
Fix mirror bug (#33224)
Fix #33200

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 months ago
wxiaoguang a068462ac0
Refactor context repository (#33202) 2 months ago
Lunny Xiao 818ad6a3ed Merge branch 'add-file-tree-to-file-view-page' of github.com:kerwin612/gitea into kerwin612-add-file-tree-to-file-view-page 2 months ago
Lunny Xiao f769c8bf43
Make template simpler 2 months ago
Kerwin Bryant 67342378d3 Merge branch 'upstream_main' into add-file-tree-to-file-view-page 2 months 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>
2 months ago
Kerwin Bryant 335375fd76 merge main 2 months ago
wxiaoguang 65aae0912a
Fix raw file API ref handling (#33172)
Fix #33164 and add more tests
2 months 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`.
2 months 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
2 months ago
yp05327 e177239529
Fix typo in gitea downloader test and add missing codebase in `ToGitServiceType` (#33146) 2 months ago
yp05327 124079871b
Convert github.com/xanzy/go-gitlab into gitlab.com/gitlab-org/api/client-go (#33126)
Fix #32985
2 months 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.
2 months 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>
2 months 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
2 months 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>
2 months 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
2 months ago
Lunny Xiao 2000a679fa
remove unused code 2 months ago
Lunny Xiao d675289302
Fix bug 2 months ago
wxiaoguang 80e4f4c4eb
Refactor package (routes and error handling, npm peer dependency) (#33111) 2 months ago
Lunny Xiao 87ed579357
Fix test 2 months ago
Lunny Xiao a125a58e81
Fix test 2 months ago
Lunny Xiao 96e050ec63
Fix bugs 2 months ago
Lunny Xiao 64c7e08df2
Fix bug 2 months ago
wxiaoguang 3d544a3ad3
Fix empty git repo handling logic (#33101)
Fix #33092
2 months ago
Lunny Xiao 09000c4ce9
Fix bug 2 months ago
Lunny Xiao fe63c5fbc1
Fix test 2 months ago
Kerwin Bryant b1b24282ae
Merge branch 'main' into add-file-tree-to-file-view-page 2 months ago
Steffen Schröter 57eb9d0b64
Inherit submodules from template repository content (#16237)
Fix #10316

---------

Signed-off-by: Steffen Schröter <steffen@vexar.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 months ago
Bo-Yi Wu 6c89de494a
feat(action): issue change title notifications (#33050)
- Add `IssueChangeTitle` method to handle issue title changes
- Add `notifyIssueChangeWithTitleOrContent` method to generalize
notification handling for issue title or content changes

action file as below:

```yaml
name: Semantic Pull Request

on:
  pull_request_target:
    types: [edited]
```

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 months ago
Chai-Shi 0387195abb
[Feature] Private README.md for organization (#32872)
Implemented #29503

---------

Co-authored-by: Ben Chang <ben_chang@htc.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 months ago
hiifong a87168869a
Fix duplicate co-author in squashed merge commit messages (#33020)
Fix: #31980

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 months ago
Lunny Xiao d45456b1b5
Move SetMerged to service layer (#33045)
No code change.
Extract from #32178
2 months ago
Lunny Xiao 8eecca3478
Remove aws go sdk package dependency (#33029)
This PR removed the dependency of `github.com/aws/aws-sdk-go/aws`

Patially fix for #33023
2 months ago
wxiaoguang cd1b5488a3
Refactor pagination (#33037)
I am sure the simple approach should work, let's try it in 1.24

Follow #29834 and #29841
2 months ago
wxiaoguang 1dbf0d7f08
Test webhook email (#33033)
Close #27918
2 months ago