Commit Graph
1526 Commits
Author SHA1 Message Date
Lunny Xiao 0b441325a9 Merge branch 'main' into kerwin612-add-file-tree-to-file-view-page 2025-01-12 22:43:42 -08:00
wxiaoguangandGitHub 2ea929a952 Refactor RefName (#33234)
And fix some FIXMEs
2025-01-13 14:01:53 +08:00
Lunny Xiao 67a749f52c Some renames and use type instead of isFile 2025-01-12 21:35:36 -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
wxiaoguangandGitHub 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
be4e961240 Fix mirror bug (#33224)
Fix #33200

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-01-12 18:46:37 +08:00
wxiaoguangandGitHub a068462ac0 Refactor context repository (#33202) 2025-01-12 03:39:46 +00:00
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 2025-01-09 23:11:38 -08:00
Lunny Xiao f769c8bf43 Make template simpler 2025-01-09 23:11:33 -08:00
Kerwin Bryant 67342378d3 Merge branch 'upstream_main' into add-file-tree-to-file-view-page 2025-01-10 06:53:59 +00:00
e5f3c16587 Fix sync fork for consistency (#33147)
Fixes #33145

An integration test could be added.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-01-10 05:29:55 +00:00
Kerwin Bryant 335375fd76 merge main 2025-01-10 01:57:19 +00:00
wxiaoguangandGitHub 65aae0912a Fix raw file API ref handling (#33172)
Fix #33164 and add more tests
2025-01-10 01:31:49 +00:00
Lunny XiaoandGitHub 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`.
2025-01-10 03:51:03 +08:00
TheFox0x7andGitHub 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
2025-01-09 09:21:47 +08:00
yp05327andGitHub e177239529 Fix typo in gitea downloader test and add missing codebase in ToGitServiceType (#33146) 2025-01-08 18:34:53 +00:00
yp05327andGitHub 124079871b Convert github.com/xanzy/go-gitlab into gitlab.com/gitlab-org/api/client-go (#33126)
Fix #32985
2025-01-08 13:10:43 +08:00
Lunny XiaoandGitHub 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.
2025-01-08 03:16:56 +00:00
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>
2025-01-08 01:38:30 +00:00
yp05327andGitHub 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
2025-01-08 01:58:47 +08:00
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>
2025-01-07 20:42:45 +08:00
wxiaoguangandGitHub 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
2025-01-07 13:17:44 +08:00
Lunny Xiao 2000a679fa remove unused code 2025-01-06 10:25:14 -08:00
Lunny Xiao d675289302 Fix bug 2025-01-06 10:06:25 -08:00
wxiaoguangandGitHub 80e4f4c4eb Refactor package (routes and error handling, npm peer dependency) (#33111) 2025-01-06 22:45:20 +08:00
Lunny Xiao 87ed579357 Fix test 2025-01-06 00:28:21 -08:00
Lunny Xiao a125a58e81 Fix test 2025-01-05 23:53:15 -08:00
Lunny Xiao 96e050ec63 Fix bugs 2025-01-05 23:17:40 -08:00
Lunny Xiao 64c7e08df2 Fix bug 2025-01-05 21:56:03 -08:00
wxiaoguangandGitHub 3d544a3ad3 Fix empty git repo handling logic (#33101)
Fix #33092
2025-01-04 18:47:24 +08:00
Lunny Xiao 09000c4ce9 Fix bug 2025-01-02 23:52:01 -08:00
Lunny Xiao fe63c5fbc1 Fix test 2025-01-02 22:32:33 -08:00
Kerwin BryantandGitHub b1b24282ae Merge branch 'main' into add-file-tree-to-file-view-page 2025-01-03 13:52:57 +08:00
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>
2025-01-01 02:55:13 +00:00
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>
2024-12-31 12:08:36 +00:00
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>
2024-12-31 04:22:09 +00:00
a87168869a Fix duplicate co-author in squashed merge commit messages (#33020)
Fix: #31980

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-12-30 19:03:21 +00:00
Lunny XiaoandGitHub d45456b1b5 Move SetMerged to service layer (#33045)
No code change.
Extract from #32178
2024-12-30 07:04:03 +00:00
Lunny XiaoandGitHub 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
2024-12-30 06:30:28 +00:00
wxiaoguangandGitHub cd1b5488a3 Refactor pagination (#33037)
I am sure the simple approach should work, let's try it in 1.24

Follow #29834 and #29841
2024-12-30 01:57:38 +00:00
wxiaoguangandGitHub 1dbf0d7f08 Test webhook email (#33033)
Close #27918
2024-12-30 01:25:49 +08:00
wxiaoguangandGitHub 0ed160ffea Refactor tests (#33021)
1. fix incorrect tests, for example: BeanExists doesn't do assert and
shouldn't be used
2. remove unnecessary test functions
3. introduce DumpQueryResult to help to see the database rows during
test (at least I need it)

```
====== DumpQueryResult: SELECT * FROM action_runner_token ======
- # row[0]
  id: 1
  token: xeiWBL5kuTYxGPynHCqQdoeYmJAeG3IzGXCYTrDX
  owner_id: 0
...
```
2024-12-29 01:05:56 +00:00
a7b2707be9 Fix Agit pull request permission check (#32999)
user with read permission should also can create agit flow pull request.
looks this logic was broken in
https://github.com/go-gitea/gitea/pull/31033 this pull request try fix
it and add test code.

---------

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-12-27 18:17:01 +00:00
2d1a171dc7 Support for email addresses containing uppercase characters when activating user account (#32998)
Fix #32807

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-12-27 19:16:23 +08:00
Lunny Xiao bf15e1878c Fix bug 2024-12-26 12:38:11 -08:00
Lunny Xiao 1a1fe32256 Fix bug 2024-12-26 12:09:57 -08:00
Lunny Xiao e860a363e7 Add more comment 2024-12-26 11:46:47 -08:00
Lunny Xiao 9ae1c85ee8 Fix bug 2024-12-26 11:41:00 -08:00
Lunny Xiao 2178347348 add function for recusive 2024-12-26 00:30:03 -08:00