summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix various ImageDiff/SVG bugs (#23312) (#23358)Giteabot2023-03-074-17/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #23312 Replace #23310, Close #19733 And fix various UI problems, including regressions from #22959 #22950 and more. ## SVG Detection The old regexp may mismatch non-SVG files. This PR adds new tests for those cases. ## UI Changes ### Before ![image](https://user-images.githubusercontent.com/2114189/222967716-f6ad8721-f46a-4a3f-9eb0-a89e488d3436.png) ![image](https://user-images.githubusercontent.com/2114189/222967780-8af8981a-e69d-4304-9dc4-0235582fa4f4.png) ### After ![image](https://user-images.githubusercontent.com/2114189/222967575-c21c23d4-0200-4e09-aac3-57895e853000.png) ![image](https://user-images.githubusercontent.com/2114189/222967585-8b8da262-bc96-441a-9851-8d3845f2659d.png) ![image](https://user-images.githubusercontent.com/2114189/222967595-58d9bea5-6df4-41fa-bf8a-86704117959d.png) ![image](https://user-images.githubusercontent.com/2114189/222967608-38757c1a-b8bd-4ebf-b7a8-3b30edb7f303.png) ![image](https://user-images.githubusercontent.com/2114189/222967623-9849a339-6fae-4484-8fa5-939e2fdacbf5.png) ![image](https://user-images.githubusercontent.com/2114189/222967633-4383d7dd-62ba-47a3-8c10-86f7ca7757ae.png) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Refactor `setting.Database.UseXXX` to methods (#23354) (#23356)Giteabot2023-03-0736-96/+103
| | | | | | | | | | | | | | | Backport #23354 Replace #23350. Refactor `setting.Database.UseMySQL` to `setting.Database.Type.IsMySQL()`. To avoid mismatching between `Type` and `UseXXX`. This refactor can fix the bug mentioned in #23350, so it should be backported. Co-authored-by: Jason Song <i@wolfogre.com>
* Fix cannot reopen after pushing commits to a closed PR (#23189) (#23324)sillyguodong2023-03-076-16/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport: #23189 Close: #22784 1. On GH, we can reopen a PR which was closed before after pushing commits. After reopening PR, we can see the commits that were pushed after closing PR in the time line. So the case of [issue](https://github.com/go-gitea/gitea/issues/22784) is a bug which needs to be fixed. 2. After closing a PR and pushing commits, `headBranchSha` is not equal to `sha`(which is the last commit ID string of reference). If the judgement exists, the button of reopen will not display. So, skip the judgement if the status of PR is closed. ![image](https://user-images.githubusercontent.com/33891828/222037529-651fccf9-0bba-433e-b2f0-79c17e0cc812.png) 3. Even if PR is already close, we should still insert comment record into DB when we push commits. So we should still call function `CreatePushPullComment()`. https://github.com/go-gitea/gitea/blob/067b0c2664d127c552ccdfd264257caca4907a77/services/pull/pull.go#L260-L282 So, I add a switch(`includeClosed`) to the `GetUnmergedPullRequestsByHeadInfo` func to control whether the status of PR must be open. In this case, by setting `includeClosed` to `true`, we can query the closed PR. ![image](https://user-images.githubusercontent.com/33891828/222621045-bb80987c-10c5-4eac-aa0c-1fb9c6aefb51.png) 4. In the loop of comments, I use the`latestCloseCommentID` variable to record the last occurrence of the close comment. In the go template, if the status of PR is closed, the comments whose type is `CommentTypePullRequestPush(29)` after `latestCloseCommentID` won't be rendered. ![image](https://user-images.githubusercontent.com/33891828/222058913-c91cf3e3-819b-40c5-8015-654b31eeccff.png) e.g. 1). The initial status of the PR is opened. ![image](https://user-images.githubusercontent.com/33891828/222453617-33c5093e-f712-4cd6-8489-9f87e2075869.png) 2). Then I click the button of `Close`. PR is closed now. ![image](https://user-images.githubusercontent.com/33891828/222453694-25c588a9-c121-4897-9ae5-0b13cf33d20b.png) 3). I try to push a commit to this PR, even though its current status is closed. ![image](https://user-images.githubusercontent.com/33891828/222453916-361678fb-7321-410d-9e37-5a26e8095638.png) But in comments list, this commit do not display.This is as expected :) ![image](https://user-images.githubusercontent.com/33891828/222454169-7617a791-78d2-404e-be5e-77d555f93313.png) 4). Click the `Reopen` button, the commit which is pushed after closing PR display now. ![image](https://user-images.githubusercontent.com/33891828/222454533-897893b6-b96e-4701-b5cb-b1800f382b8f.png) --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix PR view misalignment caused by long name file (#23321) (#23335)Giteabot2023-03-072-4/+19
| | | | | | | | | | | | Backport #23321 Close #23248 The UI after this PR: https://user-images.githubusercontent.com/17645053/223009758-7f0c9f12-d346-4cb2-a605-729fddce732f.mov Co-authored-by: Hester Gong <hestergong@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Update documentation for the new YAML label file format (#23020) (#23341)Giteabot2023-03-061-1/+14
| | | | | | | | | | | | | | Backport #23020 update documentation to include an overview of the yaml label template that is part of PR #22976 Signed-off-by: Jon Roadley-Battin <jon.roadleybattin@gmail.com> Co-authored-by: JonRB <4564448+eeyrjmr@users.noreply.github.com> Co-authored-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
* Remove unnecessary space on link (#23334) (#23340)Giteabot2023-03-061-1/+1
| | | | | | | | Backport #23334 The action run title has a blank. This PR removes it. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix incorrect redirect link of delete org project (#23327) (#23339)Giteabot2023-03-061-1/+1
| | | | | | | | | | Backport #23327 A part of https://github.com/go-gitea/gitea/pull/22865/commits The old code will cause 500 error. Co-authored-by: yp05327 <576951401@qq.com> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Fix incorrect project links and use symlink icon for org-wide projects ↵Giteabot2023-03-067-14/+14
| | | | | | | | | | | | | | | | | | (#23325) (#23336) Backport #23325 Fix displaying same projects icons between user/repo projects. And fix incorrect projects links. A part of https://github.com/go-gitea/gitea/pull/22865. ![image](https://user-images.githubusercontent.com/18380374/223044279-7b620ff1-d88a-4146-97e6-531bbf269761.png) ![image](https://user-images.githubusercontent.com/18380374/223044390-42911e3f-1f6b-439f-8441-4f3ebf99ea13.png) ![image](https://user-images.githubusercontent.com/18380374/223044437-5cad5391-0f95-4c8b-b0a3-32e263e2854f.png) Co-authored-by: yp05327 <576951401@qq.com>
* Scoped labels: don't require holding alt key to remove (#23303) (#23331)Giteabot2023-03-061-6/+1
| | | | | | | | | | Backport #23303 Alt doesn't work on all browsers, the simplest solution for v1.19 is to just not require it and toggle the label by just clicking. Part of #22974 Co-authored-by: Brecht Van Lommel <brecht@blender.org>
* Fix broken code editor diff preview (#23307) (#23320)Giteabot2023-03-063-32/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | Backport #23307 Close #23265, the code editor diff preview has been broken for long time. * Fix the regression for `data-line-num` * `.code-diff` is necessary to show the line number * Fix the regression for #12434 * The diff: [12434](https://github.com/go-gitea/gitea/pull/12434/files?diff=unified&w=1) * It hides the Type(4) (aka HunkHeader) for unexpected cases. Diff with ignoring whitespaces: https://github.com/go-gitea/gitea/pull/23307/files?diff=unified&w=1 Before: see the issue #23265 After: ![image](https://user-images.githubusercontent.com/2114189/222942810-286dc9af-0b39-4e9d-8585-8c299b881241.png) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add context when rendering labels or emojis (#23281) (#23319)Giteabot2023-03-0623-76/+136
| | | | | | | | | | | | | | Backport #23281 This branch continues the work of #23092 and attempts to rid the codebase of any `nil` contexts when using a `RenderContext`. Anything that renders markdown or does post processing may call `markup.sha1CurrentPatternProcessor()`, and this runs `git.OpenRepository()`, which needs a context. It will panic if the context is `nil`. This branch attempts to _always_ include a context when creating a `RenderContext` to prevent future crashes. Co-authored-by: Jonathan Tran <jon@allspice.io>
* Properly flush unique queues on startup (#23154) (#23201)Giteabot2023-03-067-21/+332
| | | | | | | | | | | | | | | | | | | | | | | | | Backport #23154 There have been a number of reports of PRs being blocked whilst being checked which have been difficult to debug. In investigating #23050 I have realised that whilst the Warn there is somewhat of a miscall there was a real bug in the way that the LevelUniqueQueue was being restored on start-up of the PersistableChannelUniqueQueue. Next there is a conflict in the setting of the internal leveldb queue name - This wasn't being set so it was being overridden by other unique queues. This PR fixes these bugs and adds a testcase. Thanks to @brechtvl for noticing the second issue. Fix #23050 and others Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: delvh <leon@kske.dev>
* Update hacking-on-gitea-zh_cn documentation (#23315) (#23323)Giteabot2023-03-061-14/+320
| | | | | | | | Backport #23315 This PR fix outdated hacking-on-gitea-zh_cn documentation. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Jason Song <i@wolfogre.com>
* Change interactiveBorder to fix popup preview (#23169) (#23314)Giteabot2023-03-061-0/+1
| | | | | | | | | | | | Backport #23169 Close #23073. Used the solution as reference to the reply: https://github.com/go-gitea/gitea/issues/23073#issuecomment-1440124609 Here made the change inside the `contextpopup.js` because this is where the popup component is created and tippy configuration is given. Co-authored-by: Hester Gong <hestergong@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Scoped labels: set aria-disabled on muted Exclusive option for a11y (#23306) ↵Giteabot2023-03-051-0/+2
| | | | | | | | | | | | | | (#23311) Backport #23306 It is convenient to be able to toggle off this option after removing / from the name. This ensures the muted state is communicated to blind users even when the input is not fully disabled. Part of #22974 Co-authored-by: Brecht Van Lommel <brecht@blender.org> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add basic documentation for labels, including scoped labels (#23304) (#23309)Giteabot2023-03-051-0/+42
| | | | | | | | Backport #23304 Part of #22974 Co-authored-by: Brecht Van Lommel <brecht@blender.org> Co-authored-by: delvh <dev.lh@web.de>
* Fix various bugs for "install" page (#23194) (#23286)v1.19.0-rc1Giteabot2023-03-057-30/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #23194 ## TLDR * Fix the broken page / broken image problem when click "Install" * Fix the Password Hash Algorithm display problem for #22942 * Close #20089 * Close #23183 * Close #23184 ## Details ### The broken page / broken image problem when clicking on "Install" (Redirect failed after install - #23184) Before: when clicking on "install", all new requests will fail, because the server has been restarted. Users just see a broken page with broken images, sometimes the server is not ready but the user would have been redirect to "/user/login" page, then the users see a new broken page (connection refused or something wrong ...) After: only check InstallLock=true for necessary handlers, and sleep for a while before restarting the server, then the browser has enough time to load the "post-install" page. And there is a script to check whether "/user/login" is ready, the user will only be redirected to the login page when the server is ready. ### During new instance setup fill 'Gitea Base URL' with window.location.origin - #20089 If the "app_url" input contains `localhost` (the default value from config), use current window's location href as the `app_url` (aka ROOT_URL) ### Fix the Password Hash Algorithm display problem for "Provide the ability to set password hash algorithm parameters #22942" Before: the UI shows `pbkdf2$50000$50` <details> ![image](https://user-images.githubusercontent.com/2114189/221917143-e1e54798-1698-4fee-a18d-00c48081fc39.png) </details> After: the UI shows `pbkdf2` <details> ![image](https://user-images.githubusercontent.com/2114189/221916999-97a15be8-2ebb-4a01-bf93-dac18e354fcc.png) </details> ### GET data: net::ERR_INVALID_URL #23183 Cause by empty `data:` in `<link rel="manifest" href="data:{{.ManifestData}}">` Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Support sanitising the URL by removing extra slashes in the URL (#21333) ↵Giteabot2023-03-052-2/+103
| | | | | | | | | | | | | | | | | | | | | | | (#23300) Backport #21333 Changes in this PR : Strips incoming request URL of additional slashes (/). For example an input like `https://git.data.coop//halfd/new-website.git` is translated to `https://git.data.coop/halfd/new-website.git` Fixes https://github.com/go-gitea/gitea/issues/20462 Fix #23242 Co-authored-by: Sandeep Bhat <sandyethadka@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: delvh <leon@kske.dev>
* update to mermaid v10 (#23178) (#23299)Giteabot2023-03-054-68/+233
| | | | | | | | | Backport #23178 fix #23153 Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: delvh <leon@kske.dev>
* Re-add accidentally removed `hacking-on-gitea.zh-cn.md` (#23297) (#23305)Giteabot2023-03-041-0/+43
|
* Fix code wrap for unbroken lines (#23268) (#23293)Giteabot2023-03-041-2/+1
| | | | | | | | | | | | | | | | | | | | | Backport #23268 ## The Problem `overflow-wrap: break-word` doesn't work well for unbroken lines. Use `overflow-wrap: anywhere` instead, and remove legacy alias `word-wrap` ## Before ![image](https://user-images.githubusercontent.com/2114189222743939-5f38d9e4-18d8-4ae0-8078-4b3a59195a30.png) ## After ![image](https://user-images.githubusercontent.com/2114189/222743833-0e0cfdbb-7b2e-420d-99f9-b1b45dde521a.png) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Fill head commit to in payload when notifying push commits for mirroring ↵Giteabot2023-03-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | (#23215) (#23292) Backport #23215 Just like what has been done when pushing manually: https://github.com/go-gitea/gitea/blob/7a5af25592003ddc3017fcd7b822a3e02fc40ef6/services/repository/push.go#L225-L226 Before: <img width="448" alt="image" src="https://user-images.githubusercontent.com/9418365/222100123-cd4839d1-2d4d-45f7-7a0-0cbc73162b44.png"> After: <img width="448" alt="image" src="https://user-images.githubusercontent.com/9418365/222100225-3c5bb65-7ab9-41e2-8e39-9d84c23c352d.png"> Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Avoid panic caused by broken payload when creating commit status (#23216) ↵Giteabot2023-03-045-14/+45
| | | | | | | | | | | | | | | | | | | | | (#23294) Backport #23216 When creating commit status for Actons jobs, a payload with nil `HeadCommit` will cause panic. Reported at: https://gitea.com/gitea/act_runner/issues/28#issuecomment-732166 Although the `HeadCommit` probably can not be nil after #23215, `CreateCommitStatus` should protect itself, to avoid being broken in the future. In addition, it's enough to print error log instead of returning err when `CreateCommitStatus` failed. Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: delvh <dev.lh@web.de>
* Fix GetFilesChangedBetween if the file name may be escaped (#23272) (#23279)Giteabot2023-03-041-2/+9
| | | | | | | | | | | | | | | | Backport #23272 The code for GetFilesChangedBetween uses `git diff --name-only base..head` to get the names of files changed between base and head however this forgets that git will escape certain values. This PR simply switches to use `-z` which has the `NUL` character as the separator. Ref https://github.com/go-gitea/gitea/pull/22568#discussion_r1123138096 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Use correct README link to render the README (#23152) (#23264)Giteabot2023-03-047-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | Backport #23152 `renderReadmeFile` needs `readmeTreelink` as parameter but gets `treeLink`. The values of them look like as following: `treeLink`: `/{OwnerName}/{RepoName}/src/branch/{BranchName}` `readmeTreelink`: `/{OwnerName}/{RepoName}/src/branch/{BranchName}/{ReadmeFileName}` `path.Dir` in https://github.com/go-gitea/gitea/blob/8540fc45b11eff9a73753ca139f8ea5c38509bf5/routers/web/repo/view.go#L316 should convert `readmeTreelink` into `/{OwnerName}/{RepoName}/src/branch/{BranchName}` instead of the current `/{OwnerName}/{RepoName}/src/branch`. Fixes #23151 Co-authored-by: yp05327 <576951401@qq.com> Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Fix commit retrieval by tag (#21804) (#23266)Giteabot2023-03-0319-58/+26
| | | | | | | | | | | | | | | | | | | | | Backport #21804 It is not correct to return tag data when commit data is requested, so remove the hacky code that overwrote parts of a commit with parts of a tag. This fixes commit retrieval by tag for both the latest commit in the UI and the commit info on tag webhook events. Fixes: https://github.com/go-gitea/gitea/issues/21687 Replaces: https://github.com/go-gitea/gitea/pull/21693 <img width="324" alt="Screenshot 2022-11-13 at 15 26 37" src="https://user-images.githubusercontent.com/115237/201526975-736c6ea7-ad6a-467a-a823-9a63d6ecb718.png"> <img width="789" alt="image" src="https://user-images.githubusercontent.com/115237/201526876-90a13ffc-1e5c-4d76-911b-f1ae51e8eaab.png"> Co-authored-by: silverwind <me@silverwind.io>
* Revert relative links to absolute links in mail templates (#23267) (#23269)Giteabot2023-03-033-6/+6
| | | | | | | | | Backport #23267 Follow #21986 , fix regression. The mail templates should always use `AppURL` (the full absolute URL) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Use async await to fix empty quote reply at first time (#23168) (#23256)Giteabot2023-03-022-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #23168 The reason why quote reply is empty is when quote reply is clicked, it triggers the click function on `.comment-form-reply` button, and when the first time this function is triggered, easyMDE for the reply has not yet initialized, so that click handler of `.quote-reply` button in `repo-legacy.js` got an `undefined` as easyMDE, and the following lines which put quoted reply into the easyMDE is not executed. The workaround in this PR is to pass the replied content to '.comment-form-reply' button if easyMDE is not yet initialized (quote reply first clicked) and put the replied content into it the after easyMDE is created. Now quote reply on first click: https://user-images.githubusercontent.com/17645053/221452823-fc699d50-1649-4af1-952e-f04fc8d2978e.mov <br /> Update: The above change is not appropriate as stated in the [comment](https://github.com/go-gitea/gitea/pull/23168#issuecomment-1445562284) Use await instead Close #22075. Close #23247. Co-authored-by: HesterG <hestergong@gmail.com>
* Fix switched citation format (#23250) (#23253)Giteabot2023-03-021-1/+1
| | | | | | | | | Backport #23250 Due to switched input parameters, the citation texts for Bibtex and Apa were switched. This pull request fixes #23244 Co-authored-by: Blender Defender <contact.blenderdefender@gmail.com>
* Fix missed `.hide` class (#23208) (#23237)Giteabot2023-03-022-4/+4
| | | | | | | | | Backport #23208 https://github.com/go-gitea/gitea/pull/22950 removed `hide` class, and use `gt-hidden` But there are some missed `hide`.... Co-authored-by: yp05327 <576951401@qq.com>
* Allow `<video>` in MarkDown (#22892) (#23236)Giteabot2023-03-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #22892 As you can imagine, for the Blender development process it is rather nice to be able to include videos in issues, pull requests, etc. This PR allows the `<video>` HTML tag to be used in MarkDown, with the `src`, `autoplay`, and `controls` attributes. ## Help Needed To have this fully functional, personally I feel the following things are still missing, and would appreciate some help from the Gitea team. ### Styling Some CSS is needed, but I couldn't figure out which of the LESS files would work. I tried `web_src/less/markup/content.less` and `web_src/less/_base.less`, but after running `make` the changes weren't seen in the frontend. This I would consider a minimal set of CSS rules to be applied: ```css video { max-width: 100%; max-height: 100vh; } ``` ### Default Attributes It would be fantastic if Gitea could add some default attributes to the `<video>` tag. Basically `controls` should always be there, as there is no point in disallowing scrolling through videos, looping them, etc. ### Integration with the attachments system Another thing that could be added, but probably should be done in a separate PR, is the integration with the attachments system. Dragging in a video should attach it, then generate the appropriate MarkDown/HTML. Co-authored-by: Sybren <122987084+drsybren@users.noreply.github.com>
* Close the temp file when dumping database to make the temp file can be ↵Giteabot2023-03-021-0/+1
| | | | | | | | | | deleted on Windows (#23249) (#23251) Backport #23249 There was no `dbDump.Close()` before, Windows doesn't like to delete opened files. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix incorrect checkbox behaviors in the dashboard repolist's filter (#23147) ↵Giteabot2023-03-022-113/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#23205) Backport #23147 Co-author: yp05327 , this PR is based on yp05327's #22813. The problems of the old DashboardRepoList / repolist.tmpl: * It mixes many different frameworks together * It "just works", bug on bug * It uses many anti-pattern of Vue This PR: * Fix bugs and close #22800 * Decouple the "checkbox" elements from Fomantic UI (only use CSS styles) * Simplify the HTML layout * Simplify JS logic * Make it easier to refactor the DashboardRepoList into a pure Vue component in the future. ### Screenshots #### Default ![image](https://user-images.githubusercontent.com/2114189/221355768-a3eb5b23-85b4-4e3d-b906-844d8b15539d.png) #### Click "Archived" to make it checked ![image](https://user-images.githubusercontent.com/2114189/221355777-9a104ddf-52a7-4504-869a-43a73827d802.png) #### Click "Archived" to make it intermediate ![image](https://user-images.githubusercontent.com/2114189/221355802-0f67a073-67ad-4e92-84a6-558c432103a5.png) #### Click "Archived" to make it unchecked ![image](https://user-images.githubusercontent.com/2114189/221355810-acf1d9d8-ccce-47fe-a02e-70cf4e666331.png) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: yp05327 <576951401@qq.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Order pull request conflict checking by recently updated, for each push ↵Giteabot2023-03-021-0/+1
| | | | | | | | | | | | | | | | | | | | (#23220) (#23225) Backport #23220 When a change is pushed to the default branch and many pull requests are open for that branch, conflict checking can take some time. Previously it would go from oldest to newest pull request. Now prioritize pull requests that are likely being actively worked on or prepared for merging. This only changes the order within one push to one repository, but the change is trivial and can already be quite helpful for smaller Gitea instances where a few repositories have most pull requests. A global order would require deeper changes to queues. Co-authored-by: Brecht Van Lommel <brecht@blender.org> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add loading yaml label template files (#22976) (#23232)Giteabot2023-03-0115-241/+488
| | | | | | | | | | | | Backport #22976 Extract from #11669 and enhancement to #22585 to support exclusive scoped labels in label templates * Move label template functionality to label module * Fix handling of color codes * Add Advanced label template Co-authored-by: Lauris BH <lauris@nix.lv>
* Do not create commit graph for temporary repos (#23219) (#23229)Giteabot2023-03-021-2/+8
| | | | | | | | | | | Backport #23219 When fetching remotes for conflict checking, skip unnecessary and potentially slow writing of commit graphs. In a test with the Blender repository, this reduces conflict checking time for one pull request from about 2s to 0.1s. Co-authored-by: Brecht Van Lommel <brecht@blender.org>
* Use the correct selector to hide the checkmark of selected labels on clear ↵Giteabot2023-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | (#23224) (#23228) Backport #23224 Regression of #10107 (https://github.com/go-gitea/gitea/pull/10107/files#diff-a15e36f2f9c13339f7fdd38bc2887db2ff2945cb8434464318ab9105fcc846bdR460) Fix #22222 Before: the "clear" action couldn't remove these check marks. ![image](https://user-images.githubusercontent.com/2114189/222212998-c9f33459-b71d-4e80-8588-2935f3b7050c.png) After: the "clear" action can remove these check marks. ![image](https://user-images.githubusercontent.com/2114189/222213048-2be98ed0-cac0-4e27-b72c-1dd0ac2637d5.png) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Change button text for commenting and closing an issue at the same time ↵Yarden Shoham2023-02-282-1/+10
| | | | | | | | | | | | | | | | | | | | | (#23135) (#23182) Backport #23135 Close #10468 Without SimpleMDE/EasyMDE, using Simple Textarea, the button text could be changed when content changes. After introducing SimpleMDE/EasyMDE, there is no code for updating the button text. ![image](https://user-images.githubusercontent.com/2114189/221334034-8d556cd5-1136-4ba0-8faa-a65ffadd7fb7.png) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix Fomantic UI's `touchstart` fastclick, always use `click` for click ↵wxiaoguang2023-02-282-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | events (#23065) (#23195) Backport #23065 Using `touchstart` for `click` events is a black magic for mobile browsers (Google: `fastclick`). However, it causes many UX problems if the fastclick is used without careful design. Fomantic UI uses this fastclick for its `dimmer` and `dropdown`, it makes mobile users feel strange when they "touch" the dropdown menu. This PR uses a simple patch to fix that behavior. Then the Fomantic dropdown only uses `click` for click events. This PR is simple enough and won't cause hidden bugs even if the patch doesn't work. In the future, if there are more patches for Fomantic UI, the patches could be placed in a directory like `web_src/fomantic/patches/001-fix-click-touchstart`, etc. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Pass `--global` when calling `git config --get`, for consistency with `git ↵Giteabot2023-02-281-4/+4
| | | | | | | | | | | | config --set` (#23157) (#23199) Backport #23157 This arose out of #22451; it seems we are checking using non-global settings to see if a config value is set, in order to decide whether to call another global(-indeed) configuration command. This PR changes it so that both the check and the set are for global configuration. Co-authored-by: Philip Peterson <philip-peterson@users.noreply.github.com>
* Make `gitea serv` respect git binary home (#23138) (#23197)Giteabot2023-02-281-10/+15
| | | | | | | | | | | | | | | | | Backport #23138 Close #23137 The old code is too old (8-9 years ago) Let's try to execute the git commands from git bin home directly. The verb has been checked above, it could only be: * git-upload-pack * git-upload-archive * git-receive-pack * git-lfs-authenticate Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Avoid too long names for actions (#23162) (#23190)Yarden Shoham2023-02-283-2/+6
| | | | | | | | | Backport #23162 The name of the job or step comes from the workflow file, while the name of the runner comes from its registration. If the strings used for these names are too long, they could cause db issues. Co-authored-by: Jason Song <i@wolfogre.com>
* Add InsecureSkipVerify to Minio Client for Storage (#23166) (#23177)Yarden Shoham2023-02-285-9/+28
| | | | | | | | | | Backport #23166 Allows using Minio with untrusted certificates Closes #23128 Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add word-break to sidebar-item-link (#23146) (#23180)Yarden Shoham2023-02-271-1/+1
| | | | | | | | | | Backport #23146 Fixes https://github.com/go-gitea/gitea/issues/22953 ![image](https://user-images.githubusercontent.com/18380374/221351117-1e4b8922-04ca-4717-8e3b-c338a61bc062.png) Co-authored-by: yp05327 <576951401@qq.com> Co-authored-by: delvh <leon@kske.dev>
* Remove useless comment in #23114 (#23173) (#23175)Yarden Shoham2023-02-271-1/+0
| | | | | | | | | Backport #23173 The `isAdmin` param is no longer used so the comment should be removed. https://github.com/go-gitea/gitea/blob/d27d36f2f4dd389050e613967ad2a5d02d250acc/routers/web/explore/repo.go#L36-L37 Co-authored-by: Zettat123 <zettat123@gmail.com>
* Return 404 instead of 403 if user can not access the repo (#23155) (#23158)Yarden Shoham2023-02-261-1/+1
| | | | | | | | | | | | | | | | Backport #23155 Fixes https://github.com/go-gitea/gitea/issues/23150 Before: ![image](https://user-images.githubusercontent.com/18380374/221390802-2317c6bc-d163-4def-b68b-6bb297143fe2.png) After: ![image](https://user-images.githubusercontent.com/18380374/221390823-87490351-39c3-4a40-b1d2-11fc5b85fa24.png) Co-authored-by: yp05327 <576951401@qq.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix DBConsistency checks on MSSQL (#23132) (#23134)Yarden Shoham2023-02-251-4/+4
| | | | | | | | | | | | | | | | Backport #23132 Unfortunately xorm's `builder.Select(...).From(...)` does not escape the table names. This is mostly not a problem but is a problem with the `user` table. This PR simply escapes the user table. No other uses of `From("user")` where found in the codebase so I think this should be all that is needed. Fix #23064 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Fix secrets overview page missing from docs sidebar (#23143) (#23145)Yarden Shoham2023-02-252-2/+2
| | | | | | | | | | | | | | | | | | Backport #23143 There was a warning while building the docs: `Building sites … WARN 2023/02/25 08:56:37 "/workspace/gitea/docs/content/doc/secrets/overview.en-us.md:1:1": duplicate menu entry with identifier "overview" in menu "sidebar"`. ### Before ![image](https://user-images.githubusercontent.com/20454870/221348741-55cef254-f2ac-4507-9a66-818b406c668f.png) ### After ![image](https://user-images.githubusercontent.com/20454870/221348757-42066303-e1b7-43fe-9c4f-e05182fbabdd.png) Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
* Redirect to the commit page after applying patch (#23056) (#23127)Yarden Shoham2023-02-241-6/+4
| | | | | | | Backport #23056 Fixes https://github.com/go-gitea/gitea/issues/22621 Co-authored-by: yp05327 <576951401@qq.com>
* Avoid warning for system setting when start up (#23054) (#23116)Yarden Shoham2023-02-2411-34/+43
| | | | | | | | | | | | | | Backport #23054 Partially fix #23050 After #22294 merged, it always has a warning log like `cannot get context cache` when starting up. This should not affect any real life but it's annoying. This PR will fix the problem. That means when starting up, getting the system settings will not try from the cache but will read from the database directly. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>