Commit Graph
100 Commits
Author SHA1 Message Date
Lunny XiaoandGitHub c5422fae9a Fix fork page branch selection (#32711)
Fix #32709
2024-12-05 00:57:32 +00:00
Lunny XiaoandGitHub 5ab7aa700f Use new mail package instead of an unmintained one (#32682)
Resolve #18664
2024-12-05 06:33:43 +08:00
Lunny XiaoandGitHub e45ffc530f Remove outdated code about fixture generation (#32708) 2024-12-04 07:59:28 +00:00
Lunny XiaoandGitHub 17053e953f Fix delete branch perm checking (#32654) 2024-12-04 11:59:48 +08:00
Lunny XiaoandGitHub 829c34129c Quick fix for license file name (#32696) 2024-12-03 07:59:07 -08:00
Lunny XiaoandGitHub 79d593a9be Split mail sender sub package from mailer service package (#32618)
Move all mail sender related codes into a sub package of
services/mailer. Just move, no code change.
Then we just have dependencies on go-mail package in the new sub
package. We can use other package to replace it because it's
unmaintainable. ref #18664
2024-11-30 01:15:41 +00:00
Lunny XiaoandGitHub 1ed5f379b9 Move GetFeeds to service layer (#32526)
Move GetFeeds from models to service layer, no code change.
2024-11-29 17:53:49 +00:00
Lunny XiaoandGitHub 00f8090de4 Don't create action when syncing mirror pull refs (#32659)
Fix #27961
2024-11-28 07:43:38 +00:00
Lunny XiaoandGitHub f62f68cbdd Move team related functions to service layer (#32537)
There are still some functions under `models` after last big refactor
about `models`. This change will move all team related functions to
service layer with no code change.
2024-11-27 21:12:26 +00:00
Lunny XiaoandGitHub f49d82309b Introduce OrgList and add LoadTeams, optimaze Load teams for orgs (#32543) 2024-11-26 21:55:06 +00:00
Lunny XiaoandGitHub 703be6bf30 Add github compatible tarball download API endpoints (#32572)
Fix #29654 
Fix #32481
2024-11-25 19:35:49 +00:00
Lunny XiaoandGitHub c363bd06e9 Strict pagination check (#32548) 2024-11-25 09:56:50 +08:00
Lunny XiaoandGitHub fe49cb0243 Fix get reviewers' bug (#32415)
This PR rewrites `GetReviewer` function and move it to service layer.

Reviewers should not be watchers, so that this PR removed all watchers
from reviewers. When the repository is under an organization, the pull
request unit read permission will be checked to resolve the bug of
#32394

Fix #32394
2024-11-22 10:44:48 -05:00
Lunny XiaoandGitHub a175f9805c Add line-through for deleted branch on pull request view page (#32500)
Base branch deleted

![图片](https://github.com/user-attachments/assets/bc45aa33-d514-47c8-885a-de9732f2f3d5)

branch deleted comment

![图片](https://github.com/user-attachments/assets/83729bbb-2ee8-4bd3-b6f1-780d2daad3d4)

Head branch deleted

![图片](https://github.com/user-attachments/assets/90120b22-34a9-4387-aae9-5c882e8d421a)
2024-11-21 17:04:18 +00:00
Lunny XiaoandGitHub 9bf821ae6c Fix GetInactiveUsers (#32540)
Fix #31480
2024-11-21 04:55:32 +00:00
33850a83fe Fix submodule parsing (#32571)
Fix #32568, parse `.gitmodules` correctly

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-11-20 19:26:12 +00:00
Lunny XiaoandGitHub 0d5abd9b3e Remove unnecessary code (#32560)
PushMirrors only be used in the repository setting page. So it should
not be loaded on every repository page.
2024-11-19 16:21:13 +00:00
Lunny XiaoandGitHub 896314c7a2 Fix some places which doesn't repsect org full name setting (#32243)
Partially fix #31345
2024-11-18 06:24:49 +00:00
696fbe6036 Refactor push mirror find and add check for updating push mirror (#32539)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-11-18 05:59:04 +00:00
4f879a00df Refactor find forks and fix possible bugs that weak permissions check (#32528)
- Move models/GetForks to services/FindForks
- Add doer as a parameter of FindForks to check permissions
- Slight performance optimization for get forks API with batch loading
of repository units
- Add tests for forking repository to organizations

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-11-18 03:06:25 +00:00
Lunny XiaoandGitHub f122aaf9ff Use better name for userinfo structure (#32544) 2024-11-18 10:41:59 +08:00
Lunny XiaoandGitHub c3dedcffa7 Fix basic auth with webauthn (#32531) 2024-11-16 17:52:16 +00:00
Lunny XiaoandGitHub e1b269e956 Remove transaction for archive download (#32186)
Since there is a status column in the database, the transaction is
unnecessary when downloading an archive. The transaction is blocking
database operations, especially with SQLite.

Replace #27563
2024-11-15 12:04:20 +08:00
Lunny XiaoandGitHub 4121f952d1 Fix oauth2 error handle not return immediately (#32514) 2024-11-15 02:13:01 +00:00
Lunny XiaoandGitHub 98d9a71ffe Trim title before insert/update to database to match the size requirements of database (#32498)
Fix #32489
2024-11-14 07:19:14 +00:00
b4abb6deff Reimplement GetUserOrgsList to make it simple and clear (#32486)
Reimplement GetUserOrgsList and also move some functions and test to
org_list file.

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
2024-11-14 05:31:47 +00:00
840ad7eefe Disable Oauth check if oauth disabled (#32368)
Fix #32367

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-11-12 21:33:35 +00:00
a1892cf7e3 Move some functions from issue.go to standalone files (#32468)
Just functions move, no code change.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-11-11 04:28:54 +00:00
Lunny XiaoandGitHub 331e878e81 Add new event commit status creation and webhook implementation (#27151)
This PR introduces a new event which is similar as Github's. When a new
commit status submitted, the event will be trigged. That means, now we
can receive all feedback from CI/CD system in webhooks or other notify
systems.

ref:
https://docs.github.com/en/webhooks/webhook-events-and-payloads#status

Fix #20749
2024-11-07 06:41:49 +00:00
Lunny XiaoandGitHub 276500c314 Move AddCollabrator and CreateRepositoryByExample to service layer (#32419)
- [x] Move `CreateRepositoryByExample` to service layer
- [x] Move `AddCollabrator` to service layer
- [x] Add a new parameter for `AddCollabrator` so that changing mode
immediately after that will become unnecessary.
2024-11-07 11:28:11 +08:00
Lunny XiaoandGitHub 913be9e8ac Add new index for action to resolve the performance problem (#32333)
Fix #32224
2024-11-06 22:04:48 +00:00
24b83ff63e Fix milestone deadline and date related problems (#32339)
Use zero instead of 9999-12-31 for deadline
Fix #32291

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-11-05 07:46:40 +00:00
Lunny XiaoandGitHub 1887c75c35 Only query team tables if repository is under org when getting assignees (#32414)
It's unnecessary to query the team table if the repository is not under
organization when getting assignees.
2024-11-05 07:13:52 +00:00
Lunny XiaoandGitHub 13a203828c Fix created_unix for mirroring (#32342)
Fix #32233
2024-11-02 06:11:38 +00:00
feca8802b8 Fix clean tmp dir (#32360)
Try to fix #31792 

Credit to @jeroenlaylo
Copied from
https://github.com/go-gitea/gitea/issues/31792#issuecomment-2311920520

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-10-29 18:27:03 +02:00
Lunny XiaoandGitHub 2abdbe88b5 Fix disable 2fa bug (#32320) 2024-10-23 06:41:00 +00:00
Lunny XiaoandGitHub d46d34a655 Upgrade rollup to 4.24.0 (#32312) 2024-10-23 05:00:32 +00:00
Lunny XiaoandGitHub 500774277c Upgrade vue to 3.5.12 (#32311) 2024-10-23 04:55:17 +00:00
Lunny XiaoandGitHub a264c46fb0 Add warn log when deleting inactive users (#32318)
Add log for the problem #31480
2024-10-23 09:28:28 +08:00
Lunny XiaoandGitHub 9df5ddaf44 Only rename a user when they should receive a different name (#32247)
Fix #31996
2024-10-13 03:13:55 +00:00
Lunny XiaoandGitHub aebb741c08 Use per package global lock for container uploads instead of memory lock (#31860)
This PR uses a per-package lock instead of a global lock for container
uploads. So that different packages can be uploaded simultaneously.
2024-10-11 07:37:49 +00:00
c2217670dd Move admin routers from /admin to /-/admin (#32189)
Resolve #32181

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-10-10 04:56:49 +00:00
Lunny XiaoandGitHub d6d3c96e65 Fix bug when a token is given public only (#32204) 2024-10-08 12:51:09 +03:00
Lunny XiaoandGitHub fa35ace9fb Fix bug when there are multiple triggers with workflow dispatch (#32200) 2024-10-07 03:50:38 +00:00
a989404e23 Fix javascript error when an anonymous user visiting migration page (#32144)
This PR fixes javascript errors when an anonymous user visits the
migration page.
It also makes task view checking more restrictive.

The router moved from `/user/task/{id}/status` to
`/username/reponame/-/migrate/status` because it's a migrate status.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-10-02 04:37:16 +00:00
Lunny XiaoandGitHub 3a4a1bffbe Make oauth2 code clear. Move oauth2 provider code to their own packages/files (#32148)
Fix #30266
Replace #31533
2024-10-02 08:03:19 +08:00
Lunny XiaoandGitHub 3f9e360142 Don't join repository when loading action table data (#32127) 2024-09-26 04:50:30 +00:00
Lunny XiaoandGitHub 5a8568459d Fix bug when deleting a migrated branch (#32075)
After migrating a repository with pull request, the branch is missed and
after the pull request merged, the branch cannot be deleted.
2024-09-24 07:42:08 +00:00
Lunny XiaoandGitHub 4947bec836 Include collaboration repositories on dashboard source/forks/mirrors list (#31946)
Fix #13489

In the original implementation, only `All` will display your owned and
collaborated repositories. For other filters like `Source`, `Mirrors`
and etc. will only display your owned repositories.

This PR removed the limitations. Now except `collbrations`, other
filters will always display your owned and collaborated repositories.
2024-09-24 07:12:06 +00:00
Lunny XiaoandGitHub e2f365b55c Display head branch more comfortable on pull request view (#32000)
This PR do some minor improvements for head branch display on pull
request view UI.

- [x] Remove the link if the head branch has been deleted with a
tooltip, so that users will not result in a 404 page
- [x] Display a label if this pull request is an agit based one.

![图片](https://github.com/user-attachments/assets/872f26b6-f1cf-4427-9e41-e3a5b176dfa4)
2024-09-24 04:14:57 +00:00
Lunny XiaoandGitHub 2c6fa6c1e0 Fix template bug of pull request view (#32072)
Caused by #31924
2024-09-24 03:02:42 +00:00
Lunny XiaoandGitHub 6eb5950835 Allow set branch protection in an empty repository (#32095) 2024-09-24 02:06:28 +00:00
Lunny XiaoandGitHub 3f2d8f8730 Fix panic when cloning with wrong ssh format. (#32076) 2024-09-24 01:30:05 +00:00
Lunny XiaoandGitHub 9e0db1b646 Fix rename branch permission bug (#32066)
The previous implementation requires admin permission to rename branches
which should be write permission.

Fix #31993
2024-09-22 18:08:27 +00:00
Lunny XiaoandGitHub a802508f88 Fix wrong last modify time (#32102) 2024-09-21 21:56:25 +00:00
Lunny XiaoandGitHub 5de41737a5 Fix upload maven pacakge parallelly (#31851)
Use globallock for maven package uploads.

Thanks @tlusser for the test code.

Depends on ~#31813~
2024-09-21 19:26:45 +00:00
Lunny XiaoandGitHub 8e2dd5d3dd Use camo.Always instead of camo.Allways (#32097)
Fix #31575 

https://gitea.com/gitea/docs/pulls/73
2024-09-21 12:50:54 +03:00
Lunny XiaoandGitHub 8cdf4e29c4 Fix CI (#32062) 2024-09-17 19:35:59 +00:00
Lunny XiaoandGitHub 3febcaa53b Use a common message template instead of a special one (#31878) 2024-09-14 17:17:49 +00:00
Lunny XiaoandGitHub d8f3498875 Upgrade cache to v0.2.1 (#32003)
Fix #31757
2024-09-07 17:12:37 +00:00
2da2000413 Use global lock instead of NewExclusivePool to allow distributed lock between multiple Gitea instances (#31813)
Replace #26486 
Fix #19620

---------

Co-authored-by: Jason Song <i@wolfogre.com>
2024-09-06 10:12:41 +00:00
Lunny XiaoandGitHub a5818470fe Use forum.gitea.com instead of old URL (#31989) 2024-09-06 07:20:30 +00:00
Lunny XiaoandGitHub 5c05dddbed Fix nuget/conan/container packages upload bugs (#31967) 2024-09-05 07:05:42 +00:00
Lunny XiaoandGitHub a366af4b7a Remove html tags from create tag and branch translation (#31973)
Follow #31950 and Fix the display bug of #31966 .

This will only fix the English version. I will update all these
translation files in crowdin after this merged so that all the languages
can be fixed.

And all these files should be backported together.

This PR remove the bold effect around the name when creating a new tag
or branch.
2024-09-04 12:53:55 +08:00
7eef261c3e Replace v-html with v-text in search inputbox (#31966)
Credit for @techknowlogick

Co-authored-by: techknowlogick <techknowlogick@noreply.gitea.com>
2024-09-04 02:52:00 +00:00
85b1f3080c Improve get feed with pagination (#31821)
Fix #31752

@somera

---------

Co-authored-by: delvh <dev.lh@web.de>
2024-09-02 19:05:09 +00:00
Lunny XiaoandGitHub ac34449747 Prevent update pull refs manually and will not affect other refs update (#31931)
All refs under `refs/pull` should only be changed from Gitea inside but
not by pushing from outside of Gitea.
This PR will prevent the pull refs update but allow other refs to be
updated on the same pushing with `--mirror` operations.

The main changes are to add checks on `update` hook but not
`pre-receive` because `update` will be invoked by every ref but
`pre-receive` will revert all changes once one ref update fails.
2024-09-02 07:38:27 +00:00
Lunny XiaoandGitHub 286ede47ad Fix index too many file names bug (#31903)
Try to fix #31884
Fix #28584
2024-09-01 05:57:31 +00:00
Lunny XiaoandGitHub 06c67c6d5a Fix search team (#31923)
Fix #20658
2024-08-29 13:26:25 +00:00
Lunny XiaoandGitHub fcac28c878 Upgrade micromatch to 4.0.8 (#31939) 2024-08-29 04:54:38 +00:00
Lunny XiaoandGitHub 0299bb97f0 Use correct function name (#31887) 2024-08-21 21:05:48 +00:00
Lunny XiaoandGitHub d158472a5a Don't return 500 if mirror url contains special chars (#31859)
Fix #31640
2024-08-21 01:54:55 +00:00
Lunny XiaoandGitHub c03baab678 Refactor the usage of batch catfile (#31754)
When opening a repository, it will call `ensureValidRepository` and also
`CatFileBatch`. But sometimes these will not be used until repository
closed. So it's a waste of CPU to invoke 3 times git command for every
open repository.

This PR removed all of these from `OpenRepository` but only kept
checking whether the folder exists. When a batch is necessary, the
necessary functions will be invoked.
2024-08-20 17:04:57 +00:00
Lunny XiaoandGitHub 8b92eba21f Fix agit automerge (#31207) 2024-08-20 14:17:21 +08:00
Lunny XiaoandGitHub ccf7366db0 Add tag name in the commits list (#31082)
Fix #10036

This PR adds some labels for tags of this commit after the commit
message on the commits table. The tag template is share as commit
graph's.

Desktop:
<img width="1302" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/ba94e1e6-2a3d-44f3-85a3-575fb5667c97">

Mobile:
<img width="370" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/e3eb1f44-3686-4012-aa9d-52cd88b22c0e">
2024-08-19 17:04:06 +00:00
Lunny XiaoandGitHub 4f5c96627b Fix actions notify bug (#31866)
Try to fix
https://github.com/go-gitea/gitea/issues/31757#issuecomment-2295131062
2024-08-19 16:25:41 +00:00
Lunny XiaoandGitHub b491b2104f Fix panic of ssh public key page after deletion of auth source (#31829)
Fix #31730 

This PR rewrote the function `PublicKeysAreExternallyManaged` with a
simple test. The new function removed the loop to make it more readable.
2024-08-15 23:59:01 +08:00
791d7fc76a Add issue comment when moving issues from one column to another of the project (#29311)
Fix #27278
Replace #27816

This PR adds a meta-comment for an issue when dragging an issue from one
column to another of a project.

<img width="600" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/5fc1d954-430e-4db0-aaee-a00006fa91f5">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: yp05327 <576951401@qq.com>
2024-08-09 01:29:02 +00:00
Lunny XiaoandGitHub df7f1c2ead Fix protected branch files detection on pre_receive hook (#31778)
Fix #31738

When pushing a new branch, the old commit is zero. Most git commands
cannot recognize the zero commit id. To get the changed files in the
push, we need to get the first diverge commit of this branch. In most
situations, we could check commits one by one until one commit is
contained by another branch. Then we will think that commit is the
diverge point.

And in a pre-receive hook, this will be more difficult because all
commits haven't been merged and they actually stored in a temporary
place by git. So we need to bring some envs to let git know the commit
exist.
2024-08-06 13:32:49 +00:00
Lunny XiaoandGitHub 572aaebd96 Rename head branch of pull requests when renaming a branch (#31759)
Fix #31716
2024-08-04 03:21:42 +00:00
Lunny XiaoandGitHub 976f78eb77 Fix wiki revision pagination (#31760)
Fix #31755
2024-08-03 18:35:55 +00:00
Lunny XiaoandGitHub 237b981164 Upgrade bleve to 2.4.2 (#31762) 2024-08-02 19:32:31 +00:00
Lunny XiaoandGitHub d109923ed8 Make GetRepositoryByName more safer (#31712)
Fix #31708
2024-07-29 01:32:54 +00:00
0d08bb6112 Upgrade xorm to v1.3.9 and improve some migrations Sync (#29899)
Co-authored-by: 6543 <6543@obermui.de>
2024-07-14 17:15:59 -04:00
Lunny XiaoandGitHub 1b0ccf4bea Upgrade security public key (#31594)
Fix #31591
2024-07-10 16:28:22 +00:00
Lunny XiaoandGitHub 436af472a9 Fix wrong merge on removing docs (#31605) 2024-07-10 15:47:32 +00:00
Lunny XiaoandGitHub af1f0dfcc6 Remove docs sub folder since docs has been moved to https://gitea.com/gitea/docs (#31536) 2024-07-10 01:46:08 +00:00
Lunny XiaoandGitHub fa82a8af12 Have new announcement about docs contributions (#31364)
According to the maintainers' discussion and voting. We decide to move
docs to https://gitea.com/gitea/docs . Add some hints on this repository
to not make contributors confusing.
2024-06-14 11:17:05 +08:00
Lunny XiaoandGitHub e4abaff7ff Fix bug filtering issues which have no project (#31337)
Fix #31327
This is a quick patch to fix the bug.
Some parameters are using 0, some are using -1. I think it needs a
refactor to keep consistent. But that will be another PR.
2024-06-14 02:31:07 +00:00
Lunny XiaoandGitHub 7115dce773 Fix hash render end with colon (#31319)
Fix a hash render problem like `<hash>: xxxxx` which is usually used in
release notes.
2024-06-12 22:35:46 +00:00
Lunny XiaoandGitHub 1968c2222d Fix adopt repository has empty object name in database (#31333)
Fix #31330
Fix #31311

A workaround to fix the old database is to update object_format_name to
`sha1` if it's empty or null.
2024-06-12 18:22:01 +08:00
Lunny XiaoandGitHub 2788a7ca27 Fix agit checkout command line hint & fix ShowMergeInstructions checking (#31219) 2024-06-03 06:45:21 +08:00
Lunny XiaoandGitHub 98a61040b1 Fix the possible migration failure on 286 with postgres 16 (#31209)
Try to fix #31205
2024-06-02 03:01:08 +00:00
352a2cae24 Performance improvements for pull request list API (#30490)
Fix #30483

---------

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-05-31 12:10:11 +00:00
Lunny XiaoandGitHub 1137a0357e Fix branch order (#31174)
Fix #31172

The original order or the default order should not be ignored even if we
have an is_deleted order.
2024-05-31 09:58:41 +08:00
fb7b743bd0 Azure blob storage support (#30995)
This PR implemented object storages(LFS/Packages/Attachments and etc.)
for Azure Blob Storage. It depends on azure official golang SDK and can
support both the azure blob storage cloud service and azurite mock
server.

Replace #25458
Fix #22527 

- [x] CI Tests
- [x] integration test, MSSQL integration tests will now based on
azureblob
  - [x] unit test 
- [x] CLI Migrate Storage
- [x] Documentation for configuration added

------

TODO (other PRs):
- [ ] Improve performance of `blob download`.

---------

Co-authored-by: yp05327 <576951401@qq.com>
2024-05-30 07:33:50 +00:00
Lunny XiaoandGitHub 015efcd8bf Use repo as of renderctx's member rather than a repoPath on metas (#29222)
Use a `gitrepo.Repository` in the markup's RenderContext but not store
the repository's path.
2024-05-30 07:04:01 +00:00
Lunny XiaoandGitHub 5c1b550e00 Fix push multiple branches error with tests (#31151) 2024-05-29 06:43:02 +00:00
Lunny XiaoandGitHub de4616690f Add topics for repository API (#31127)
Fix ##31100
2024-05-28 10:03:54 +00:00
Lunny XiaoandGitHub b6f15c7948 Add missed return after ctx.ServerError (#31130) 2024-05-28 12:31:59 +03:00