aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix user router possbile panic (#29751)Lunny Xiao2024-03-132-2/+14
| | | regression from #28023
* Refactor label.IsArchived() (#29750)65432024-03-133-15/+12
| | | just some missed nits
* Fix date rendering by adding `<gitea-absolute-date>` (#29725)silverwind2024-03-125-14/+67
| | | | | | | | | | | | | Alternative to: https://github.com/go-gitea/gitea/pull/29698 Fixes: https://github.com/go-gitea/gitea/issues/29034 <img width="278" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/12ecd967-2723-410d-8a28-a1b0f41b7bba"> It also fixes a secondary issue that we were showing timestamp tooltips over date, which makes no sense, so these are now gone as well: <img width="284" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/a70432f3-97b6-41e6-b202-b53b76924a66">
* Update to labeler v5 (#29721)Denys Konovalov2024-03-122-24/+72
| | | | | | | | | | Updated to actions/labeler@v5 Updated labeler config accordingly, also improved the config and added more labels. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Update Chroma to v2.13.0 (#29732)JakobDev2024-03-122-10/+10
| | | | | | | | | This adds new lexers and includes some fixes. See https://github.com/alecthomas/chroma/releases/tag/v2.13.0 for the full changelog. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Highlight archived labels (#29680)65432024-03-129-20/+35
| | | | | | | | | | | | | | | | | | | | | | | | the issue is, that you can not distinguish between normal and archived labels. So this will make archived labels 80% **grayscale**. And prepend "Archived: " to the tooltip info ![image](https://github.com/go-gitea/gitea/assets/24977596/fd77c4d2-eff5-4afd-9bfa-19cb9991c5e7) ![image](https://github.com/go-gitea/gitea/assets/24977596/2e0f30e5-f301-4c9c-8e9f-677298d90b27) ![image](https://github.com/go-gitea/gitea/assets/24977596/53d70abf-b306-453d-aa95-a3a035b19a33) ![image](https://github.com/go-gitea/gitea/assets/24977596/6020e5f5-2364-4807-979f-37dffa8735e5) --- *Sponsored by Kithara Software GmbH* --------- Co-authored-by: delvh <dev.lh@web.de>
* Add more stats tables (#29730)Lunny Xiao2024-03-121-1/+6
| | | Add `Tags`, `Branches` and `CommitStatus` to monitor/stats
* Use Get but not Post to get actions artifacts (#29734)Lunny Xiao2024-03-122-3/+3
|
* Do some performance optimize for issues list and view issue/pull (#29515)Lunny Xiao2024-03-1210-61/+121
| | | | | | | | | | | | | | This PR do some performance optimzations. - [x] Add `index` for the column `comment_id` of `Attachment` table to accelerate query from the database. - [x] Remove unnecessary database queries when viewing issues. Before some conditions which id = 0 will be sent to the database - [x] Remove duplicated load posters - [x] Batch loading attachements, isread of comments on viewing issue --------- Co-authored-by: Zettat123 <zettat123@gmail.com>
* Some performance optimization on dashboard and issues page (#29010)Lunny Xiao2024-03-127-75/+228
| | | | | | | | | This PR do some loading speed optimization for feeds user interface pages. - Load action users batchly but not one by one. - Load action repositories batchly but not one by one. - Load action's Repo Owners batchly but not one by one. - Load action's possible issues batchly but not one by one. - Load action's possible comments batchly but not one by one.
* Remove jQuery AJAX from the issue branch reference selection (#29722)Yarden Shoham2024-03-121-2/+10
| | | | | | | | | | - Replaced a single jQuery AJAX instance with our fetch wrapper - Tested the issue branch reference selection and it works as before # Demo using `fetch` instead of jQuery AJAX ![demo](https://github.com/go-gitea/gitea/assets/20454870/7e195632-41f8-494b-b599-f6291860f330) Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Lazy load object format with command line and don't do it in OpenRepository ↵Lunny Xiao2024-03-1215-31/+72
| | | | | | | (#29712) Most time, when invoking `git.OpenRepository`, `objectFormat` will not be used, so it's a waste to invoke commandline to get the object format. This PR make it a lazy operation, only invoke that when necessary.
* remove repetitive words (#29695)pengqiseven2024-03-117-7/+7
| | | Signed-off-by: pengqiseven <912170095@qq.com>
* Sync branches first (#29714)Jason Song2024-03-111-13/+13
| | | | | Follow #29493. Sync branches to DB first, then trigger push events.
* Add a warning for disallowed email domains (#29658)Zettat1232024-03-116-16/+32
| | | | | | | | | | | | | Resolve #29660 Follow #29522 and #29609 Add a warning for disallowed email domains when admins manually add/edit users. Thanks @yp05327 for the [comment](https://github.com/go-gitea/gitea/pull/29605#issuecomment-1980105119) ![image](https://github.com/go-gitea/gitea/assets/15528715/6737b221-a3a2-4180-9ef8-b846c10f96e0)
* Fix inconsistent rendering of block mathematical expressions (#29677)yp053272024-03-111-1/+2
| | | | | | | | | | | | | | | | Fix #28735 GitHub render `\```math\``` ` as a block now. Add `display` class will render it as a block. After: ![image](https://github.com/go-gitea/gitea/assets/18380374/2a1c20c7-438e-4ab1-8c66-cf91c8343087) ![image](https://github.com/go-gitea/gitea/assets/18380374/b81b8a93-8bca-46a5-b7db-e0d2f53e1342) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Use repo object format name instead of detecting from git repository (#29702)Lunny Xiao2024-03-106-29/+9
| | | | It's unnecessary to detect the repository object format from git repository. Just use the repository's object format name.
* Improve CSV rendering (#29638)silverwind2024-03-101-1/+17
| | | | | | | | | | Before: <img width="1332" alt="Screenshot 2024-03-06 at 21 42 17" src="https://github.com/go-gitea/gitea/assets/115237/0ea07eee-31f8-4783-bd56-37bd8396f00d"> After: <img width="1336" alt="Screenshot 2024-03-06 at 21 41 58" src="https://github.com/go-gitea/gitea/assets/115237/eb7f9cc9-587f-4e3b-92bd-cc67ca639963">
* Remove jQuery AJAX from the comment edit history (#29703)Yarden Shoham2024-03-101-22/+36
| | | | | | | | | | | - Removed all jQuery AJAX calls and replaced with our fetch wrapper - Tested the comment edit history list, diff, and delete functionality and it works as before # Demo using `fetch` instead of jQuery AJAX ![demo](https://github.com/go-gitea/gitea/assets/20454870/e8c557bc-f2b9-4d73-b55e-0850c1b19364) Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* fix: rendering internal file links in org (#29669)Ankit R Gadiya2024-03-102-4/+38
| | | | | | | | The internal links to other files in the repository were not rendering with the Src Prefix (/src/branch-name/file-path). This commit fixes that by using the `SrcLink` as base if available. Resolves #29668
* Fix broken webhooks (#29690)Lunny Xiao2024-03-101-1/+6
| | | Fix #29689
* Suppress error from monaco-editor (#29684)silverwind2024-03-091-0/+8
| | | | | | | | | | | | Fixes: https://github.com/go-gitea/gitea/issues/29414 I see no way for us to catch this error, so downgrade it until https://github.com/microsoft/monaco-editor/issues/4325 is fixed, which will likely take a few weeks to propagate up from vscode. The entries in `updates.config.js` will make [`updates`](https://github.com/silverwind/updates) not upgrade these anymore and I think it's good documentation as well to have the reasons why we don't upgrade these dependencies.
* Fix action runner offline label padding (#29691)Chongyi Zheng2024-03-091-1/+1
| | | | | | | | | | | | | | Before: The `offline` padding is `calc(.833em - 1px)` from `basic` CSS class, but `idle` padding is `6px`. <img width="1035" alt="image" src="https://github.com/go-gitea/gitea/assets/37034805/ccb42615-20d7-4032-a805-40cd9643012d"> After: <img width="1035" alt="image" src="https://github.com/go-gitea/gitea/assets/37034805/d6af99c8-76cb-4850-96d6-5289b06e1ca8">
* Update allowed attachment types (#29688)silverwind2024-03-093-4/+4
| | | | | Update to match GitHub's latest. Co-authored-by: Giteabot <teabot@gitea.io>
* Completely style the webkit autofill (#29683)silverwind2024-03-091-4/+12
| | | | | | | | | | | | Previously it was only partially styled, e.g. there was black text on white background even in dark theme caused by fomantic styles. <img width="195" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/bc5cf516-2aef-45c3-854a-c9f5497aacca"> <img width="195" alt="Screenshot 2024-03-09 at 02 09 29" src="https://github.com/go-gitea/gitea/assets/115237/ef0af17d-6e0b-402e-b24d-bfa34dc2f4e0"> Co-authored-by: Giteabot <teabot@gitea.io>
* Include go files in tailwind processing (#29686)silverwind2024-03-091-0/+3
| | | | | | | | | | | | | We need to scan `.go` files for tailwind classes. Does not seem to affect build time much luckily. Fixes: https://github.com/go-gitea/gitea/pull/29678#discussion_r1518448600 Verified via `rg tw-object-contain public/assets/css/index.css`. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Fix WebHookEditor regression from jQuery removal (#29692)Yarden Shoham2024-03-091-7/+10
| | | | | | | | Make these calls optional --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Patch in exact search for meilisearch (#29671)65432024-03-0914-33/+184
| | | | | | | | | | | | | | | | | | | meilisearch does not have an search option to contorl fuzzynes per query right now: - https://github.com/meilisearch/meilisearch/issues/1192 - https://github.com/orgs/meilisearch/discussions/377 - https://github.com/meilisearch/meilisearch/discussions/1096 so we have to create a workaround by post-filter the search result in gitea until this is addressed. For future works I added an option in backend only atm, to enable fuzzynes for issue indexer too. And also refactored the code so the fuzzy option is equal in logic to code indexer --- *Sponsored by Kithara Software GmbH*
* Use more specific selector for `name` links (#29679)silverwind2024-03-081-1/+1
| | | | | | | | Followup https://github.com/go-gitea/gitea/pull/29305. As per discussion in https://github.com/go-gitea/gitea/pull/29666#discussion_r1517506422, make this selector only search in the current `.markup` document, as there can be multiples displayed at the same time. @DanielMatiasCarvalho maybe you can review.
* Replace more gt- with tw- (#29678)silverwind2024-03-088-40/+17
| | | This will conclude the trivial class replacements.
* Fix commit_status problem when testing (#29672)charles2024-03-081-1/+1
| | | | | | | Close #29661 fix #29656 Co-authored-by: Giteabot <teabot@gitea.io>
* Support pasting URLs over markdown text (#29566)silverwind2024-03-085-31/+103
| | | | | | | | | | | | | | | | | Support pasting URLs over selection text in the textarea editor. Does not work in EasyMDE and I don't intend to support it. Image paste works as usual in both Textarea and EasyMDE. The new `replaceTextareaSelection` function changes textarea content via [`insertText`](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand#using_inserttext) command, which preserves history, e.g. `CTRL-Z` works and is also demostrated below. We should later refactor the image paste code to use the same function because it currently destroys history. Overriding the formatting via `Shift` key is supported as well, e.g. `Ctrl+Shift+V` will insert the URL as-is, like on GitHub. ![urlpaste](https://github.com/go-gitea/gitea/assets/115237/522b1023-6797-401c-9e4a-498570adfc88)
* bump python version to 3.12 in dev container (#29670)yp053272024-03-081-1/+3
| | | | | | | | | ![image](https://github.com/go-gitea/gitea/assets/18380374/963dc021-ac9b-4713-8344-654f966c80a4) The default version is 3.9.2, which is not supported by poetry. --------- Co-authored-by: silverwind <me@silverwind.io>
* Add cache for branch divergence on branch list page (#29577)Lunny Xiao2024-03-082-6/+54
| | | | | | The branch page for blender project will take 6s because calculating divergence is very slow. This PR will add a cache for the branch divergence calculation. So when the second visit the branch list, it will take only less 200ms.
* Fix user-defined markup links targets (#29305)DC2024-03-081-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This seeks to fix the bug reported on issue #29196. Cause: ID's with custom characters (- , _ , etc.), were not linking correctly in the Markdown file when rendered in the browser because the ID in the respective destinies would be different than the one in anchor, while for IDs with only letters, the ID would be the same. Fix: It was suggested that to fix this bug, it should more or less like GitHub does it. While in gitea the anchors would be put in HTML like this: ``` <p dir="auto"><a href="#user-content-_toc152597800" rel="nofollow">Review</a></p> <p dir="auto"><a href="#user-content-_toc152597802" rel="nofollow">Staging</a></p> <p dir="auto"><a href="#user-content-_toc152597803" rel="nofollow">Development</a></p> <p dir="auto"><a href="#user-content-_toc152597828" rel="nofollow">Testing</a></p> <p dir="auto"><a href="#user-content-_toc152597829" rel="nofollow">Unit-tests</a></p> ``` In GitHub, the same anchor's href properties would be the same without "user-content-" trailing behind. So my code made sure to change those anchors, so it would not include "user-content-" and then add respective Event Listeners so it would scroll into the supposed places. Fixes: #29196 --------- Co-authored-by: silverwind <me@silverwind.io>
* Don't show AbortErrors on logout (#29639)silverwind2024-03-081-2/+4
| | | | | | | When logging out of Gitea, a error toast can be seen for a split second. I don't know why or how it happens but I found it it's an `AbortError` (related to [AbortController#abort](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)), so let's hide it.
* Style fomantic grey labels (#29458)silverwind2024-03-082-4/+6
| | | | | | | | | | Fomantic grey labels in the dashboard repo lists were showing original fomantic colors, fixed that. Also slightly tweaked the light theme colors so it uses same opacity values as dark theme. <img width="165" alt="Screenshot 2024-03-07 at 21 06 23" src="https://github.com/go-gitea/gitea/assets/115237/72744d6f-2ee1-4e5d-8ba0-b482a446f535"> <img width="167" alt="Screenshot 2024-03-07 at 21 06 00" src="https://github.com/go-gitea/gitea/assets/115237/1ba93775-e5a9-4b28-b90f-59c1e9199687">
* Don't use `<br />` in alert block (#29650)Yarden Shoham2024-03-081-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Follows https://github.com/go-gitea/gitea/pull/29121 When I implemented alert blocks I was always testing the markdown in issue comments. I used `<br />` for line breaks and it looked good. I have since learned that the markdown on README files doesn't allow these tags. So a comment with ```md > [!NOTE] > If you're interested in using our APIs, we have experimental support with [documentation](https://try.gitea.io/api/swagger). ``` looked like this in a comment ![image](https://github.com/go-gitea/gitea/assets/20454870/96b1de01-2c87-4d4f-83dd-98192b83e9d0) but looked like this in a README ![image](https://github.com/go-gitea/gitea/assets/20454870/474b636d-dd7a-4b7f-ba27-643803c71aa3) So I changed how we render the alert block by having the alert itself have a dedicated paragraph, so line breaks happen naturally between paragraphs. # Before ![image](https://github.com/go-gitea/gitea/assets/20454870/474b636d-dd7a-4b7f-ba27-643803c71aa3) ![image](https://github.com/go-gitea/gitea/assets/20454870/167a8d37-9a44-4479-9340-5dc80347b595) # After ![image](https://github.com/go-gitea/gitea/assets/20454870/2f99fec0-98ff-4ba8-97fe-b4567041ae79) ![image](https://github.com/go-gitea/gitea/assets/20454870/ffdeae11-fb06-4d00-b497-eae135f0d7ad) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: silverwind <me@silverwind.io>
* Fix incorrect rendering csv file when file size is larger than ↵yp053272024-03-081-2/+4
| | | | | UI.CSV.MaxFileSize (#29653) Fix #29506
* Set user's 24h preference from their current OS locale (#29651)silverwind2024-03-083-3/+32
| | | | | | | | | | | | | | Fixes: https://github.com/go-gitea/gitea/issues/28371 Fixed by using a JS solution that formats according to `lang`, but alters the 24h format setting as per user's locale. This will work for all tooltips: <img width="243" alt="Screenshot 2024-03-07 at 23 03 35" src="https://github.com/go-gitea/gitea/assets/115237/6d16c71c-6786-4eda-8cdc-50ec68ba62c6"> <img width="250" alt="Screenshot 2024-03-07 at 23 03 17" src="https://github.com/go-gitea/gitea/assets/115237/4e26bbb7-12df-4b81-bd37-14705e87e8f7"> <img width="310" alt="Screenshot 2024-03-07 at 23 14 34" src="https://github.com/go-gitea/gitea/assets/115237/1ef599f0-6401-4e19-b1da-59cdfc09b0f6"> I think there is only one other place in the UI where we render such absolute dates, which is in the actions view and which I've also fixed: <img width="275" alt="Screenshot 2024-03-07 at 23 04 00" src="https://github.com/go-gitea/gitea/assets/115237/df0fbe1f-96ee-4338-ab5e-2b10e215005d">
* Move get/set default branch from git package to gitrepo package to hide ↵Lunny Xiao2024-03-0815-63/+52
| | | | repopath (#29126)
* Make runs-on support variable expression (#29468)sillyguodong2024-03-086-72/+99
| | | | | | | | As title. Close issue: https://gitea.com/gitea/act_runner/issues/445 Follow: https://gitea.com/gitea/act/pulls/91 Move `getSecretsOfTask` and `getVariablesOfTask` under `models` because of circular dependency issues.
* Filter for default-branch selection (#29388)Tim-Niclas Oelschläger2024-03-081-1/+1
| | | | | | | | | | | | | | | Filter for default-branch selection (fixes #4751) before: ![image](https://github.com/go-gitea/gitea/assets/72873130/dcae266d-2e04-41bf-8739-64a85c9007f6) after: ![image](https://github.com/go-gitea/gitea/assets/72873130/5f27c0a7-1d30-4ccd-b4bb-6c34fff1b79f) --------- Co-authored-by: silverwind <me@silverwind.io>
* Fixing the issue when status check per rule matches multiple actions (#29631)charles2024-03-082-7/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Close #29628 rule ``` Test / Build* Test / Build * Test / Build 2* Test / Build 1* ``` ![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8) rule2 ``` Test / Build* Test / Build 1* ``` ![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8) rule3 ``` Test / Build* Test / Build 1* NotExist* ``` ![image](https://github.com/go-gitea/gitea/assets/30816317/f6a5e832-2e1b-4049-915b-45bec5ef070c) --------- Co-authored-by: Zettat123 <zettat123@gmail.com>
* Fix 500 when deleting account with incorrect password or unsupported login ↵Lunny Xiao2024-03-082-2/+19
| | | | | | | | | type (#29579) Fix #26210 --------- Co-authored-by: Jason Song <i@wolfogre.com>
* Partially enable MSSQL case-sensitive collation support (#29238)wxiaoguang2024-03-085-24/+17
| | | Follow #28662
* Store webhook event in database (#29145)oliverpool2024-03-0728-1545/+1713
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor the webhook logic, to have the type-dependent processing happen only in one place. --- ## Current webhook flow 1. An event happens 2. It is pre-processed (depending on the webhook type) and its body is added to a task queue 3. When the task is processed, some more logic (depending on the webhook type as well) is applied to make an HTTP request This means that webhook-type dependant logic is needed in step 2 and 3. This is cumbersome and brittle to maintain. Updated webhook flow with this PR: 1. An event happens 2. It is stored as-is and added to a task queue 3. When the task is processed, the event is processed (depending on the webhook type) to make an HTTP request So the only webhook-type dependent logic happens in one place (step 3) which should be much more robust. ## Consequences of the refactor - the raw event must be stored in the hooktask (until now, the pre-processed body was stored) - to ensure that previous hooktasks are correctly sent, a `payload_version` is added (version 1: the body has already been pre-process / version 2: the body is the raw event) So future webhook additions will only have to deal with creating an http.Request based on the raw event (no need to adjust the code in multiple places, like currently). Moreover since this processing happens when fetching from the task queue, it ensures that the queuing of new events (upon a `git push` for instance) does not get slowed down by a slow webhook. As a concrete example, the PR #19307 for custom webhooks, should be substantially smaller: - no need to change `services/webhook/deliver.go` - minimal change in `services/webhook/webhook.go` (add the new webhook to the map) - no need to change all the individual webhook files (since with this refactor the `*webhook_model.Webhook` is provided as argument)
* Fix bug hidden on CI and make ci failed if tests failure (#29254)Lunny Xiao2024-03-0720-46/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | The tests on migration tests failed but CI reports successfully https://github.com/go-gitea/gitea/actions/runs/7364373807/job/20044685969#step:8:141 This PR will fix the bug on migration v283 and also the CI hidden behaviour. The reason is on the Makefile `GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(MIGRATE_TEST_PACKAGES)` will return the error exit code. But `for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \ GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \ done` will not work. This also fix #29602
* Remove jQuery AJAX from the repo editor (#29636)Yarden Shoham2024-03-072-30/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # Preview Tab - Removed the jQuery AJAX call and replaced with our fetch wrapper - Tested the preview tab functionality and it works as before # Diff Tab - Removed the jQuery AJAX call and replaced with htmx - Tested the diff tab functionality and it works as before ## htmx Attributes - `hx-post="{{.RepoLink}}..."`: make a POST request to the endpoint - `hx-indicator=".tab[data-tab='diff']"`: attach the loading indicator to the tab body - `hx-target=".tab[data-tab='diff']"`: target the tab body for swapping with the response - `hx-swap="innerHTML"`: swap the target's inner HTML - `hx-include="#edit_area"`: include the value of the textarea (content) in the request body - `hx-vals='{"context":"{{.BranchLink}}"}'`: include the context in the request body - `hx-params="context,content"`: include only these keys in the request body # Demo using `fetch` and `htmx` instead of jQuery AJAX ![demo](https://github.com/go-gitea/gitea/assets/20454870/585cd6e8-f329-4c9e-ab53-a540acbd7988) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: silverwind <me@silverwind.io>
* Use strict protocol check when redirect (#29642)wxiaoguang2024-03-072-1/+48
|