Commit graph

18907 commits

Author SHA1 Message Date
oliverpool 855f95f7a2 test: sourcehut_builds trigger
(cherry picked from commit 7b47cb43c1)
2024-05-24 00:26:19 +00:00
Earl Warren b5c49a19d2 Merge pull request 'Revert "Prevent automatic OAuth grants for public clients (#30790) (#30836)"' (#3867) from earl-warren/forgejo:wip-oauth-revert into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3867
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-05-22 15:06:48 +00:00
Earl Warren 6771312133
Revert "Prevent automatic OAuth grants for public clients (#30790) (#30836)"
This reverts commit 248a5b8d7a.

This commit introduces a regression descrdibed at

https://github.com/go-gitea/gitea/pull/30790#issuecomment-2118812426

There is a commit to try and fix it, but it is similarly
untested. Let's not accumulate regressions and wait until it is either
field tested by humans in Gitea or a test is written.

https://github.com/go-gitea/gitea/pull/31015/files
2024-05-22 16:37:00 +02:00
Earl Warren 07ad7dd8f6 Merge pull request 'fix: Forgejo 7.0 is compatible with Gitea v1.21.11' (#3857) from earl-warren/forgejo:wip-gitea-compatibility into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3857
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-21 13:43:05 +00:00
Earl Warren 6a472f90f8
fix: Forgejo 7.0 is compatible with Gitea v1.21.11 2024-05-21 15:01:37 +02:00
0ko f00123b893 [v7/forgejo][I18N] Translations update from Weblate (#3852)
Manual backport of #3759 with MSSQL removal conflict resolved in zh-TW `require_db_desc`.

Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: kdh8219 <kdh8219@monamo.dev>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: leana8959 <leana8959@users.noreply.translate.codeberg.org>
Co-authored-by: yeziruo <yeziruo@users.noreply.translate.codeberg.org>
Co-authored-by: Fitik <Fitik@users.noreply.translate.codeberg.org>
Co-authored-by: b1nar10 <b1nar10@users.noreply.translate.codeberg.org>
Co-authored-by: hankskyjames777 <hankskyjames777@users.noreply.translate.codeberg.org>
Co-authored-by: Mumulhl <mumulhl@duck.com>
Co-authored-by: Kita Ikuyo <searinminecraft@courvix.com>

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3852
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-21 03:15:55 +00:00
Earl Warren 0f61cb389a Merge pull request '[v7.0/forgejo] Fix error on renaming merged PRs' (#3842) from bp-v7.0/forgejo-3351ce2 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3842
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-20 14:08:11 +00:00
Earl Warren cbdef1792f Merge pull request '[v7.0/forgejo] badges: Relax the default workflow badge conditions' (#3846) from bp-v7.0/forgejo-d6915f4 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3846
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-20 11:44:22 +00:00
Gergely Nagy ef4c6abbb9 badges: Relax the default workflow badge conditions
Previously, if no branch was explicitly specified for a workflow, it
defaulted to the default branch of the repo. This worked fine for
workflows that were triggered on push, but it prevented showing badges
for workflows that only run on tags, or on schedule - since they do not
run on a specific branch.

Thus, relax the conditions, and if no branch is specified, just return
the latest run of the given workflow. If one is specified, *then*
restrict it to said branch.

Fixes #3487.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit d6915f4d5f)
2024-05-20 10:47:25 +00:00
0ko 0b01434aa3 Fix error on renaming merged PRs (#3840)
Closes https://codeberg.org/forgejo/forgejo/issues/3743.

This is a simple fix for https://codeberg.org/forgejo/forgejo/issues/3743, based on changes in [gitea#30990](https://github.com/go-gitea/gitea/pull/30990), which was not included in https://codeberg.org/forgejo/forgejo/pulls/3838 due to large code differences.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3840
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
(cherry picked from commit 3351ce2bc5)
2024-05-19 18:20:50 +00:00
Otto 487b2129aa Merge pull request '[v7.0/forgejo] Suppress Monaco JavaScript errors in Safari' (#3833) from bp-v7.0/forgejo-e4c3c03 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3833
Reviewed-by: Otto <otto@codeberg.org>
2024-05-19 12:56:18 +00:00
David Davies-Payne b9674b3ee9 Suppress Monaco JavaScript errors in Safari (#3805)
Fix #3638

This is a manual Forgejo-specific version of the Gitea PR https://github.com/go-gitea/gitea/pull/30862. The weekly Forgejo PR #3772 could not cherry-pick this commit due to conflicts (eg subsequent CodeSpell changes).

Only occurs with Webkit in Safari over eg `http://192..`. (not localhost).
See https://webkit.org/blog/10855/async-clipboard-api/

---
**Before**
![Before.jpg](/attachments/c570d030-fcce-48ea-ac96-06b624541c7b)

**After**
![After.jpg](/attachments/1a9132ab-f7f3-43a5-b3ea-37b6f2b671c4)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3805
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: David Davies-Payne <d2p@me.com>
Co-committed-by: David Davies-Payne <d2p@me.com>
(cherry picked from commit e4c3c039be)
2024-05-18 21:20:48 +00:00
0ko a5776cc883 Merge pull request '[v7.0/forgejo] Fix overflowing titles in project columns' (#3827) from beowulf/bp-v7.0/forgejo-853f005 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3827
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-05-18 14:13:17 +00:00
Beowulf 972dd76eeb
fixed overflow of projects column title
This fixes that titles of project columns can overflow and push the
action menu out of the card, so that interaction is no longer possible.

Addition to the cherry pick:
In v7.0, `min-width: 0` is additionally applied to the title of the
project column, as this is missing for the .ui.label in contrast to v8.0.

Fixes #3717

(cherry picked from commit 853f005180)
2024-05-18 09:36:51 +02:00
Earl Warren af32e3c09a Merge pull request '[v7.0/forgejo] [I18N] Some English decap and other fixes' (#3825) from bp-v7.0/forgejo-1b12ca8 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3825
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-18 07:35:38 +00:00
0ko ceb9d543b3 [I18N] Some English decap and other fixes
(cherry picked from commit 1b12ca80ec)
2024-05-18 07:02:14 +00:00
Earl Warren 0d06f3c2dd Merge pull request '[v7.0/forgejo] Fix contrast for issue count in projects columns' (#3814) from bp-v7.0/forgejo-82e0066 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3814
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-17 11:10:21 +00:00
Beowulf b898370a04 Fixed contrast for issue count in projects column
Regression introduced by 9934931f1f

See #3772

(cherry picked from commit 82e0066ed4)
2024-05-17 10:36:05 +00:00
Earl Warren 7eb54dbfca Merge pull request '[v7.0/forgejo] Update dependency mermaid to v10.9.1' (#3802) from earl-warren/forgejo:wip-v7.0-mermaid into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3802
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-16 17:07:15 +00:00
Renovate Bot 055a403781
Update dependency mermaid to v10.9.1
(cherry picked from commit 03e2aed969)

Conflicts:
	package-lock.json
	package.json
	trivial context conflict
2024-05-16 18:12:23 +02:00
Earl Warren f7e9db75c4 Merge pull request '[v7.0/forgejo] Port: Fix some UI problems (install) (gitea#30854)' (#3799) from bp-v7.0/forgejo-c16ae1a into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3799
Reviewed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-05-16 15:39:08 +00:00
Earl Warren 4ecbb2ef1b Merge pull request '[gitea] week 2024-20-v7.0 cherry pick (release/v1.22 -> v7.0/forgejo)' (#3772) from earl-warren/wcp/2024-20-v7.0 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3772
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
2024-05-16 15:36:08 +00:00
forgejo-backport-action 7a8b2d8eb8 [v7.0/forgejo] Improve base locale related to settings and accounts (#3742)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/3733

- general English improvements
- separated the header of Language part in user settings into a new string for better translatability
- made that header contain "Default", just like the theme one, because this is how this actually works: the bottom selector saves the language temporarily, the selector in the settings saves it permanently. Not many users know about this difference. This clarification will help some
- removed some of "Manage" from the headers where they aren't really needed. This improves the consistency with some other headers

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3742
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2024-05-16 14:15:33 +00:00
Earl Warren 6bf1bcab57 Merge pull request '[v7.0/forgejo] test: add more sha256 repositories tests' (#3798) from bp-v7.0/forgejo-67effd6-df8aaeb-348182f-e3e82d0 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3798
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-16 13:54:37 +00:00
wxiaoguang 4feb183d91 Fix some UI problems (install) (#30854)
(cherry picked from commit ce8b11ae131bef6cd7df0849ed39da7984953a4b)
(cherry picked from commit c16ae1ab39)
2024-05-16 13:22:15 +00:00
Earl Warren 0f10d15dfa Merge pull request '[v7.0/forgejo] template: label fix correct input id' (#3796) from bp-v7.0/forgejo-208eed0 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3796
Reviewed-by: Otto <otto@codeberg.org>
2024-05-16 13:15:23 +00:00
oliverpool d877f18092 test-sha256: APICreateFile
(cherry picked from commit 67effd6985)
2024-05-16 13:07:14 +00:00
oliverpool 32a0e1e2b4 test-sha256: APICreateBranch
(cherry picked from commit df8aaeb1d5)
2024-05-16 13:07:14 +00:00
oliverpool ab4570d0cb test-sha256: PushDeployKeyOnEmptyRepo
(cherry picked from commit 348182f4b3)
2024-05-16 13:07:14 +00:00
oliverpool 7c40672ddf test: useless duplication
(cherry picked from commit e3e82d02ad)
2024-05-16 13:07:14 +00:00
Frank Villaro-Dixon aefe770255 template: label fix correct input id
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
(cherry picked from commit 208eed05ff)
2024-05-16 10:16:28 +00:00
Earl Warren 40b639d2a0 Merge pull request '[v7.0/forgejo] fix: hook post-receive for sha256 repos' (#3788) from bp-v7.0/forgejo-5e73c67-2ac3dcb into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3788
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-05-16 06:59:56 +00:00
oliverpool 3f9f6f1350 fix: hook post-receive for sha256 repos
(cherry picked from commit 5e73c67d67)
2024-05-15 21:08:15 +00:00
oliverpool 6de1f714f3 test: hook post-receive for sha256 repos
failing push-to-create for sha256 will be fixed in a followup PR

(cherry picked from commit 2ac3dcbd43)
2024-05-15 21:08:15 +00:00
Earl Warren fa448e2293 Merge pull request '[v7.0/forgejo] gitea#30535: Refactor and fix archive link bug' (#3760) from algernon/forgejo:backport/3696-to-7.0 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3760
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-14 22:25:07 +00:00
Earl Warren 161fca9007 Merge pull request '[v7.0/forgejo] Replace reply with a forked version to fix the cut-off of the incoming mail text' (#3753) from beowulf/fix-inline-attachments-body-cut-off-bp7.0 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3753
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-14 15:21:25 +00:00
Earl Warren 08894a9335
[DEADCODE] update 2024-05-14 16:47:37 +02:00
Giteabot 56642554d1
Move reverproxyauth before session so the header will not be ignored even if user has login (#27821) (#30948)
Backport #27821 by @lunny

When a user logout and then login another user, the reverseproxy auth
should be checked before session otherwise the old user is still login.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 14dc00ae01c35ad51a3982a5725777bbeabe2b78)
2024-05-14 16:17:23 +02:00
Giteabot 10a9b6b806
Fix some UI regressions for commit list (#30920) (#30937)
Backport #30920 by wxiaoguang

Close #30919

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 94c5a30c8bd2ae78ffd7bd3b39bee019c531e1e7)
2024-05-14 16:14:38 +02:00
silverwind 6917b25ad3
Fix and tweak pull request commit list (#30528)
Fixes https://github.com/go-gitea/gitea/issues/30493, regression from
https://github.com/go-gitea/gitea/pull/30374.

Also did the flexbox convertion as suggested by the existing comment.

<img width="850" alt="Screenshot 2024-04-16 at 22 28 48"
src="https://github.com/go-gitea/gitea/assets/115237/e8905944-620a-4211-b5c5-53ed3b3ee23e">

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 311f5261cdb23b46d3f510e40fd4e2ac06e376c0)
(cherry picked from commit eea7ea9d0a)
2024-05-14 16:14:14 +02:00
yp05327 37fc6cdaf6
Fix incorrect default branch when adopt a repository (#30912) (#30928)
Backport #30912

ps: removed useless `u *user_model.User` for `adoptRepository`
(cherry picked from commit 2200c41ffd7dc84faa1de61941603af11b3412f2)
2024-05-14 16:09:33 +02:00
Zettat123 65529bd334
Update issue indexer after merging a PR (#30715)
Fix #30684

(cherry picked from commit f09e68ec33262d5356779572a0b1c66e6e86590f)

Conflicts:
	tests/integration/pull_merge_test.go
	trivial context conflict
(cherry picked from commit 8f0f6bf89c)

(cherry picked from commit df5513978a630355a28b6b42fcc63fe5d70652d8)
2024-05-14 16:00:57 +02:00
Lunny Xiao d91839692f
Fix various problems around projects board view (#30696)
The previous implementation will start multiple POST requests from the
frontend when moving a column and another bug is moving the default
column will never be remembered in fact.

- [x] This PR will allow the default column to move to a non-first
position
- [x] And it also uses one request instead of multiple requests when
moving the columns
- [x] Use a star instead of a pin as the icon for setting the default
column action
- [x] Inserted new column will be append to the end
- [x] Fix #30701 the newly added issue will be append to the end of the
default column
- [x] Fix when deleting a column, all issues in it will be displayed
from UI but database records exist.
- [x] Add a limitation for columns in a project to 20. So the sorting
will not be overflow because it's int8.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit a303c973e0264dab45a787c4afa200e183e0d953)

Conflicts:
	routers/web/web.go
	e91733468ef726fc9365aa4820cdd5f2ddfdaa23 Add missing database transaction for new issue (#29490) was not cherry-picked
	services/issue/issue.go
	fe6792dff3 Enable/disable owner and repo projects independently (#28805) was not cherry-picked
(cherry picked from commit 7d3ca90dfe)

(cherry picked from commit 084bec89ed7ae0816fc2d8db6784ad22523d1fc4)
2024-05-14 15:51:15 +02:00
silverwind 9934931f1f
[PORT] gitea##30237: Fix and rewrite contrast color calculation, fix project-related bugs
1. The previous color contrast calculation function was incorrect at
least for the `#84b6eb` where it output low-contrast white instead of
black. I've rewritten these functions now to accept hex colors and to
match GitHub's calculation and to output pure white/black for maximum
contrast. Before and after:
<img width="94" alt="Screenshot 2024-04-02 at 01 53 46"
src="https://github.com/go-gitea/gitea/assets/115237/00b39e15-a377-4458-95cf-ceec74b78228"><img
width="90" alt="Screenshot 2024-04-02 at 01 51 30"
src="https://github.com/go-gitea/gitea/assets/115237/1677067a-8d8f-47eb-82c0-76330deeb775">

2. Fix project-related issues:

- Expose the new `ContrastColor` function as template helper and use it
for project cards, replacing the previous JS solution which eliminates a
flash of wrong color on page load.
- Fix a bug where if editing a project title, the counter would get
lost.
- Move `rgbToHex` function to color utils.

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>

---
Conflict resolution: Trivial.
(cherry picked from commit 36887ed3921d03f1864360c95bd2ecf853bfbe72)
(cherry picked from commit f6c0c39f1a)
2024-05-14 15:50:47 +02:00
Yarden Shoham c6d2c18052
Remove jQuery class from the project page (#30183)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the edit column modal functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit b535c6ca7b9e8c4bcf5637091ee5ad6d9c807c31)
(cherry picked from commit 702f112602)
2024-05-14 15:50:31 +02:00
Giteabot 8f8d85da47
Fix wrong transfer hint (#30889) (#30900)
Backport #30889 by @lunny

Fix #30187

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 271e8748a2035ebc836cc2d1e03f4e68b063697e)
2024-05-14 15:45:03 +02:00
Lunny Xiao 7e81775184
Move database operations of merging a pull request to post receive hook and add a transaction (#30805)
Merging PR may fail because of various problems. The pull request may
have a dirty state because there is no transaction when merging a pull
request. ref
https://github.com/go-gitea/gitea/pull/25741#issuecomment-2074126393

This PR moves all database update operations to post-receive handler for
merging a pull request and having a database transaction. That means if
database operations fail, then the git merging will fail, the git client
will get a fail result.

There are already many tests for pull request merging, so we don't need
to add a new one.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit ebf0c969403d91ed80745ff5bd7dfbdb08174fc7)

Conflicts:
	modules/private/hook.go
	routers/private/hook_post_receive.go
	trivial conflicts because
	  263a716cb5 * Performance optimization for git push (#30104)
	was not cherry-picked and because of
	  998a431747 Do not update PRs based on events that happened before they existed
(cherry picked from commit eb792d9f8a)

(cherry picked from commit ec3f5f9992d7ff8250c044a4467524d53bd50210)
2024-05-14 15:37:32 +02:00
6543 99bd29f02f
Repository explore alphabetically order respect owner name (#30882)
similar to #30784 but only for the repo explore page

is covered by #30876 for the main branch

(cherry picked from commit d410e2acce22e5b3518a9bf64a9152b32a91fe18)
2024-05-14 15:31:36 +02:00
Giteabot e5f9482745
Fix missing migrate actions artifacts (#30874) (#30886)
Backport #30874 by @lunny

The actions artifacts should be able to be migrate to the new storage
place.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 216c8eada3c0727288dc5565ae9fdd798b17c463)
2024-05-14 15:31:14 +02:00
Giteabot 220594bacc
Make "sync branch" also sync object format and add tests (#30878) (#30880)
Backport #30878 by wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit ad5a8d043c6818c0c496ebae2f5ea9373219bcd6)
2024-05-14 15:28:38 +02:00