aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix some RPM registry flaws (#28782)KN4CK3R2024-01-1918-503/+659
| | | | | | | | | | | | | | | | | | | Related #26984 (https://github.com/go-gitea/gitea/pull/26984#issuecomment-1889588912) Fix admin cleanup message. Fix models `Get` not respecting default values. Rebuild RPM repository files after cleanup. Do not add RPM group to package version name. Force stable sorting of Alpine/Debian/RPM repository data. Fix missing deferred `Close`. Add tests for multiple RPM groups. Removed non-cached `ReplaceAllStringRegex`. If there are multiple groups available, it's stated in the package installation screen: ![grafik](https://github.com/go-gitea/gitea/assets/1666336/8f132760-882c-4ab8-9678-77e47dfc4415)
* tests: missing refs/ in bare repositories (#28844)Adam Majer2024-01-191-0/+1
| | | | | Git 2.43.0 will not detect a git repository as valid without refs/ subdirectory present. `git gc` cleans this up and puts it in packed-refs. We must keep refs/ non-empty.
* Fix archive creating LFS hooks and breaking pull requests (#28848)Brecht Van Lommel2024-01-191-0/+5
| | | | | | | | | | | | | | | | | | | | | | When LFS hooks are present in gitea-repositories, operations like git push for creating a pull request fail. These repositories are not meant to include LFS files or git push them, that is handled separately. And so they should not have LFS hooks. Installing git-lfs on some systems (like Debian Linux) will automatically set up /etc/gitconfig to create LFS hooks in repositories. For most git commands in Gitea this is not a problem, either because they run on a temporary clone or the git command does not create LFS hooks. But one case where this happens is git archive for creating repository archives. To fix that, add a GIT_CONFIG_NOSYSTEM=1 to disable using the system configuration for that command. According to a comment, GIT_CONFIG_NOSYSTEM is not used for all git commands because the system configuration can be intentionally set up for Gitea to use. Resolves #19810, #21148
* Return `responseText` instead of string in some functions (#28836)yp053272024-01-198-30/+18
| | | | Follow https://github.com/go-gitea/gitea/pull/28796#issuecomment-1891727591
* Fix display latest sync time for pull mirrors on the repo page (#28841)yp053272024-01-182-8/+8
| | | | | | | | | | | | | | Follow #28712 1. Missing Locale word `mirror_sync` 2. Maybe forgot checking the conflict from #27760 Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/6100d35b-7fe3-4095-9c24-7875568f7380) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/69647169-b812-45bc-a267-ab28f2df6ef6)
* Add testing for CalcCommitStatus (#28823)Lunny Xiao2024-01-171-0/+115
|
* Remove duplicated checkinit on git module (#28824)Lunny Xiao2024-01-171-4/+0
| | | | `checkInit` has been invoked in `InitSimple`. So it's unnecessary to invoke it twice in `InitFull`.
* Add missing migration (#28827)Lunny Xiao2024-01-171-0/+2
| | | Missed from #28498
* Fix uploaded artifacts should be overwritten (#28726)FuXiaoHei2024-01-173-3/+104
| | | | | | | | | | | Fix `Uploaded artifacts should be overwritten` https://github.com/go-gitea/gitea/issues/28549 When upload different content to uploaded artifact, it checks that content size is not match in db record with previous artifact size, then the new artifact is refused. Now if it finds uploading content size is not matching db record when receiving chunks, it updates db records to follow the latest size value.
* Retarget depending pulls when the parent branch is deleted (#28686)Viktor Kuzmin2024-01-179-24/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes you need to work on a feature which depends on another (unmerged) feature. In this case, you may create a PR based on that feature instead of the main branch. Currently, such PRs will be closed without the possibility to reopen in case the parent feature is merged and its branch is deleted. Automatic target branch change make life a lot easier in such cases. Github and Bitbucket behave in such way. Example: $PR_1$: main <- feature1 $PR_2$: feature1 <- feature2 Currently, merging $PR_1$ and deleting its branch leads to $PR_2$ being closed without the possibility to reopen. This is both annoying and loses the review history when you open a new PR. With this change, $PR_2$ will change its target branch to main ($PR_2$: main <- feature2) after $PR_1$ has been merged and its branch has been deleted. This behavior is enabled by default but can be disabled. For security reasons, this target branch change will not be executed when merging PRs targeting another repo. Fixes #27062 Fixes #18408 --------- Co-authored-by: Denys Konovalov <kontakt@denyskon.de> Co-authored-by: delvh <dev.lh@web.de>
* Bump `@github/relative-time-element` to 4.3.1 (#28819)Yarden Shoham2024-01-162-5/+5
| | | | | | | | | | | | | - Fixes https://github.com/go-gitea/gitea/issues/28747 # Before ![image](https://github.com/go-gitea/gitea/assets/20454870/65d8dc84-680f-4c16-9aa1-b5986102e4e7) # After ![image](https://github.com/go-gitea/gitea/assets/20454870/7cb288e7-ebde-4e94-a10a-cac28d6bdcfd) Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Fix reverting a merge commit failing (#28794)Mihir Joshi2024-01-1618-9/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #22236 --- Error occurring currently while trying to revert commit using read-tree -m approach: > 2022/12/26 16:04:43 ...rvices/pull/patch.go:240:AttemptThreeWayMerge() [E] [63a9c61a] Unable to run read-tree -m! Error: exit status 128 - fatal: this operation must be run in a work tree > - fatal: this operation must be run in a work tree We need to clone a non-bare repository for `git read-tree -m` to work. https://github.com/go-gitea/gitea/commit/bb371aee6ecf5e570cdf7b5f7f0d6f47a607a325 adds support to create a non-bare cloned temporary upload repository. After cloning a non-bare temporary upload repository, we [set default index](https://github.com/go-gitea/gitea/blob/main/services/repository/files/cherry_pick.go#L37) (`git read-tree HEAD`). This operation ends up resetting the git index file (see investigation details below), due to which, we need to call `git update-index --refresh` afterward. Here's the diff of the index file before and after we execute SetDefaultIndex: https://www.diffchecker.com/hyOP3eJy/ Notice the **ctime**, **mtime** are set to 0 after SetDefaultIndex. You can reproduce the same behavior using these steps: ```bash $ git clone https://try.gitea.io/me-heer/test.git -s -b main $ cd test $ git read-tree HEAD $ git read-tree -m 1f085d7ed8 1f085d7ed8 9933caed00 error: Entry '1' not uptodate. Cannot merge. ``` After which, we can fix like this: ``` $ git update-index --refresh $ git read-tree -m 1f085d7ed8 1f085d7ed8 9933caed00 ```
* Render code block in activity tab (#28816)JakobDev2024-01-161-7/+7
| | | | | | | | | | | This is a little bugfix. Inline code is usually rendered in issue titles, but it is missing in the activity tab. Before: ![Screenshot 2024-01-16 at 14-20-51 Test](https://github.com/go-gitea/gitea/assets/15185051/383370f3-0fb2-49de-81cc-014e5cf86727) After: ![grafik](https://github.com/go-gitea/gitea/assets/15185051/83eaf973-ce9a-44ce-beea-2db49fc8bd73)
* Remove trust model selection from repository creation on web page because it ↵Lunny Xiao2024-01-163-34/+2
| | | | | | | | | | | | | | | | | | can be changed in settings later (#28814) As more and more options can be set for creating the repository, I don't think we should put all of them into the creation web page which will make things look complicated and confusing. And I think we need some rules about how to decide which should/should not be put in creating a repository page. One rule I can imagine is if this option can be changed later and it's not a MUST on the creation, then it can be removed on the page. So I found trust model is the first one. This PR removed the trust model selections on creating a repository web page and kept others as before. This is also a preparation for #23894 which will add a choice about SHA1 or SHA256 that cannot be changed once the repository created.
* Use refname:strip-2 instead of refname:short when syncing tags (#28797)Lunny Xiao2024-01-163-13/+15
| | | | | | | | | Fix #28694 Generally, `refname:short` should be equal to `refname:lstrip=2` except `core.warnAmbiguousRefs is used to select the strict abbreviation mode.` ref: https://git-scm.com/docs/git-for-each-ref#Documentation/git-for-each-ref.txt-refname
* Add gist to comparison (#28809)crapStone2024-01-151-0/+2
| | | | | | | This PR adds a section to the documentation that links to the project [Opengist](https://github.com/thomiceli/opengist) on GitHub. The feature was proposed in #16670 but didn't resonate well with the maintainers.
* Fix links in issue card (#28806)Denys Konovalov2024-01-151-3/+3
| | | | Fixes_ https://github.com/go-gitea/gitea/issues/23318#issuecomment-1611086747
* Show latest commit for file (#28067)JakobDev2024-01-155-54/+107
| | | | | | | | | If you view a file, you can now see the latest commit that changed that file. ![grafik](https://github.com/go-gitea/gitea/assets/15185051/272c3120-6db7-4f88-86e1-60080c9aabe5) --------- Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
* Add ability to see open and closed issues at the same time (#28757)Gwyneth Morgan2024-01-154-19/+42
| | | | | | By clicking the currently active "Open" or "Closed" filter button in the issue list, the user can toggle that filter off in order to see all issues regardless of state. The URL "state" parameter will be set to "all" and the "Open"/"Closed" button will not show as active.
* Display latest sync time for pull mirrors on the repo page (#28712)Dmitry Sharshakov2024-01-151-0/+7
| | | | | | | Fixes #25168 --------- Co-authored-by: delvh <dev.lh@web.de>
* Fix `GetCommitStatuses` (#28787)KN4CK3R2024-01-153-37/+37
| | | Fixes #28764.
* Caller should check the ResponseExtra.HasError() first to see whether the ↵wxiaoguang2024-01-154-3/+4
| | | | | | request fails (#28796) `resp != nil` doesn't mean the request really succeeded. Add a comment for requestJSONResp to clarify the behavior.
* Rework markup link rendering (#26745)KN4CK3R2024-01-1542-395/+967
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #26548 This PR refactors the rendering of markup links. The old code uses `strings.Replace` to change some urls while the new code uses more context to decide which link should be generated. The added tests should ensure the same output for the old and new behaviour (besides the bug). We may need to refactor the rendering a bit more to make it clear how the different helper methods render the input string. There are lots of options (resolve links / images / mentions / git hashes / emojis / ...) but you don't really know what helper uses which options. For example, we currently support images in the user description which should not be allowed I think: <details> <summary>Profile</summary> https://try.gitea.io/KN4CK3R ![grafik](https://github.com/go-gitea/gitea/assets/1666336/109ae422-496d-4200-b52e-b3a528f553e5) </details> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix nil pointer panic when exec some gitea cli command (#28791)yp053272024-01-153-0/+9
| | | | | | | | | panic: ![image](https://github.com/go-gitea/gitea/assets/18380374/7fcde2ad-1d42-4b60-b120-3b60a8926e8e) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/49d9f0ca-e590-4a35-8ca2-1317d1b7c939)
* Add branch protection setting for ignoring stale approvals (#28498)Jimmy Praet2024-01-1512-2/+53
| | | | | | | | | | | | | | | | | | | | | | Fixes #27114. * In Gitea 1.12 (#9532), a "dismiss stale approvals" branch protection setting was introduced, for ignoring stale reviews when verifying the approval count of a pull request. * In Gitea 1.14 (#12674), the "dismiss review" feature was added. * This caused confusion with users (#25858), as "dismiss" now means 2 different things. * In Gitea 1.20 (#25882), the behavior of the "dismiss stale approvals" branch protection was modified to actually dismiss the stale review. For some users this new behavior of dismissing the stale reviews is not desirable. So this PR reintroduces the old behavior as a new "ignore stale approvals" branch protection setting. --------- Co-authored-by: delvh <dev.lh@web.de>
* Forbid removing the last admin user (#28337)yp053272024-01-158-7/+80
| | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix when private user following user, private user will not be counted in ↵yp053272024-01-151-0/+2
| | | | | | | | | | | | | | | | | | | his own view (#28037) Doer: asdasasdasasdasasdasasdasasdasasdasasdas (private user) Followed: TestUser (public user) Before: (From doer's view) ![image](https://github.com/go-gitea/gitea/assets/18380374/9ba16b3b-068c-43c5-a3dd-e3343b5b32f2) (From followed user's view, can see doer) ![image](https://github.com/go-gitea/gitea/assets/18380374/dfd1b564-d689-4393-b3d3-1e6bf52c94ba) After: (From doer's view) ![image](https://github.com/go-gitea/gitea/assets/18380374/1c85c1d1-c9f7-40c8-948c-145f7cae9a04)
* Update github.com/cloudflare/circl (#28789)Chongyi Zheng2024-01-152-3/+3
| | | | | | cloudflare/circl: https://github.com/advisories/GHSA-9763-4f94-gfch Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Move more functions to db.Find (#28419)Lunny Xiao2024-01-1536-238/+305
| | | | | | | | | Following #28220 This PR move more functions to use `db.Find`. --------- Co-authored-by: delvh <dev.lh@web.de>
* Add non-JS fallback for reaction tooltips (#28785)Gwyneth Morgan2024-01-151-1/+3
| | | | | | | When JavaScript is not loaded, fall back to displaying reaction tooltips with the default browser `title` attribute. An element with a present but empty `data-tooltip-content` will use the `title` attribute for its tippy.js tooltip content, so when JavaScript is enabled, this functions the same as the current behavior.
* Modernize merge button (#28140)Earl Warren2024-01-153-63/+65
| | | | | | | | | | | | | | | | - Make use of the `form-fetch-action` for the merge button, which will automatically prevent the action from happening multiple times and show a nice loading indicator as user feedback while the merge request is being processed by the server. - Adjust the merge PR code to JSON response as this is required for the `form-fetch-action` functionality. - Resolves https://codeberg.org/forgejo/forgejo/issues/774 - Likely resolves the cause of https://codeberg.org/forgejo/forgejo/issues/1688#issuecomment-1313044 (cherry picked from commit 4ec64c19507caefff7ddaad722b1b5792b97cc5a) Co-authored-by: Gusted <postmaster@gusted.xyz>
* Warn that `DISABLE_QUERY_AUTH_TOKEN` is false only if it's explicitly ↵Yarden Shoham2024-01-141-1/+4
| | | | | | | | | | defined (#28783) So we don't warn on default behavior - Fixes https://github.com/go-gitea/gitea/issues/28758 - Follows https://github.com/go-gitea/gitea/pull/28390 Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Speed up loading the dashboard on mysql/mariadb (#28546)Lunny Xiao2024-01-141-3/+6
| | | Fixes #28155
* Fix schedule tasks bugs (#28691)Lunny Xiao2024-01-1219-88/+204
| | | | | | | | | | | | | | | | Fix #28157 This PR fix the possible bugs about actions schedule. ## The Changes - Move `UpdateRepositoryUnit` and `SetRepoDefaultBranch` from models to service layer - Remove schedules plan from database and cancel waiting & running schedules tasks in this repository when actions unit has been disabled or global disabled. - Remove schedules plan from database and cancel waiting & running schedules tasks in this repository when default branch changed.
* Add tests for #28765 (#28773)Jack Hay2024-01-121-1/+4
| | | Adds tests to cover changes made in #28765
* Fix issue dependencies (#27736)Nanguan Lin2024-01-122-56/+55
| | | | | | | | | | | | | | | | | | | | Fix #27722 Fix #27357 Fix #25837 1. Fix the typo `BlockingByDependenciesNotPermitted`, which causes the `not permitted message` not to show. The correct one is `Blocking` or `BlockedBy` 2. Rewrite the perm check. The perm check uses a very tricky way to avoid duplicate checks for a slice of issues, which is confusing. In fact, it's also the reason causing the bug. It uses `lastRepoID` and `lastPerm` to avoid duplicate checks, but forgets to assign the `lastPerm` at the end of the code block. So I rewrote this to avoid this trick. ![I U1AT{GNFY3 1HZ`6L{(2L](https://github.com/go-gitea/gitea/assets/70063547/79acd02a-a567-4316-ae0d-11c6461becf1) 3. It also reuses the `blocks` slice, which is even more confusing. So I rewrote this too. ![UARFPXRGGZQFB7J$2`R}5_R](https://github.com/go-gitea/gitea/assets/70063547/f21cff0f-d9ac-4ce4-ae4d-adffc98ecd99)
* Assign pull request to project during creation (#28227)Denys Konovalov2024-01-122-1/+13
| | | | | | | | | When creating a pull request, allow directly assigning it to a project, as it is already possible for issues. After: ![grafik](https://github.com/go-gitea/gitea/assets/47871822/01dc2b3d-d56a-4053-b2fc-138725d7633a)
* Fix button size in "attached header right" (#28770)wxiaoguang2024-01-124-8/+9
| | | | | | | | | | | | | | | | | | | | | | | Before: <details> ![image](https://github.com/go-gitea/gitea/assets/2114189/c82f8615-04d4-408f-95bf-689c227a8814) ![image](https://github.com/go-gitea/gitea/assets/2114189/d01d05a7-09ca-48f3-a0e7-fec48119b426) </details> After: ![image](https://github.com/go-gitea/gitea/assets/2114189/e560398e-2fa4-4f46-9229-f6acc70e32ab) ![image](https://github.com/go-gitea/gitea/assets/2114189/bd18961d-0636-4584-b893-c465daaf40af)
* Improve CSS helper naming (#28769)wxiaoguang2024-01-125-13/+13
| | | | * `gt-w-100` => `gt-w-full` to match tailwind * clarify `gt-hidden` priority
* Revamp repo header (#27760)Denys Konovalov2024-01-125-153/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Redesign repo header with following new aspects: - responsive & better-looking repo title - hide repo button text instead of icons in mobile view - use same tab style as on explore and org page <details> <summary>Before:</summary> ![grafik](https://github.com/go-gitea/gitea/assets/47871822/57360b77-d43c-49ac-b798-2363c03da7ec) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/d4117f79-a5f5-4f36-bf65-bbada3e7e73b) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/e26f967f-e264-4337-9925-3d942e04fd6d) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/b4683c8d-9c6a-4089-afa7-8dd219e43a46) </details> <details> <summary>After:</summary> ![grafik](https://github.com/go-gitea/gitea/assets/47871822/8ddbc9f6-53c7-4e4e-bea9-704fd93524ca) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/c0588aa9-788d-469c-98a0-81484fbd220c) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/206e931e-404d-4d1b-92ce-908698addfcc) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/a508f9c8-fadc-4a85-94ba-18796f77e07b)
* Support for grouping RPMs using paths (#26984)Exploding Dragon2024-01-129-101/+192
| | | | | | | | | | | | The current rpm repository places all packages in the same repository, and different systems (el7,f34) may hit packages that do not belong to this distribution ( #25304 ) , which now supports grouping of rpm. ![图片](https://github.com/go-gitea/gitea/assets/33776693/d1e1d99f-7799-4b2b-a19b-cb2a5c692914) Fixes #25304 . Fixes #27056 . Refactor: [#25866](https://github.com/go-gitea/gitea/pull/25866)
* Require token for GET subscription endpoint (#28765)Jack Hay2024-01-121-3/+3
| | | | | | | Fixes #28756 ## Changes - Require and check API token for `GET /repos/{owner}/{repo}/subscription` in order to populate `ctx.Doer`.
* Fix `convert.ToTeams` on empty input (#28426)KN4CK3R2024-01-112-26/+26
| | | | | Fixes #28420 Don't return `nil` if the input was empty.
* Show description as tooltip instead of title for labels (#28754)delvh2024-01-121-2/+2
| | | | | | | | | | | | | Follow GitHubs behavior of showing the label description as a tooltip instead of the browser native title. ## Before ![grafik](https://github.com/go-gitea/gitea/assets/51889757/70448327-467b-4bee-b799-40a442a5ce16) ## After ![grafik](https://github.com/go-gitea/gitea/assets/51889757/abe7d700-148b-4cef-a487-6b0f8f20b212)
* Integration Test for Commit Search containing Square Brackets (#28751)Mihir Joshi2024-01-112-1/+2
| | | | | | Integration test for #28744 Change keywords commit search flag from `-F` to `--fixed-strings` for readability
* Hide code related setting options in repository when code unit is disabled ↵Lunny Xiao2024-01-102-19/+19
| | | | | | | | | | (#28631) Since #20805, code can be hidden. However, the related settings are still shown even though they don't have any meaning then. https://github.com/go-gitea/gitea/assets/81045/5fdee54d-ac81-418a-82f7-eadff048cedd
* Add -F to commit search to treat keywords as strings (#28744)Mihir Joshi2024-01-101-0/+3
| | | | | | | | | | | | | Fixes #28269 The [default behavior](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp) of --grep in git log is to interpret the keyword as a regular expression. This causes the search to fail in the cases where the search keyword contains a `[`, since `[` is a special character used in grep. If we want our keywords to be interpreted as 'strings', we should use [-F flag](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp).
* Recommend/convert to use case-sensitive collation for MySQL/MSSQL (#28662)wxiaoguang2024-01-1021-186/+439
| | | | | | | | | | | | | | | | | | Mainly for MySQL/MSSQL. It is important for Gitea to use case-sensitive database charset collation. If the database is using a case-insensitive collation, Gitea will show startup error/warning messages, and show the errors/warnings on the admin panel's Self-Check page. Make `gitea doctor convert` work for MySQL to convert the collations of database & tables & columns. * Fix #28131 ## :warning: BREAKING :warning: It is not quite breaking, but it's highly recommended to convert the database&table&column to a consistent and case-sensitive collation.
* Add download attribute to release attachments (#28739)JakobDev2024-01-091-1/+1
| | | Fixes #28736
* Concatenate error in `checkIfPRContentChanged` (#28731)Earl Warren2024-01-091-0/+4
| | | | | | | | | - If there's a error with the Git command in `checkIfPRContentChanged` the stderr wasn't concatendated to the error, which results in still not knowing why an error happend. - Adds concatenation for stderr to the returned error. - Ref: https://codeberg.org/forgejo/forgejo/issues/2077 Co-authored-by: Gusted <postmaster@gusted.xyz>