Commit graph

19052 commits

Author SHA1 Message Date
Otto Richter
187e10d8c9 Fix unlabelled button in code review 2024-04-18 16:20:29 +02:00
Earl Warren
c7b8a434c3 Merge pull request 'ci(renovate): fix step names' (#3311) from viceice/forgejo:ci/renovate/fix-step-names into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3311
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-18 14:04:19 +00:00
Earl Warren
b58474173a Merge pull request 'Update ghcr.io/visualon/renovate Docker tag to v37.305.0' (#3312) from renovate/ghcr.io-visualon-renovate-37.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3312
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-18 13:54:22 +00:00
crystal
95fa27374b
typo 2024-04-18 07:27:48 -06:00
Gergely Nagy
b0c0167c54
services: Use proper Message-IDs for release mails
When sending notification emails about a release, use a properly
formatted, RFC-compliant message id, rather than the release's HTML URL
wrapped in angle brackets (which would not be compliant).

Fixes #3105.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-18 13:44:18 +02:00
Renovate Bot
0f078ba4c9 Update ghcr.io/visualon/renovate Docker tag to v37.305.0 2024-04-18 11:25:53 +00:00
Michael Kriese
1f4915692b
ci(renovate): fix step names 2024-04-18 13:22:51 +02:00
Renovate Bot
ca2473e895 Update ghcr.io/visualon/renovate Docker tag to v37.303.2 2024-04-17 16:05:21 +00:00
Earl Warren
bc3e66097c Merge pull request 'fix(release): add missing ARG RELEASE_VERSION' (#3290) from earl-warren/forgejo:wip-oci-labels into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3290
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-17 15:51:36 +00:00
Earl Warren
97189d41f3
fix(release): add missing ARG RELEASE_VERSION
The ARG RELEASE_VERSION set in the build-env image does not propagate
to the images that follow. As a result the value of the version label
is always empty.

This should have been caught by the test in the CI but although it
notified the problem in the output, it did not fail. Upgrade to the
forgejo-build-publish version that fixes this false positive.
2024-04-17 17:16:53 +02:00
crystal
0ff5be49ab
[RELEASE] v1.21.11-0 release notes 2024-04-17 05:45:41 -06:00
Earl Warren
d07f12e010 Merge pull request 'Do not require login_name & source_id for /admin/user/{username}' (#3278) from algernon/forgejo:leave-your-name-at-the-door into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3278
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-17 11:05:13 +00:00
Mai-Lapyst
5b6b3f3fb3
Fix some edge cases; closes #3232
- Fixes wrong usage of AppURL
- Fixes wrong rendering with extra path segments when AppSubURL is empty
- Now also renders all links when 2+ permalinks are present
2024-04-17 13:02:48 +02:00
Earl Warren
618e517d4c Merge pull request 'Update dependency vue to v3.4.23' (#3280) from renovate/vue-monorepo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3280
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-17 10:32:43 +00:00
Earl Warren
c2f2858363 Merge pull request 'chore(renovate): schedule some deps quarterly' (#3284) from viceice/forgejo:chore/renovate-schedule into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3284
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-17 10:16:50 +00:00
Gergely Nagy
dc39043cd6
Change the default SSH clone url to the ssh:// style
Rather than using an scp-style URI, use the same URL style for SSH
clones as for HTTP(S) ones. This is not only more consistent, but the
URL style allows one to specify a port, and makes it clear that it is an
SSH clone URL.

git itself favours the URL style, and mentions the scp-style in passing
only. Said style is prominently used by GitHub, and might be more
familiar for a lot of people, but other than familiarity, it has no
advantage over the URL style.

For the benefit of consistency, and flexibility, lets flip the default,
and make it the URL style. Instance admins who prefer to use the
scp-style, and are running SSH on its standard port, can change the
setting back to false.

This addresses #3193.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-17 11:04:48 +02:00
Gergely Nagy
d07c8c821c
Do not require login_name & source_id for /admin/user/{username}
When editing a user via the API, do not require setting `login_name` or
`source_id`: for local accounts, these do not matter. However, when
editing a non-local account, require *both*, as before.

Fixes #1861.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-17 10:33:52 +02:00
Michael Kriese
bb0daa9522
chore(renovate): schedule some deps quarterly 2024-04-17 09:24:59 +02:00
Earl Warren
e4aa7bd511 Merge pull request 'webhook: improve UX for sourcehut and matrix' (#3156) from oliverpool/forgejo:webhook_sourcehut_polish into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3156
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-17 06:39:54 +00:00
Gergely Nagy
ea4071ca9f Allow admins to fork repos even when creation limits are exhausted (#3277)
This is a continuation of #2728, with a test case added.

Fixes #2633.

I kept @zareck 's commit as is, because I believe it is correct. We can't move the check to `owner.CanForkRepo()`, because `owner` is the future owner of the forked repo, and may be an organization. We need to check the admin permission of the `doer`, like in the case of repository creation.

I verified that the test fails without the `ForkRepository` change, and passes with it.

Co-authored-by: Cassio Zareck <cassiomilczareck@gmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3277
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gergely Nagy <forgejo@gergo.csillger.hu>
Co-committed-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-17 05:52:02 +00:00
Earl Warren
33d0617538 Merge pull request 'feat(release): add OCI labels to container images' (#3261) from earl-warren/forgejo:wip-oci-labels into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3261
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-17 05:46:36 +00:00
Earl Warren
a003691c7b Merge pull request 'Allow changing global wiki editability via the API' (#3276) from algernon/forgejo:let-the-api-control-your-wiki-editability into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3276
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-17 05:46:10 +00:00
Renovate Bot
a5c0643d13 Update dependency vue to v3.4.23 2024-04-17 00:04:27 +00:00
Gusted
787bc6ed94 Merge pull request 'Update dependency @stylistic/eslint-plugin-js to v1.7.2' (#3251) from renovate/stylistic-eslint-plugin-js-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3251
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-16 20:59:10 +00:00
Gergely Nagy
df8e58c5cb
Allow changing global wiki editability via the API
The global wiki editability can be set via the web UI, this patch makes
it possible to set the same thing via the API too. This is accomplished
by adjusting the GET and PATCH handlers of the
`/api/v1/repos/{owner}/{repo}` route.

The first will include the property when checking the repo's settings,
the second allows a repo admin to change the setting too.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-16 22:51:36 +02:00
oliverpool
ada8bfa52f Merge pull request 'Fix release published actions not triggering for releases created from existing tags' (#3220) from zotan/forgejo:forgejo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3220
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 18:27:59 +00:00
Laura Hausmann
8506dbe2e5
Add tests for webhook release events
Co-authored-by: oliverpool <git@olivier.pfad.fr>
2024-04-16 19:25:26 +02:00
Earl Warren
a5a0fc7344 Merge pull request '[BUG] Escape editor.add_tmpl translation' (#3269) from gusted/forgejo-escape-tr into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3269
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 16:19:47 +00:00
Earl Warren
028d19c0fe
feat(release): add OCI labels to container images 2024-04-16 17:50:57 +02:00
Earl Warren
a76f71a648 Merge pull request '[BUG] Fix styling of close button' (#3267) from gusted/forgejo-theme-reg into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3267
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-04-16 15:18:03 +00:00
Gusted
a0f47b8de7
[BUG] Escape editor.add_tmpl translation
- Previously translations were escaped, but now translations are
accepted as-is and will be rendered as HTML. Use `TrString` to escape
the translation value.
- Adds integration test.
- Regression of 65248945c9.
- Resolves #3260
2024-04-16 15:50:49 +02:00
oliverpool
df042909bb Merge pull request '[Port] container.FilterSlice function (gitea#30339 & gitea#30370)' (#3264) from oliverpool/forgejo:port_30339 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3264
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-16 13:12:11 +00:00
Earl Warren
9aa430268b Merge pull request 'Add commit status summary table to reduce query from commit status table' (#3245) from viceice/forgejo:feat/commit-status-summary into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3245
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 12:22:49 +00:00
0ko
41ab13c14f Various improvements to pages: notifications and subscriptions
- fix rounding on /notifications/subscriptions
- add navigation interconnectivity between notifications and subscriptions
- use modern style for tabs
- clearing notificatons: hide the whole form instead of div. It doesn't seem like its changed via JS?
- replace issue-title-buttons and edit-buttons with universal top-right-buttons, get rid of tw-mr-0 helpers
- repo issues: fix misalignments on mobile view
2024-04-16 15:29:28 +05:00
Gusted
7fcb9c3636
[BUG] Fix styling of close button
- This is a partial revert of c2280a2009,
it was already fixed upstream, but not for the `.basic` variant.
- Resolves #3252
2024-04-16 12:25:09 +02:00
Earl Warren
4fc06cfd78 Merge pull request '[PORT] gitea#30139: Refactor markdown render' (#3259) from algernon/forgejo:gitea/port/30139 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3259
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 10:08:52 +00:00
Michael Kriese
8e9c296014
fix: don't update cache for empty state 2024-04-16 12:02:01 +02:00
Lunny Xiao
c0d22d55c9
Fix commitstatus summary (#30431)
The target_url is necessary for the UI, but missed in
commit_status_summary table. This PR fix it.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-04-16 12:01:27 +02:00
Lunny Xiao
f393ccf745
Fix commit status cache which missed target_url (#30426)
Fix #30421

---------

Co-authored-by: Jason Song <i@wolfogre.com>
2024-04-16 12:01:26 +02:00
Lunny Xiao
6495741238
Add commit status summary table to reduce query from commit status table (#30223)
This PR adds a new table named commit status summary to reduce queries
from the commit status table. After this change, commit status summary
table will be used for the final result, commit status table will be for
details.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
2024-04-16 12:01:20 +02:00
oliverpool
b125b3e3aa Partial revert of "Refactor more filterslice (gitea#30370)"
This reverts commit 44abf6ab47.
2024-04-16 11:54:47 +02:00
oliverpool
2db6d5dae9 simplify getPendingRepoIDs 2024-04-16 11:53:18 +02:00
Lunny Xiao
44abf6ab47 Refactor more filterslice (gitea#30370) 2024-04-16 11:51:00 +02:00
oliverpool
525accfae6 Add container.FilterSlice function (gitea#30339)
Many places have the following logic:
```go
func (jobs ActionJobList) GetRunIDs() []int64 {
	ids := make(container.Set[int64], len(jobs))
	for _, j := range jobs {
		if j.RunID == 0 {
			continue
		}
		ids.Add(j.RunID)
	}
	return ids.Values()
}
```

this introduces a `container.FilterMapUnique` function, which reduces
the code above to:
```go
func (jobs ActionJobList) GetRunIDs() []int64 {
	return container.FilterMapUnique(jobs, func(j *ActionRunJob) (int64, bool) {
		return j.RunID, j.RunID != 0
	})
}
```
Conflicts:
models/issues/comment_list.go due to premature refactor in #3116
2024-04-16 11:49:44 +02:00
Earl Warren
5a10eec50f Merge pull request '[PORT] gitea#30406: Check the token's owner and repository when registering a runner' (#3257) from algernon/forgejo:gitea/port/30406 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3257
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 08:44:34 +00:00
wxiaoguang
f692069616
Refactor markdown render (#30139)
Only split the file into small ones (and rename AttentionTypes to
attentionTypes)

(cherry picked from commit 71706126b56616750a65290460fd211b9b8449da)
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>

Conflicts:
	- modules/markup/markdown/goldmark.go
	- modules/markup/markdown/transform_blockquote.go
	Conflicts were resolved by favouring the Forgejo implementation:
	I copied the Forgejo code to the same place Gitea copied them
	to, and adjusted the imports accordingly.

	Apart from conflict resolution, this also moves
	`applyElementDir` from a local func in `goldmark.Transform` to a
	method on `*ASTTransformer`, to make it callable from the
	extracted functions.
2024-04-16 10:42:49 +02:00
Zettat123
463ea8fdd2
Check the token's owner and repository when registering a runner (#30406)
Fix #30378

(cherry picked from commit 0fe9f93eb4c94d55e43b18b9c3cc6d513a34c0b5)

Conflicts:
	- models/organization/org.go
	- services/repository/delete.go
	- services/user/delete.go
	In all three cases, conflicts were resolved by manually adding
        the lines added by the Gitea patch, keeping the Forgejo code
        surrounding them.
2024-04-16 09:38:26 +02:00
oliverpool
94dd22a784 webhook: matrix use v3 endpoint and drop headers 2024-04-16 08:59:56 +02:00
oliverpool
99830a40a1 webhook: matrix access_token helper text 2024-04-16 08:59:56 +02:00
oliverpool
5d45545ca1 webhook deliver: keep Bearer prefix in history 2024-04-16 08:59:56 +02:00