summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Use general token signing secret (#29205) (#29325)wxiaoguang2024-02-2213-70/+130
| | | | | Backport #29205 (including #29172) Use a clearly defined "signing secret" for token signing.
* Fix SSPI user creation (#28948) (#29323)Lunny Xiao2024-02-221-7/+3
| | | | | | | | | Fixes #28945 Backport #28948 Setting the avatar is wrong and creating a random password is equal to leave it empty. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Improve the `issue_comment` workflow trigger event (#29277) (#29322)Giteabot2024-02-224-27/+130
| | | | | | | | | | | | | | | | | | | | | Backport #29277 by @Zettat123 Fix #29175 Replace #29207 This PR makes some improvements to the `issue_comment` workflow trigger event. 1. Fix the bug that pull requests cannot trigger `issue_comment` workflows 2. Previously the `issue_comment` event only supported the `created` activity type. This PR adds support for the missing `edited` and `deleted` activity types. 3. Some events (including `issue_comment`, `issues`, etc. ) only trigger workflows that belong to the workflow file on the default branch. This PR introduces the `IsDefaultBranchWorkflow` function to check for these events. Co-authored-by: Zettat123 <zettat123@gmail.com>
* Discard unread data of `git cat-file` (#29297) (#29310)Giteabot2024-02-2210-80/+66
| | | | | | | | | | | | Backport #29297 by @KN4CK3R Fixes #29101 Related #29298 Discard all read data to prevent misinterpreting existing data. Some discard calls were missing in error cases. Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: yp05327 <576951401@qq.com>
* Implement some action notifier functions (#29173) (#29308)yp053272024-02-223-13/+75
| | | | | | | | | | | | | Backport #29173 Fix #29166 Add support for the following activity types of `pull_request` - assigned - unassigned - review_requested - review_request_removed - milestoned - demilestoned
* Prevent double use of `git cat-file` session. (#29298) (#29301)KN4CK3R2024-02-222-6/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #29298 Fixes the reason why #29101 is hard to replicate. Related #29297 Create a repo with a file with minimum size 4097 bytes (I use 10000) and execute the following code: ```go gitRepo, err := gitrepo.OpenRepository(db.DefaultContext, <repo>) assert.NoError(t, err) commit, err := gitRepo.GetCommit(<sha>) assert.NoError(t, err) entry, err := commit.GetTreeEntryByPath(<file>) assert.NoError(t, err) b := entry.Blob() // Create a reader r, err := b.DataAsync() assert.NoError(t, err) defer r.Close() // Create a second reader r2, err := b.DataAsync() assert.NoError(t, err) // Should be no error but is ErrNotExist defer r2.Close() ``` The problem is the check in `CatFileBatch`: https://github.com/go-gitea/gitea/blob/79217ea63c1f77de7ca79813ae45950724e63d02/modules/git/repo_base_nogogit.go#L81-L87 `Buffered() > 0` is used to check if there is a "operation" in progress at the moment. This is a problem because we can't control the internal buffer in the `bufio.Reader`. The code above demonstrates a sequence which initiates an operation for which the code thinks there is no active processing. The second call to `DataAsync()` therefore reuses the existing instances instead of creating a new batch reader.
* Fix gitea-action user avatar broken on edited menu (#29190) (#29307)yp053272024-02-221-1/+5
| | | | | Backport #29190 Fix #29178
* Fix error display when merging PRs (#29288) (#29309)Zettat1232024-02-221-4/+4
| | | | | | | | | Backport #29288 Partially fix #29071, regression of Modernize merge button #28140 Fix some missing `Redirect` -> `JSONRedirect`. Thanks @yp05327 for the help in https://github.com/go-gitea/gitea/issues/29071#issuecomment-1931261075
* Fix missing link on outgoing new release notifications (#29079) (#29300)wxiaoguang2024-02-211-0/+1
| | | | | | | Backport #29079 Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz> Co-authored-by: Wiktor Kwapisiewicz <wiktor@metacode.biz> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix debian InRelease Acquire-By-Hash newline (#29204) (#29299)wxiaoguang2024-02-211-1/+1
| | | | | Backport #29204 Co-authored-by: Robin Schoonover <robin@cornhooves.org>
* Always write proc-receive hook for all git versions (#29287) (#29291)wxiaoguang2024-02-211-7/+5
| | | Backport #29287
* Do not show delete button when time tracker is disabled (#29257) (#29279)Zettat1232024-02-201-1/+1
| | | | | | | | | | | | Backport #29257 Fix #29233 The delete button of time logs won't be shown when the time tracker is disabled. ![image](https://github.com/go-gitea/gitea/assets/15528715/5cc4e0c9-d2f9-4b8f-a2f5-fe202b94c191) Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix missed edit issues event for actions (#29237) (#29251)Lunny Xiao2024-02-201-0/+41
| | | | Fix #29213 Backport #29237
* Disallow merge when required checked are missing (#29143) (#29268)Markus Amshove2024-02-193-2/+47
| | | | | | backport #29143 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Workaround to clean up old reviews on creating a new one (#28554) (#29264)65432024-02-193-9/+165
| | | | | | | | close #28542 backport #28554 --- *Sponsored by Kithara Software GmbH*
* Fix bug when the linked account was disactived and list the linked accounts ↵Lunny Xiao2024-02-195-13/+16
| | | | | | | | | (#29263) The bug has been fixed on v1.22 but not backport to v1.21. This original PR have many refactors so I don't think it's necessary to backport all of them. Fix #28667
* Explained where create issue/PR template (#29035)Km2024-02-191-1/+2
| | | | | | | | | | | | | | | For some user (as me), documentation lack of precision about where to store issue/pr template. I propose an enhancement about this point. With bold exergue and precision about server itself. I've found some user with same interrogation as : https://forum.gitea.com/t/issue-template-directory/3328 --------- Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Do not use lower tag names to find releases/tags (#29261) (#29262)Jason Song2024-02-191-6/+6
| | | | | | | | | | | | | | | | Backport #29261. Fix #26090, see https://github.com/go-gitea/gitea/issues/26090#issuecomment-1952013206 Since `TagName` stores the original tag name and `LowerTagName` stores the lower tag name, it doesn't make sense to use lowercase tags as `TagNames` in `FindReleasesOptions`. https://github.com/go-gitea/gitea/blob/5e72526da4e915791f03af056890e16821bde052/services/repository/push.go#L396-L397 While the only other usage looks correct: https://github.com/go-gitea/gitea/blob/5e72526da4e915791f03af056890e16821bde052/routers/web/repo/repo.go#L416
* Convert visibility to number (#29226) (#29244)Tim-Nicas Oelschläger2024-02-181-1/+1
| | | | | | | | | | | | Backport #29226 Don't throw error while creating user (Fixes #29218) --- The backport info from Giteabot https://github.com/go-gitea/gitea/pull/29226#issuecomment-1951341322 needs to specify the version, because the default is v1.18
* Load outdated comments when (un)resolving conversation on PR timeline ↵Jimmy Praet2024-02-182-3/+4
| | | | | | | | | | | | (#29203) (#29221) Backport #29203 Relates to #28654, #29039 and #29050. The "show outdated comments" flag should only apply to the file diff view. On the PR timeline, outdated comments are always shown. So they should also be loaded when (un)resolving a conversation on the timeline page.
* Make submit event code work with both jQuery event and native event (#29223) ↵wxiaoguang2024-02-183-2/+3
| | | | | (#29234) Backport #29223 (no conflict)
* Only delete scheduled workflows when needed (#29091) (#29235)Zettat1232024-02-181-3/+6
| | | | | | | | Backport #29091 Fix #29040 `handleSchedules` should be called only if `DetectWorkflows` should detect schedule workflows
* Fix push to create with capitalize repo name (#29090) (#29206)Lunny Xiao2024-02-171-5/+7
| | | | | | Fix #29073 Backport #29090 Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* rm outdated docs from some languages (#27530) (#29208)Lunny Xiao2024-02-1749-2154/+1
| | | | | | | | | backport #27530 to make pull request lint happy https://github.com/go-gitea/gitea/actions/runs/7939560756/job/21679856929?pr=29206 since #29106 --------- Co-authored-by: techknowlogick <techknowlogick@gitea.com>
* Refactor git version functions and check compatibility (#29155) (#29157)wxiaoguang2024-02-173-31/+80
| | | | | | Backport #29155 with an extra change: tolerate the git 2.43.1 GIT_FLUSH bug in Gitea 1.21.x, more details in the comment of repo_attribute.go Manually tested with git 2.43.1 and an old git (2.39.2)
* Rework spellchecking, add lint-spell (#29112)silverwind2024-02-169-25/+37
| | | | | | | | | | | | | | | | | Backport clean cherry-picks of https://github.com/go-gitea/gitea/commit/9c39f8515fa88d644736c6773d7a05d070a02e82 and https://github.com/go-gitea/gitea/commit/c7a21cbb0c5f8302495fa24baf218dc3462de2c5 onto 1.21. - Use maintained fork https://github.com/golangci/misspell - Rename `mispell-check` to `lint-spell`, add `lint-spell-fix` - Run `lint-spell` in separate actions step - Lint more files, fix discovered issues - Remove inaccurate and outdated info in docs (we do not need GOPATH for tools anymore) Maybe later we can add more spellchecking tools, but I have not found any good ones yet.
* Use ghost user if user was not found (#29161) (#29169)KN4CK3R2024-02-142-0/+12
| | | Backport #29161
* Refactor issue template parsing and fix API endpoint (#29069) (#29140)wxiaoguang2024-02-146-33/+88
| | | | | | | | | | | | | | | | | | Backport #29069 The old code `GetTemplatesFromDefaultBranch(...) ([]*api.IssueTemplate, map[string]error)` doesn't really follow Golang's habits, then the second returned value might be misused. For example, the API function `GetIssueTemplates` incorrectly checked the second returned value and always responds 500 error. This PR refactors GetTemplatesFromDefaultBranch to ParseTemplatesFromDefaultBranch and clarifies its behavior, and fixes the API endpoint bug, and adds some tests. And by the way, add proper prefix `X-` for the header generated in `checkDeprecatedAuthMethods`, because non-standard HTTP headers should have `X-` prefix, and it is also consistent with the new code in `GetIssueTemplates`
* Dont load Review if Comment is CommentTypeReviewRequest (#28551) (#29160)65432024-02-133-1/+12
| | | | | | Backport #28551 RequestReview get deleted on review. So we don't have to try to load them on comments.
* Refactor parseSignatureFromCommitLine (#29054) (#29108)wxiaoguang2024-02-098-149/+104
| | | | | | | Backport #29054. Fix #28840 This backport is for 1.21 only and it is different from the change in 1.22: this backport still accept the legacy date format to avoid breaking.
* Fix swift packages not resolving (#29095) (#29102)CEnnis912024-02-081-1/+1
|
* Fix incorrect link to swift doc and swift package-registry login command ↵CEnnis912024-02-082-2/+3
| | | | (#29096) (#29103)
* Avoid showing unnecessary JS errors when there are elements with different ↵Giteabot2024-02-083-9/+19
| | | | | | | | | origin on the page (#29081) (#29089) Backport #29081 by wxiaoguang Try to fix #29080 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix gitea-origin-url with default ports (#29085) (#29088)Giteabot2024-02-083-13/+34
| | | | | | | | | | | | | | | | | | Backport #29085 by @silverwind When setting `url.host` on a URL object with no port specified (like is the case of default port), the resulting URL's port will not change. Workaround this quirk in the URL standard by explicitely setting port for the http and https protocols. Extracted the logic to a function for the purpose of testing. Initially I wanted to have the function in utils.js, but it turns out esbuild can not treeshake the unused functions which would result in the webcomponents chunk having all 2kB utils.js inlined, so it seemed not worth. Fixes: https://github.com/go-gitea/gitea/issues/29084 Co-authored-by: silverwind <me@silverwind.io>
* Improve user experience for outdated comments (#29050) (#29086)Giteabot2024-02-085-17/+100
| | | | | | | | | | | | | | Backport #29050 by wxiaoguang Try to improve #28949 1. Make `ctx.Data["ShowOutdatedComments"] = true` by default: it brings consistent user experience, and sometimes the "outdated (source changed)" comments are still valuable. 2. Show a friendly message if the comment won't show, then the end users won't fell that "the comment disappears" (it is the special case when `ShowOutdatedComments = false`) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix orgmode link resolving (#29024) (#29076)wxiaoguang2024-02-072-41/+43
| | | | | | | | Backport #29024 Also backport #27968 (remove unnecessary titles) Fix #28974 Add some new tests and fix some legacy unclear tests.
* fix: Elasticsearch: Request Entity Too Large #28117 (#29062) (#29075)Giteabot2024-02-071-5/+11
| | | | | | | | | | | Backport #29062 by @inferno-umar Fix for gitea putting everything into one request without batching and sending it to Elasticsearch for indexing as issued in #28117 This issue occured in large repositories while Gitea tries to index the code using ElasticSearch. Co-authored-by: dark-angel <70754989+inferno-umar@users.noreply.github.com>
* Hide code links on release page if user cannot read code (#29064) (#29066)Giteabot2024-02-061-24/+5
| | | | | | | | | | | | | | | | | | | | | Backport #29064 by @wolfogre On the release list page, if the user doesn't have the permission to read code, the code links will lead to 404 pages or api errors: <img width="1297" alt="image" src="https://github.com/go-gitea/gitea/assets/9418365/a74fbc63-6dd6-43c6-853c-28acdbfdcb4e"> After this PR: <img width="1297" alt="image" src="https://github.com/go-gitea/gitea/assets/9418365/a626373d-c2df-40a9-8fed-1b12ff6bc56f"> And this PR also removed some dead code. After #23465, the tag list page has an independent template, and all `IsTag` in the release list template are always false. Co-authored-by: Jason Song <i@wolfogre.com>
* Fix typos in the documentation (#29048) (#29056)Wang2024-02-051-1/+1
| | | | | Backport #29048 Corrected two typos.
* Do not render empty comments (#29039) (#29049)Giteabot2024-02-041-1/+10
| | | | | | | | | | | Backport #29039 by wxiaoguang Follow #28654 The `comments` might be empty, so the templates shouldn't (and couldn't) use it to render. When there is no comment, the UI should also be updated to empty, so returning an empty body is good enough. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* labels and licenses are directories (#29037)Km2024-02-031-2/+2
| | | | Be more explicit about custom path relative to licences and labels content
* Avoid sending update/delete release notice when it is draft (#29008) (#29025)Giteabot2024-02-021-8/+7
| | | | | | | Backport #29008 by @yp05327 Fix #27157 Co-authored-by: yp05327 <576951401@qq.com>
* Wrap contained tags and branches again (#29021) (#29026)Giteabot2024-02-021-2/+2
| | | | | | | | | | | | Backport #29021 by @delvh Fixes #29016 ## After ![grafik](https://github.com/go-gitea/gitea/assets/51889757/2c72ee8f-439e-4328-85df-77772e0f4aef) Co-authored-by: delvh <dev.lh@web.de>
* Fix incorrect button CSS usages (#29015) (#29023)Giteabot2024-02-023-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #29015 by @wxiaoguang Fix 2 problems: 1. Remove the legacy (non-existing) CSS: `class="btn btn-gray btn-radius"` 2. Remove the button styles inside the `ui message`, according to: https://fomantic-ui.com/collections/message.html , the button shouldn't have any border/padding. ### Before ![image](https://github.com/go-gitea/gitea/assets/2114189/4c7e98e2-4e8a-493f-9b7e-446a365066a1) ![image](https://github.com/go-gitea/gitea/assets/2114189/05221251-7a79-4c96-8973-fb4588275672) ### After ![image](https://github.com/go-gitea/gitea/assets/2114189/8bc3edbc-42a6-40bd-85fd-de40e94841d4) ![image](https://github.com/go-gitea/gitea/assets/2114189/93f69143-d835-437c-b5eb-0f6dddde97a1) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Strip trailing newline in markdown code copy (#29019) (#29022)Giteabot2024-02-011-1/+3
| | | | | | | Behaviour now matches GH. Safeguard added in the for loop because `textContent` may be null in which case it does not make sense to render the copy button. Co-authored-by: silverwind <me@silverwind.io>
* Add changelog for 1.21.5 (#28992)v1.21.5Lunny Xiao2024-02-011-0/+33
| | | As title.
* Revert "Speed up loading the dashboard on mysql/mariadb (#28546)" (#29006) ↵Giteabot2024-02-011-6/+3
| | | | | | | | | | (#29007) Backport #29006 by @lunny This reverts commit fa8c3beb26acfcc7e732038c947225857ebcbf31. #28546 Because it seems performance become worse. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix an actions schedule bug (#28942) (#28999)Giteabot2024-01-317-19/+104
| | | | | | | | | | | | | | | Backport #28942 by @Zettat123 In #28691, schedule plans will be deleted when a repo's actions unit is disabled. But when the unit is enabled, the schedule plans won't be created again. This PR fixes the bug. The schedule plans will be created again when the actions unit is re-enabled --------- Co-authored-by: Zettat123 <zettat123@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Don't remove all mirror repository's releases when mirroring (#28817) (#28939)Giteabot2024-01-313-7/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #28817 by @lunny Fix #22066 # Purpose This PR fix the releases will be deleted when mirror repository sync the tags. # The problem In the previous implementation of #19125. All releases record in databases of one mirror repository will be deleted before sync. Ref: https://github.com/go-gitea/gitea/pull/19125/files#diff-2aa04998a791c30e5a02b49a97c07fcd93d50e8b31640ce2ddb1afeebf605d02R481 # The Pros This PR introduced a new method which will load all releases from databases and all tags on git data into memory. And detect which tags needs to be inserted, which tags need to be updated or deleted. Only tags releases(IsTag=true) which are not included in git data will be deleted, only tags which sha1 changed will be updated. So it will not delete any real releases include drafts. # The Cons The drawback is the memory usage will be higher than before if there are many tags on this repository. This PR defined a special release struct to reduce columns loaded from database to memory. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Preserve BOM in web editor (#28935) (#28959)Giteabot2024-01-2713-134/+69
| | | | | | | | | | | | | | | | | | | | | | | Backport #28935 by @silverwind The `ToUTF8*` functions were stripping BOM, while BOM is actually valid in UTF8, so the stripping must be optional depending on use case. This does: - Add a options struct to all `ToUTF8*` functions, that by default will strip BOM to preserve existing behaviour - Remove `ToUTF8` function, it was dead code - Rename `ToUTF8WithErr` to `ToUTF8` - Preserve BOM in Monaco Editor - Remove a unnecessary newline in the textarea value. Browsers did ignore it, it seems but it's better not to rely on this behaviour. Fixes: https://github.com/go-gitea/gitea/issues/28743 Related: https://github.com/go-gitea/gitea/issues/6716 which seems to have once introduced a mechanism that strips and re-adds the BOM, but from what I can tell, this mechanism was removed at some point after that PR. Co-authored-by: silverwind <me@silverwind.io>