Commit graph

20964 commits

Author SHA1 Message Date
Lunny Xiao
f709de2403
Fix wrong last modify time (#32102)
(cherry picked from commit a802508f88e546bf18990559e44bf27a09c869ee)
2024-09-27 08:42:48 +02:00
Timon van der Berg
2675a24649
Repo Activity: count new issues that were closed (#31776)
I'm new to go and contributing to gitea, your guidance is much
appreciated.

This is meant to solve https://github.com/go-gitea/gitea/issues/13309

Previously, closed issues would not be shown under new issues in the
activity tab, even if they were newly created.

changes:
* Split out newlyCreatedIssues from issuesForActivityStatement to count
  both currently open and closed issues.
* Use a seperate function to count active issues to prevent
double-counting issues after the above change.

Result is that new issues that have been closed are shown both under
"new" and "closed".

Signed-off-by: Timon van der Berg <tmnvanderberg@gmail.com>
(cherry picked from commit ebfde845294cc681de6b1fe1adcf27e35f61b89b)
2024-09-27 08:42:48 +02:00
KN4CK3R
526054332a
Fix incorrect /tokens api (#32085)
Fixes #32078

- Add missing scopes output.
- Disallow empty scope.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 08adbc468f8875fd4763c3656b334203c11adc0a)
2024-09-27 08:42:48 +02:00
Earl Warren
6275d1bc50
Refactor CSRF protector (#32057) (fix forgejo tests)
Fix the tests unique to Forgejo that are impacted by the refactor.
2024-09-27 08:42:48 +02:00
wxiaoguang
1ae3b127fc
Refactor CSRF protector (#32057)
Remove unused CSRF options, decouple "new csrf protector" and "prepare"
logic, do not redirect to home page if CSRF validation falis (it
shouldn't happen in daily usage, if it happens, redirecting to home
doesn't help either but just makes the problem more complex for "fetch")

(cherry picked from commit 1fede04b83288d8a91304a83b7601699bb5cba04)

Conflicts:
	options/locale/locale_en-US.ini
	tests/integration/repo_branch_test.go
  trivial context conflicts
2024-09-27 08:42:48 +02:00
Earl Warren
1bdf334844
feat: add IfZero utility function
(cherry picked from commit 43de021ac1ca017212ec75fd88a8a80a9db27c4c)
2024-09-27 08:42:48 +02:00
hiifong
9d5f409a5a
Lazy load avatar images (#32051)
(cherry picked from commit f38e1014483b84f4541ffb354cd5dfdd7e000e2c)
2024-09-22 09:11:06 +02:00
KN4CK3R
0cafec4c7a
Do not escape relative path in RPM primary index (#32038)
Fixes #32021

Do not escape the relative path.

(cherry picked from commit f528df944bb9436afcb9272add2ee0cccefbdb55)
2024-09-22 09:07:45 +02:00
Zettat123
961766744b
Check if the due_date is nil when editing issues (#32035)
(cherry picked from commit 3a51c37672d2fbad1f222922e75ce704d5a1ac71)
2024-09-22 09:05:15 +02:00
forgejo-renovate-action
565084925a Merge pull request 'Update dependency @stoplight/spectral-cli to v6.13.1 (forgejo)' (#5368) from renovate/forgejo-stoplight-spectral-cli-6.x into forgejo 2024-09-22 06:40:45 +00:00
Renovate Bot
6745603edd Update dependency @stoplight/spectral-cli to v6.13.1 2024-09-22 00:02:33 +00:00
Earl Warren
e806a6efae Merge pull request 'Update module connectrpc.com/connect to v1.17.0 (forgejo)' (#5365) from renovate/forgejo-connectrpc.com-connect-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5365
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-09-21 06:27:43 +00:00
forgejo-renovate-action
c071848aa6 Merge pull request 'Update dependency eslint to v8.57.1 (forgejo)' (#5337) from renovate/forgejo-linters into forgejo 2024-09-21 06:24:08 +00:00
forgejo-renovate-action
56d5d3df3e Merge pull request 'Update dependency @playwright/test to v1.47.2 (forgejo)' (#5363) from renovate/forgejo-playwright-monorepo into forgejo 2024-09-21 06:23:39 +00:00
Renovate Bot
e1ee45ee85 Update module connectrpc.com/connect to v1.17.0 2024-09-21 02:02:43 +00:00
Renovate Bot
fad920940f Update dependency eslint to v8.57.1 2024-09-21 00:02:47 +00:00
Renovate Bot
74383be05e Update dependency @playwright/test to v1.47.2 2024-09-21 00:02:32 +00:00
Earl Warren
9c504be9ee Merge pull request '[gitea] week 2024-38 cherry pick (gitea/main -> forgejo) (release notes)' (#5359) from earl-warren/forgejo:wip-release-notes into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5359
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-09-20 22:01:20 +00:00
Earl Warren
4aab2a5c8e
[gitea] week 2024-38 cherry pick (gitea/main -> forgejo) (release notes) 2024-09-20 07:11:08 +02:00
Earl Warren
64d3fcd403 Merge pull request '[gitea] week 2024-38 cherry pick (gitea/main -> forgejo)' (#5325) from algernon/wcp/2024-38 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5325
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-09-20 05:06:42 +00:00
Earl Warren
712d78984c Merge pull request 'chore(renovate): disable renovate self-updates on release branches' (#5335) from viceice/forgejo:chore/renovate into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5335
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-09-20 04:07:02 +00:00
Renovate Bot
b4e88cb0b7 Update dependency vue to v3.5.6 (forgejo) (#5339)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5339
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2024-09-19 08:44:10 +00:00
Codeberg Translate
6d57cbe5c8 i18n: update of translations from Codeberg Translate (#5309)
Translations update from [Codeberg Translate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

<!--start release-notes-assistant-->

## Draft release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Localization
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/5309): <!--number 5309 --><!--line 0 --><!--description aTE4bjogdXBkYXRlIG9mIHRyYW5zbGF0aW9ucyBmcm9tIENvZGViZXJnIFRyYW5zbGF0ZQ==-->i18n: update of translations from Codeberg Translate<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Outbreak2096 <Outbreak2096@users.noreply.translate.codeberg.org>
Co-authored-by: aleksi <aleksi@users.noreply.translate.codeberg.org>
Co-authored-by: Vaclovas Intas <Gateway_31@protonmail.com>
Co-authored-by: toasterbirb <toasterbirb@users.noreply.translate.codeberg.org>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: Zughy <Zughy@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5309
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-09-19 06:08:33 +00:00
Otto
a0c11f58dd Merge pull request 'Fix milestone assignment in new issue' (#5180) from esainane/forgejo:five-hundred-more into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5180
Reviewed-by: Otto <otto@codeberg.org>
2024-09-17 16:50:42 +00:00
Otto
652c2ee49b Merge pull request 'ui: Improve commit graph layout' (#5214) from 0ko/forgejo:ui-graph-layout into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5214
Reviewed-by: Otto <otto@codeberg.org>
2024-09-17 16:50:31 +00:00
Sai Nane
1e54e211ca Fix milestone assignment in New Issue
Avoids the use of HTMX on milestone assignment within a New Issue form.

The New Issue form doesn't have an issue ID to send to a milestone change URL,
which the backend expects in order to construct a proper reply. The frontend
template was also not built to use the new HTMX response. This resulted in a
backend error and a large warning whenever anyone tried to set a milestone
from within the New Issue form (new pull requests were also affected), rather
than from a View Issue page.

This introduces a new parameter into the `issue/milestone/select_menu`
template, "NewIssuePage".

When unset, the template produces the same results as before. Selection uses
`hx-post` to notify the server immediately, using the updated htmx fragment
from the reply.

When set to a truthy value, the old style of form is used. Selection uses
`data-id` and `data-href` to update the selected milestone locally, via
`selectItem` in `repo-legacy.js`, recreating the selected element and updating
the hidden form value.

Fixes #5176.
2024-09-17 17:45:02 +02:00
Sai Nane
b42ca2ed0c Revert repo-legacy.js to pre-#4542
The New Issue form should not use the new HTMX system. This first requires
we restore the ability to locally assign the milestone ID.
2024-09-17 17:45:02 +02:00
Sai Nane
7f02f4722c Test: Milestone assignment in new issue
This test currently fails, as expected, given this functionality is currently
broken.
2024-09-17 17:45:02 +02:00
0ko
dbe2846e3b ui: improve commit graph layout 2024-09-17 17:33:00 +02:00
Otto Richter
61314f05fc tests(e2e): Test overflow in commit graph 2024-09-17 17:33:00 +02:00
Michael Kriese
cfbcd7f60f
chore(renovate): disable renovate self-updates on release branches 2024-09-16 08:39:26 +02:00
forgejo-renovate-action
0ccefbebfc Merge pull request 'Update renovate to v38.80.0 (forgejo)' (#5332) from renovate/forgejo-renovate into forgejo 2024-09-16 03:42:22 +00:00
Renovate Bot
4cff39c4d9 Update renovate to v38.80.0 2024-09-16 00:02:10 +00:00
Michael Kriese
8f501b6b1a Merge pull request 'Update dependency postcss to v8.4.47 (forgejo)' (#5327) from renovate/forgejo-postcss into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5327
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-09-15 13:50:22 +00:00
Otto
1ca29a7db8 Merge pull request 'tests(e2e): long search result overflow' (#5326) from fnetx/e2e-wiki-overflow into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5326
Reviewed-by: Shiny Nematoda <snematoda@noreply.codeberg.org>
2024-09-15 11:08:36 +00:00
Renovate Bot
94ec8a25bc Update dependency postcss to v8.4.47 2024-09-15 00:02:14 +00:00
Otto Richter
804ca6590f tests(e2e): long search result overflow
Test fails before https://codeberg.org/forgejo/forgejo/pulls/5260
2024-09-14 22:28:24 +02:00
Otto
d78598ef0d Merge pull request 'ui: wiki/code search fixes' (#5260) from snematoda/search-ui-fix into forgejo
closes forgejo/forgejo#5259 (leftover arrowhead in Safari)
Fixes long results in wiki search overflowing the page

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5260
Reviewed-by: Otto <otto@codeberg.org>
2024-09-14 19:38:35 +00:00
forgejo-renovate-action
07a1328671 Merge pull request 'Update dependency @stoplight/spectral-cli to v6.12.0 (forgejo)' (#5313) from renovate/forgejo-stoplight-spectral-cli-6.x into forgejo 2024-09-14 19:08:46 +00:00
Otto
f93d8e8a45 Merge pull request 'docs(e2e): Add parametric viewport example test' (#5322) from fnetx/e2e-example into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5322
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-09-14 19:05:47 +00:00
forgejo-renovate-action
1f91664e82 Merge pull request 'Update dependency vue to v3.5.5 (forgejo)' (#5318) from renovate/forgejo-patch-vue-monorepo into forgejo 2024-09-14 18:59:02 +00:00
Gergely Nagy
cd87c4fee6
[DEADCODE] update
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-09-14 18:58:51 +02:00
Kemal Zebari
eb765dabfd
Handle invalid target when creating releases using API (#31841)
A 500 status code was thrown when passing a non-existent target to the
create release API. This snapshot handles this error and instead throws
a 404 status code.

Discovered while working on #31840.

(cherry picked from commit f05d9c98c4cb95e3a8a71bf3e2f8f4529e09f96f)
2024-09-14 18:45:18 +02:00
Daniel
5c7b85a981
Failed authentications are logged to level Warning (#32016)
PR for issue #31968
Replaces PR #31983 to comply with gitea's error definition

Failed authentications are now logged to level `Warning` instead of
`Info`.

(cherry picked from commit 64298dcb9e72a5a87a4680563d91fae5b90e0160)
2024-09-14 17:55:25 +02:00
charles-plutohealth
5af168fb92
Fix /repos/{owner}/{repo}/pulls/{index}/files endpoint not populating previous_filename (#32017)
---
`status == "rename"` should have read `status == "renamed"`. The typo
means that file.PreviousFilename would never be populated, which e.g.
breaks usage of the Github Action at
https://github.com/dorny/paths-filter.

(cherry picked from commit 7c6edf1ba06d4c3269eaa78f4039c9123b006c51)
2024-09-14 17:53:55 +02:00
Jason Song
2da0ebbd23
Support allowed hosts for migrations to work with proxy (#32025)
(cherry picked from commit 125679f2e14cdc8a26a147f7e8fd0e5f174fb5cb)
2024-09-14 17:52:54 +02:00
Jason Song
5b1990b3b2
Increase cacheContextLifetime to reduce false reports (#32011)
Replace #32001.

To prevent the context cache from being misused for long-term work
(which would result in using invalid cache without awareness), the
context cache is designed to exist for a maximum of 10 seconds. This
leads to many false reports, especially in the case of slow SQL.

This PR increases it to 5 minutes to reduce false reports.

5 minutes is not a very safe value, as a lot of changes may have
occurred within that time frame. However, as far as I know, there has
not been a case of misuse of context cache discovered so far, so I think
5 minutes should be OK.

Please note that after this PR, if warning logs are found again, it
should get attention, at that time it can be almost 100% certain that it
is a misuse.

(cherry picked from commit a323a82ec4bde6ae39b97200439829bf67c0d31e)
2024-09-14 17:09:03 +02:00
GiteaBot
af3fbb397a
[skip ci] Updated licenses and gitignores
(cherry picked from commit 972eae358db0c20bda23833ca94b4324d6d343cb)
2024-09-14 17:05:52 +02:00
Shiny Nematoda
5365ca76ce ui(code-search): webkit hack to hide marker for summary tags
closes forgejo/forgejo#5259
2024-09-14 14:22:13 +00:00
Shiny Nematoda
0a30f00263 ui(wiki): fix search result overflow for long lines 2024-09-14 14:22:01 +00:00