Michael Jerger
15bb6b7f92
[gitea] week 2025-22 cherry pick (gitea/main -> forgejo) ( #8198 )
...
## Checklist
- [x] go to the last cherry-pick PR (forgejo/forgejo#8040 ) to figure out how far it went: [gitea@d5bbaee64e](d5bbaee64e
)
- [x] cherry-pick and open PR (forgejo/forgejo#8198 )
- [ ] have the PR pass the CI
- end-to-end (specially important if there are actions related changes)
- [ ] add `run-end-to-end` label
- [ ] check the result
- [ ] write release notes
- [ ] assign reviewers
- [ ] 48h later, last call
- merge 1 hour after the last call
## Legend
- ❓ - No decision about the commit has been made.
- 🍒 - The commit has been cherry picked.
- ⏩ - The commit has been skipped.
- 💡 - The commit has been skipped, but should be ported to Forgejo.
- ✍️ - The commit has been skipped, and a port to Forgejo already exists.
## Commits
- 🍒 [`gitea`](17cfae82a5
) -> [`forgejo`](6397da88d3
) Hide href attribute of a tag if there is no target_url ([gitea#34556](https://github.com/go-gitea/gitea/pull/34556 ))
- 🍒 [`gitea`](b408bf2f0b
) -> [`forgejo`](46bc899d57
) Fix: skip paths check on tag push events in workflows ([gitea#34602](https://github.com/go-gitea/gitea/pull/34602 ))
- 🍒 [`gitea`](9165ea8713
) -> [`forgejo`](04332f31bf
) Only activity tab needs heatmap data loading ([gitea#34652](https://github.com/go-gitea/gitea/pull/34652 ))
- 🍒 [`gitea`](3f7dbbdaf1
) -> [`forgejo`](2a9019fd04
) Small fix in Pull Requests page ([gitea#34612](https://github.com/go-gitea/gitea/pull/34612 ))
- 🍒 [`gitea`](497b83b75d
) -> [`forgejo`](9a83cc7bad
) Fix migration pull request title too long ([gitea#34577](https://github.com/go-gitea/gitea/pull/34577 ))
## TODO
- 💡 [`gitea`](6b8b580218
) Refactor container and UI ([gitea#34736](https://github.com/go-gitea/gitea/pull/34736 ))
Packages: Fix for container, needs careful merge.
------
- 💡 [`gitea`](bbee652e29
) Prevent duplicate form submissions when creating forks ([gitea#34714](https://github.com/go-gitea/gitea/pull/34714 ))
Fork: Fix, needs careful merge.
------
- 💡 [`gitea`](d21ce9fa07
) Improve the performance when detecting the file editable ([gitea#34653](https://github.com/go-gitea/gitea/pull/34653 ))
LFS: Performance improvement - needs careful merge.
------
- 💡 [`gitea`](8fed27bf6a
) Fix various problems ([gitea#34708](https://github.com/go-gitea/gitea/pull/34708 ))
Various: Fixes, tests missing.
------
- 💡 [`gitea`](c9505a26b9
) Improve instance wide ssh commit signing ([gitea#34341](https://github.com/go-gitea/gitea/pull/34341 ))
CodeSign: Nice feature - needs careful merge.
------
- 💡 [`gitea`](fbc3796f9e
) Fix pull requests API convert panic when head repository is deleted. ([gitea#34685](https://github.com/go-gitea/gitea/pull/34685 ))
Pull: Fix, needs careful merge.
------
- 💡 [`gitea`](1610a63bfd
) Fix commit message rendering and some UI problems ([gitea#34680](https://github.com/go-gitea/gitea/pull/34680 ))
Various Fixes - needs carefull merge.
------
- 💡 [`gitea`](0082cb51fa
) Fix last admin check when syncing users ([gitea#34649](https://github.com/go-gitea/gitea/pull/34649 ))
oidc: fix "first user is always admin". Needs careful merge.
------
- 💡 [`gitea`](c6b2cbd75d
) Fix footnote jump behavior on the issue page. ([gitea#34621](https://github.com/go-gitea/gitea/pull/34621 ))
Issues: Fix Markdown rendering. Needs carefull merge
------
- 💡 [`gitea`](7a59f5a825
) Ignore "Close" error when uploading container blob ([gitea#34620](https://github.com/go-gitea/gitea/pull/34620 ))
No issue, no test.
------
- 💡 [`gitea`](6d0b24064a
) Keeping consistent between UI and API about combined commit status state and fix some bugs ([gitea#34562](https://github.com/go-gitea/gitea/pull/34562 ))
Next PR in Commit-Status story.
------
- 💡 [`gitea`](f6041441ee
) Refactor FindOrgOptions to use enum instead of bool, fix membership visibility ([gitea#34629](https://github.com/go-gitea/gitea/pull/34629 ))
Just for a common sense here: How should I consider refactorings?
------
- 💡 [`gitea`](cc942e2a86
) Fix GetUsersByEmails ([gitea#34643](https://github.com/go-gitea/gitea/pull/34643 ))
User: Seems to fix email validation - but seems not to be finished.
------
- 💡 [`gitea`](7fa5a88831
) Add `--color-logo` for text that should match logo color ([gitea#34639](https://github.com/go-gitea/gitea/pull/34639 ))
UI: Nice idea - can we adapt this?
------
- 💡 [`gitea`](47d69b7749
) Validate hex colors when creating/editing labels ([gitea#34623](https://github.com/go-gitea/gitea/pull/34623 ))
Label: Color validation but needs careful merge.
------
- 💡 [`gitea`](108db0b04f
) Fix possible pull request broken when leave the page immediately after clicking the update button ([gitea#34509](https://github.com/go-gitea/gitea/pull/34509 ))
Nice fix for a bug hard to trace down.
Needs careful merge & think about whether a test is possible.
------
- 💡 [`gitea`](79cc369892
) Fix issue label delete incorrect labels webhook payload ([gitea#34575](https://github.com/go-gitea/gitea/pull/34575 ))
Small fix but would expect a test, showing what was fixed.
------
- 💡 [`gitea`](fe57ee3074
) fixed incorrect page navigation with up and down arrow on last item of dashboard repos ([gitea#34570](https://github.com/go-gitea/gitea/pull/34570 ))
Small & simple - but tests are missing.
------
- 💡 [`gitea`](4e471487fb
) Remove unnecessary duplicate code ([gitea#34552](https://github.com/go-gitea/gitea/pull/34552 ))
Fix arround "Split GetLatestCommitStatus".
------
- 💡 [`gitea`](c5e78fc7ad
) Do not mutate incoming options to SearchRepositoryByName ([gitea#34553](https://github.com/go-gitea/gitea/pull/34553 ))
Large refactoring to simplify options handling. But needs careful merge.
------
- 💡 [`gitea`](f48c0135a6
) Fix/improve avatar sync from LDAP ([gitea#34573](https://github.com/go-gitea/gitea/pull/34573 ))
Nice fix but needs test.
------
- 💡 [`gitea`](e8d8984f7c
) Fix some trivial problems ([gitea#34579](https://github.com/go-gitea/gitea/pull/34579 ))
Various fixes, tests missing.
------
## Skipped
- ⏩ [`gitea`](637070e07b
) Fix container range bug ([gitea#34725](https://github.com/go-gitea/gitea/pull/34725 ))
------
- ⏩ [`gitea`](0d3e9956cd
) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](28debdbe00
) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](dcc9206a59
) Raise minimum Node.js version to 20, test on 24 ([gitea#34713](https://github.com/go-gitea/gitea/pull/34713 ))
------
- ⏩ [`gitea`](bc28654b49
) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](65986f423f
) Refactor embedded assets and drop unnecessary dependencies ([gitea#34692](https://github.com/go-gitea/gitea/pull/34692 ))
------
- ⏩ [`gitea`](18bafcc378
) Bump minimum go version to 1.24.4 ([gitea#34699](https://github.com/go-gitea/gitea/pull/34699 ))
------
- ⏩ [`gitea`](8d135ef5cf
) Update JS deps ([gitea#34701](https://github.com/go-gitea/gitea/pull/34701 ))
------
- ⏩ [`gitea`](d5893ee260
) Fix markdown wrap ([gitea#34697](https://github.com/go-gitea/gitea/pull/34697 ))
- gitea UI specific specific
------
- ⏩ [`gitea`](06ccb3a1d4
) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](94db956e31
) frontport changelog ([gitea#34689](https://github.com/go-gitea/gitea/pull/34689 ))
------
- ⏩ [`gitea`](d5afdccde8
) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](e9f5105e95
) Migrate to urfave v3 ([gitea#34510](https://github.com/go-gitea/gitea/pull/34510 ))
already in Forgejo - see https://codeberg.org/forgejo/forgejo/pulls/8035
------
- ⏩ [`gitea`](2c341b6803
) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](92e7e98c56
) Update x/crypto package and make builtin SSH use default parameters ([gitea#34667](https://github.com/go-gitea/gitea/pull/34667 ))
------
- ⏩ [`gitea`](7b39c82587
) Fix "oras" OCI client compatibility ([gitea#34666](https://github.com/go-gitea/gitea/pull/34666 ))
Already in forgejo - see https://codeberg.org/forgejo/forgejo/issues/8070
------
- ⏩ [`gitea`](1fe652cd26
) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](a9a705f4db
) Fix missed merge commit sha and time when migrating from codecommit ([gitea#34645](https://github.com/go-gitea/gitea/pull/34645 ))
Migration: Seems to be an important fix, but no tests.
As I know @earl-warren worked hard on migration, is this still relevant to us?
------
- ⏩ [`gitea`](1e0758a9f1
) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](f6f6aedd4f
) Update JS deps, regenerate SVGs ([gitea#34640](https://github.com/go-gitea/gitea/pull/34640 ))
------
- ⏩ [`gitea`](aa2b3b2b1f
) Misc CSS fixes ([gitea#34638](https://github.com/go-gitea/gitea/pull/34638 ))
- gitea UI specific specific
------
- ⏩ [`gitea`](b38f2d31fd
) add codecommit to supported services in api docs ([gitea#34626](https://github.com/go-gitea/gitea/pull/34626 ))
------
- ⏩ [`gitea`](74a0178c6a
) add openssh-keygen to rootless image ([gitea#34625](https://github.com/go-gitea/gitea/pull/34625 ))
already in Forgejo - see https://codeberg.org/forgejo/forgejo/issues/6896
------
- ⏩ [`gitea`](5b22af4373
) bump to alpine 3.22 ([gitea#34613](https://github.com/go-gitea/gitea/pull/34613 ))
------
- ⏩ [`gitea`](9e0e107d23
) Fix notification count positioning for variable-width elements ([gitea#34597](https://github.com/go-gitea/gitea/pull/34597 ))
- gitea UI specific specific
------
- ⏩ [`gitea`](e5781cec75
) Fix margin issue in markup paragraph rendering ([gitea#34599](https://github.com/go-gitea/gitea/pull/34599 ))
- gitea UI specific specific
------
- ⏩ [`gitea`](375dab1111
) Make pull request and issue history more compact ([gitea#34588](https://github.com/go-gitea/gitea/pull/34588 ))
- gitea UI specific specific
------
- ⏩ [`gitea`](2a1585b32e
) Refactor some tests ([gitea#34580](https://github.com/go-gitea/gitea/pull/34580 ))
------
<details>
<summary><h2>Stats</h2></summary>
<br>
Between [`gitea@d5bbaee64e`](d5bbaee64e
) and [`gitea@6b8b580218`](6b8b580218
), **55** commits have been reviewed. We picked **5**, skipped **28** (of which **3** were already in Forgejo!), and decided to port **22**.
</details>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: NorthRealm <155140859+NorthRealm@users.noreply.github.com>
Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
Co-authored-by: endo0911engineer <161911062+endo0911engineer@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8198
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
Co-committed-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
2025-06-17 18:28:07 +02:00
Gusted
2457f5ff22
chore: branding import path ( #7337 )
...
- Massive replacement of changing `code.gitea.io/gitea` to `forgejo.org`.
- Resolves forgejo/discussions#258
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7337
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-03-27 19:40:14 +00:00
TheFox0x7
0813126058
test: add more workflow event coverage
2024-08-18 15:19:01 +02:00
TheFox0x7
4de909747b
Add testifylint to lint checks ( #4535 )
...
go-require lint is ignored for now
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4535
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
2024-07-30 19:41:10 +00:00
Mai-Lapyst
51735c415b
Add support for workflow_dispatch ( #3334 )
...
Closes #2797
I'm aware of https://github.com/go-gitea/gitea/pull/28163 exists, but since I had it laying around on my drive and collecting dust, I might as well open a PR for it if anyone wants the feature a bit sooner than waiting for upstream to release it or to be a forgejo "native" implementation.
This PR Contains:
- Support for the `workflow_dispatch` trigger
- Inputs: boolean, string, number, choice
Things still to be done:
- [x] API Endpoint `/api/v1/<org>/<repo>/actions/workflows/<workflow id>/dispatches`
- ~~Fixing some UI bugs I had no time figuring out, like why dropdown/choice inputs's menu's behave weirdly~~ Unrelated visual bug with dropdowns inside dropdowns
- [x] Fix bug where opening the branch selection submits the form
- [x] Limit on inputs to render/process
Things not in this PR:
- Inputs: environment (First need support for environments in forgejo)
Things needed to test this:
- A patch for https://code.forgejo.org/forgejo/runner to actually consider the inputs inside the workflow.
~~One possible patch can be seen here: https://code.forgejo.org/Mai-Lapyst/runner/src/branch/support-workflow-inputs~~
[PR](https://code.forgejo.org/forgejo/runner/pulls/199 )

## Testing
- Checkout PR
- Setup new development runner with [this PR](https://code.forgejo.org/forgejo/runner/pulls/199 )
- Create a repo with a workflow (see below)
- Go to the actions tab, select the workflow and see the notice as in the screenshot above
- Use the button + dropdown to run the workflow
- Try also running it via the api using the `` endpoint
- ...
- Profit!
<details>
<summary>Example workflow</summary>
```yaml
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log Level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
tags:
description: 'Test scenario tags'
required: false
type: boolean
boolean_default_true:
description: 'Test scenario tags'
required: true
type: boolean
default: true
boolean_default_false:
description: 'Test scenario tags'
required: false
type: boolean
default: false
number1_default:
description: 'Number w. default'
default: '100'
type: number
number2:
description: 'Number w/o. default'
type: number
string1_default:
description: 'String w. default'
default: 'Hello world'
type: string
string2:
description: 'String w/o. default'
required: true
type: string
jobs:
test:
runs-on: docker
steps:
- uses: actions/checkout@v3
- run: whoami
- run: cat /etc/issue
- run: uname -a
- run: date
- run: echo ${{ inputs.logLevel }}
- run: echo ${{ inputs.tags }}
- env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- run: echo "abc"
```
</details>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3334
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
Co-committed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-06-28 05:17:11 +00:00
Lunny Xiao
97292da960
Fix schedule tasks bugs ( #28691 )
...
Fix #28157
This PR fix the possible bugs about actions schedule.
## The Changes
- Move `UpdateRepositoryUnit` and `SetRepoDefaultBranch` from models to
service layer
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when actions unit has been disabled
or global disabled.
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when default branch changed.
2024-01-12 21:50:38 +00:00
Zettat123
9a8af92577
Fix the bug when getting files changed for pull_request_target
event ( #26320 )
...
Follow #25229
Copy from
https://github.com/go-gitea/gitea/pull/26290#issuecomment-1663135186
The bug is that we cannot get changed files for the
`pull_request_target` event. This event runs in the context of the base
branch, so we won't get any changes if we call
`GetFilesChangedSinceCommit` with `PullRequest.Base.Ref`.
2023-08-05 14:26:06 +08:00
Zettat123
7586b5815a
Fix activity type match in matchPullRequestEvent
( #25746 )
...
Fix #25736
Caused by #24048
Right now we only check the activity type for `pull_request` event when
`types` is specified or there are no `types` and filter. If a workflow
only specifies filters but no `types` like this:
```
on:
pull_request:
branches: [main]
```
the workflow will be triggered even if the activity type is not one of
`[opened, reopened, sync]`. We need to check the activity type in this
case.
Co-authored-by: Giteabot <teabot@gitea.io>
2023-07-07 16:30:07 +00:00
Zettat123
48e5a74f21
Support pull_request_target
event ( #25229 )
...
Fix #25088
This PR adds the support for
[`pull_request_target`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target )
workflow trigger. `pull_request_target` is similar to `pull_request`,
but the workflow triggered by the `pull_request_target` event runs in
the context of the base branch of the pull request rather than the head
branch. Since the workflow from the base is considered trusted, it can
access the secrets and doesn't need approvals to run.
2023-06-26 14:33:18 +08:00
Zettat123
5eb4c63867
Support triggering workflows by wiki related events ( #24119 )
...
This PR is to support triggering workflows by wiki related events like
creating, editing or deleting wiki pages. In GitHub, this event is
called
[gollum](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#gollum )
2023-04-17 13:49:47 -04:00
Zettat123
2d91afaa92
Fix mismatch between hook events and github event types ( #24048 )
...
Some workflow trigger events can have multiple activity types, such as
`issues` and `pull_request`, and user can specify which types can
trigger the workflow. See GitHub documentation:
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
Now some hook events cannot match the workflow trigger events correctly
because we don't check the activity types. For example,
`pull_request_label` is an individual hook event. But there isn't a
`pull_request_label` workflow trigger event, we can only use
`pull_request` event's `label` activity type. If we don't check the
activity types, the workflows without the `label` activity type may be
triggered by the `pull_request_label` event by mistake. We need to
improve the match logic.
- [x] [`issues`
](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issues )
- [x]
[`issue_comment`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment )
- [x]
[`pull_request`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request )
- [x]
[`pull_request_review`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_review )
- [x]
[`pull_request_review_comment`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_review_comment )
- [x]
[`release`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release )
- [x]
[`registry_package`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#registry_package )
2023-04-12 12:16:47 -04:00