summaryrefslogtreecommitdiffstats
path: root/services
Commit message (Collapse)AuthorAgeFilesLines
...
* Avoid user does not exist error when detecting schedule actions when the ↵yp053272024-04-111-6/+3
| | | | | | | | | | | | | | | | commit author is an external user (#30357) ![image](https://github.com/go-gitea/gitea/assets/18380374/ddf6ee84-2242-49b9-b066-bd8429ba4d76) When repo is a mirror, and commit author is an external user, then `GetUserByEmail` will return error. reproduce/test: - mirror Gitea to your instance - disable action and enable it again, this will trigger `DetectAndHandleSchedules` ps: also follow #24706, it only fixed normal runs, not scheduled runs.
* Performance optimization for git push (#30104)Lunny Xiao2024-04-091-9/+17
| | | | | Agit returned result should be from `ProcReceive` hook but not `PostReceive` hook. Then for all non-agit pull requests, it will not check the pull requests for every pushing `refs/pull/%d/head`.
* Fix missed doer (#30231)Lunny Xiao2024-04-085-34/+34
| | | | | Fix #29879 Co-authored-by: Giteabot <teabot@gitea.io>
* Add optional doctor storage init (#30330)Michael Kriese2024-04-081-0/+11
| | | Add optional storage init to doctor
* Avoid showing `Failed to change the default wiki branch` if repo has no wiki ↵yp053272024-04-081-0/+4
| | | | when saving repo settings (#30329)
* Fix oauth2 builtin application logic (#30304)wxiaoguang2024-04-083-11/+79
| | | | | | Fix #29074 (allow to disable all builtin apps) and don't make the doctor command remove the builtin apps. By the way, rename refobject and joincond to camel case.
* Clean up log messages (#30313)wxiaoguang2024-04-076-14/+14
| | | | | | `log.Xxx("%v")` is not ideal, this PR adds necessary context messages. Remove some unnecessary logs. Co-authored-by: Giteabot <teabot@gitea.io>
* Fix code block style for code preview (#30298)wxiaoguang2024-04-061-3/+3
| | | | | Fix #30292 To avoid unnecessary style overriding, use "div" instead of "code"
* Commit-Dropdown: Show Author of commit if available (#30272)sebastian-sauer2024-04-051-4/+4
| | | | | | | | | | | | | | | As in commits page we show the author of the commit in the commits dropdown and not the committer. Commits Page: ![Screenshot from 2024-04-03 22-34-41](https://github.com/go-gitea/gitea/assets/1135157/1c7c5c19-6d0a-4176-8a87-7bca6a0c6dc8) and the same contents in our dropdown: ![image](https://github.com/go-gitea/gitea/assets/1135157/aa094af2-c369-47ac-9c27-ca208d1d03f0) fixes #29588
* Render embedded code preview by permlink in markdown (#30234)wxiaoguang2024-04-025-1/+204
| | | | | The permlink in markdown will be rendered as a code preview block, like GitHub Co-authored-by: silverwind <me@silverwind.io>
* Remove scheduled action tasks if the repo is archived (#30224)Zettat1232024-04-012-2/+7
| | | Fix #30220
* Refactor DeleteInactiveUsers, fix bug and add tests (#30206)wxiaoguang2024-04-012-25/+45
| | | | | | | | | 1. check `IsActive` before calling `IsLastAdminUser`. 2. Fix some comments and error messages. 3. Don't `return err` if "removing file" fails in `DeleteUser`. 4. Remove incorrect `DeleteInactiveEmailAddresses`. Active users could also have inactive emails, and inactive emails do not support "olderThan" 5. Add tests
* Add API for `Variables` (#29520)sillyguodong2024-03-281-0/+100
| | | | | | | close #27801 --------- Co-authored-by: silverwind <me@silverwind.io>
* Prevent re-review and dismiss review actions on closed and merged PRs (#30065)Kemal Zebari2024-03-282-0/+81
| | | | | | | | | | | | | | | | | | | Resolves #29965. --- Manually tested this by: - Following the [installation](https://docs.gitea.com/next/installation/install-with-docker#basics) guide (but built a local Docker image instead) - Creating 2 users, one who is the `Owner` of a newly-created repository and the other a `Collaborator` - Had the `Collaborator` create a PR that the `Owner` reviews - `Collaborator` resolves conversation and `Owner` merges PR And with this change we see that we can no longer see re-request review button for the `Owner`: <img width="1351" alt="Screenshot 2024-03-25 at 12 39 18 AM" src="https://github.com/go-gitea/gitea/assets/60799661/bcd9c579-3cf7-474f-a51e-b436fe1a39a4">
* Put an edit file button on pull request files to allow a quick operation ↵Lunny Xiao2024-03-271-0/+19
| | | | | | | | | | | | | | | | | | | | (#29697) Resolve #23848 This PR put an edit file button on pull request files to allow a quick edit for a file. After the edit finished, it will return back to the viewed file position on pull request files tab. It also use a branch view file link instead of commit link when it's a non-commit pull request files view. <img width="1532" alt="image" src="https://github.com/go-gitea/gitea/assets/81045/3637ca4c-89d5-4621-847b-79702a44f617"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Fix possible data race on tests (#30093)Lunny Xiao2024-03-261-1/+0
|
* Fix duplicate migrated milestones (#30102)yp053272024-03-261-2/+1
| | | Fix #17567
* Fix gitea doctor will remove repo-avatar files when execute command ↵yp053272024-03-261-1/+1
| | | | | `storage-archives` (#30094) Fix #30037
* Fix panic for `fixBrokenRepoUnits16961` (#30068)yp053272024-03-261-0/+6
| | | ![image](https://github.com/go-gitea/gitea/assets/18380374/508b3ceb-f53d-4d3b-a781-97c1542af1cb)
* Fix Add/Remove WIP on pull request title failure (#29999)Lunny Xiao2024-03-252-21/+20
| | | Fix #29997
* Migrate margin and padding helpers to tailwind (#30043)silverwind2024-03-243-4/+4
| | | | | | | | | | | | | This will conclude the refactor of 1:1 class replacements to tailwind, except `gt-hidden`. Commands ran: ```bash perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/* perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/* perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/* perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/* perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/* perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/* ```
* Use db.ListOptionsAll instead of db.ListOptions{ListAll: true} (#29995)Lunny Xiao2024-03-225-16/+10
|
* Fix some pending problems (#29985)wxiaoguang2024-03-222-8/+7
| | | | | | | | | | | | | | | | | These changes are quite independent and trivial, so I don't want to open too many PRs. * https://github.com/go-gitea/gitea/pull/29882#discussion_r1529607091 * the `f.Close` should be called properly * the error message could be more meaningful (https://github.com/go-gitea/gitea/pull/29882#pullrequestreview-1942557935) * https://github.com/go-gitea/gitea/pull/29859#pullrequestreview-1942324716 * the new translation strings don't take arguments * https://github.com/go-gitea/gitea/pull/28710#discussion_r1443778807 * stale for long time * #28140 * a form was forgotten to be changed to work with backend code
* Fix bugs in rerunning jobs (#29955)Zettat1232024-03-222-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix #28761 Fix #27884 Fix #28093 ## Changes ### Rerun all jobs When rerun all jobs, status of the jobs with `needs` will be set to `blocked` instead of `waiting`. Therefore, these jobs will not run until the required jobs are completed. ### Rerun a single job When a single job is rerun, its dependents should also be rerun, just like GitHub does (https://github.com/go-gitea/gitea/issues/28761#issuecomment-2008620820). In this case, only the specified job will be set to `waiting`, its dependents will be set to `blocked` to wait the job. ### Show warning if every job has `needs` If every job in a workflow has `needs`, all jobs will be blocked and no job can be run. So I add a warning message. <img src="https://github.com/go-gitea/gitea/assets/15528715/88f43511-2360-465d-be96-ee92b57ff67b" width="480px" />
* Refactor external URL detection (#29973)wxiaoguang2024-03-221-0/+27
| | | | Follow #29960, `IsExternalURL` is not needed anymore. Add some tests for `RedirectToCurrentSite`
* Performance improvements for pull request list page (#29900)Lunny Xiao2024-03-212-4/+5
| | | | | | | | | | | This PR will avoid load pullrequest.Issue twice in pull request list page. It will reduce x times database queries for those WIP pull requests. Partially fix #29585 --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Refactor URL detection (#29960)wxiaoguang2024-03-211-3/+3
| | | "Redirect" functions should only redirect if the target is for current Gitea site.
* Fix the bug that user may logout if he switch pages too fast (#29962)Lunny Xiao2024-03-211-17/+9
| | | | | | | | | | | | This PR fixed a bug when the user switching pages too fast, he will logout automatically. The reason is that when the error is context cancelled, the previous code think user hasn't login then the session will be deleted. Now it will return the errors but not think it's not login. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Cancel previous runs of the same PR automatically (#29961)Jason Song2024-03-213-11/+11
| | | | | | | | | | | Follow #25716. Also cancel previous runs for `pull_request_sync`. It's not a bug since it original PR said "if the event is push". The main change is https://github.com/go-gitea/gitea/pull/29961/files#diff-08adda3f8ae0360937f46abb1f4418603bd3518522baa356be11c6c7ac4abcc3. And also rename `CancelRunningJobs` to `CancelPreviousJobs` to make it more clear.
* Fix loadOneBranch panic (#29938)wxiaoguang2024-03-201-4/+6
| | | | | | Try to fix #29936 Far from ideal, but still better than panic.
* Restore deleted branches when syncing (#29898)Jason Song2024-03-201-2/+2
| | | | | | | | | | | Regression of #29493. If a branch has been deleted, repushing it won't restore it. Lunny may have noticed that, but I didn't delve into the comment then overlooked it: https://github.com/go-gitea/gitea/pull/29493#discussion_r1509046867 The additional comments added are to explain the issue I found during testing, which are unrelated to the fixes.
* Fix invalid link of the commit status when ref is tag (#29752)yp053272024-03-191-3/+13
| | | | | | | | | | Fix #29731 Caused by #24634 Also remove fixme. ps: we can not fix the existed runs, as wrong refs are all recorded in DB, and we can not know whether they are branch or tag: ![image](https://github.com/go-gitea/gitea/assets/18380374/cb7cf266-f73f-419a-be1a-4689fdd1952a)
* Notify reviewers added via CODEOWNERS (#29842)Jimmy Praet2024-03-194-24/+75
|
* Fix missing error check of bufio.Scanner (#29882)coldWater2024-03-192-0/+8
| | | maybe more
* Upgrade Go 1.22 and upgrade dependency (#29869)wxiaoguang2024-03-171-1/+0
|
* fix telegram webhook (#29864)Denys Konovalov2024-03-172-1/+12
| | | | | | | | | | | Fix #29837 which is a regression caused by https://github.com/go-gitea/gitea/pull/29145/files#diff-731445ee00f0f1bf2ff731f4f96ddcf51cdc53fd2faaf406eb3536fc292ea748L48. The line was probably removed by accident. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Remove AddParamIfExist(AddParam) (#29841)wxiaoguang2024-03-161-13/+9
| | | | | | Follow #29834 Remove AddParamIfExist, use "AddParamString" instead, it should clearly know what is being added into the parameters.
* Refactor AddParam to AddParamIfExist (#29834)wxiaoguang2024-03-161-9/+8
| | | | | | | When read the code: `pager.AddParam(ctx, "search", "search")`, the question always comes: What is it doing? Where is the value from? Why "search" / "search" ? Now it is clear: `pager.AddParamIfExist("search", ctx.Data["search"])`
* Fix codeowner detected diff base branch to mergebase (#29783)Lunny Xiao2024-03-153-2/+124
| | | | | | | | | | | | | | Fix #29763 This PR fixes 2 problems with CodeOwner in the pull request. - Don't use the pull request base branch but merge-base as a diff base to detect the code owner. - CodeOwner detection in fork repositories will be disabled because almost all the fork repositories will not change CODEOWNERS files but it should not be used on fork repositories' pull requests. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Unify search boxes (#29530)Denys Konovalov2024-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify all but a few search boxes to use uniform style, uniform translations and shared templates where possible. Remove a few duplicated search templates, e. g. code search. <details><summary>Example after screenshots:</summary> ![grafik](https://github.com/go-gitea/gitea/assets/47871822/e20e7d6b-c6be-4a47-b132-672766f41421) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/d5b11b9c-c12f-4a29-8fb0-24e5aa511d18) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/d86bb444-36c7-426d-9cf1-c634963dffb1) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/a76c0319-0518-484a-a840-563d02b61198) </details> Also includes #29700 Co-authored-by: 6543 <6543@obermui.de> --------- Co-authored-by: 6543 <m.huber@kithara.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
* add skip ci support for pull request title (#29774)Denys Konovalov2024-03-141-3/+7
| | | | | Extends #28075 to support [skip ci] inside PR titles. Close #29265
* Add test for webhook (#29755)wxiaoguang2024-03-141-49/+29
| | | Follow #29690
* Fix possible NPE in ToPullReviewList (#29759)Lunny Xiao2024-03-132-1/+53
| | | Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Use relative links for commits, mentions, and issues in markdown (#29427)KN4CK3R2024-03-132-2/+27
| | | | | | | | | | | | Fixes #29404 Use relative links for - commits - mentions - issues --------- Co-authored-by: silverwind <me@silverwind.io>
* Add a warning for disallowed email domains (#29658)Zettat1232024-03-111-6/+2
| | | | | | | | | | | | | Resolve #29660 Follow #29522 and #29609 Add a warning for disallowed email domains when admins manually add/edit users. Thanks @yp05327 for the [comment](https://github.com/go-gitea/gitea/pull/29605#issuecomment-1980105119) ![image](https://github.com/go-gitea/gitea/assets/15528715/6737b221-a3a2-4180-9ef8-b846c10f96e0)
* Use repo object format name instead of detecting from git repository (#29702)Lunny Xiao2024-03-103-9/+3
| | | | It's unnecessary to detect the repository object format from git repository. Just use the repository's object format name.
* Fix broken webhooks (#29690)Lunny Xiao2024-03-101-1/+6
| | | Fix #29689
* Replace more gt- with tw- (#29678)silverwind2024-03-081-1/+1
| | | This will conclude the trivial class replacements.
* Fix commit_status problem when testing (#29672)charles2024-03-081-1/+1
| | | | | | | Close #29661 fix #29656 Co-authored-by: Giteabot <teabot@gitea.io>
* Add cache for branch divergence on branch list page (#29577)Lunny Xiao2024-03-082-6/+54
| | | | | | The branch page for blender project will take 6s because calculating divergence is very slow. This PR will add a cache for the branch divergence calculation. So when the second visit the branch list, it will take only less 200ms.