aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add a doctor check to disable the "Actions" unit for mirrors (#32424)Zettat1232024-11-101-0/+70
| | | | | | | | Resolve #32232 Users can disable the "Actions" unit for all mirror repos by running ``` gitea doctor check --run disable-mirror-actions-unit --fix ```
* Refactor sidebar assignee&milestone&project selectors (#32465)wxiaoguang2024-11-1123-829/+504
| | | | | | | | | | | | | | | | | | | Follow #32460 Now the code could be much clearer than before and easier to maintain. A lot of legacy code is removed. Manually tested. This PR is large enough, that fine tunes could be deferred to the future if there is no bug found or design problem. Screenshots: <details> ![image](https://github.com/user-attachments/assets/35f4ab7b-1bc0-4bad-a73c-a4569328303c) </details>
* Refactor sidebar label selector (#32460)wxiaoguang2024-11-1022-232/+275
| | | Introduce `issueSidebarLabelsData` to handle all sidebar labels related data.
* Fix mermaid diagram height when initially hidden (#32457)silverwind2024-11-091-1/+12
| | | | | | | | | | | In a hidden iframe, `document.body.clientHeight` is not reliable. Use `IntersectionObserver` to detect the visibility change and update the height there. Fixes: https://github.com/go-gitea/gitea/issues/32392 <img width="885" alt="image" src="https://github.com/user-attachments/assets/a95ef6aa-27e7-443f-9d06-400ef27919ae">
* Add reviewers selection to new pull request (#32403)Calvin K2024-11-0926-268/+500
| | | | | | | | | | Users could add reviewers when creating new PRs. --------- Co-authored-by: splitt3r <splitt3r@users.noreply.github.com> Co-authored-by: Sebastian Sauer <sauer.sebastian@gmail.com> Co-authored-by: bb-ben <70356237+bboerben@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix issue sidebar (#32455)wxiaoguang2024-11-094-31/+13
| | | | | | | | | | | | | | | | | | | | | Fix #32453 Major changes: * revert the `<div class="divider"></div>` in `templates/repo/issue/branch_selector_field.tmpl` (it was removed by mistake in ##32444) * remove incorrect `<div class="inline field">` in `templates/repo/issue/sidebar/allow_maintainer_edit.tmpl` * use `gt-ellipsis` to replace the "title" class in the dependency list, then `.repository .issue-content-right .ui.list .title` could be removed * remove the "relaxed" from dependency list, then there is no padding, then `.repository .issue-content-right .ui.list .dependency` could be removed (`white-space` doesn't have effect either because there is `gt-ellipsis`) * remove dead code `.repository .issue-content-right #deadlineForm input ` The fixed UI should be the same as before.
* Refactor language menu and dom utils (#32450)wxiaoguang2024-11-0810-62/+70
| | | | | 1. Make `queryElem*` functions could correctly handle TS types 2. Remove some legacy jQuery $ calls (introduce fomanticQuery for Fomantic UI only) 3. Fix some TS typing problems
* Fix broken releases when re-pushing tags (#32435)Zettat1232024-11-082-7/+59
| | | Fix #32427
* Refactor issue page info (#32445)wxiaoguang2024-11-088-27/+36
| | | Fix a longstanding TODO since 2021 (#14826) / 2018 (#2531)
* Split issue sidebar into small templates (#32444)wxiaoguang2024-11-0815-676/+675
| | | Only move code
* Only provide the commit summary for Discord webhook push events (#32432)Kemal Zebari2024-11-073-3/+17
| | | | | | | | | | | | Resolves #32371. #31970 should have just showed the commit summary, but `strings.SplitN()` was misused such that we did not perform any splitting at all and just used the message. This was not caught in the unit test made in that PR since the test commit summary was > 50 (which truncated away the commit description). This snapshot resolves this and adds another unit test to ensure that we only show the commit summary.
* Add new event commit status creation and webhook implementation (#27151)Lunny Xiao2024-11-0710-22/+90
| | | | | | | | | | | 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
* Support quote selected comments to reply (#32431)wxiaoguang2024-11-0716-70/+255
| | | | | | | | | Many existing tests were quite hacky, these could be improved later. <details> ![image](https://github.com/user-attachments/assets/93aebb4f-9de5-4cb8-910b-50c64cbcd25a) </details>
* Move AddCollabrator and CreateRepositoryByExample to service layer (#32419)Lunny Xiao2024-11-0719-499/+231
| | | | | | - [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.
* Add new index for action to resolve the performance problem (#32333)Lunny Xiao2024-11-063-1/+57
| | | Fix #32224
* Include file extension checks in attachment API (#32151)Kemal Zebari2024-11-069-17/+148
| | | | | | From testing, I found that issue posters and users with repository write access are able to edit attachment names in a way that circumvents the instance-level file extension restrictions using the edit attachment APIs. This snapshot adds checks for these endpoints.
* Updated tokenizer to better matching when search for code snippets (#32261)Bruno Sofiato2024-11-0617-12/+83
| | | | | | | | | | | | | | | | | | | | This PR improves the accuracy of Gitea's code search. Currently, Gitea does not consider statements such as `onsole.log("hello")` as hits when the user searches for `log`. The culprit is how both ES and Bleve are tokenizing the file contents (in both cases, `console.log` is a whole token). In ES' case, we changed the tokenizer to [simple_pattern_split](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-simplepatternsplit-tokenizer.html#:~:text=The%20simple_pattern_split%20tokenizer%20uses%20a,the%20tokenization%20is%20generally%20faster.). In such a case, tokens are words formed by digits and letters. In Bleve's case, it employs a [letter](https://blevesearch.com/docs/Tokenizers/) tokenizer. Resolves #32220 --------- Signed-off-by: Bruno Sofiato <bruno.sofiato@gmail.com>
* Correctly query the primary button in a form (#32438)wxiaoguang2024-11-074-10/+34
| | | | | | | | | | | | | | | | | The "primary button" is used at many places, but sometimes they might conflict (due to button switch, hidden panel, dropdown menu, etc). Sometimes we could add a special CSS class for the buttons, but sometimes not (see the comment of QuickSubmit) This PR introduces `querySingleVisibleElem` to help to get the correct primary button (the only visible one), and prevent from querying the wrong buttons. Fix #32437 --------- Co-authored-by: silverwind <me@silverwind.io>
* Use 8 as default value for git lfs concurrency (#32421)wxiaoguang2024-11-055-6/+9
|
* Fix milestone deadline and date related problems (#32339)Lunny Xiao2024-11-0523-165/+147
| | | | | | | | | 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>
* Only query team tables if repository is under org when getting assignees ↵Lunny Xiao2024-11-051-14/+16
| | | | | | (#32414) It's unnecessary to query the team table if the repository is not under organization when getting assignees.
* Refactor RepoRefByType (#32413)wxiaoguang2024-11-057-109/+100
| | | | | 1. clarify the "filepath" could(should) contain "{ref}" 2. remove unclear RepoRefLegacy and RepoRefAny, use RepoRefUnknown to guess 3. by the way, avoid using AppURL
* Refactor template ctx and render utils (#32422)wxiaoguang2024-11-0553-205/+281
| | | Clean up the templates
* Refactor DateUtils and merge TimeSince (#32409)wxiaoguang2024-11-0474-228/+241
| | | Follow #32383 and #32402
* Refactor markup package (#32399)wxiaoguang2024-11-0419-1087/+1154
| | | | | | To make the markup package easier to maintain: 1. Split some go files into small files 2. Use a shared util.NopCloser, remove duplicate code 3. Remove unused functions
* Add some handy markdown editor features (#32400)wxiaoguang2024-11-049-22/+138
| | | | | | | | | There were some missing features from EasyMDE: 1. H1 - H3 style 2. Auto add task list 3. Insert a table And added some tests
* Make LFS http_client parallel within a batch. (#32369)Royce Remer2024-11-047-140/+170
| | | | Signed-off-by: Royce Remer <royceremer@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor repo legacy (#32404)wxiaoguang2024-11-039-362/+383
| | | | | | Only move code, no unnecessary logic change. (There are many problems in old code, but changing them is not in this PR's scope) Co-authored-by: Giteabot <teabot@gitea.io>
* Replace DateTime with proper functions (#32402)wxiaoguang2024-11-028-34/+58
| | | | | | | | | Follow #32383 This PR cleans up the "Deadline" usages in templates, make them call `ParseLegacy` first to get a `Time` struct then display by `DateUtils`. Now it should be pretty clear how "deadline string" works, it makes it possible to do further refactoring and correcting.
* Fix git error handling (#32401)wxiaoguang2024-11-0210-89/+35
|
* Fix created_unix for mirroring (#32342)Lunny Xiao2024-11-021-2/+3
| | | Fix #32233
* Replace DateTime with DateUtils (#32383)wxiaoguang2024-11-0233-37/+73
|
* improve performance of diffs (#32393)Rowan Bohde2024-11-025-42/+44
| | | | | | | | | | | | | | | | | | | | | | | | This has two major changes that significantly reduce the amount of work done for large diffs: * Kill a running git process when reaching the maximum number of files in a diff, preventing it from processing the entire diff. * When loading a diff with the URL param `file-only=true`, skip loading stats. This speeds up loading both hidden files of a diff and sections of a diff when clicking the "Show More" button. A couple of minor things from profiling are also included: * Reuse existing repo in `PrepareViewPullInfo` if head and base are the same. The performance impact is going to depend heavily on the individual diff and the hardware it runs on, but when testing locally on a diff changing 100k+ lines over hundreds of files, I'm seeing a roughly 75% reduction in time to load the result of "Show More" --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor tests to prevent from unnecessary preparations (#32398)wxiaoguang2024-11-016-55/+89
|
* Add artifacts test fixture (#30300)Kyle D.2024-11-019-38/+141
| | | | | | | | | | | | Closes https://github.com/go-gitea/gitea/issues/30296 - Adds a DB fixture for actions artifacts - Adds artifacts test files - Clears artifacts test files between each run - Note: I initially initialized the artifacts only for artifacts tests, but because the files are small it only takes ~8ms, so I changed it to always run in test setup for simplicity - Fix some otherwise flaky tests by making them not depend on previous tests
* Fix `missing signature key` error when pulling Docker images with ↵Zettat1232024-10-3119-24/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `SERVE_DIRECT` enabled (#32365) Fix #28121 I did some tests and found that the `missing signature key` error is caused by an incorrect `Content-Type` header. Gitea correctly sets the `Content-Type` header when serving files. https://github.com/go-gitea/gitea/blob/348d1d0f322ca57c459acd902f54821d687ca804/routers/api/packages/container/container.go#L712-L717 However, when `SERVE_DIRECT` is enabled, the `Content-Type` header may be set to an incorrect value by the storage service. To fix this issue, we can use query parameters to override response header values. https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html <img width="600px" src="https://github.com/user-attachments/assets/f2ff90f0-f1df-46f9-9680-b8120222c555" /> In this PR, I introduced a new parameter to the `URL` method to support additional parameters. ``` URL(path, name string, reqParams url.Values) (*url.URL, error) ``` --- Most S3-like services support specifying the content type when storing objects. However, Gitea always use `application/octet-stream`. Therefore, I believe we also need to improve the `Save` method to support storing objects with the correct content type. https://github.com/go-gitea/gitea/blob/b7fb20e73e63b8edc9b90c52073e248bef428fcc/modules/storage/minio.go#L214-L221
* Fix a number of typescript issues (#32308)silverwind2024-10-319-26/+36
| | | | | | | | | | | | | | - Prefer [window.location.assign](https://developer.mozilla.org/en-US/docs/Web/API/Location/assign) over assigning to [window.location](https://developer.mozilla.org/en-US/docs/Web/API/Window/location) which typescript does not like. This works in all browsers including PaleMoon. - Fix all typescript issues in `web_src/js/webcomponents`, no behaviour changes. - ~~Workaround bug in `@typescript-eslint/no-unnecessary-type-assertion` rule.~~ - Omit vendored file from type checks. - `tsc` error count is reduce by 53 with these changes.
* Update go dependencies (#32389)wxiaoguang2024-10-319-361/+339
|
* Update JS and PY dependencies (#32388)silverwind2024-10-318-2374/+2650
| | | | | | | | | | | | | - Update all JS dependencies excluding stylelint (because of https://github.com/AndyOGo/stylelint-declaration-strict-value/issues/379). - Update all PY dependencies. - Replace `eslint-plugin-deprecation` with `@typescript-eslint/no-deprecated` rule. - Enabled `unicorn/prefer-math-min-max` and autofixed issues. - Tested all dependencies. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix suggestions for issues (#32380)wxiaoguang2024-10-3011-88/+82
|
* refactor: remove redundant err declarations (#32381)Oleksandr Redko2024-10-3011-20/+3
|
* Fix the missing menu in organization project view page (#32313)yp053272024-10-301-5/+9
| | | | | | | | | | | | | | | | | | | | | | | #29248 didn't modify the view page. The class name is not good enough, so this is a quick fix. Before: org: ![image](https://github.com/user-attachments/assets/3e26502d-66b4-4043-ab03-003ba7391487) user: ![image](https://github.com/user-attachments/assets/9b22b90c-d63c-4228-acad-4d9fb20590ac) After: org: ![image](https://github.com/user-attachments/assets/21bf98a7-8a5b-4dc6-950a-88f529e36450) user: (no change) ![image](https://github.com/user-attachments/assets/fea0dcae-3625-44e8-bb9e-4c3733da8764) Co-authored-by: Giteabot <teabot@gitea.io>
* Fix toAbsoluteLocaleDate and add more tests (#32387)wxiaoguang2024-10-312-14/+20
|
* Respect UI.ExploreDefaultSort setting again (#32357)65432024-10-302-2/+4
| | | | | | fix regression of https://github.com/go-gitea/gitea/pull/29430 --- *Sponsored by Kithara Software GmbH*
* Fix absolute-date (#32375)wxiaoguang2024-10-304-34/+21
|
* Fix undefined errors on Activity page (#32378)cloudchamb3r2024-10-301-3/+3
| | | | | close #32377 Co-authored-by: Giteabot <teabot@gitea.io>
* Add new [lfs_client].BATCH_SIZE and [server].LFS_MAX_BATCH_SIZE config ↵Royce Remer2024-10-305-7/+48
| | | | | | | | | | | | | | | | | | settings. (#32307) This contains two backwards-compatible changes: * in the lfs http_client, the number of lfs oids requested per batch is loaded from lfs_client#BATCH_SIZE and defaulted to the previous value of 20 * in the lfs server/service, the max number of lfs oids allowed in a batch api request is loaded from server#LFS_MAX_BATCH_SIZE and defaults to 'nil' which equates to the previous behavior of 'infinite' This fixes #32306 --------- Signed-off-by: Royce Remer <royceremer@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* remove unused call to $.HeadRepo in view_title template (#32317)Rowan Bohde2024-10-301-1/+1
| | | | | | | | | | | | This is only populated in [`ParseCompareInfo`](https://github.com/search?q=repo%3Ago-gitea%2Fgitea%20%20.Data%5B%22HeadRepo%22%5D&type=code) which is called in two handlers: * [`CompareAndPullRequestPost`](https://github.com/go-gitea/gitea/blob/9206fbb55fd28f21720072fce6a36cc22277934c/routers/web/repo/pull.go#L1246) - a JSON post handler that doesn't render templates * [`CompareDiff`](https://github.com/go-gitea/gitea/blob/9206fbb55fd28f21720072fce6a36cc22277934c/routers/web/repo/compare.go#L706) - which can render `diff/box.tmpl` and `diff/compare.tmpl`
* Fix clean tmp dir (#32360)Lunny Xiao2024-10-291-13/+23
| | | | | | | | | | | | 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>
* Optimize branch protection rule loading (#32280)65432024-10-292-8/+43
| | | | | | | | | | before if it was nonglob each load would try to glob it and the check that is not glob ... now we only do that once and no future loading will trigger it --- *Sponsored by Kithara Software GmbH*