From d5f66e4c0a0de8e6c1574cf785256172bb2fddd5 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 7 Aug 2024 08:31:33 +0200 Subject: [PATCH 001/173] shfmt -w globally --- actions/actions.sh | 116 +++++----- actions/example-automerge/run.sh | 2 +- actions/example-cron/run.sh | 8 +- actions/example-post-7-0-schedule/run.sh | 8 +- actions/example-post-7-0-schedule/setup.sh | 2 +- .../example-pull-request/assert-contexts.sh | 8 +- actions/example-pull-request/run.sh | 55 +++-- actions/example-pull-request/setup.sh | 1 - actions/example-push-cancel/run.sh | 2 +- actions/example-service/setup.sh | 4 +- actions/example-workflow-dispatch/run.sh | 10 +- end-to-end.sh | 2 +- federation/federation.sh | 76 +++---- federation/scenario-star/run.sh | 16 +- federation/scenario-star/setup.sh | 1 + federation/scenario-star/teardown.sh | 1 + forgejo/fixtures.sh | 2 +- forgejo/fixtures/storage.sh | 53 ++--- lib/api.sh | 8 +- lib/build.sh | 18 +- lib/lib.sh | 212 +++++++++--------- packages/alpine-1.21/test.sh | 28 +-- packages/alpine-7.0-test/test.sh | 30 +-- packages/alpine.sh | 8 +- storage/storage.sh | 10 +- upgrade/test-pprof-upload.sh | 60 ++--- upgrade/upgrade.sh | 12 +- 27 files changed, 378 insertions(+), 375 deletions(-) diff --git a/actions/actions.sh b/actions/actions.sh index d06027ff..f467ba83 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -1,57 +1,57 @@ # Copyright 2024 The Forgejo Authors # SPDX-License-Identifier: MIT -ACTIONS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +ACTIONS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" function actions_verify_example() { - local example=$1 + local example=$1 - export HOST_PORT - export url=http://${FORGEJO_USER}:${FORGEJO_PASSWORD}@${HOST_PORT} - export token=$(cat $DOT_FORGEJO_CURL/token) + export HOST_PORT + export url=http://${FORGEJO_USER}:${FORGEJO_PASSWORD}@${HOST_PORT} + export token=$(cat $DOT_FORGEJO_CURL/token) - actions_cleanup_example_volume + actions_cleanup_example_volume - export example - export EXAMPLE_DIR=$ACTIONS_DIR/example-$example + export example + export EXAMPLE_DIR=$ACTIONS_DIR/example-$example - if test -f $EXAMPLE_DIR/setup.sh ; then - echo "============================ SETUP example-$example ===================" - bash -ex $EXAMPLE_DIR/setup.sh || return 1 - fi + if test -f $EXAMPLE_DIR/setup.sh; then + echo "============================ SETUP example-$example ===================" + bash -ex $EXAMPLE_DIR/setup.sh || return 1 + fi - if test -f $EXAMPLE_DIR/run.sh ; then - echo "============================ RUN example-$example ===================" - bash -ex $EXAMPLE_DIR/run.sh || return 1 - else - forgejo-test-helper.sh run_workflow actions/example-$example $url root example-$example $example $token || return 1 - fi + if test -f $EXAMPLE_DIR/run.sh; then + echo "============================ RUN example-$example ===================" + bash -ex $EXAMPLE_DIR/run.sh || return 1 + else + forgejo-test-helper.sh run_workflow actions/example-$example $url root example-$example $example $token || return 1 + fi - if test -f $EXAMPLE_DIR/teardown.sh ; then - echo "============================ TEARDOWN example-$example ===================" - bash -ex $EXAMPLE_DIR/teardown.sh || return 1 - fi + if test -f $EXAMPLE_DIR/teardown.sh; then + echo "============================ TEARDOWN example-$example ===================" + bash -ex $EXAMPLE_DIR/teardown.sh || return 1 + fi - actions_save_contexts $example + actions_save_contexts $example } function actions_save_contexts() { local example="$1" if test -d /srv/example/$example/contexts; then - mkdir -p /srv/contexts - rsync -av /srv/example/$example/contexts/ /srv/contexts/$example/ + mkdir -p /srv/contexts + rsync -av /srv/example/$example/contexts/ /srv/contexts/$example/ fi } function actions_cleanup_example_volume() { - if test $(id -u) != 0 ; then - $SUDO chown $(id -u) /srv + if test $(id -u) != 0; then + $SUDO chown $(id -u) /srv fi - if ! test -d /srv/example ; then - mkdir -p /srv/example - return + if ! test -d /srv/example; then + mkdir -p /srv/example + return fi $SUDO rm -fr /srv/example/* @@ -79,10 +79,10 @@ function actions_teardown() { function actions_runner_version() { local runner_version=$($DIR/forgejo-runner --version | sed -n -e 's/forgejo-runner version v//p') - if test -z "$runner_version" ; then - $DIR/forgejo-runner --version - echo failed to parse version - false + if test -z "$runner_version"; then + $DIR/forgejo-runner --version + echo failed to parse version + false fi echo $runner_version } @@ -90,37 +90,37 @@ function actions_runner_version() { function test_actions() { local versions="${1:-1.21 $RELEASE_NUMBERS_AND_DEV}" - for version in $versions ; do + for version in $versions; do - actions_setup $version - local runner_version=$(actions_runner_version) + actions_setup $version + local runner_version=$(actions_runner_version) - log_info "Testing actions with Forgejo $version & Forgejo runner $runner_version" + log_info "Testing actions with Forgejo $version & Forgejo runner $runner_version" - if dpkg --compare-versions $version ge 7.0 && dpkg --compare-versions $runner_version gt 3.3.0 ; then - for example in artifacts-v4 ; do - run actions_verify_example $example - done - fi - - for example in echo cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context ; do - run actions_verify_example $example - done - - if dpkg --compare-versions $version lt 7.1 ; then - for example in cron ; do - run actions_verify_example $example - done - fi - - if dpkg --compare-versions $version ge 7.1 ; then - for example in automerge post-7-0-schedule ; do + if dpkg --compare-versions $version ge 7.0 && dpkg --compare-versions $runner_version gt 3.3.0; then + for example in artifacts-v4; do run actions_verify_example $example done fi - if dpkg --compare-versions $version ge 8.0 ; then - for example in workflow-dispatch ; do + for example in echo cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do + run actions_verify_example $example + done + + if dpkg --compare-versions $version lt 7.1; then + for example in cron; do + run actions_verify_example $example + done + fi + + if dpkg --compare-versions $version ge 7.1; then + for example in automerge post-7-0-schedule; do + run actions_verify_example $example + done + fi + + if dpkg --compare-versions $version ge 8.0; then + for example in workflow-dispatch; do run actions_verify_example $example done fi diff --git a/actions/example-automerge/run.sh b/actions/example-automerge/run.sh index 2134dc4a..1d48860f 100755 --- a/actions/example-automerge/run.sh +++ b/actions/example-automerge/run.sh @@ -22,7 +22,7 @@ function reset_automerge_pr() { ( cd $d - rm -fr example-automerge + rm -fr example-automerge git clone $url/$repo cd example-automerge git checkout -b other diff --git a/actions/example-cron/run.sh b/actions/example-cron/run.sh index f95045f8..bf19e981 100755 --- a/actions/example-cron/run.sh +++ b/actions/example-cron/run.sh @@ -7,7 +7,7 @@ forgejo-test-helper.sh push_workflow actions/example-$example $url root example- # See https://codeberg.org/forgejo/forgejo/pulls/1941 for more information # function verify_ref() { - local ref=$(sqlite3 $DIR/forgejo-work-path/forgejo.db 'select ref from action_schedule') + local ref=$(sqlite3 $DIR/forgejo-work-path/forgejo.db 'select ref from action_schedule') test "${ref##*/}" = "main" } verify_ref @@ -16,12 +16,12 @@ forgejo-curl.sh api_json --data '{"new_branch_name":"zzzz"}' $api/repos/root/exa verify_ref # cron runs once per minute, give it three minutes max before declaring failure -if ! RETRY_DELAYS="30 30 30 30 30 30" forgejo.sh retry test -f /srv/example/cron-volume/DONE ; then +if ! RETRY_DELAYS="30 30 30 30 30 30" forgejo.sh retry test -f /srv/example/cron-volume/DONE; then cat $FORGEJO_RUNNER_LOGS false fi c=/srv/example/cron/contexts/schedule/github cat $c -test "schedule" = "$(jq -r .event_name < $c)" -test "schedule" = "$(jq -r .event.action < $c)" +test "schedule" = "$(jq -r .event_name <$c)" +test "schedule" = "$(jq -r .event.action <$c)" diff --git a/actions/example-post-7-0-schedule/run.sh b/actions/example-post-7-0-schedule/run.sh index e6e13094..29617c17 100755 --- a/actions/example-post-7-0-schedule/run.sh +++ b/actions/example-post-7-0-schedule/run.sh @@ -10,7 +10,7 @@ forgejo-curl.sh web --form name=TEST_SCHEDULE_RUNSON --form data=docker http://$ # See https://codeberg.org/forgejo/forgejo/pulls/1941 for more information # function verify_ref() { - local ref=$(sqlite3 $DIR/forgejo-work-path/forgejo.db 'select ref from action_schedule') + local ref=$(sqlite3 $DIR/forgejo-work-path/forgejo.db 'select ref from action_schedule') test "${ref##*/}" = "main" } verify_ref @@ -19,12 +19,12 @@ forgejo-curl.sh api_json --data '{"new_branch_name":"zzzz"}' $api/repos/root/exa verify_ref # runs once per minute, give it three minutes max before declaring failure -if ! RETRY_DELAYS="30 30 30 30 30 30" forgejo.sh retry test -f /srv/example/post-7-0-schedule-volume/DONE ; then +if ! RETRY_DELAYS="30 30 30 30 30 30" forgejo.sh retry test -f /srv/example/post-7-0-schedule-volume/DONE; then cat $FORGEJO_RUNNER_LOGS false fi c=/srv/example/post-7-0-schedule/contexts/schedule/github cat $c -test "schedule" = "$(jq -r .event_name < $c)" -test "schedule" = "$(jq -r .event.action < $c)" \ No newline at end of file +test "schedule" = "$(jq -r .event_name <$c)" +test "schedule" = "$(jq -r .event.action <$c)" diff --git a/actions/example-post-7-0-schedule/setup.sh b/actions/example-post-7-0-schedule/setup.sh index 9e170739..5592dbeb 100755 --- a/actions/example-post-7-0-schedule/setup.sh +++ b/actions/example-post-7-0-schedule/setup.sh @@ -1 +1 @@ -mkdir -p /srv/example/post-7-0-schedule-volume \ No newline at end of file +mkdir -p /srv/example/post-7-0-schedule-volume diff --git a/actions/example-pull-request/assert-contexts.sh b/actions/example-pull-request/assert-contexts.sh index 57f02571..83cd6606 100755 --- a/actions/example-pull-request/assert-contexts.sh +++ b/actions/example-pull-request/assert-contexts.sh @@ -4,8 +4,8 @@ set -ex c=$d/contexts -test opened = "$(jq -r .event.action < $c/fork-org/pull_request/github)" -test opened = "$(jq -r .event.action < $c/fork-org/pull_request_target/github)" +test opened = "$(jq -r .event.action <$c/fork-org/pull_request/github)" +test opened = "$(jq -r .event.action <$c/fork-org/pull_request_target/github)" -test opened = "$(jq -r .event.action < $c/root/pull_request/github)" -test opened = "$(jq -r .event.action < $c/root/pull_request_target/github)" +test opened = "$(jq -r .event.action <$c/root/pull_request/github)" +test opened = "$(jq -r .event.action <$c/root/pull_request_target/github)" diff --git a/actions/example-pull-request/run.sh b/actions/example-pull-request/run.sh index a262e6f4..de54e37c 100755 --- a/actions/example-pull-request/run.sh +++ b/actions/example-pull-request/run.sh @@ -12,45 +12,44 @@ function main() { forgejo-curl.sh api_json --data-raw '{"organization":"fork-org"}' $api/repos/root/example-pull-request/forks forgejo-curl.sh api_json -X PUT --data-raw '{"data":"AAAA"}' $api/repos/root/example-pull-request/actions/secrets/SECRET - ( - cd $d - git clone $url/fork-org/example-pull-request fork - cd fork - git config user.email root@example.com - git config user.name username - echo fork $PROOF >> README - touch file-unique-to-the-pr-branch - git add . - git commit -m 'fork change' - git push + cd $d + git clone $url/fork-org/example-pull-request fork + cd fork + git config user.email root@example.com + git config user.name username + echo fork $PROOF >>README + touch file-unique-to-the-pr-branch + git add . + git commit -m 'fork change' + git push ) forgejo.sh retry forgejo-curl.sh api_json --data-raw '{"title":"PR from fork","base":"main","head":"fork-org:main"}' $api/repos/root/example-pull-request/pulls ( - cd $d - git clone $url/root/example-pull-request - cd example-pull-request - git checkout -b other - git config user.email root@example.com - git config user.name username - touch file-unique-to-the-pr-branch - echo other $PROOF >> README - git add . - git commit -m 'other change' - git push --force -u origin other + cd $d + git clone $url/root/example-pull-request + cd example-pull-request + git checkout -b other + git config user.email root@example.com + git config user.name username + touch file-unique-to-the-pr-branch + echo other $PROOF >>README + git add . + git commit -m 'other change' + git push --force -u origin other ) forgejo.sh retry forgejo-curl.sh api_json --data-raw '{"title":"PR same repo","base":"main","head":"other"}' $api/repos/root/example-pull-request/pulls export RETRY_DELAYS="60 60 60 60 60 60 60" - for assert in $EXAMPLE_DIR/assert-*.sh ; do - if ! forgejo.sh retry $assert ; then - find $d - sed -e 's/^/[RUNNER LOGS]/' < $FORGEJO_RUNNER_LOGS - false - fi + for assert in $EXAMPLE_DIR/assert-*.sh; do + if ! forgejo.sh retry $assert; then + find $d + sed -e 's/^/[RUNNER LOGS]/' <$FORGEJO_RUNNER_LOGS + false + fi done } diff --git a/actions/example-pull-request/setup.sh b/actions/example-pull-request/setup.sh index 72c13c02..5f469629 100755 --- a/actions/example-pull-request/setup.sh +++ b/actions/example-pull-request/setup.sh @@ -1,2 +1 @@ mkdir -p /srv/example/pull-request - diff --git a/actions/example-push-cancel/run.sh b/actions/example-push-cancel/run.sh index d6705d8f..891798ed 100755 --- a/actions/example-push-cancel/run.sh +++ b/actions/example-push-cancel/run.sh @@ -11,7 +11,7 @@ forgejo-test-helper.sh wait_running $url $repo $sha # # push to the same branch # -forgejo-test-helper.sh push_workflow actions/example-echo $url root example-$example setup-forgejo $token +forgejo-test-helper.sh push_workflow actions/example-echo $url root example-$example setup-forgejo $token # # wait for the workflow to be canceled as a result of the previous push # diff --git a/actions/example-service/setup.sh b/actions/example-service/setup.sh index 3a9674ef..7bc1672a 100755 --- a/actions/example-service/setup.sh +++ b/actions/example-service/setup.sh @@ -1,3 +1,3 @@ -> /srv/example-service-volume-valid -> /srv/example-service-volume-invalid +>/srv/example-service-volume-valid +>/srv/example-service-volume-invalid FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config.yaml forgejo-runner.sh reload diff --git a/actions/example-workflow-dispatch/run.sh b/actions/example-workflow-dispatch/run.sh index ed550706..8a49365b 100755 --- a/actions/example-workflow-dispatch/run.sh +++ b/actions/example-workflow-dispatch/run.sh @@ -10,7 +10,7 @@ api=$url/api/v1 repo=root/example-$example function context_wait() { - if ! forgejo.sh retry test -f $context ; then + if ! forgejo.sh retry test -f $context; then cat "$FORGEJO_RUNNER_LOGS" false fi @@ -19,7 +19,7 @@ function context_wait() { function verify_required() { local actual=$(forgejo-curl.sh api_json -w '%{http_code}' --data '{"ref":"main","inputs":{}}' $api/repos/$repo/actions/workflows/test.yml/dispatches) local expected=400 - if test "$actual" != $expected ; then + if test "$actual" != $expected; then log_info "dispatch is expected to fail with status $expected because of string2 is a required value but got status $actual instead" return 1 fi @@ -28,7 +28,7 @@ function verify_required() { function verify_inputs() { local inputs='{"string2":"value2"}' forgejo-curl.sh api_json --data '{"ref":"main","inputs":'$inputs'}' $api/repos/$repo/actions/workflows/test.yml/dispatches - cat > $TMPDIR/expected <<'EOF' + cat >$TMPDIR/expected <<'EOF' { "boolean_default_false": "false", "boolean_default_true": "true", @@ -46,7 +46,7 @@ function run_tests() { npm --silent install json-diff verify_inputs context_wait - node_modules/.bin/json-diff <(jq .event.inputs < $context) $TMPDIR/expected + node_modules/.bin/json-diff <(jq .event.inputs <$context) $TMPDIR/expected } function main() { @@ -56,7 +56,7 @@ function main() { run_tests - test "workflow_dispatch" = "$(jq -r .event_name < $context)" + test "workflow_dispatch" = "$(jq -r .event_name <$context)" } main diff --git a/end-to-end.sh b/end-to-end.sh index ab9454bd..05865ac6 100755 --- a/end-to-end.sh +++ b/end-to-end.sh @@ -11,7 +11,7 @@ # Everything happens in /tmp/forgejo-end-to-end # -SELF_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SELF_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SELF="${BASH_SOURCE[0]}" source $SELF_DIR/lib/lib.sh diff --git a/federation/federation.sh b/federation/federation.sh index 7fbb215b..f0acfcfe 100755 --- a/federation/federation.sh +++ b/federation/federation.sh @@ -1,46 +1,46 @@ # Copyright 2024 The Forgejo Authors # SPDX-License-Identifier: MIT -FEDERATION_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +FEDERATION_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" export FEDERATION_INSTANCES="ONE TWO" export FEDERATION_CONFIGS function federation_setup_variables() { - if test "$FEDERATION_CONFIGS" ; then - return + if test "$FEDERATION_CONFIGS"; then + return fi - for instance in $FEDERATION_INSTANCES ; do - local config=$FEDERATION_DIR/$instance-app.ini - FEDERATION_CONFIGS="$FEDERATION_CONFIGS $config" - local base=$(work_path_base $config) - local work_path=$DIR/$base - local host_port=$(get_host_port $config) + for instance in $FEDERATION_INSTANCES; do + local config=$FEDERATION_DIR/$instance-app.ini + FEDERATION_CONFIGS="$FEDERATION_CONFIGS $config" + local base=$(work_path_base $config) + local work_path=$DIR/$base + local host_port=$(get_host_port $config) - eval export ${instance}_CONFIG=$config - eval export ${instance}_CURL=$work_path/forgejo-curl.sh - eval export ${instance}_HOST_PORT=$host_port + eval export ${instance}_CONFIG=$config + eval export ${instance}_CURL=$work_path/forgejo-curl.sh + eval export ${instance}_HOST_PORT=$host_port done } function federation_verify_scenario() { - local scenario=$1 + local scenario=$1 - export scenario - export SCENARIO_DIR=$FEDERATION_DIR/scenario-$scenario + export scenario + export SCENARIO_DIR=$FEDERATION_DIR/scenario-$scenario - if test -f $SCENARIO_DIR/setup.sh ; then - echo "============================ SETUP scenario-$scenario ===================" - bash -ex $SCENARIO_DIR/setup.sh || return 1 - fi + if test -f $SCENARIO_DIR/setup.sh; then + echo "============================ SETUP scenario-$scenario ===================" + bash -ex $SCENARIO_DIR/setup.sh || return 1 + fi - echo "============================ RUN scenario-$scenario ===================" - bash -ex $SCENARIO_DIR/run.sh || return 1 + echo "============================ RUN scenario-$scenario ===================" + bash -ex $SCENARIO_DIR/run.sh || return 1 - if test -f $SCENARIO_DIR/teardown.sh ; then - echo "============================ TEARDOWN scenario-$scenario ===================" - bash -ex $SCENARIO_DIR/teardown.sh || return 1 - fi + if test -f $SCENARIO_DIR/teardown.sh; then + echo "============================ TEARDOWN scenario-$scenario ===================" + bash -ex $SCENARIO_DIR/teardown.sh || return 1 + fi } function federation_setup() { @@ -50,9 +50,9 @@ function federation_setup() { federation_teardown local config - for config in $FEDERATION_CONFIGS ; do - reset_forgejo $config - start_forgejo $version $config + for config in $FEDERATION_CONFIGS; do + reset_forgejo $config + start_forgejo $version $config done } @@ -60,8 +60,8 @@ function federation_teardown() { federation_setup_variables local config - for config in $FEDERATION_CONFIGS ; do - stop_forgejo $config + for config in $FEDERATION_CONFIGS; do + stop_forgejo $config done } @@ -71,16 +71,16 @@ function test_federation() { local versions="${1:-$RELEASE_NUMBERS_AND_DEV}" - for version in $versions ; do + for version in $versions; do - if dpkg --compare-versions $version lt 7.1 ; then - continue - fi + if dpkg --compare-versions $version lt 7.1; then + continue + fi - federation_setup $version + federation_setup $version - for scenario in star ; do - run federation_verify_scenario $scenario - done + for scenario in star; do + run federation_verify_scenario $scenario + done done } diff --git a/federation/scenario-star/run.sh b/federation/scenario-star/run.sh index 15db8e23..ad340d22 100644 --- a/federation/scenario-star/run.sh +++ b/federation/scenario-star/run.sh @@ -9,20 +9,20 @@ function star_count() { local host_port=$2 local count=$3 - $curl api_json http://$host_port/api/v1/repos/root/test > $TMPDIR/count.json - if test $count != $(jq -r .stars_count < $TMPDIR/count.json) ; then - jq . < $TMPDIR/count.json - return 1 + $curl api_json http://$host_port/api/v1/repos/root/test >$TMPDIR/count.json + if test $count != $(jq -r .stars_count <$TMPDIR/count.json); then + jq . <$TMPDIR/count.json + return 1 fi } # # create a repo on each instance # -$ONE_CURL api_json --data '{"name":"test","auto_init":true}' $ONE_HOST_PORT/api/v1/user/repos > $TMPDIR/one-repo.json -one_repo_id=$(jq -r .id < $TMPDIR/one-repo.json) -$TWO_CURL api_json --data '{"name":"test","auto_init":true}' $TWO_HOST_PORT/api/v1/user/repos > $TMPDIR/two-repo.json -two_repo_id=$(jq -r .id < $TMPDIR/two-repo.json) +$ONE_CURL api_json --data '{"name":"test","auto_init":true}' $ONE_HOST_PORT/api/v1/user/repos >$TMPDIR/one-repo.json +one_repo_id=$(jq -r .id <$TMPDIR/one-repo.json) +$TWO_CURL api_json --data '{"name":"test","auto_init":true}' $TWO_HOST_PORT/api/v1/user/repos >$TMPDIR/two-repo.json +two_repo_id=$(jq -r .id <$TMPDIR/two-repo.json) # # the repo in instance two is federated with the repo in instance one diff --git a/federation/scenario-star/setup.sh b/federation/scenario-star/setup.sh index e69de29b..8b137891 100644 --- a/federation/scenario-star/setup.sh +++ b/federation/scenario-star/setup.sh @@ -0,0 +1 @@ + diff --git a/federation/scenario-star/teardown.sh b/federation/scenario-star/teardown.sh index e69de29b..8b137891 100644 --- a/federation/scenario-star/teardown.sh +++ b/federation/scenario-star/teardown.sh @@ -0,0 +1 @@ + diff --git a/forgejo/fixtures.sh b/forgejo/fixtures.sh index 9e7f5ca2..b49abf50 100644 --- a/forgejo/fixtures.sh +++ b/forgejo/fixtures.sh @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT -FIXTURES_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +FIXTURES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source $FIXTURES_DIR/fixtures/storage.sh source $FIXTURES_DIR/fixtures/doctor.sh diff --git a/forgejo/fixtures/storage.sh b/forgejo/fixtures/storage.sh index 0de79b5b..cf893b84 100644 --- a/forgejo/fixtures/storage.sh +++ b/forgejo/fixtures/storage.sh @@ -15,7 +15,7 @@ function fixture_get_paths_s3() { ( mc ls --quiet --recursive testS3/$path | sed -e "s|.* |$path/|" - ) > $DIR/path + ) >$DIR/path } function fixture_content_search_s3() { @@ -23,15 +23,15 @@ function fixture_content_search_s3() { local expected="$2" fixture_get_paths_s3 $path - if test $(wc -l < $DIR/path) -lt 1 ; then - echo expected at least one but got "'$(cat $DIR/path)'" - return 1 + if test $(wc -l <$DIR/path) -lt 1; then + echo expected at least one but got "'$(cat $DIR/path)'" + return 1 fi - for filename in $(cat $DIR/path) ; do - local content=$(mc cat testS3/$filename | base64 -w0) - if test "$content" = "$expected" ; then - return 0 - fi + for filename in $(cat $DIR/path); do + local content=$(mc cat testS3/$filename | base64 -w0) + if test "$content" = "$expected"; then + return 0 + fi done echo nothing in $path found with the expected content "$expected" return 1 @@ -41,7 +41,10 @@ function fixture_get_paths_local() { local path=$1 local work_path=$DIR/forgejo-work-path - ( cd $work_path ; find $path -type f) > $DIR/path + ( + cd $work_path + find $path -type f + ) >$DIR/path } function fixture_get_one_path() { @@ -50,7 +53,7 @@ function fixture_get_one_path() { fixture_get_paths_$storage $path - if test $(wc -l < $DIR/path) != 1 ; then + if test $(wc -l <$DIR/path) != 1; then echo expected one path but got cat $DIR/path return 1 @@ -77,7 +80,7 @@ function fixture_lfs_create() { ( cd $DIR/fixture git lfs track "*.txt" - echo CONTENT > file.txt + echo CONTENT >file.txt git add . git commit -m 'lfs files' git push @@ -87,11 +90,11 @@ function fixture_lfs_create() { function fixture_lfs_assert() { local d=$(mktemp -d) ( - git clone http://${FORGEJO_USER}:${FORGEJO_PASSWORD}@${HOST_PORT}/${FORGEJO_USER}/${FORGEJO_REPO} $d/${FORGEJO_REPO} - cd $d/${FORGEJO_REPO} - rm file.txt + git clone http://${FORGEJO_USER}:${FORGEJO_PASSWORD}@${HOST_PORT}/${FORGEJO_USER}/${FORGEJO_REPO} $d/${FORGEJO_REPO} + cd $d/${FORGEJO_REPO} + rm file.txt git-lfs checkout file.txt - test -f file.txt + test -f file.txt ) rm -fr $d } @@ -110,7 +113,7 @@ function fixture_lfs_assert_local() { } function fixture_packages_create() { - echo PACKAGE_CONTENT > $DIR/fixture/package + echo PACKAGE_CONTENT >$DIR/fixture/package forgejo-curl.sh api_json -X DELETE http://${HOST_PORT}/api/packages/${FORGEJO_USER}/generic/test_package/1.0.0/file.txt || true forgejo-curl.sh api_json --upload-file $DIR/fixture/package http://${HOST_PORT}/api/packages/${FORGEJO_USER}/generic/test_package/1.0.0/file.txt } @@ -128,7 +131,7 @@ function fixture_packages_assert_local() { } function fixture_avatars_create() { - echo -n $ONEPIXEL | base64 --decode > $DIR/avatar.png + echo -n $ONEPIXEL | base64 --decode >$DIR/avatar.png forgejo-curl.sh web --form avatar=@$DIR/avatar.png http://${HOST_PORT}/user/settings/avatar } @@ -145,7 +148,7 @@ function fixture_avatars_assert_local() { } function fixture_repo_avatars_create() { - echo -n $ONEPIXEL | base64 --decode > $DIR/repo-avatar.png + echo -n $ONEPIXEL | base64 --decode >$DIR/repo-avatar.png forgejo-curl.sh web --form avatar=@$DIR/repo-avatar.png http://${HOST_PORT}/${FORGEJO_USER}/${FORGEJO_REPO}/settings/avatar # v1.21 only #forgejo-curl.sh api_json -X POST --data-raw '{"body":"'$avatar'"}' http://${HOST_PORT}/api/v1/repos/${FORGEJO_USER}/${FORGEJO_REPO}/avatar @@ -166,17 +169,17 @@ function fixture_repo_avatars_assert_local() { } function fixture_attachments_create_1_18() { - echo -n $ONEPIXEL | base64 --decode > $DIR/attachment.png + echo -n $ONEPIXEL | base64 --decode >$DIR/attachment.png forgejo-curl.sh web --trace-ascii - --form file=@$DIR/attachment.png http://${HOST_PORT}/${FORGEJO_USER}/${FORGEJO_REPO}/issues/attachments } function fixture_attachments_create() { - if forgejo-curl.sh api_json http://${HOST_PORT}/api/v1/version | grep --quiet --fixed-strings 1.18. ; then + if forgejo-curl.sh api_json http://${HOST_PORT}/api/v1/version | grep --quiet --fixed-strings 1.18.; then fixture_attachments_create_1_18 return fi id=$(forgejo-curl.sh api_json --data-raw '{"title":"TITLE"}' http://${HOST_PORT}/api/v1/repos/${FORGEJO_USER}/${FORGEJO_REPO}/issues | jq .id) - echo -n $ONEPIXEL | base64 --decode > $DIR/attachment.png + echo -n $ONEPIXEL | base64 --decode >$DIR/attachment.png forgejo-curl.sh api --form name=attachment.png --form attachment=@$DIR/attachment.png http://${HOST_PORT}/api/v1/repos/${FORGEJO_USER}/${FORGEJO_REPO}/issues/$id/assets } @@ -206,18 +209,18 @@ function fixture_create() { git remote add origin http://${FORGEJO_USER}:${FORGEJO_PASSWORD}@${HOST_PORT}/${FORGEJO_USER}/${FORGEJO_REPO} git config user.email root@example.com git config user.name username - echo SOMETHING > README + echo SOMETHING >README git add README git commit -m 'initial commit' git push --set-upstream --force origin main ) - for fun in ${STORAGE_FUN} ; do + for fun in ${STORAGE_FUN}; do fixture_${fun}_create done } function fixture_assert() { - for fun in lfs ; do + for fun in lfs; do fixture_${fun}_assert done } diff --git a/lib/api.sh b/lib/api.sh index 03db36c1..cc56f506 100644 --- a/lib/api.sh +++ b/lib/api.sh @@ -14,16 +14,16 @@ function api_user_make_admin() { function api_user_create() { local api="$1" username="$2" email="$3" log_info "(re)create user $username" - forgejo-curl.sh api_json -X DELETE $api/admin/users/$username?purge=true >& /dev/null || true + forgejo-curl.sh api_json -X DELETE $api/admin/users/$username?purge=true >&/dev/null || true forgejo-curl.sh api_json --data '{"username":"'$username'","email":"'$email'","password":"admin1234","must_change_password":false}' $api/admin/users } function user_login() { local username=$1 ( - export DOT=$API_TMPDIR/$username - forgejo-curl.sh logout - forgejo-curl.sh --user $username --password "admin1234" login http://${HOST_PORT} + export DOT=$API_TMPDIR/$username + forgejo-curl.sh logout + forgejo-curl.sh --user $username --password "admin1234" login http://${HOST_PORT} ) } diff --git a/lib/build.sh b/lib/build.sh index 11bdf3a6..bbef73eb 100755 --- a/lib/build.sh +++ b/lib/build.sh @@ -4,16 +4,16 @@ set -ex -SELF_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SELF_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" version=$1 dir_binaries=$2 v=$(echo $version | sed -E -e 's/^([0-9]+\.[0-9]+).*/\1/') src=$dir_binaries/src-$v -read url ref semver < $SELF_DIR/../forgejo/sources/$v +read url ref semver <$SELF_DIR/../forgejo/sources/$v -if ! test -d $src ; then +if ! test -d $src; then mkdir -p $src cd $src git init @@ -22,15 +22,15 @@ else cd $src fi -if ! [[ "$ref" =~ ^refs/ ]] ; then +if ! [[ "$ref" =~ ^refs/ ]]; then ref=refs/heads/$ref fi -for retry in 1 2 3 ; do - if timeout 15m git fetch --update-head-ok origin +$ref:$ref ; then - break +for retry in 1 2 3; do + if timeout 15m git fetch --update-head-ok origin +$ref:$ref; then + break else - echo "Retry git fetch in 60 seconds" - sleep 60 + echo "Retry git fetch in 60 seconds" + sleep 60 fi done git fetch --update-head-ok origin +$ref:$ref diff --git a/lib/lib.sh b/lib/lib.sh index 74485366..295c0eb3 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -2,11 +2,11 @@ # Copyright 2024 The Forgejo Authors # SPDX-License-Identifier: MIT -LIB_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source $LIB_DIR/api.sh -if ${VERBOSE:-false} ; then +if ${VERBOSE:-false}; then set -ex PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}: ' else @@ -17,8 +17,8 @@ set -o pipefail export DEBIAN_FRONTEND=noninteractive -if test $(id -u) != 0 ; then - SUDO=sudo +if test $(id -u) != 0; then + SUDO=sudo fi IP=$(hostname -I | cut -f1 -d' ') @@ -35,7 +35,7 @@ export DOT_FORGEJO_CURL=$DIR/forgejo-curl export DOT=$DOT_FORGEJO_CURL # for backward compatibility with forgejo-curl.sh 1.0.0 : ${FORGEJO_USER:=root} : ${FORGEJO_PASSWORD:=admin1234} -: ${RELEASE_NUMBERS_AND_DEV:="$(for r in $RELEASE_NUMBERS ; do echo -n "$r $r-dev " ; done)"} +: ${RELEASE_NUMBERS_AND_DEV:="$(for r in $RELEASE_NUMBERS; do echo -n "$r $r-dev "; done)"} ORGANIZATIONS=$(cat $LIB_DIR/ORGANIZATIONS) function log_info() { @@ -44,50 +44,50 @@ function log_info() { function dependencies() { - if ! test -f /usr/local/bin/forgejo-curl.sh ; then - $SUDO curl --fail -sS https://code.forgejo.org/forgejo/forgejo-curl/raw/branch/main/forgejo-curl.sh -o /usr/local/bin/forgejo-curl.sh - $SUDO chmod +x /usr/local/bin/forgejo-curl.sh + if ! test -f /usr/local/bin/forgejo-curl.sh; then + $SUDO curl --fail -sS https://code.forgejo.org/forgejo/forgejo-curl/raw/branch/main/forgejo-curl.sh -o /usr/local/bin/forgejo-curl.sh + $SUDO chmod +x /usr/local/bin/forgejo-curl.sh fi - if ! which make curl daemon git-lfs jq sqlite3 skopeo > /dev/null ; then + if ! which make curl daemon git-lfs jq sqlite3 skopeo >/dev/null; then $SUDO apt-get update -qq $SUDO apt-get install -y -qq make curl daemon git-lfs jq sqlite3 skopeo fi - if ! test -f /usr/local/bin/mc || ! test -f /usr/local/bin/minio ; then + if ! test -f /usr/local/bin/mc || ! test -f /usr/local/bin/minio; then $SUDO curl --fail -sS https://dl.min.io/client/mc/release/linux-amd64/mc -o /usr/local/bin/mc $SUDO curl --fail -sS https://dl.min.io/server/minio/release/linux-amd64/minio -o /usr/local/bin/minio fi - if ! test -x /usr/local/bin/mc || ! test -x /usr/local/bin/minio ; then + if ! test -x /usr/local/bin/mc || ! test -x /usr/local/bin/minio; then $SUDO chmod +x /usr/local/bin/mc $SUDO chmod +x /usr/local/bin/minio fi - if ! test -f /usr/local/bin/garage > /dev/null ; then + if ! test -f /usr/local/bin/garage >/dev/null; then $SUDO curl --fail -sS https://garagehq.deuxfleurs.fr/_releases/v0.8.2/x86_64-unknown-linux-musl/garage -o /usr/local/bin/garage fi - if ! test -x /usr/local/bin/garage > /dev/null ; then + if ! test -x /usr/local/bin/garage >/dev/null; then $SUDO chmod +x /usr/local/bin/garage fi } function build_all() { - for dev in $RELEASE_NUMBERS ; do - local forgejo=$DIR_BINARIES/forgejo-$dev-dev - if test -f $forgejo ; then - log_info $dev already exists - else - $LIB_DIR/build.sh $dev $DIR_BINARIES - log_info $dev built from sources - fi + for dev in $RELEASE_NUMBERS; do + local forgejo=$DIR_BINARIES/forgejo-$dev-dev + if test -f $forgejo; then + log_info $dev already exists + else + $LIB_DIR/build.sh $dev $DIR_BINARIES + log_info $dev built from sources + fi done } function retry() { rm -f $DIR/wait-for.out success=false - for delay in 1 1 5 5 15 ; do - if "$@" >> $DIR/wait-for.out 2>&1 ; then + for delay in 1 1 5 5 15; do + if "$@" >>$DIR/wait-for.out 2>&1; then success=true break fi @@ -95,7 +95,7 @@ function retry() { echo waiting $delay sleep $delay done - if test $success = false ; then + if test $success = false; then cat $DIR/wait-for.out return 1 fi @@ -105,36 +105,36 @@ function full_version() { local version=$1 local owner=$2 - if [[ $version =~ ^[0-9]+\.[0-9]+$ ]] ; then - full_version=$(curl -sS "https://codeberg.org/api/v1/repos/$owner/forgejo/releases?limit=50" | jq -r '.[] | .tag_name | select(startswith("v'$version'"))' | sort --reverse --version-sort | head -1) - echo ${full_version#v} + if [[ $version =~ ^[0-9]+\.[0-9]+$ ]]; then + full_version=$(curl -sS "https://codeberg.org/api/v1/repos/$owner/forgejo/releases?limit=50" | jq -r '.[] | .tag_name | select(startswith("v'$version'"))' | sort --reverse --version-sort | head -1) + echo ${full_version#v} else - echo $version + echo $version fi } function download_forgejo() { local version=$1 - if ! test -f $DIR_BINARIES/forgejo-$version ; then + if ! test -f $DIR_BINARIES/forgejo-$version; then mkdir -p $DIR_BINARIES - for owner in $ORGANIZATIONS ; do - full_version=$(full_version $version $owner) - if test "$full_version" = "" ; then - continue - fi - if wget -O $DIR_BINARIES/forgejo-$version --quiet https://codeberg.org/$owner/forgejo/releases/download/v$full_version/forgejo-$full_version-linux-amd64 ; then - break - fi - done - if test -s $DIR_BINARIES/forgejo-$version ; then - if test "$version" != "$full_version" ; then - log_info "downloaded Forgejo $full_version for $version" - fi - else - echo unable to download Forgejo $version - return 1 - fi + for owner in $ORGANIZATIONS; do + full_version=$(full_version $version $owner) + if test "$full_version" = ""; then + continue + fi + if wget -O $DIR_BINARIES/forgejo-$version --quiet https://codeberg.org/$owner/forgejo/releases/download/v$full_version/forgejo-$full_version-linux-amd64; then + break + fi + done + if test -s $DIR_BINARIES/forgejo-$version; then + if test "$version" != "$full_version"; then + log_info "downloaded Forgejo $full_version for $version" + fi + else + echo unable to download Forgejo $version + return 1 + fi chmod +x $DIR_BINARIES/forgejo-$version fi } @@ -142,9 +142,9 @@ function download_forgejo() { function download_gitea() { local version=$1 - if ! test -f $DIR_BINARIES/gitea-$version ; then + if ! test -f $DIR_BINARIES/gitea-$version; then mkdir -p $DIR_BINARIES - if [[ $version =~ ^[0-9]+\.[0-9]+$ ]] ; then + if [[ $version =~ ^[0-9]+\.[0-9]+$ ]]; then full_version=$(curl -sS "https://api.github.com/repos/go-gitea/gitea/releases?per_page=100" | jq -r '.[] | .tag_name | select(startswith("v'$version'"))' | grep -v -e '-rc' | sort --reverse --version-sort | head -1) full_version=${full_version#v} else @@ -152,8 +152,8 @@ function download_gitea() { fi wget -O $DIR_BINARIES/gitea-$version --quiet https://dl.gitea.com/gitea/$full_version/gitea-$full_version-linux-amd64 - if test -s $DIR_BINARIES/gitea-$version ; then - if test "$version" != "$full_version" ; then + if test -s $DIR_BINARIES/gitea-$version; then + if test "$version" != "$full_version"; then log_info "downloaded Gitea $full_version for $version" fi else @@ -185,18 +185,18 @@ function clobber() { function start_gitlab_cache_load() { local image=$1 local d=$DIR_BINARIES/gitlab - if test -d $d ; then - log_info "loading $image from $d" - skopeo copy dir:$d docker-daemon:$image + if test -d $d; then + log_info "loading $image from $d" + skopeo copy dir:$d docker-daemon:$image fi } function start_gitlab_cache_save() { local image=$1 local d=$DIR_BINARIES/gitlab - if ! test -d $d ; then - log_info "saving $image to $d" - skopeo copy docker-daemon:$image dir:$d + if ! test -d $d; then + log_info "saving $image to $d" + skopeo copy docker-daemon:$image dir:$d fi } @@ -208,21 +208,21 @@ function start_gitlab() { local GITLAB_OMNIBUS_CONFIG="nginx['listen_https'] = false ; nginx['listen_port'] = 8181 ; external_url 'http://$IP:$GITLAB_PORT'; gitlab_rails['gitlab_shell_ssh_port'] = 2221; $config" docker run --name="test-gitlab" --shm-size=128M -d \ - -e GITLAB_OMNIBUS_CONFIG="$GITLAB_OMNIBUS_CONFIG" \ - -p 2221:22 -p $GITLAB_PORT:8181 \ - $image >& /dev/null < /dev/null + -e GITLAB_OMNIBUS_CONFIG="$GITLAB_OMNIBUS_CONFIG" \ + -p 2221:22 -p $GITLAB_PORT:8181 \ + $image >&/dev/null /dev/null + grep '' $work_path/log/*.log 2>/dev/null return 1 fi - echo "$binary --config $work_path/app.ini --work-path $work_path" '"$@"' > $work_path/forgejocli + echo "$binary --config $work_path/app.ini --work-path $work_path" '"$@"' >$work_path/forgejocli chmod +x $work_path/forgejocli cp -a $work_path/forgejocli $DIR/forgejocli # because setup-forgejo/forgejo-runner.sh expects it here create_user_and_login $version $config @@ -277,18 +277,18 @@ function start_forgejo_daemon() { function start_minio() { mkdir -p $DIR/minio daemon --chdir=$DIR --unsafe \ - --env="PATH=$PATH" \ - --env=MINIO_ROOT_USER=123456 \ - --env=MINIO_ROOT_PASSWORD=12345678 \ - --env=MINIO_VOLUMES=$DIR/minio \ - --pidfile=$DIR/minio-pid --errlog=$DIR/minio-err.log --output=$DIR/minio-out.log -- /usr/local/bin/minio server - retry mc alias set testS3 http://127.0.0.1:9000 123456 12345678 >& /dev/null + --env="PATH=$PATH" \ + --env=MINIO_ROOT_USER=123456 \ + --env=MINIO_ROOT_PASSWORD=12345678 \ + --env=MINIO_VOLUMES=$DIR/minio \ + --pidfile=$DIR/minio-pid --errlog=$DIR/minio-err.log --output=$DIR/minio-out.log -- /usr/local/bin/minio server + retry mc alias set testS3 http://127.0.0.1:9000 123456 12345678 >&/dev/null mc alias set testS3 http://127.0.0.1:9000 123456 12345678 } function start_garage() { mkdir -p $DIR/garage/{data,meta} - cat > $DIR/garage/garage.toml <$DIR/garage/garage.toml < $work_path/app.ini + -e "s|\${WORK_PATH}|$work_path|g" \ + -e "s|^WORK_PATH = .*|WORK_PATH = $work_path|" \ + <$config >$work_path/app.ini } function reset_minio() { @@ -391,19 +391,19 @@ function create_user_and_login() { local work_path=$DIR/$(work_path_base $config) local email="$FORGEJO_USER@example.com" - if ! $work_path/forgejocli admin user list | grep --quiet "$email" ; then - $work_path/forgejocli admin user create --admin --username "$FORGEJO_USER" --password "$FORGEJO_PASSWORD" --email $email + if ! $work_path/forgejocli admin user list | grep --quiet "$email"; then + $work_path/forgejocli admin user create --admin --username "$FORGEJO_USER" --password "$FORGEJO_PASSWORD" --email $email fi forgejo-curl.sh logout local scopes='--scopes ["all"]' - if echo $version | grep --quiet 1.18 ; then + if echo $version | grep --quiet 1.18; then scopes="" fi forgejo-curl.sh --user "$FORGEJO_USER" --password "$FORGEJO_PASSWORD" $scopes login http://$(get_host_port $config) local forgejo_curl=$work_path/forgejo-curl.sh - cat > $forgejo_curl <$forgejo_curl < $DIR/$fun.out + >$DIR/$fun.out tail --follow $DIR/$fun.out |& sed --unbuffered -n -e "/^$PREFIX/s/^$PREFIX //p" & local pid=$! - if ! VERBOSE=true $SELF $fun "$@" >& $DIR/$fun.out ; then + if ! VERBOSE=true $SELF $fun "$@" >&$DIR/$fun.out; then kill $pid cat $DIR/$fun.out echo Failure running $fun diff --git a/packages/alpine-1.21/test.sh b/packages/alpine-1.21/test.sh index e2108797..93a3aba2 100755 --- a/packages/alpine-1.21/test.sh +++ b/packages/alpine-1.21/test.sh @@ -33,20 +33,20 @@ sudo -u user APKBUILD=alpine/APKBUILD abuild -r # upload new package cd packages/srv/x86_64/ for file in $(find . -name '*.apk' -type f | sed -e 's,./,,'); do - # remove old package - curl \ - --fail \ - -H "Authorization: token $forgejo_token" \ - -X DELETE \ - "$forgejo_url/api/packages/root/alpine/3.19/forgejo-2174/$file" \ - || true + # remove old package + curl \ + --fail \ + -H "Authorization: token $forgejo_token" \ + -X DELETE \ + "$forgejo_url/api/packages/root/alpine/3.19/forgejo-2174/$file" || + true - # upload new package - curl \ - --fail \ - -H "Authorization: token $forgejo_token" \ - -T "$file" \ - "$forgejo_url/api/packages/root/alpine/3.19/forgejo-2174" + # upload new package + curl \ + --fail \ + -H "Authorization: token $forgejo_token" \ + -T "$file" \ + "$forgejo_url/api/packages/root/alpine/3.19/forgejo-2174" done # ensure that the install-if condition works as expected @@ -54,5 +54,5 @@ apk add openrc (cd /etc/apk/keys && curl -JO $forgejo_url/api/packages/root/alpine/key) echo "$forgejo_url/api/packages/root/alpine/3.19/forgejo-2174" >>/etc/apk/repositories apk add forgejo-2174 -[ -e /usr/bin/forgejo_2174 ] # from the installed package +[ -e /usr/bin/forgejo_2174 ] # from the installed package [ -e /etc/init.d/forgejo_2174 ] # from the -openrc package installed because of the install-if condition diff --git a/packages/alpine-7.0-test/test.sh b/packages/alpine-7.0-test/test.sh index 45bb60e9..82565d04 100755 --- a/packages/alpine-7.0-test/test.sh +++ b/packages/alpine-7.0-test/test.sh @@ -36,20 +36,20 @@ sudo -u user APKBUILD=alpine/forgejo-2173/APKBUILD abuild -r # upload new package cd packages/alpine/x86_64/ for file in $(find . -name '*.apk' -type f | sed -e 's,./,,'); do - # remove old package - curl \ - --fail \ - -H "Authorization: token $forgejo_token" \ - -X DELETE \ - "$forgejo_url/api/packages/root/alpine/3.19/e2e-tests/$file" \ - || true + # remove old package + curl \ + --fail \ + -H "Authorization: token $forgejo_token" \ + -X DELETE \ + "$forgejo_url/api/packages/root/alpine/3.19/e2e-tests/$file" || + true - # upload new package - curl \ - --fail \ - -H "Authorization: token $forgejo_token" \ - -T "$file" \ - "$forgejo_url/api/packages/root/alpine/3.19/e2e-tests" + # upload new package + curl \ + --fail \ + -H "Authorization: token $forgejo_token" \ + -T "$file" \ + "$forgejo_url/api/packages/root/alpine/3.19/e2e-tests" done # ensure that the install-if condition works as expected @@ -57,7 +57,7 @@ apk add openrc (cd /etc/apk/keys && curl -JO $forgejo_url/api/packages/root/alpine/key) echo "$forgejo_url/api/packages/root/alpine/3.19/e2e-tests" >>/etc/apk/repositories apk add forgejo-2174 forgejo-2173 -[ -e /usr/bin/forgejo_2174 ] # from the installed package -[ -e /usr/bin/forgejo_2173 ] # from the installed package +[ -e /usr/bin/forgejo_2174 ] # from the installed package +[ -e /usr/bin/forgejo_2173 ] # from the installed package [ -e /etc/init.d/forgejo_2174 ] # from the -openrc package installed because of the install-if condition [ -e /etc/init.d/forgejo_2173 ] # from the -openrc package installed because of the install-if condition diff --git a/packages/alpine.sh b/packages/alpine.sh index ae82913b..79595ae6 100644 --- a/packages/alpine.sh +++ b/packages/alpine.sh @@ -16,9 +16,9 @@ function test_packages_alpine_version() { } function test_packages_alpine() { - for alpine_version in 3.18 3.19 ; do - for forgejo_version in 1.21 7.0-test 7.0-dev ; do - test_packages_alpine_version $alpine_version $forgejo_version - done + for alpine_version in 3.18 3.19; do + for forgejo_version in 1.21 7.0-test 7.0-dev; do + test_packages_alpine_version $alpine_version $forgejo_version + done done } diff --git a/storage/storage.sh b/storage/storage.sh index a531e505..e96a0d3c 100755 --- a/storage/storage.sh +++ b/storage/storage.sh @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT -STORAGE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +STORAGE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" STORAGE_PATHS="attachments avatars lfs packages repo-archive repo-avatars" @@ -14,7 +14,7 @@ function storage_reset() { function verify_storage() { local work_path=$DIR/forgejo-work-path - for path in ${STORAGE_PATHS} ; do + for path in ${STORAGE_PATHS}; do test -d $work_path/data/$path done } @@ -22,7 +22,7 @@ function verify_storage() { function cleanup_storage() { local work_path=$DIR/forgejo-work-path - for path in ${STORAGE_PATHS} ; do + for path in ${STORAGE_PATHS}; do rm -fr $work_path/data/$path done } @@ -33,13 +33,13 @@ function test_storage_stable_s3() { log_info "See also https://codeberg.org/forgejo/forgejo/issues/1338" - for version in 1.21 $RELEASE_NUMBERS_AND_DEV ; do + for version in 1.21 $RELEASE_NUMBERS_AND_DEV; do log_info "Forgejo $version & $s3_backend" stop storage_reset stable-s3 start $version $s3_backend fixture_create - for fun in ${STORAGE_FUN} ; do + for fun in ${STORAGE_FUN}; do fixture_${fun}_assert_s3 done done diff --git a/upgrade/test-pprof-upload.sh b/upgrade/test-pprof-upload.sh index e5ab46d1..48dada45 100644 --- a/upgrade/test-pprof-upload.sh +++ b/upgrade/test-pprof-upload.sh @@ -1,43 +1,43 @@ # SPDX-License-Identifier: MIT function test_upload_profiles() { - FORGEJO_URL="http://localhost:6060" - PROFILECLI_URL="http://0.0.0.0:4040" + FORGEJO_URL="http://localhost:6060" + PROFILECLI_URL="http://0.0.0.0:4040" - endpoints=("/debug/pprof/allocs" "/debug/pprof/block" "/debug/pprof/goroutine" "/debug/pprof/mutex" "/debug/pprof/profile?seconds=5") - curl -fL https://github.com/grafana/pyroscope/releases/download/v1.1.5/profilecli_1.1.5_linux_amd64.tar.gz -o profilecli.tar.gz - tar xzf profilecli.tar.gz + endpoints=("/debug/pprof/allocs" "/debug/pprof/block" "/debug/pprof/goroutine" "/debug/pprof/mutex" "/debug/pprof/profile?seconds=5") + curl -fL https://github.com/grafana/pyroscope/releases/download/v1.1.5/profilecli_1.1.5_linux_amd64.tar.gz -o profilecli.tar.gz + tar xzf profilecli.tar.gz - for endpoint in "${endpoints[@]}"; do - output=$(basename "$endpoint") - if [[ $endpoint == *"/profile"* ]]; then - output="profile" - fi - output="${output}.pprof" - # Download the content and save it to a file - curl -s "${FORGEJO_URL}${endpoint}" -o "${output}" - ./profilecli upload ${output} --url=${PROFILECLI_URL} + for endpoint in "${endpoints[@]}"; do + output=$(basename "$endpoint") + if [[ $endpoint == *"/profile"* ]]; then + output="profile" + fi + output="${output}.pprof" + # Download the content and save it to a file + curl -s "${FORGEJO_URL}${endpoint}" -o "${output}" + ./profilecli upload ${output} --url=${PROFILECLI_URL} - rm ${output} - done + rm ${output} + done } function test_forgejo_pprof() { - stop - docker rm -f test_pyroscope - docker run --name test_pyroscope --rm -d -p 4040:4040 docker.io/grafana/pyroscope + stop + docker rm -f test_pyroscope + docker run --name test_pyroscope --rm -d -p 4040:4040 docker.io/grafana/pyroscope - reset_forgejo $UPGRADE_DIR/default-app.ini - log_info "run 7.0-test" - start 7.0-test - test_upload_profiles - stop + reset_forgejo $UPGRADE_DIR/default-app.ini + log_info "run 7.0-test" + start 7.0-test + test_upload_profiles + stop - log_info "run 8.0-test" - start 8.0-test - test_upload_profiles - stop - - docker stop test_pyroscope + log_info "run 8.0-test" + start 8.0-test + test_upload_profiles + stop + + docker stop test_pyroscope } diff --git a/upgrade/upgrade.sh b/upgrade/upgrade.sh index 5b66d8c0..640cf045 100755 --- a/upgrade/upgrade.sh +++ b/upgrade/upgrade.sh @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT -UPGRADE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +UPGRADE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" function upgrade_reset() { local config=$1 @@ -11,7 +11,7 @@ function upgrade_reset() { function verify_storage() { local work_path=$DIR/forgejo-work-path - for path in ${STORAGE_PATHS} ; do + for path in ${STORAGE_PATHS}; do test -d $work_path/data/$path done } @@ -19,14 +19,14 @@ function verify_storage() { function cleanup_storage() { local work_path=$DIR/forgejo-work-path - for path in ${STORAGE_PATHS} ; do + for path in ${STORAGE_PATHS}; do rm -fr $work_path/data/$path done } function test_successful_upgrades() { stop - for config in $UPGRADE_DIR/default-app.ini ; do + for config in $UPGRADE_DIR/default-app.ini; do log_info "using $config" upgrade_reset $config @@ -38,7 +38,7 @@ function test_successful_upgrades() { fixture_assert doctor_run $config - for version in $RELEASE_NUMBERS_AND_DEV ; do + for version in $RELEASE_NUMBERS_AND_DEV; do stop log_info "run $version" start $version @@ -55,7 +55,7 @@ function test_gitea_upgrades() { echo gitea 1.21 forgejo 7.0-test echo gitea 1.21 forgejo 8.0-test echo gitea 1.22 forgejo 8.0-test - ) | while read gitea gitea_version forgejo forgejo_version ; do + ) | while read gitea gitea_version forgejo forgejo_version; do log_info "upgrading from Gitea $gitea_version to Forgejo $forgejo_version" stop upgrade_reset $config From 50c5908a91954b7b106aba27c8764149937565e5 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 7 Aug 2024 09:12:09 +0200 Subject: [PATCH 002/173] Forgejo v1.21 is EOL, v9.0 is dev --- actions/actions.sh | 2 +- forgejo/fixtures/storage.sh | 2 -- lib/lib.sh | 2 +- storage/storage.sh | 4 +--- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/actions/actions.sh b/actions/actions.sh index f467ba83..089efbfe 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -88,7 +88,7 @@ function actions_runner_version() { } function test_actions() { - local versions="${1:-1.21 $RELEASE_NUMBERS_AND_DEV}" + local versions="${1:-$RELEASE_NUMBERS_AND_DEV}" for version in $versions; do diff --git a/forgejo/fixtures/storage.sh b/forgejo/fixtures/storage.sh index cf893b84..80b7c70c 100644 --- a/forgejo/fixtures/storage.sh +++ b/forgejo/fixtures/storage.sh @@ -150,8 +150,6 @@ function fixture_avatars_assert_local() { function fixture_repo_avatars_create() { echo -n $ONEPIXEL | base64 --decode >$DIR/repo-avatar.png forgejo-curl.sh web --form avatar=@$DIR/repo-avatar.png http://${HOST_PORT}/${FORGEJO_USER}/${FORGEJO_REPO}/settings/avatar - # v1.21 only - #forgejo-curl.sh api_json -X POST --data-raw '{"body":"'$avatar'"}' http://${HOST_PORT}/api/v1/repos/${FORGEJO_USER}/${FORGEJO_REPO}/avatar } function fixture_repo_avatars_assert_s3() { diff --git a/lib/lib.sh b/lib/lib.sh index 295c0eb3..b5101caa 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -26,7 +26,7 @@ IP=$(hostname -I | cut -f1 -d' ') # # Forgejo releases for which a branch exists (7.0/forgejo etc.) # -RELEASE_NUMBERS="7.0 8.0" +RELEASE_NUMBERS="7.0 8.0 9.0" PREFIX=============== export DIR=/tmp/forgejo-end-to-end diff --git a/storage/storage.sh b/storage/storage.sh index e96a0d3c..6ace0987 100755 --- a/storage/storage.sh +++ b/storage/storage.sh @@ -31,9 +31,7 @@ function test_storage_stable_s3() { local work_path=$DIR/forgejo-work-path local s3_backend=${1:-minio} - log_info "See also https://codeberg.org/forgejo/forgejo/issues/1338" - - for version in 1.21 $RELEASE_NUMBERS_AND_DEV; do + for version in $RELEASE_NUMBERS_AND_DEV; do log_info "Forgejo $version & $s3_backend" stop storage_reset stable-s3 From f46d01885f550caa40748c84a36a6e7cdcd9d869 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 7 Aug 2024 09:17:29 +0200 Subject: [PATCH 003/173] packages: alpine: verify supported versions v8.0-dev should be supported too but it is not LTS: only care for 9.0-dev which is not different for Alpine. --- packages/alpine-1.21/package-source/APKBUILD | 26 --------- .../alpine-1.21/package-source/forgejo_2174 | 3 - .../package-source/forgejo_2174.init | 7 --- packages/alpine-1.21/test.sh | 58 ------------------- packages/alpine-7.0-test/test.sh | 2 +- packages/alpine-9.0-dev | 1 + packages/alpine.sh | 4 +- 7 files changed, 4 insertions(+), 97 deletions(-) delete mode 100644 packages/alpine-1.21/package-source/APKBUILD delete mode 100755 packages/alpine-1.21/package-source/forgejo_2174 delete mode 100755 packages/alpine-1.21/package-source/forgejo_2174.init delete mode 100755 packages/alpine-1.21/test.sh create mode 120000 packages/alpine-9.0-dev diff --git a/packages/alpine-1.21/package-source/APKBUILD b/packages/alpine-1.21/package-source/APKBUILD deleted file mode 100644 index ce75e29d..00000000 --- a/packages/alpine-1.21/package-source/APKBUILD +++ /dev/null @@ -1,26 +0,0 @@ -# -*- mode: Shell-script; eval: (setq indent-tabs-mode 't); eval: (setq tab-width 4) -*- -# Maintainer: Dominic Meiser -pkgname=forgejo-2174 -pkgver=1.0 -pkgrel=0 -pkgdesc="Forgejo #2174 Reproduction" -url="https://msrd0.dev/msrd0/$pkgname" -arch="x86_64" -license="custom" - -# using x86_64 instead of noarch as a workaround of -# https://codeberg.org/forgejo/forgejo/issues/2173 -subpackages="$pkgname-openrc::x86_64" - -source="forgejo_2174 forgejo_2174.init" -builddir="$srcdir" - -package() { - install -D -m755 "$srcdir/forgejo_2174" "$pkgdir"/usr/bin/forgejo_2174 - install -D -m755 "$srcdir/forgejo_2174.init" "$pkgdir"/etc/init.d/forgejo_2174 -} - -sha512sums=" -651c2a816510a18981bcd45077eb5acd6e58511d641949ddc690e326b81018d851eb7f1c88e2336eada2f216606ce2aa0569eb2d02d7c423c80705cc00acf838 forgejo_2174 -b1cba77139cdaf9e0cdd78de93becbb3891ec59646e8d2cb40620b230bd798d51e6d9c58e65b584812a6bb8eb2b9c9f89262a8700a39c62af8ec8ea09aee4e29 forgejo_2174.init -" diff --git a/packages/alpine-1.21/package-source/forgejo_2174 b/packages/alpine-1.21/package-source/forgejo_2174 deleted file mode 100755 index b12f87b3..00000000 --- a/packages/alpine-1.21/package-source/forgejo_2174 +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -echo "Hello World" diff --git a/packages/alpine-1.21/package-source/forgejo_2174.init b/packages/alpine-1.21/package-source/forgejo_2174.init deleted file mode 100755 index 06b7f209..00000000 --- a/packages/alpine-1.21/package-source/forgejo_2174.init +++ /dev/null @@ -1,7 +0,0 @@ -#!/sbin/openrc-run - -command="/usr/bin/forgejo_2174" - -depend() { - need net -} diff --git a/packages/alpine-1.21/test.sh b/packages/alpine-1.21/test.sh deleted file mode 100755 index 93a3aba2..00000000 --- a/packages/alpine-1.21/test.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/busybox ash -set -exuo pipefail - -forgejo_url=$1 -forgejo_token=$2 - -# initialize abuild -apk update -apk add --no-cache alpine-sdk sudo util-linux -adduser -D user -h /home/user -addgroup user abuild -echo "root ALL=(ALL) ALL" >/etc/sudoers -echo "%abuild ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers -mkdir -p /var/cache/distfiles -chgrp abuild /var/cache/distfiles -chmod 775 /var/cache/distfiles -mkdir -p "/home/user/.abuild" -echo "/home/user/.abuild/user.rsa" | abuild-keygen -i -b 4096 -echo 'PACKAGER_PRIVKEY=/home/user/.abuild/user.rsa' >/home/user/.abuild/abuild.conf -chown -R "user:user" /home/user/ - -# make sure we own the relevant directory -cp -r package-source /srv/alpine -cd /srv -mkdir packages -echo "REPODEST=/srv/packages" >>/home/user/.abuild/abuild.conf -cat /home/user/.abuild/abuild.conf -chown -R user:user alpine packages - -# build the package -sudo -u user APKBUILD=alpine/APKBUILD abuild -r - -# upload new package -cd packages/srv/x86_64/ -for file in $(find . -name '*.apk' -type f | sed -e 's,./,,'); do - # remove old package - curl \ - --fail \ - -H "Authorization: token $forgejo_token" \ - -X DELETE \ - "$forgejo_url/api/packages/root/alpine/3.19/forgejo-2174/$file" || - true - - # upload new package - curl \ - --fail \ - -H "Authorization: token $forgejo_token" \ - -T "$file" \ - "$forgejo_url/api/packages/root/alpine/3.19/forgejo-2174" -done - -# ensure that the install-if condition works as expected -apk add openrc -(cd /etc/apk/keys && curl -JO $forgejo_url/api/packages/root/alpine/key) -echo "$forgejo_url/api/packages/root/alpine/3.19/forgejo-2174" >>/etc/apk/repositories -apk add forgejo-2174 -[ -e /usr/bin/forgejo_2174 ] # from the installed package -[ -e /etc/init.d/forgejo_2174 ] # from the -openrc package installed because of the install-if condition diff --git a/packages/alpine-7.0-test/test.sh b/packages/alpine-7.0-test/test.sh index 82565d04..d830df29 100755 --- a/packages/alpine-7.0-test/test.sh +++ b/packages/alpine-7.0-test/test.sh @@ -6,7 +6,7 @@ forgejo_token=$2 # initialize abuild apk update -apk add --no-cache alpine-sdk sudo util-linux +apk add --no-cache alpine-sdk sudo util-linux curl adduser -D user -h /home/user addgroup user abuild echo "root ALL=(ALL) ALL" >/etc/sudoers diff --git a/packages/alpine-9.0-dev b/packages/alpine-9.0-dev new file mode 120000 index 00000000..a2389c03 --- /dev/null +++ b/packages/alpine-9.0-dev @@ -0,0 +1 @@ +alpine-7.0-test \ No newline at end of file diff --git a/packages/alpine.sh b/packages/alpine.sh index 79595ae6..3a4ea78c 100644 --- a/packages/alpine.sh +++ b/packages/alpine.sh @@ -16,8 +16,8 @@ function test_packages_alpine_version() { } function test_packages_alpine() { - for alpine_version in 3.18 3.19; do - for forgejo_version in 1.21 7.0-test 7.0-dev; do + for alpine_version in 3.19 3.20; do + for forgejo_version in 7.0-dev 9.0-dev; do test_packages_alpine_version $alpine_version $forgejo_version done done From 497a5d76bbe2fd6d2f9d48cafbbefd70b17e7901 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 7 Aug 2024 09:18:25 +0200 Subject: [PATCH 004/173] actions: trim v1.20 & v1.21 specific comment --- actions/example-if-cancel/.forgejo/workflows/test.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/actions/example-if-cancel/.forgejo/workflows/test.yml b/actions/example-if-cancel/.forgejo/workflows/test.yml index 5a921988..d6800175 100644 --- a/actions/example-if-cancel/.forgejo/workflows/test.yml +++ b/actions/example-if-cancel/.forgejo/workflows/test.yml @@ -1,9 +1,3 @@ -# -# As of Forgejo v1.20 running this example would require using the web -# endpoints because there is no API to do the same. -# -# It was manually tested to **not work** with Forgejo v1.21 & runner 3.0.1 -# on: [push] jobs: From d872865242ddc8a078bec8365ef5ee6b6064d0c7 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 7 Aug 2024 09:36:16 +0200 Subject: [PATCH 005/173] test Forgejo upgrades starting with v7.0 instead of v1.21 --- upgrade/upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upgrade/upgrade.sh b/upgrade/upgrade.sh index 640cf045..9d29aa83 100755 --- a/upgrade/upgrade.sh +++ b/upgrade/upgrade.sh @@ -30,7 +30,7 @@ function test_successful_upgrades() { log_info "using $config" upgrade_reset $config - version=1.21 + version=7.0 log_info "run $version" cleanup_storage start $version From 944dd9872703a75cc2870aeb4f4f10c283970e69 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 7 Aug 2024 09:36:50 +0200 Subject: [PATCH 006/173] test Gitea upgrades with v7.0 and v9.0 the upgrade path from Gitea v1.21 & v1.22 to v8.0 was tested before it was published. The patch releases for v8.0 will only include bug fixes and no database upgrades: they are the only kind of changes that could cause a problem with upgrades. --- upgrade/upgrade.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upgrade/upgrade.sh b/upgrade/upgrade.sh index 9d29aa83..60e6faca 100755 --- a/upgrade/upgrade.sh +++ b/upgrade/upgrade.sh @@ -52,9 +52,9 @@ function test_successful_upgrades() { function test_gitea_upgrades() { local config=$UPGRADE_DIR/default-app.ini ( - echo gitea 1.21 forgejo 7.0-test - echo gitea 1.21 forgejo 8.0-test - echo gitea 1.22 forgejo 8.0-test + echo gitea 1.21 forgejo 7.0-dev + echo gitea 1.21 forgejo 9.0-dev + echo gitea 1.22 forgejo 9.0-dev ) | while read gitea gitea_version forgejo forgejo_version; do log_info "upgrading from Gitea $gitea_version to Forgejo $forgejo_version" stop From af9305b221fd0b53ab4787a3544bf7c3c9396ef9 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 7 Aug 2024 09:38:32 +0200 Subject: [PATCH 007/173] README: link to v7.0 documentation instead of v1.21 --- README.md | 4 ++-- end-to-end.sh | 10 ---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 257e5b66..fa8c10e6 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,13 @@ as: { "insecure-registries": [ "10.0.0.0/8" ] } -``` +``` Use setup-forgejo from source. The [setup-forgejo](https://code.forgejo.org/actions/setup-forgejo) repository is a [Forgejo -Action](https://forgejo.org/docs/v1.21/user/actions/) which is meant +Action](https://forgejo.org/docs/v7.0/user/actions/) which is meant to be used in workflows. However, it is implemented as shell scripts that can also be used to create Forgejo instances and runners locally. This is convenient for testing and the reason why it needs to be added to the PATH. diff --git a/end-to-end.sh b/end-to-end.sh index 05865ac6..3b3a702a 100755 --- a/end-to-end.sh +++ b/end-to-end.sh @@ -1,16 +1,6 @@ #!/bin/bash # SPDX-License-Identifier: MIT -# -# Debug loop from the source tree: -# -# ./end-to-end.sh dependencies -# ./end-to-end.sh build_all -# VERBOSE=true ./end-to-end.sh test_downgrade_1.20.2_fails -# -# Everything happens in /tmp/forgejo-end-to-end -# - SELF_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SELF="${BASH_SOURCE[0]}" source $SELF_DIR/lib/lib.sh From 0f4173555f965f46fd0481cbfe5155adaf45abdb Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 7 Aug 2024 09:56:02 +0200 Subject: [PATCH 008/173] forgejo: fix sources Gitea compatibility It is cosmetic, keep it accurate. --- forgejo/sources/7.0 | 2 +- forgejo/sources/8.0 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/forgejo/sources/7.0 b/forgejo/sources/7.0 index b033f014..0e2cc26e 100644 --- a/forgejo/sources/7.0 +++ b/forgejo/sources/7.0 @@ -1 +1 @@ -https://codeberg.org/forgejo/forgejo v7.0/forgejo 7.0.0+gitea-1.22.0 +https://codeberg.org/forgejo/forgejo v7.0/forgejo 7.0.0+gitea-1.21.0 diff --git a/forgejo/sources/8.0 b/forgejo/sources/8.0 index 3c5a3ec6..42ce80b7 100644 --- a/forgejo/sources/8.0 +++ b/forgejo/sources/8.0 @@ -1 +1 @@ -https://codeberg.org/forgejo/forgejo forgejo 8.0.0+gitea-1.21.0 +https://codeberg.org/forgejo/forgejo v8.0/forgejo 8.0.0+gitea-1.22.0 From 6224249696769f138e1c5499a561d6cc821d6791 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 7 Aug 2024 11:49:17 +0200 Subject: [PATCH 009/173] upgrade: test pprof against the two active stable releases --- upgrade/test-pprof-upload.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/upgrade/test-pprof-upload.sh b/upgrade/test-pprof-upload.sh index 48dada45..48e00055 100644 --- a/upgrade/test-pprof-upload.sh +++ b/upgrade/test-pprof-upload.sh @@ -28,13 +28,13 @@ function test_forgejo_pprof() { docker run --name test_pyroscope --rm -d -p 4040:4040 docker.io/grafana/pyroscope reset_forgejo $UPGRADE_DIR/default-app.ini - log_info "run 7.0-test" - start 7.0-test + log_info "run 7.0-dev" + start 7.0-dev test_upload_profiles stop - log_info "run 8.0-test" - start 8.0-test + log_info "run 9.0-dev" + start 9.0-dev test_upload_profiles stop From 427c46dbf95685b0e32bb450198f836580d56d60 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 8 Aug 2024 16:48:39 +0200 Subject: [PATCH 010/173] lib: remove RELEASE_NUMBERS_AND_DEV, use RELEASE_NUMBERS In the lifecycle of vX.Y.Z, all tests are run against vX.Y-test before it is published, including when the tag is pushed because the automated release process now runs end-to-end before pushing the release to forgejo-experimental. Running end-to-end against vX.Y-dev is therefore redundant with at least two other runs with exactly the same SHA (the one before the tag is pushed and the one when the tag is pushed). There would be value in doing that if it allowed to detect race conditions in Forgejo. But such races were not found in the past six months and there is a lot more scrutiny on commits merged in Forgejo which makes it even less likely than it was before. Running the tests on vX.Y instead of also including the built version provide the same coverage and reduces the workload. --- actions/actions.sh | 2 +- federation/federation.sh | 2 +- lib/lib.sh | 1 - packages/alpine-7.0-dev | 1 - .../package-source/forgejo-2173/APKBUILD | 0 .../package-source/forgejo-2173/forgejo_2173 | 0 .../package-source/forgejo-2173/forgejo_2173.init | 0 .../package-source/forgejo-2174/APKBUILD | 0 .../package-source/forgejo-2174/forgejo_2174 | 0 .../package-source/forgejo-2174/forgejo_2174.init | 0 packages/{alpine-7.0-test => alpine-7.0}/test.sh | 0 packages/alpine-9.0 | 1 + packages/alpine-9.0-dev | 1 - storage/storage.sh | 2 +- upgrade/upgrade.sh | 2 +- 15 files changed, 5 insertions(+), 7 deletions(-) delete mode 120000 packages/alpine-7.0-dev rename packages/{alpine-7.0-test => alpine-7.0}/package-source/forgejo-2173/APKBUILD (100%) rename packages/{alpine-7.0-test => alpine-7.0}/package-source/forgejo-2173/forgejo_2173 (100%) rename packages/{alpine-7.0-test => alpine-7.0}/package-source/forgejo-2173/forgejo_2173.init (100%) rename packages/{alpine-7.0-test => alpine-7.0}/package-source/forgejo-2174/APKBUILD (100%) rename packages/{alpine-7.0-test => alpine-7.0}/package-source/forgejo-2174/forgejo_2174 (100%) rename packages/{alpine-7.0-test => alpine-7.0}/package-source/forgejo-2174/forgejo_2174.init (100%) rename packages/{alpine-7.0-test => alpine-7.0}/test.sh (100%) create mode 120000 packages/alpine-9.0 delete mode 120000 packages/alpine-9.0-dev diff --git a/actions/actions.sh b/actions/actions.sh index 089efbfe..b4117783 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -88,7 +88,7 @@ function actions_runner_version() { } function test_actions() { - local versions="${1:-$RELEASE_NUMBERS_AND_DEV}" + local versions="${1:-$RELEASE_NUMBERS}" for version in $versions; do diff --git a/federation/federation.sh b/federation/federation.sh index f0acfcfe..e3e7ab7a 100755 --- a/federation/federation.sh +++ b/federation/federation.sh @@ -69,7 +69,7 @@ function test_federation() { # start_gitlab octobus/heptapod:1.5.3 federation_setup_variables - local versions="${1:-$RELEASE_NUMBERS_AND_DEV}" + local versions="${1:-$RELEASE_NUMBERS}" for version in $versions; do diff --git a/lib/lib.sh b/lib/lib.sh index b5101caa..9dc8ee34 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -35,7 +35,6 @@ export DOT_FORGEJO_CURL=$DIR/forgejo-curl export DOT=$DOT_FORGEJO_CURL # for backward compatibility with forgejo-curl.sh 1.0.0 : ${FORGEJO_USER:=root} : ${FORGEJO_PASSWORD:=admin1234} -: ${RELEASE_NUMBERS_AND_DEV:="$(for r in $RELEASE_NUMBERS; do echo -n "$r $r-dev "; done)"} ORGANIZATIONS=$(cat $LIB_DIR/ORGANIZATIONS) function log_info() { diff --git a/packages/alpine-7.0-dev b/packages/alpine-7.0-dev deleted file mode 120000 index a2389c03..00000000 --- a/packages/alpine-7.0-dev +++ /dev/null @@ -1 +0,0 @@ -alpine-7.0-test \ No newline at end of file diff --git a/packages/alpine-7.0-test/package-source/forgejo-2173/APKBUILD b/packages/alpine-7.0/package-source/forgejo-2173/APKBUILD similarity index 100% rename from packages/alpine-7.0-test/package-source/forgejo-2173/APKBUILD rename to packages/alpine-7.0/package-source/forgejo-2173/APKBUILD diff --git a/packages/alpine-7.0-test/package-source/forgejo-2173/forgejo_2173 b/packages/alpine-7.0/package-source/forgejo-2173/forgejo_2173 similarity index 100% rename from packages/alpine-7.0-test/package-source/forgejo-2173/forgejo_2173 rename to packages/alpine-7.0/package-source/forgejo-2173/forgejo_2173 diff --git a/packages/alpine-7.0-test/package-source/forgejo-2173/forgejo_2173.init b/packages/alpine-7.0/package-source/forgejo-2173/forgejo_2173.init similarity index 100% rename from packages/alpine-7.0-test/package-source/forgejo-2173/forgejo_2173.init rename to packages/alpine-7.0/package-source/forgejo-2173/forgejo_2173.init diff --git a/packages/alpine-7.0-test/package-source/forgejo-2174/APKBUILD b/packages/alpine-7.0/package-source/forgejo-2174/APKBUILD similarity index 100% rename from packages/alpine-7.0-test/package-source/forgejo-2174/APKBUILD rename to packages/alpine-7.0/package-source/forgejo-2174/APKBUILD diff --git a/packages/alpine-7.0-test/package-source/forgejo-2174/forgejo_2174 b/packages/alpine-7.0/package-source/forgejo-2174/forgejo_2174 similarity index 100% rename from packages/alpine-7.0-test/package-source/forgejo-2174/forgejo_2174 rename to packages/alpine-7.0/package-source/forgejo-2174/forgejo_2174 diff --git a/packages/alpine-7.0-test/package-source/forgejo-2174/forgejo_2174.init b/packages/alpine-7.0/package-source/forgejo-2174/forgejo_2174.init similarity index 100% rename from packages/alpine-7.0-test/package-source/forgejo-2174/forgejo_2174.init rename to packages/alpine-7.0/package-source/forgejo-2174/forgejo_2174.init diff --git a/packages/alpine-7.0-test/test.sh b/packages/alpine-7.0/test.sh similarity index 100% rename from packages/alpine-7.0-test/test.sh rename to packages/alpine-7.0/test.sh diff --git a/packages/alpine-9.0 b/packages/alpine-9.0 new file mode 120000 index 00000000..b34295a0 --- /dev/null +++ b/packages/alpine-9.0 @@ -0,0 +1 @@ +alpine-7.0 \ No newline at end of file diff --git a/packages/alpine-9.0-dev b/packages/alpine-9.0-dev deleted file mode 120000 index a2389c03..00000000 --- a/packages/alpine-9.0-dev +++ /dev/null @@ -1 +0,0 @@ -alpine-7.0-test \ No newline at end of file diff --git a/storage/storage.sh b/storage/storage.sh index 6ace0987..8fdb64fc 100755 --- a/storage/storage.sh +++ b/storage/storage.sh @@ -31,7 +31,7 @@ function test_storage_stable_s3() { local work_path=$DIR/forgejo-work-path local s3_backend=${1:-minio} - for version in $RELEASE_NUMBERS_AND_DEV; do + for version in $RELEASE_NUMBERS; do log_info "Forgejo $version & $s3_backend" stop storage_reset stable-s3 diff --git a/upgrade/upgrade.sh b/upgrade/upgrade.sh index 60e6faca..79c65ccf 100755 --- a/upgrade/upgrade.sh +++ b/upgrade/upgrade.sh @@ -38,7 +38,7 @@ function test_successful_upgrades() { fixture_assert doctor_run $config - for version in $RELEASE_NUMBERS_AND_DEV; do + for version in $RELEASE_NUMBERS; do stop log_info "run $version" start $version From 149c6a545cf206580c1b50899c4a0e1678ffa136 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 8 Aug 2024 17:05:42 +0200 Subject: [PATCH 011/173] lib: source build replace the matching release Instead of having an explicit vX.Y-dev version to be referenced explicitly, a binary built from source replaces the matching version. For instance, if forgejo/build-from-sources contains v9.0, * the development branch is compiled from source * the v9.0 artifact is uploaded * prior to running any test, the artificat is downloaded and used * the v9.0 binary is not downloaded from forgejo/experimental/integration because it is already present The vX.Y release is built daily and the end-to-end tests run on it. If a regression is introduced, it will be spotted within 24h. Compiling from source is used when the Forgejo runs the end-to-end suite on a specific pull request. --- .forgejo/workflows/end-to-end.yml | 16 +++++++++++----- lib/lib.sh | 12 ------------ packages/alpine.sh | 2 +- upgrade/test-pprof-upload.sh | 8 ++++---- upgrade/upgrade.sh | 7 +++---- 5 files changed, 19 insertions(+), 26 deletions(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 83ce3884..05d43c56 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -31,8 +31,15 @@ jobs: go-version: "1.22" - name: lib/build.sh run: | - set -x + mkdir $d /tmp/forgejo-upload + touch /tmp/forgejo-upload/PLACEHOLDER + if ! test -f forgejo/build-from-sources; then + echo forgejo/build-from-sources is not present, do not build any version from source + exit 0 + fi + + set -x # # SQLite needs gcc to be compiled # @@ -41,13 +48,12 @@ jobs: apt-get -q install -y -qq build-essential d=/tmp/forgejo-binaries - mkdir $d /tmp/forgejo-upload - for version in $(ls forgejo/sources) ; do - forgejo=$d/forgejo-$version-dev + for version in $(cat forgejo/build-from-sources) ; do lib/build.sh $version $d + forgejo=$d/forgejo-$version-dev $forgejo --version - mv $forgejo /tmp/forgejo-upload + mv $forgejo /tmp/forgejo-upload/forgejo-$version done - uses: actions/upload-artifact@v3 with: diff --git a/lib/lib.sh b/lib/lib.sh index 9dc8ee34..a7471b88 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -70,18 +70,6 @@ function dependencies() { fi } -function build_all() { - for dev in $RELEASE_NUMBERS; do - local forgejo=$DIR_BINARIES/forgejo-$dev-dev - if test -f $forgejo; then - log_info $dev already exists - else - $LIB_DIR/build.sh $dev $DIR_BINARIES - log_info $dev built from sources - fi - done -} - function retry() { rm -f $DIR/wait-for.out success=false diff --git a/packages/alpine.sh b/packages/alpine.sh index 3a4ea78c..4ae92ae4 100644 --- a/packages/alpine.sh +++ b/packages/alpine.sh @@ -17,7 +17,7 @@ function test_packages_alpine_version() { function test_packages_alpine() { for alpine_version in 3.19 3.20; do - for forgejo_version in 7.0-dev 9.0-dev; do + for forgejo_version in 7.0 9.0; do test_packages_alpine_version $alpine_version $forgejo_version done done diff --git a/upgrade/test-pprof-upload.sh b/upgrade/test-pprof-upload.sh index 48e00055..5c676871 100644 --- a/upgrade/test-pprof-upload.sh +++ b/upgrade/test-pprof-upload.sh @@ -28,13 +28,13 @@ function test_forgejo_pprof() { docker run --name test_pyroscope --rm -d -p 4040:4040 docker.io/grafana/pyroscope reset_forgejo $UPGRADE_DIR/default-app.ini - log_info "run 7.0-dev" - start 7.0-dev + log_info "run 7.0" + start 7.0 test_upload_profiles stop - log_info "run 9.0-dev" - start 9.0-dev + log_info "run 9.0" + start 9.0 test_upload_profiles stop diff --git a/upgrade/upgrade.sh b/upgrade/upgrade.sh index 79c65ccf..fb2f8c8b 100755 --- a/upgrade/upgrade.sh +++ b/upgrade/upgrade.sh @@ -52,9 +52,9 @@ function test_successful_upgrades() { function test_gitea_upgrades() { local config=$UPGRADE_DIR/default-app.ini ( - echo gitea 1.21 forgejo 7.0-dev - echo gitea 1.21 forgejo 9.0-dev - echo gitea 1.22 forgejo 9.0-dev + echo gitea 1.21 forgejo 7.0 + echo gitea 1.21 forgejo 9.0 + echo gitea 1.22 forgejo 9.0 ) | while read gitea gitea_version forgejo forgejo_version; do log_info "upgrading from Gitea $gitea_version to Forgejo $forgejo_version" stop @@ -81,7 +81,6 @@ source $UPGRADE_DIR/test-pprof-upload.sh function test_upgrades() { run dependencies - run build_all run test_successful_upgrades run test_forgejo_pprof From 8636471d6356325f34ea6afbe4a6735201d4ffcf Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 11 Aug 2024 11:38:52 +0200 Subject: [PATCH 012/173] actions: verify the log compression feature If running Forgejo >= v9.0, verify the logs are compressed by default --- actions/actions.sh | 24 +++++++++++++++++++++--- actions/feature-logs-compression/run.sh | 8 ++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100755 actions/feature-logs-compression/run.sh diff --git a/actions/actions.sh b/actions/actions.sh index b4117783..7bcc4dfc 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -3,13 +3,27 @@ ACTIONS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -function actions_verify_example() { - local example=$1 - +function actions_export_variables() { export HOST_PORT export url=http://${FORGEJO_USER}:${FORGEJO_PASSWORD}@${HOST_PORT} export token=$(cat $DOT_FORGEJO_CURL/token) +} +function actions_verify_feature() { + local feature=$1 + + actions_export_variables + + export FEATURE_DIR=$ACTIONS_DIR/feature-$feature + + echo "============================ RUN feature-$feature ===================" + bash -ex $FEATURE_DIR/run.sh || return 1 +} + +function actions_verify_example() { + local example=$1 + + actions_export_variables actions_cleanup_example_volume export example @@ -124,5 +138,9 @@ function test_actions() { run actions_verify_example $example done fi + + if dpkg --compare-versions $version ge 9.0; then + run actions_verify_feature logs-compression + fi done } diff --git a/actions/feature-logs-compression/run.sh b/actions/feature-logs-compression/run.sh new file mode 100755 index 00000000..c1cd2596 --- /dev/null +++ b/actions/feature-logs-compression/run.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +source $FEATURE_DIR/../../lib/lib.sh +source $FEATURE_DIR/../../forgejo/fixtures.sh + +fixture_get_one_path local data/actions_log/root/example-echo/01/1.log.zst From 75503c5396e9a205cf2c8d8f06c2aa5d84865dd7 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Fri, 23 Aug 2024 16:19:22 +0200 Subject: [PATCH 013/173] actions: feature: compression: do not hardcode the log path The log path depends on the previous actions run and may not always be 01/1.log.zst. Assuming it is makes this test fragile as it is influenced by which previous tests are run and what they do. --- actions/feature-logs-compression/run.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/actions/feature-logs-compression/run.sh b/actions/feature-logs-compression/run.sh index c1cd2596..174a24d7 100755 --- a/actions/feature-logs-compression/run.sh +++ b/actions/feature-logs-compression/run.sh @@ -5,4 +5,11 @@ set -e source $FEATURE_DIR/../../lib/lib.sh source $FEATURE_DIR/../../forgejo/fixtures.sh -fixture_get_one_path local data/actions_log/root/example-echo/01/1.log.zst +if ! fixture_get_one_path local data/actions_log/root/example-echo | grep --quiet log.zst; then + ( + cd $DIR/forgejo-work-path + find data + ) + echo expected a single log.zst file in data/actions_log/root/example-echo + exit 1 +fi From 427d9ed2673a618aa92bd20460aea359415674b7 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Fri, 23 Aug 2024 14:53:04 +0200 Subject: [PATCH 014/173] tests: upgrade setup-forgejo to v2.0.2 --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index ad0e706b..3bf04135 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://code.forgejo.org/actions/setup-forgejo@v2 + - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.2 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 1f2f98fb2193987190d7f495f416c90bb3c8aa39 Mon Sep 17 00:00:00 2001 From: limiting-factor Date: Mon, 2 Sep 2024 11:45:26 +0200 Subject: [PATCH 015/173] lib: reduce GitLab noise The absence of the test-gitlab container will display Error response from daemon: No such container: test-gitlab which can be mistaken as an actual error where in fact it should be ignored. --- lib/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib.sh b/lib/lib.sh index a7471b88..3e21377f 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -217,7 +217,7 @@ function start_gitlab() { } function stop_gitlab() { - docker rm -f test-gitlab + docker rm -f test-gitlab >&/dev/null } function stop_forgejo() { From 94289bc80dd400634d894bb79f8bcc68e71ad223 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 25 Sep 2024 14:12:49 +0200 Subject: [PATCH 016/173] v10.0 development cycle started --- forgejo/sources/10.0 | 1 + lib/lib.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 forgejo/sources/10.0 diff --git a/forgejo/sources/10.0 b/forgejo/sources/10.0 new file mode 100644 index 00000000..101d770d --- /dev/null +++ b/forgejo/sources/10.0 @@ -0,0 +1 @@ +https://codeberg.org/forgejo/forgejo forgejo 10.0.0+gitea-1.23 diff --git a/lib/lib.sh b/lib/lib.sh index 3e21377f..4b489a04 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -26,7 +26,7 @@ IP=$(hostname -I | cut -f1 -d' ') # # Forgejo releases for which a branch exists (7.0/forgejo etc.) # -RELEASE_NUMBERS="7.0 8.0 9.0" +RELEASE_NUMBERS="7.0 9.0 10.0" PREFIX=============== export DIR=/tmp/forgejo-end-to-end From 294ca18400198eec3f2e1d43eaba0199583cd889 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 6 Oct 2024 06:22:58 +0200 Subject: [PATCH 017/173] README: update local testing instructions --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fa8c10e6..4b5808aa 100644 --- a/README.md +++ b/README.md @@ -50,25 +50,26 @@ cd end-to-end ```sh make TAGS='bindata sqlite sqlite_unlock_notify' generate forgejo -cp -a forgejo /srv/forgejo-binaries/forgejo-8.0-dev +cp -a forgejo /srv/forgejo-binaries/forgejo-10.0 ``` -It will be used whenever the version `8.0-dev` is specified in a test. +It will be used whenever the version `10.0` is specified in a test. ## Running actions locally To run and debug workflows from `actions/example-*`, from the root of the source directory, with docker and forgejo-curl.sh installed, mimic -what `.forgejo/workflows/actions.yml` does. There may be some manual +what `.forgejo/workflows/end-to-end.yml` does. There may be some manual tweaking (such as creating temporary directories) because the tests run as root in the context of Forgejo Actions and assume they have admin permissions. But they do not need to run as root and must work fine when run as a regular user. ```sh -./end-to-end.sh actions_setup 1.21 +./end-to-end.sh run dependencies +./end-to-end.sh actions_setup 10.0 firefox 0.0.0.0:3000 # user root / admin1234 -./end-to-end.sh actions_verify_example artifacts +./end-to-end.sh actions_verify_example echo ./end-to-end.sh actions_teardown ``` ## Running other tests locally From f48fa029169d05e04f2a7fe13fbf099ffd9ed3e7 Mon Sep 17 00:00:00 2001 From: Kwonunn Date: Sun, 6 Oct 2024 16:53:11 +0200 Subject: [PATCH 018/173] WIP: Add test for schedule not being cancelled --- .../.forgejo/workflows/test.yml | 8 ++++++++ actions/example-schedule-noncancel/run.sh | 18 ++++++++++++++++++ actions/example-schedule-noncancel/teardown.sh | 4 ++++ 3 files changed, 30 insertions(+) create mode 100644 actions/example-schedule-noncancel/.forgejo/workflows/test.yml create mode 100755 actions/example-schedule-noncancel/run.sh create mode 100644 actions/example-schedule-noncancel/teardown.sh diff --git a/actions/example-schedule-noncancel/.forgejo/workflows/test.yml b/actions/example-schedule-noncancel/.forgejo/workflows/test.yml new file mode 100644 index 00000000..e0015c38 --- /dev/null +++ b/actions/example-schedule-noncancel/.forgejo/workflows/test.yml @@ -0,0 +1,8 @@ +on: + schedule: + - cron: "* * * * *" +jobs: + test: + runs-on: docker + steps: + - run: sleep 15 diff --git a/actions/example-schedule-noncancel/run.sh b/actions/example-schedule-noncancel/run.sh new file mode 100755 index 00000000..9fa275d1 --- /dev/null +++ b/actions/example-schedule-noncancel/run.sh @@ -0,0 +1,18 @@ +repo=root/example-$example +# +# push the repository +# +forgejo-test-helper.sh push_workflow actions/example-$example $url root example-$example setup-forgejo $token +sha=$(forgejo-test-helper.sh branch_tip $url $repo main) +# +# wait for the workflow (sleep infinity) to start running +# +forgejo-test-helper.sh wait_running $url $repo $sha +# +# push to the same branch +# +forgejo-test-helper.sh push_workflow actions/example-echo $url root example-$example setup-forgejo $token +# +# wait for the workflow to be canceled as a result of the previous push +# +forgejo-test-helper.sh wait_success $url $repo $sha diff --git a/actions/example-schedule-noncancel/teardown.sh b/actions/example-schedule-noncancel/teardown.sh new file mode 100644 index 00000000..ae9987a3 --- /dev/null +++ b/actions/example-schedule-noncancel/teardown.sh @@ -0,0 +1,4 @@ +# +# this will effectively discard any linger workflow so they do not interfere with other tests +# +forgejo-runner.sh reload From 631055d190d2474a11affb0fb71704fabdd3710c Mon Sep 17 00:00:00 2001 From: Kwonunn Date: Sat, 12 Oct 2024 15:11:14 +0200 Subject: [PATCH 019/173] rewrite schedule cancelling test --- .../{test.yml => schedule_continue.yml} | 0 actions/example-schedule-noncancel/run.sh | 80 +++++++++++++++++-- 2 files changed, 74 insertions(+), 6 deletions(-) rename actions/example-schedule-noncancel/.forgejo/workflows/{test.yml => schedule_continue.yml} (100%) diff --git a/actions/example-schedule-noncancel/.forgejo/workflows/test.yml b/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml similarity index 100% rename from actions/example-schedule-noncancel/.forgejo/workflows/test.yml rename to actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml diff --git a/actions/example-schedule-noncancel/run.sh b/actions/example-schedule-noncancel/run.sh index 9fa275d1..5d0af814 100755 --- a/actions/example-schedule-noncancel/run.sh +++ b/actions/example-schedule-noncancel/run.sh @@ -1,18 +1,86 @@ repo=root/example-$example +# +# delete the repository +# +api=$url/api/v1 +forgejo-curl.sh api_json -X DELETE $api/repos/root/example-$example + # # push the repository # forgejo-test-helper.sh push_workflow actions/example-$example $url root example-$example setup-forgejo $token -sha=$(forgejo-test-helper.sh branch_tip $url $repo main) + +# Prevent test failure because the db is occupied +sqlite3 $DIR/forgejo-work-path/forgejo.db "pragma busy_timeout=20000" + # -# wait for the workflow (sleep infinity) to start running +# get the run id of the workflow that just started # -forgejo-test-helper.sh wait_running $url $repo $sha +getScheduleRun() { + sqlite3 $DIR/forgejo-work-path/forgejo.db \ + "select action_run.id \ + from action_run \ + inner join action_schedule on action_run.schedule_id = action_schedule.id \ + inner join repository on action_schedule.repo_id = repository.id \ + where repository.name = 'example-schedule-noncancel' \ + order by action_run.created desc limit 1" +} + +run_id=$(getScheduleRun) +while [ -z $run_id ]; do + echo waiting 5... + sleep 5 + run_id=$(getScheduleRun) +done + +echo Schedule run id: $run_id + # -# push to the same branch +# Wait for it to be started +# +checkStarted() { + sqlite3 $DIR/forgejo-work-path/forgejo.db \ + "select id \ + from action_run \ + where id = $run_id \ + and started is not null" +} + +started_check=$(checkStarted) +while [ -z $started_check ]; do + echo waiting 2... + sleep 2 + started_check=$(checkStarted) +done + +echo Run has started +echo Push to repo again + +# +# Push to the repo again # forgejo-test-helper.sh push_workflow actions/example-echo $url root example-$example setup-forgejo $token + # -# wait for the workflow to be canceled as a result of the previous push +# Wait for the workflow to finish anyway # -forgejo-test-helper.sh wait_success $url $repo $sha +echo Wait for workflow to finish + +checkFinished() { + sqlite3 $DIR/forgejo-work-path/forgejo.db \ + "select status \ + from action_run \ + where id = $run_id \ + and status != 6" +} + +finished_status=$(checkFinished) +while [ -z $finished_status ]; do + echo waiting 5... + sleep 5 + finished_status=$(checkFinished) +done + +echo Workflow finished. + +test $finished_status = 1 From c3eb8918b444b8262db0e7c24db9863338a1b20c Mon Sep 17 00:00:00 2001 From: Kwonunn Date: Sun, 13 Oct 2024 12:45:19 +0200 Subject: [PATCH 020/173] implement waiting based on a file --- .../.forgejo/workflows/schedule_continue.yml | 8 +++++++- actions/example-schedule-noncancel/run.sh | 10 ++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml b/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml index e0015c38..8fe7177a 100644 --- a/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml +++ b/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml @@ -4,5 +4,11 @@ on: jobs: test: runs-on: docker + container: + image: code.forgejo.org/oci/debian:bookworm + options: "--volume /srv/example:/srv/example" steps: - - run: sleep 15 + - run: | + while ! [ -f /srv/example/schedule-noncancel/PUSHED ]; do + sleep 3 + done diff --git a/actions/example-schedule-noncancel/run.sh b/actions/example-schedule-noncancel/run.sh index 5d0af814..810e634d 100755 --- a/actions/example-schedule-noncancel/run.sh +++ b/actions/example-schedule-noncancel/run.sh @@ -3,7 +3,9 @@ repo=root/example-$example # delete the repository # api=$url/api/v1 -forgejo-curl.sh api_json -X DELETE $api/repos/root/example-$example +if forgejo-curl.sh api_json -X GET $api/repos/root/example-$example; then + forgejo-curl.sh api_json -X DELETE $api/repos/root/example-$example +fi # # push the repository @@ -61,6 +63,10 @@ echo Push to repo again # forgejo-test-helper.sh push_workflow actions/example-echo $url root example-$example setup-forgejo $token +echo Signal to the workflow that the push has happened +mkdir -p /srv/example/schedule-noncancel +touch /srv/example/schedule-noncancel/PUSHED + # # Wait for the workflow to finish anyway # @@ -71,7 +77,7 @@ checkFinished() { "select status \ from action_run \ where id = $run_id \ - and status != 6" + and (status != 6 and status != 5)" } finished_status=$(checkFinished) From 222313181f79c1d9e72064224393470446e19685 Mon Sep 17 00:00:00 2001 From: Kwonunn Date: Sun, 13 Oct 2024 13:57:07 +0200 Subject: [PATCH 021/173] Add schedule-noncancel test to 9.0 suite --- actions/actions.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/actions/actions.sh b/actions/actions.sh index 7bcc4dfc..9701e391 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -141,6 +141,7 @@ function test_actions() { if dpkg --compare-versions $version ge 9.0; then run actions_verify_feature logs-compression + run actions_verify_example schedule-noncancel fi done } From f7d1900c5b286983989f1d6218857ab3410fd38a Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 15 Oct 2024 13:42:20 +0300 Subject: [PATCH 022/173] actions: logs-compression check depends on echo There is no guarantee that a test will not reset the actions logs from a previous test. Since logs-compression depends on the logs from the echo test, make that dependency explicit. --- actions/actions.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/actions/actions.sh b/actions/actions.sh index 9701e391..246f7257 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -117,7 +117,14 @@ function test_actions() { done fi - for example in echo cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do + run actions_verify_example echo + if dpkg --compare-versions $version ge 9.0; then + # depends on run actions_verify_example echo + # run it immediately after + run actions_verify_feature logs-compression + fi + + for example in cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do run actions_verify_example $example done @@ -140,7 +147,6 @@ function test_actions() { fi if dpkg --compare-versions $version ge 9.0; then - run actions_verify_feature logs-compression run actions_verify_example schedule-noncancel fi done From 3875197a1bd08ebe2c7b6cd30b6b24cfdf6af25b Mon Sep 17 00:00:00 2001 From: Kwonunn Date: Thu, 17 Oct 2024 11:48:22 +0200 Subject: [PATCH 023/173] fix: attempt to avoid database timeouts due to locking --- .../.forgejo/workflows/schedule_continue.yml | 3 +- actions/example-schedule-noncancel/run.sh | 31 ++++++++++++------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml b/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml index 8fe7177a..58156ea3 100644 --- a/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml +++ b/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml @@ -6,7 +6,8 @@ jobs: runs-on: docker container: image: code.forgejo.org/oci/debian:bookworm - options: "--volume /srv/example:/srv/example" + volumes: + - /srv/example:/srv/example steps: - run: | while ! [ -f /srv/example/schedule-noncancel/PUSHED ]; do diff --git a/actions/example-schedule-noncancel/run.sh b/actions/example-schedule-noncancel/run.sh index 810e634d..b3756bf9 100755 --- a/actions/example-schedule-noncancel/run.sh +++ b/actions/example-schedule-noncancel/run.sh @@ -12,20 +12,20 @@ fi # forgejo-test-helper.sh push_workflow actions/example-$example $url root example-$example setup-forgejo $token -# Prevent test failure because the db is occupied -sqlite3 $DIR/forgejo-work-path/forgejo.db "pragma busy_timeout=20000" - # # get the run id of the workflow that just started # getScheduleRun() { - sqlite3 $DIR/forgejo-work-path/forgejo.db \ - "select action_run.id \ + rm -f $DIR/forgejo-work-path/forgejo.copy.db + cp $DIR/forgejo-work-path/forgejo.db $DIR/forgejo-work-path/forgejo.copy.db + sqlite3 $DIR/forgejo-work-path/forgejo.copy.db \ + "pragma busy_timeout = 5000; \ + select action_run.id \ from action_run \ inner join action_schedule on action_run.schedule_id = action_schedule.id \ inner join repository on action_schedule.repo_id = repository.id \ where repository.name = 'example-schedule-noncancel' \ - order by action_run.created desc limit 1" + order by action_run.created desc limit 1" | sed '2q;d' } run_id=$(getScheduleRun) @@ -41,11 +41,14 @@ echo Schedule run id: $run_id # Wait for it to be started # checkStarted() { - sqlite3 $DIR/forgejo-work-path/forgejo.db \ - "select id \ + rm -f $DIR/forgejo-work-path/forgejo.copy.db + cp $DIR/forgejo-work-path/forgejo.db $DIR/forgejo-work-path/forgejo.copy.db + sqlite3 $DIR/forgejo-work-path/forgejo.copy.db \ + "pragma busy_timeout = 5000; \ + select id \ from action_run \ where id = $run_id \ - and started is not null" + and started is not null" | sed '2q;d' } started_check=$(checkStarted) @@ -73,11 +76,14 @@ touch /srv/example/schedule-noncancel/PUSHED echo Wait for workflow to finish checkFinished() { - sqlite3 $DIR/forgejo-work-path/forgejo.db \ - "select status \ + rm -f $DIR/forgejo-work-path/forgejo.copy.db + cp $DIR/forgejo-work-path/forgejo.db $DIR/forgejo-work-path/forgejo.copy.db + sqlite3 $DIR/forgejo-work-path/forgejo.copy.db \ + "pragma busy_timeout = 5000; \ + select status \ from action_run \ where id = $run_id \ - and (status != 6 and status != 5)" + and (status != 6 and status != 5)" | sed '2q;d' } finished_status=$(checkFinished) @@ -88,5 +94,6 @@ while [ -z $finished_status ]; do done echo Workflow finished. +rm -f $DIR/forgejo-work-path/forgejo.copy.db test $finished_status = 1 From 6508a9e2cab43d8cdd8e7b09c3bd5bc3f4b5de08 Mon Sep 17 00:00:00 2001 From: Kwonunn Date: Mon, 28 Oct 2024 13:51:42 +0000 Subject: [PATCH 024/173] set runner loglevel to debug --- actions/runner-config.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/actions/runner-config.yaml b/actions/runner-config.yaml index 12019d78..7d9e7642 100644 --- a/actions/runner-config.yaml +++ b/actions/runner-config.yaml @@ -1,6 +1,5 @@ - log: - level: info + level: debug runner: file: .runner From 3433d6ced2e93161d7deb8de2ad2d07243258a54 Mon Sep 17 00:00:00 2001 From: Kwonunn Date: Mon, 28 Oct 2024 14:55:49 +0100 Subject: [PATCH 025/173] forgot two of the configs --- actions/example-cache/runner-config.yaml | 2 +- actions/example-service/runner-config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/example-cache/runner-config.yaml b/actions/example-cache/runner-config.yaml index 9b342f1c..11818cc5 100644 --- a/actions/example-cache/runner-config.yaml +++ b/actions/example-cache/runner-config.yaml @@ -1,6 +1,6 @@ log: - level: info + level: debug runner: file: .runner diff --git a/actions/example-service/runner-config.yaml b/actions/example-service/runner-config.yaml index 27981abe..c931a240 100644 --- a/actions/example-service/runner-config.yaml +++ b/actions/example-service/runner-config.yaml @@ -1,6 +1,6 @@ log: - level: info + level: debug runner: file: .runner From aca70a3e54d2d947dd9f34e5173267072dcbd1fd Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 10 Nov 2024 08:37:44 +0100 Subject: [PATCH 026/173] lib: retry longer to allow for slower machines The end-to-end tests moved to a slower machine recently. When the daily releases are build, the end-to-end all run simultaneously and slow down the machine to a point where it will take more than 30 seconds for a Forgejo instance to start. Be more forgiving and let it retry for a minute. https://code.forgejo.org/forgejo/end-to-end/actions/runs/1857/jobs/6 --- lib/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib.sh b/lib/lib.sh index 4b489a04..2c952b8c 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -73,7 +73,7 @@ function dependencies() { function retry() { rm -f $DIR/wait-for.out success=false - for delay in 1 1 5 5 15; do + for delay in 1 1 5 5 15 15 15; do if "$@" >>$DIR/wait-for.out 2>&1; then success=true break From 33f3e7eb658fbe8608b41b187041ee09378f2ff8 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 10 Nov 2024 12:09:05 +0100 Subject: [PATCH 027/173] fix: update the docs branches Closes forgejo/end-to-end#188 --- .forgejo/workflows/end-to-end.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 05d43c56..780332fe 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -111,11 +111,11 @@ jobs: strategy: matrix: info: - - version: "7.0" + - version: "10.0" branch: next forgejo: https://codeberg.org owner: forgejo-experimental - - version: "1.21" + - version: "9.0" forgejo: https://codeberg.org owner: forgejo steps: From 8bf5b2c8027a87b77c138f59c260fb6cd7b228aa Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 11 Nov 2024 08:30:01 +0100 Subject: [PATCH 028/173] actions: run echo and compression tests first --- actions/actions.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/actions/actions.sh b/actions/actions.sh index 246f7257..e248f7fd 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -111,12 +111,6 @@ function test_actions() { log_info "Testing actions with Forgejo $version & Forgejo runner $runner_version" - if dpkg --compare-versions $version ge 7.0 && dpkg --compare-versions $runner_version gt 3.3.0; then - for example in artifacts-v4; do - run actions_verify_example $example - done - fi - run actions_verify_example echo if dpkg --compare-versions $version ge 9.0; then # depends on run actions_verify_example echo @@ -124,6 +118,12 @@ function test_actions() { run actions_verify_feature logs-compression fi + if dpkg --compare-versions $version ge 7.0 && dpkg --compare-versions $runner_version gt 3.3.0; then + for example in artifacts-v4; do + run actions_verify_example $example + done + fi + for example in cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do run actions_verify_example $example done From c4b3c61325f70769992b6e4a9fbb43ef596b2f4a Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 12 Nov 2024 15:40:12 +0100 Subject: [PATCH 029/173] actions: fix: wait for the action logs to show up The Forgejo instance completed the echo test successfully, there must be a log at some point. But since Forgejo is still running, it may not had time to write the logs just yet. Retry instead of giving up immediately. --- actions/feature-logs-compression/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/feature-logs-compression/run.sh b/actions/feature-logs-compression/run.sh index 174a24d7..7502fbde 100755 --- a/actions/feature-logs-compression/run.sh +++ b/actions/feature-logs-compression/run.sh @@ -5,7 +5,7 @@ set -e source $FEATURE_DIR/../../lib/lib.sh source $FEATURE_DIR/../../forgejo/fixtures.sh -if ! fixture_get_one_path local data/actions_log/root/example-echo | grep --quiet log.zst; then +if ! retry bash -c "find $DIR/forgejo-work-path/data/actions_log/root/example-echo | grep --quiet log.zst"; then ( cd $DIR/forgejo-work-path find data From 48f422b90315d9d0e2148a142ef9636fd4793be2 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 21 Nov 2024 07:32:07 +0000 Subject: [PATCH 030/173] Add renovate.json --- renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..cd7ea572 --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "local>forgejo/renovate-config" + ] +} From 4f84eefa62d5b107096f92277ddac439e1d822e7 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 21 Nov 2024 13:01:22 +0000 Subject: [PATCH 031/173] Update actions/setup-go action to v5 --- .forgejo/workflows/end-to-end.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 780332fe..690c814c 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -26,7 +26,7 @@ jobs: image: 'docker.io/node:20-bookworm' steps: - uses: https://code.forgejo.org/actions/checkout@v4 - - uses: https://code.forgejo.org/actions/setup-go@v4 + - uses: https://code.forgejo.org/actions/setup-go@v5 with: go-version: "1.22" - name: lib/build.sh From 33749f5a5e0f6f43ba0caa8c4f2fb1ecba63c276 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 27 Nov 2024 01:21:38 +0000 Subject: [PATCH 032/173] actions: runner [container].docker_host variations * automount * "" or "-" * unix:///var/run/docker.sock * tcp://127.0.0.1:2375 --- .forgejo/workflows/end-to-end.yml | 1 + README.md | 4 +++ actions/actions.sh | 22 ++++++++++++++ .../.forgejo/workflows/test.yml | 9 ++++++ .../runner-config.yaml | 30 +++++++++++++++++++ actions/example-with-docker-host/setup.sh | 1 + actions/example-with-docker-host/teardown.sh | 1 + .../.forgejo/workflows/test.yml | 9 ++++++ .../runner-config.yaml | 30 +++++++++++++++++++ actions/example-with-docker-socket/setup.sh | 1 + .../example-with-docker-socket/teardown.sh | 1 + .../.forgejo/workflows/test.yml | 11 +++++++ .../runner-config.yaml | 30 +++++++++++++++++++ actions/example-with-docker-tcp/setup.sh | 1 + actions/example-with-docker-tcp/teardown.sh | 1 + .../.forgejo/workflows/test.yml | 6 ++++ 16 files changed, 158 insertions(+) create mode 100644 actions/example-with-docker-host/.forgejo/workflows/test.yml create mode 100644 actions/example-with-docker-host/runner-config.yaml create mode 100755 actions/example-with-docker-host/setup.sh create mode 100755 actions/example-with-docker-host/teardown.sh create mode 100644 actions/example-with-docker-socket/.forgejo/workflows/test.yml create mode 100644 actions/example-with-docker-socket/runner-config.yaml create mode 100755 actions/example-with-docker-socket/setup.sh create mode 100755 actions/example-with-docker-socket/teardown.sh create mode 100644 actions/example-with-docker-tcp/.forgejo/workflows/test.yml create mode 100644 actions/example-with-docker-tcp/runner-config.yaml create mode 100755 actions/example-with-docker-tcp/setup.sh create mode 100755 actions/example-with-docker-tcp/teardown.sh create mode 100644 actions/example-without-docker-socket/.forgejo/workflows/test.yml diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 690c814c..b460f1bf 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -77,6 +77,7 @@ jobs: steps: - uses: https://code.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end + - run: ./end-to-end.sh prepare_dockerd - run: su forgejo -c "./end-to-end.sh test_actions" - name: full logs if: always() diff --git a/README.md b/README.md index 4b5808aa..4e7ed5bb 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,10 @@ firefox 0.0.0.0:3000 # user root / admin1234 ./end-to-end.sh actions_verify_example echo ./end-to-end.sh actions_teardown ``` + +Note that `with-docker-tcp` requires the docker daemon listens to +tcp://127.0.0.1:2375. See `actions/actions.sh` for how to do that. + ## Running other tests locally To run and debug tests, from the root of the source directory. diff --git a/actions/actions.sh b/actions/actions.sh index e248f7fd..321524a7 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -101,6 +101,21 @@ function actions_runner_version() { echo $runner_version } +function prepare_dockerd() { + mkdir -p /etc/systemd/system/docker.service.d + cat >/etc/systemd/system/docker.service.d/override.conf <<'EOF' +[Service] +ExecStart= +ExecStart=/usr/sbin/dockerd -H unix:///var/run/docker.sock -H tcp://127.0.0.1:2375 --containerd=/run/containerd/containerd.sock $DOCKER_OPTS +EOF + systemctl daemon-reload + if ! systemctl restart docker.service; then + journalctl --no-pager --unit docker.service + return 1 + fi + netstat -lntp | grep 127.0.0.1:2375 +} + function test_actions() { local versions="${1:-$RELEASE_NUMBERS}" @@ -118,6 +133,13 @@ function test_actions() { run actions_verify_feature logs-compression fi + run actions_verify_example with-docker-tcp + if dpkg --compare-versions $runner_version gt 5.0.2; then + for example in with-docker-host with-docker-socket without-docker-socket; do + run actions_verify_example $example + done + fi + if dpkg --compare-versions $version ge 7.0 && dpkg --compare-versions $runner_version gt 3.3.0; then for example in artifacts-v4; do run actions_verify_example $example diff --git a/actions/example-with-docker-host/.forgejo/workflows/test.yml b/actions/example-with-docker-host/.forgejo/workflows/test.yml new file mode 100644 index 00000000..32a82a49 --- /dev/null +++ b/actions/example-with-docker-host/.forgejo/workflows/test.yml @@ -0,0 +1,9 @@ +on: [push] + +jobs: + build: + runs-on: docker + container: + image: code.forgejo.org/oci/node:20-bookworm + steps: + - run: "test -e /var/run/docker.sock" diff --git a/actions/example-with-docker-host/runner-config.yaml b/actions/example-with-docker-host/runner-config.yaml new file mode 100644 index 00000000..839de20b --- /dev/null +++ b/actions/example-with-docker-host/runner-config.yaml @@ -0,0 +1,30 @@ + +log: + level: debug + +runner: + file: .runner + capacity: 1 + env_file: .env + timeout: 3h + insecure: false + fetch_timeout: 5s + fetch_interval: 2s + labels: ["docker:docker://code.forgejo.org/oci/node:20-bookworm"] + +cache: + enabled: true + dir: "/srv/example/cache" + host: "" + port: 0 + +container: + network: "bridge" + privileged: false + options: + workdir_parent: + valid_volumes: ["/srv/example"] + docker_host: "unix:///var/run/docker.sock" + +host: + workdir_parent: diff --git a/actions/example-with-docker-host/setup.sh b/actions/example-with-docker-host/setup.sh new file mode 100755 index 00000000..9c1f5adf --- /dev/null +++ b/actions/example-with-docker-host/setup.sh @@ -0,0 +1 @@ +FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config.yaml forgejo-runner.sh reload diff --git a/actions/example-with-docker-host/teardown.sh b/actions/example-with-docker-host/teardown.sh new file mode 100755 index 00000000..b410c513 --- /dev/null +++ b/actions/example-with-docker-host/teardown.sh @@ -0,0 +1 @@ +forgejo-runner.sh reload diff --git a/actions/example-with-docker-socket/.forgejo/workflows/test.yml b/actions/example-with-docker-socket/.forgejo/workflows/test.yml new file mode 100644 index 00000000..32a82a49 --- /dev/null +++ b/actions/example-with-docker-socket/.forgejo/workflows/test.yml @@ -0,0 +1,9 @@ +on: [push] + +jobs: + build: + runs-on: docker + container: + image: code.forgejo.org/oci/node:20-bookworm + steps: + - run: "test -e /var/run/docker.sock" diff --git a/actions/example-with-docker-socket/runner-config.yaml b/actions/example-with-docker-socket/runner-config.yaml new file mode 100644 index 00000000..e09edaaa --- /dev/null +++ b/actions/example-with-docker-socket/runner-config.yaml @@ -0,0 +1,30 @@ + +log: + level: debug + +runner: + file: .runner + capacity: 1 + env_file: .env + timeout: 3h + insecure: false + fetch_timeout: 5s + fetch_interval: 2s + labels: ["docker:docker://code.forgejo.org/oci/node:20-bookworm"] + +cache: + enabled: true + dir: "/srv/example/cache" + host: "" + port: 0 + +container: + network: "bridge" + privileged: false + options: + workdir_parent: + valid_volumes: ["/srv/example"] + docker_host: "automount" + +host: + workdir_parent: diff --git a/actions/example-with-docker-socket/setup.sh b/actions/example-with-docker-socket/setup.sh new file mode 100755 index 00000000..9c1f5adf --- /dev/null +++ b/actions/example-with-docker-socket/setup.sh @@ -0,0 +1 @@ +FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config.yaml forgejo-runner.sh reload diff --git a/actions/example-with-docker-socket/teardown.sh b/actions/example-with-docker-socket/teardown.sh new file mode 100755 index 00000000..b410c513 --- /dev/null +++ b/actions/example-with-docker-socket/teardown.sh @@ -0,0 +1 @@ +forgejo-runner.sh reload diff --git a/actions/example-with-docker-tcp/.forgejo/workflows/test.yml b/actions/example-with-docker-tcp/.forgejo/workflows/test.yml new file mode 100644 index 00000000..c33c2e7a --- /dev/null +++ b/actions/example-with-docker-tcp/.forgejo/workflows/test.yml @@ -0,0 +1,11 @@ +on: [push] + +jobs: + build: + runs-on: docker + container: + image: code.forgejo.org/oci/node:20-bookworm + steps: + - run: | + ! test -e /var/run/docker.sock + ! env | grep DOCKER_HOST diff --git a/actions/example-with-docker-tcp/runner-config.yaml b/actions/example-with-docker-tcp/runner-config.yaml new file mode 100644 index 00000000..730d9c88 --- /dev/null +++ b/actions/example-with-docker-tcp/runner-config.yaml @@ -0,0 +1,30 @@ + +log: + level: debug + +runner: + file: .runner + capacity: 1 + env_file: .env + timeout: 3h + insecure: false + fetch_timeout: 5s + fetch_interval: 2s + labels: ["docker:docker://code.forgejo.org/oci/node:20-bookworm"] + +cache: + enabled: true + dir: "/srv/example/cache" + host: "" + port: 0 + +container: + network: "bridge" + privileged: false + options: + workdir_parent: + valid_volumes: ["/srv/example"] + docker_host: "tcp://127.0.0.1:2375" + +host: + workdir_parent: diff --git a/actions/example-with-docker-tcp/setup.sh b/actions/example-with-docker-tcp/setup.sh new file mode 100755 index 00000000..9c1f5adf --- /dev/null +++ b/actions/example-with-docker-tcp/setup.sh @@ -0,0 +1 @@ +FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config.yaml forgejo-runner.sh reload diff --git a/actions/example-with-docker-tcp/teardown.sh b/actions/example-with-docker-tcp/teardown.sh new file mode 100755 index 00000000..b410c513 --- /dev/null +++ b/actions/example-with-docker-tcp/teardown.sh @@ -0,0 +1 @@ +forgejo-runner.sh reload diff --git a/actions/example-without-docker-socket/.forgejo/workflows/test.yml b/actions/example-without-docker-socket/.forgejo/workflows/test.yml new file mode 100644 index 00000000..8d5c8371 --- /dev/null +++ b/actions/example-without-docker-socket/.forgejo/workflows/test.yml @@ -0,0 +1,6 @@ +on: [push] +jobs: + test: + runs-on: docker + steps: + - run: "! test -e /var/run/docker.sock" From 77e6412295c969aced9580a8eca7ff05154a704b Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 27 Nov 2024 10:26:17 +0000 Subject: [PATCH 033/173] fix(actions): documentation update matrix needs prepare_dockerd It runs all actions tests to collect artefacts relevant to the documentation and has the same dependencies as running the actions tests in a pull request. --- .forgejo/workflows/end-to-end.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index b460f1bf..bb0348b0 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -129,6 +129,7 @@ jobs: set -x full_version=$(./end-to-end.sh full_version ${{ matrix.info.version }} ${{ matrix.info.owner }}) echo value="$full_version" >> $GITHUB_OUTPUT + - run: ./end-to-end.sh prepare_dockerd - run: su forgejo -c "./end-to-end.sh test_actions ${{ matrix.info.version }}" - name: update documentation uses: https://code.forgejo.org/actions/cascading-pr@v2.1 From bc7eb2f2455eac7afd0d9b090784de4bfdd9a49a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 27 Nov 2024 12:01:13 +0000 Subject: [PATCH 034/173] Update actions/setup-forgejo action to v2.0.3 --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 3bf04135..024a2e2a 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.2 + - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.3 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 6ce90814b20492b738867247dd33776255d87ee7 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 4 Dec 2024 14:11:17 +0100 Subject: [PATCH 035/173] fix: do not use api.github.com to avoid being rate limited --- lib/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib.sh b/lib/lib.sh index 2c952b8c..a2a86790 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -132,7 +132,7 @@ function download_gitea() { if ! test -f $DIR_BINARIES/gitea-$version; then mkdir -p $DIR_BINARIES if [[ $version =~ ^[0-9]+\.[0-9]+$ ]]; then - full_version=$(curl -sS "https://api.github.com/repos/go-gitea/gitea/releases?per_page=100" | jq -r '.[] | .tag_name | select(startswith("v'$version'"))' | grep -v -e '-rc' | sort --reverse --version-sort | head -1) + full_version=$(curl -sS "https://gitea.com/api/v1/repos/gitea/gitea-mirror/tags" | jq -r '.[] | .name | select(startswith("v'$version'"))' | grep -v -e '-rc' | sort --reverse --version-sort | head -1) full_version=${full_version#v} else full_version=$version From 0a782ec58fc3ce011c64e5f46d22ae0176a4c6f7 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 8 Dec 2024 00:01:21 +0000 Subject: [PATCH 036/173] Update actions/setup-forgejo action to v2.0.4 --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 024a2e2a..e2dbbe67 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.3 + - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.4 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From d142c4a60db46bea1f98609022f2ee5c434536b4 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 8 Dec 2024 16:18:15 +0100 Subject: [PATCH 037/173] fix: actions: verify the docker_host socket works It could be mounted but not functional. --- actions/example-with-docker-host/.forgejo/workflows/test.yml | 5 +++-- .../example-with-docker-socket/.forgejo/workflows/test.yml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/actions/example-with-docker-host/.forgejo/workflows/test.yml b/actions/example-with-docker-host/.forgejo/workflows/test.yml index 32a82a49..6089092f 100644 --- a/actions/example-with-docker-host/.forgejo/workflows/test.yml +++ b/actions/example-with-docker-host/.forgejo/workflows/test.yml @@ -4,6 +4,7 @@ jobs: build: runs-on: docker container: - image: code.forgejo.org/oci/node:20-bookworm + image: code.forgejo.org/oci/docker:cli steps: - - run: "test -e /var/run/docker.sock" + - run: ls -l /var/run/docker.sock + - run: docker ps diff --git a/actions/example-with-docker-socket/.forgejo/workflows/test.yml b/actions/example-with-docker-socket/.forgejo/workflows/test.yml index 32a82a49..6089092f 100644 --- a/actions/example-with-docker-socket/.forgejo/workflows/test.yml +++ b/actions/example-with-docker-socket/.forgejo/workflows/test.yml @@ -4,6 +4,7 @@ jobs: build: runs-on: docker container: - image: code.forgejo.org/oci/node:20-bookworm + image: code.forgejo.org/oci/docker:cli steps: - - run: "test -e /var/run/docker.sock" + - run: ls -l /var/run/docker.sock + - run: docker ps From af5923c7d47128798fee3cec5f61b947afa681bc Mon Sep 17 00:00:00 2001 From: xtex Date: Fri, 13 Dec 2024 21:19:44 +0800 Subject: [PATCH 038/173] feat: test FORGEJO_TOKEN --- actions/actions.sh | 4 ++++ .../.forgejo/workflows/test.yml | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 actions/example-branding-v10/.forgejo/workflows/test.yml diff --git a/actions/actions.sh b/actions/actions.sh index 321524a7..8eb7a76f 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -171,5 +171,9 @@ function test_actions() { if dpkg --compare-versions $version ge 9.0; then run actions_verify_example schedule-noncancel fi + + if dpkg --compare-versions $version ge 10.0 && dpkg --compare-versions $runner_version gt 5.0.4; then + run actions_verify_example branding-v10 + fi done } diff --git a/actions/example-branding-v10/.forgejo/workflows/test.yml b/actions/example-branding-v10/.forgejo/workflows/test.yml new file mode 100644 index 00000000..a51b8fa1 --- /dev/null +++ b/actions/example-branding-v10/.forgejo/workflows/test.yml @@ -0,0 +1,14 @@ +on: [push] + +jobs: + test: + runs-on: docker + container: + image: code.forgejo.org/oci/node:20-bookworm + steps: + - name: FORGEJO_TOKEN + run: | + set -x + test "$FORGEJO_TOKEN" + test "$FORGEJO_TOKEN" = "${{ env.FORGEJO_TOKEN }}" + test "$FORGEJO_TOKEN" = "${{ github.TOKEN }}" From 33d36a0e99c43aad6d93ca5921e37f2ddcf2bf7c Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 22 Dec 2024 12:48:09 +0100 Subject: [PATCH 039/173] feat: verify migration warnings when upgrading from Gitea --- upgrade/upgrade.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/upgrade/upgrade.sh b/upgrade/upgrade.sh index fb2f8c8b..fd84757b 100755 --- a/upgrade/upgrade.sh +++ b/upgrade/upgrade.sh @@ -49,12 +49,22 @@ function test_successful_upgrades() { done } +function migration_assert() { + local work_path=$DIR/forgejo-work-path + local logfile=$work_path/log/forgejo.log + + grep --quiet 'ORM engine initialization successful' $logfile + if grep --fixed-strings 'serveInstalled() [W] Table' $logfile; then + echo "unexpected warnings in database migration" + return 1 + fi +} + function test_gitea_upgrades() { local config=$UPGRADE_DIR/default-app.ini ( - echo gitea 1.21 forgejo 7.0 - echo gitea 1.21 forgejo 9.0 - echo gitea 1.22 forgejo 9.0 + echo gitea 1.21 forgejo 10.0 + echo gitea 1.22 forgejo 10.0 ) | while read gitea gitea_version forgejo forgejo_version; do log_info "upgrading from Gitea $gitea_version to Forgejo $forgejo_version" stop @@ -74,6 +84,8 @@ function test_gitea_upgrades() { verify_storage fixture_assert doctor_run $config + + migration_assert done } From 186b29a8a0efe62aa624e2a73dd486e50c43981c Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 24 Dec 2024 09:56:36 +0100 Subject: [PATCH 040/173] Revert "feat: test FORGEJO_TOKEN" This reverts commit af5923c7d47128798fee3cec5f61b947afa681bc. --- actions/actions.sh | 4 ---- .../.forgejo/workflows/test.yml | 14 -------------- 2 files changed, 18 deletions(-) delete mode 100644 actions/example-branding-v10/.forgejo/workflows/test.yml diff --git a/actions/actions.sh b/actions/actions.sh index 8eb7a76f..321524a7 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -171,9 +171,5 @@ function test_actions() { if dpkg --compare-versions $version ge 9.0; then run actions_verify_example schedule-noncancel fi - - if dpkg --compare-versions $version ge 10.0 && dpkg --compare-versions $runner_version gt 5.0.4; then - run actions_verify_example branding-v10 - fi done } diff --git a/actions/example-branding-v10/.forgejo/workflows/test.yml b/actions/example-branding-v10/.forgejo/workflows/test.yml deleted file mode 100644 index a51b8fa1..00000000 --- a/actions/example-branding-v10/.forgejo/workflows/test.yml +++ /dev/null @@ -1,14 +0,0 @@ -on: [push] - -jobs: - test: - runs-on: docker - container: - image: code.forgejo.org/oci/node:20-bookworm - steps: - - name: FORGEJO_TOKEN - run: | - set -x - test "$FORGEJO_TOKEN" - test "$FORGEJO_TOKEN" = "${{ env.FORGEJO_TOKEN }}" - test "$FORGEJO_TOKEN" = "${{ github.TOKEN }}" From 346b44a198c5fae961db086ec1075330db760d59 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 29 Dec 2024 16:14:07 +0000 Subject: [PATCH 041/173] upgrade: verify that Forgejo upgrades show no migration warnings Refs: https://codeberg.org/forgejo/forgejo/issues/6389 --- upgrade/upgrade.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/upgrade/upgrade.sh b/upgrade/upgrade.sh index fd84757b..b4cab9ce 100755 --- a/upgrade/upgrade.sh +++ b/upgrade/upgrade.sh @@ -46,6 +46,8 @@ function test_successful_upgrades() { fixture_assert doctor_run $config done + + migration_assert done } From 3bfb74d358a4660d40b76093ed68109995019b8a Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 25 Dec 2024 11:50:37 +0100 Subject: [PATCH 042/173] chore(release): cut branch v11.0 --- .forgejo/workflows/end-to-end.yml | 4 ++-- forgejo/sources/10.0 | 2 +- forgejo/sources/11.0 | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 forgejo/sources/11.0 diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index bb0348b0..6ffa514c 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -112,11 +112,11 @@ jobs: strategy: matrix: info: - - version: "10.0" + - version: "11.0" branch: next forgejo: https://codeberg.org owner: forgejo-experimental - - version: "9.0" + - version: "10.0" forgejo: https://codeberg.org owner: forgejo steps: diff --git a/forgejo/sources/10.0 b/forgejo/sources/10.0 index 101d770d..7c1c0138 100644 --- a/forgejo/sources/10.0 +++ b/forgejo/sources/10.0 @@ -1 +1 @@ -https://codeberg.org/forgejo/forgejo forgejo 10.0.0+gitea-1.23 +https://codeberg.org/forgejo/forgejo forgejo 10.0.0+gitea-1.22 diff --git a/forgejo/sources/11.0 b/forgejo/sources/11.0 new file mode 100644 index 00000000..0286dcaf --- /dev/null +++ b/forgejo/sources/11.0 @@ -0,0 +1 @@ +https://codeberg.org/forgejo/forgejo forgejo 11.0.0 From f6f0acae0e69b8b4df4d75e31a22d944d81bb62d Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 11 Jan 2025 09:02:39 +0100 Subject: [PATCH 043/173] actions: verify runner config options for the container - is not restricted to --volume (can use --env, etc.) - --volume is sanitized with valid_volumes --- actions/actions.sh | 2 +- .../.forgejo/workflows/test.yml | 12 ++++++++ .../example-config-options/runner-config.yaml | 30 +++++++++++++++++++ actions/example-config-options/setup.sh | 3 ++ actions/example-config-options/teardown.sh | 1 + 5 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 actions/example-config-options/.forgejo/workflows/test.yml create mode 100644 actions/example-config-options/runner-config.yaml create mode 100755 actions/example-config-options/setup.sh create mode 100755 actions/example-config-options/teardown.sh diff --git a/actions/actions.sh b/actions/actions.sh index 321524a7..230f3b47 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -146,7 +146,7 @@ function test_actions() { done fi - for example in cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do + for example in config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do run actions_verify_example $example done diff --git a/actions/example-config-options/.forgejo/workflows/test.yml b/actions/example-config-options/.forgejo/workflows/test.yml new file mode 100644 index 00000000..83b6b0a4 --- /dev/null +++ b/actions/example-config-options/.forgejo/workflows/test.yml @@ -0,0 +1,12 @@ +on: [push] + +jobs: + test: + runs-on: docker + steps: + - run: | + test -f /srv/example-config-options-volume-valid + - run: | + ! test -f /srv/example-config-options-volume-invalid + - run: | + test "$FROB" = "NITZ" diff --git a/actions/example-config-options/runner-config.yaml b/actions/example-config-options/runner-config.yaml new file mode 100644 index 00000000..13b9b72c --- /dev/null +++ b/actions/example-config-options/runner-config.yaml @@ -0,0 +1,30 @@ + +log: + level: debug + +runner: + file: .runner + capacity: 1 + env_file: .env + timeout: 3h + insecure: false + fetch_timeout: 5s + fetch_interval: 2s + labels: ["docker:docker://code.forgejo.org/oci/node:20-bookworm"] + +cache: + enabled: false + dir: "" + host: "" + port: 0 + +container: + network: "" + privileged: false + options: "--volume /srv/example-config-options-volume-valid:/srv/example-config-options-volume-valid --volume /srv/example-config-options-volume-invalid:/srv/example-config-options-volume-invalid --env FROB=NITZ" + workdir_parent: + valid_volumes: ["/srv/example-config-options-volume-valid"] + docker_host: "" + +host: + workdir_parent: diff --git a/actions/example-config-options/setup.sh b/actions/example-config-options/setup.sh new file mode 100755 index 00000000..d9f6ea9c --- /dev/null +++ b/actions/example-config-options/setup.sh @@ -0,0 +1,3 @@ +>/srv/example-config-options-volume-valid +>/srv/example-config-options-volume-invalid +FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config.yaml forgejo-runner.sh reload diff --git a/actions/example-config-options/teardown.sh b/actions/example-config-options/teardown.sh new file mode 100755 index 00000000..b410c513 --- /dev/null +++ b/actions/example-config-options/teardown.sh @@ -0,0 +1 @@ +forgejo-runner.sh reload From dbe50bffc7fb01b6e8cee98d445d44f7ebd8a25c Mon Sep 17 00:00:00 2001 From: gratux Date: Sat, 11 Jan 2025 15:27:44 +0000 Subject: [PATCH 044/173] add test for force_rebuild (#448) see also [forgejo/runner #406](https://code.forgejo.org/forgejo/runner/pulls/406) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/448 Reviewed-by: earl-warren Co-authored-by: gratux Co-committed-by: gratux --- actions/actions.sh | 4 +++ .../.forgejo/local-docker-action/Dockerfile | 5 +++ .../.forgejo/local-docker-action/action.yml | 6 ++++ .../local-docker-action/entrypoint.sh | 3 ++ .../.forgejo/local-docker-action/input.txt | 1 + .../.forgejo/workflows/test.yml | 10 ++++++ actions/example-force-rebuild/run.sh | 34 +++++++++++++++++++ .../runner-config-with-rebuild.yml | 30 ++++++++++++++++ .../runner-config-without-rebuild.yml | 30 ++++++++++++++++ actions/example-force-rebuild/teardown.sh | 1 + 10 files changed, 124 insertions(+) create mode 100644 actions/example-force-rebuild/.forgejo/local-docker-action/Dockerfile create mode 100644 actions/example-force-rebuild/.forgejo/local-docker-action/action.yml create mode 100755 actions/example-force-rebuild/.forgejo/local-docker-action/entrypoint.sh create mode 100644 actions/example-force-rebuild/.forgejo/local-docker-action/input.txt create mode 100644 actions/example-force-rebuild/.forgejo/workflows/test.yml create mode 100755 actions/example-force-rebuild/run.sh create mode 100644 actions/example-force-rebuild/runner-config-with-rebuild.yml create mode 100644 actions/example-force-rebuild/runner-config-without-rebuild.yml create mode 100755 actions/example-force-rebuild/teardown.sh diff --git a/actions/actions.sh b/actions/actions.sh index 230f3b47..0311d687 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -140,6 +140,10 @@ function test_actions() { done fi + if dpkg --compare-versions $runner_version gt 6.0.1; then + run actions_verify_example force-rebuild + fi + if dpkg --compare-versions $version ge 7.0 && dpkg --compare-versions $runner_version gt 3.3.0; then for example in artifacts-v4; do run actions_verify_example $example diff --git a/actions/example-force-rebuild/.forgejo/local-docker-action/Dockerfile b/actions/example-force-rebuild/.forgejo/local-docker-action/Dockerfile new file mode 100644 index 00000000..23e027ec --- /dev/null +++ b/actions/example-force-rebuild/.forgejo/local-docker-action/Dockerfile @@ -0,0 +1,5 @@ +FROM debian:bookworm-slim +COPY entrypoint.sh /run/entrypoint.sh +# if we rebuild, we should notice this file change +COPY input.txt /run/input.txt +ENTRYPOINT [ "/run/entrypoint.sh" ] \ No newline at end of file diff --git a/actions/example-force-rebuild/.forgejo/local-docker-action/action.yml b/actions/example-force-rebuild/.forgejo/local-docker-action/action.yml new file mode 100644 index 00000000..e53d6279 --- /dev/null +++ b/actions/example-force-rebuild/.forgejo/local-docker-action/action.yml @@ -0,0 +1,6 @@ +name: local docker action +description: local docker action, build depends on "input.txt" + +runs: + using: 'docker' + image: 'Dockerfile' diff --git a/actions/example-force-rebuild/.forgejo/local-docker-action/entrypoint.sh b/actions/example-force-rebuild/.forgejo/local-docker-action/entrypoint.sh new file mode 100755 index 00000000..e2ee36ad --- /dev/null +++ b/actions/example-force-rebuild/.forgejo/local-docker-action/entrypoint.sh @@ -0,0 +1,3 @@ +#! /usr/bin/env bash +set -x +exit "$(< /run/input.txt)" \ No newline at end of file diff --git a/actions/example-force-rebuild/.forgejo/local-docker-action/input.txt b/actions/example-force-rebuild/.forgejo/local-docker-action/input.txt new file mode 100644 index 00000000..5a944794 --- /dev/null +++ b/actions/example-force-rebuild/.forgejo/local-docker-action/input.txt @@ -0,0 +1 @@ +this file will be filled by the test \ No newline at end of file diff --git a/actions/example-force-rebuild/.forgejo/workflows/test.yml b/actions/example-force-rebuild/.forgejo/workflows/test.yml new file mode 100644 index 00000000..41510651 --- /dev/null +++ b/actions/example-force-rebuild/.forgejo/workflows/test.yml @@ -0,0 +1,10 @@ +--- +on: + push: +jobs: + test: + runs-on: docker + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - uses: ./.forgejo/local-docker-action diff --git a/actions/example-force-rebuild/run.sh b/actions/example-force-rebuild/run.sh new file mode 100755 index 00000000..2f2cb7eb --- /dev/null +++ b/actions/example-force-rebuild/run.sh @@ -0,0 +1,34 @@ +function setup_with_rebuild() { + FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config-with-rebuild.yml forgejo-runner.sh reload +} + +function setup_without_rebuild() { + FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config-without-rebuild.yml forgejo-runner.sh reload +} + +function run() { + local expected="$1" + local repo=root/example-$example + forgejo-test-helper.sh push_workflow actions/example-$example $url root example-$example setup-forgejo $token + sha=$(forgejo-test-helper.sh branch_tip $url $repo main) + forgejo-test-helper.sh wait_$expected $url $repo $sha +} + +function main() { + # set up passing docker action + echo "0" > $EXAMPLE_DIR/.forgejo/local-docker-action/input.txt + setup_with_rebuild + run success + + # change docker action to fail + echo "1" > $EXAMPLE_DIR/.forgejo/local-docker-action/input.txt + # ... but without a rebuild, it should still pass + setup_without_rebuild + run success + + # now the action should fail + setup_with_rebuild + run failure +} + +main diff --git a/actions/example-force-rebuild/runner-config-with-rebuild.yml b/actions/example-force-rebuild/runner-config-with-rebuild.yml new file mode 100644 index 00000000..c99a2300 --- /dev/null +++ b/actions/example-force-rebuild/runner-config-with-rebuild.yml @@ -0,0 +1,30 @@ +log: + level: debug + +runner: + file: .runner + capacity: 1 + env_file: .env + timeout: 3h + insecure: false + fetch_timeout: 5s + fetch_interval: 2s + labels: ["docker:docker://code.forgejo.org/oci/node:20-bookworm"] + +cache: + enabled: false + dir: "" + host: "" + port: 0 + +container: + network: "bridge" + privileged: false + options: + workdir_parent: + valid_volumes: ["/srv/example"] + docker_host: "" + force_rebuild: true + +host: + workdir_parent: diff --git a/actions/example-force-rebuild/runner-config-without-rebuild.yml b/actions/example-force-rebuild/runner-config-without-rebuild.yml new file mode 100644 index 00000000..793fbcd6 --- /dev/null +++ b/actions/example-force-rebuild/runner-config-without-rebuild.yml @@ -0,0 +1,30 @@ +log: + level: debug + +runner: + file: .runner + capacity: 1 + env_file: .env + timeout: 3h + insecure: false + fetch_timeout: 5s + fetch_interval: 2s + labels: ["docker:docker://code.forgejo.org/oci/node:20-bookworm"] + +cache: + enabled: false + dir: "" + host: "" + port: 0 + +container: + network: "bridge" + privileged: false + options: + workdir_parent: + valid_volumes: ["/srv/example"] + docker_host: "" + force_rebuild: false + +host: + workdir_parent: diff --git a/actions/example-force-rebuild/teardown.sh b/actions/example-force-rebuild/teardown.sh new file mode 100755 index 00000000..b410c513 --- /dev/null +++ b/actions/example-force-rebuild/teardown.sh @@ -0,0 +1 @@ +forgejo-runner.sh reload From dacb3b0fac69265be900abb955b61813d67db239 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 11 Jan 2025 18:05:32 +0100 Subject: [PATCH 045/173] chore(cleanup): log compression test does not belong It is a feature and best tested in Forgejo itself, not in end-to-end. It is a recurring source of false negative and there is little to no value is fixing the associated border case because it only applies to short lived Forgejo instances used during tests. Fixes: https://code.forgejo.org/forgejo/end-to-end/issues/431 --- actions/actions.sh | 9 +-------- actions/feature-logs-compression/run.sh | 15 --------------- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100755 actions/feature-logs-compression/run.sh diff --git a/actions/actions.sh b/actions/actions.sh index 0311d687..e62debf4 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -126,13 +126,6 @@ function test_actions() { log_info "Testing actions with Forgejo $version & Forgejo runner $runner_version" - run actions_verify_example echo - if dpkg --compare-versions $version ge 9.0; then - # depends on run actions_verify_example echo - # run it immediately after - run actions_verify_feature logs-compression - fi - run actions_verify_example with-docker-tcp if dpkg --compare-versions $runner_version gt 5.0.2; then for example in with-docker-host with-docker-socket without-docker-socket; do @@ -150,7 +143,7 @@ function test_actions() { done fi - for example in config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do + for example in echo config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do run actions_verify_example $example done diff --git a/actions/feature-logs-compression/run.sh b/actions/feature-logs-compression/run.sh deleted file mode 100755 index 7502fbde..00000000 --- a/actions/feature-logs-compression/run.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -e - -source $FEATURE_DIR/../../lib/lib.sh -source $FEATURE_DIR/../../forgejo/fixtures.sh - -if ! retry bash -c "find $DIR/forgejo-work-path/data/actions_log/root/example-echo | grep --quiet log.zst"; then - ( - cd $DIR/forgejo-work-path - find data - ) - echo expected a single log.zst file in data/actions_log/root/example-echo - exit 1 -fi From 734eb7de64fb4f416c1727070909a0b7ba5cbbf4 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 11 Jan 2025 18:18:13 +0000 Subject: [PATCH 046/173] Update actions/setup-forgejo action to v2.0.5 --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index e2dbbe67..b345b28d 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.4 + - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.5 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 65e3fafd02990b4614d50049e1bf1bfbd41a28e1 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 12 Jan 2025 08:05:37 +0100 Subject: [PATCH 047/173] actions: force-rebuild must use a copy of the repository it may not have permission to write on the repository itself, nor should it. --- actions/example-force-rebuild/run.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/actions/example-force-rebuild/run.sh b/actions/example-force-rebuild/run.sh index 2f2cb7eb..d82890a3 100755 --- a/actions/example-force-rebuild/run.sh +++ b/actions/example-force-rebuild/run.sh @@ -1,3 +1,7 @@ +TMPDIR=$(mktemp -d) + +trap "rm -fr $TMPDIR" EXIT + function setup_with_rebuild() { FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config-with-rebuild.yml forgejo-runner.sh reload } @@ -7,28 +11,32 @@ function setup_without_rebuild() { } function run() { - local expected="$1" + local dir="$1" + local expected="$2" local repo=root/example-$example - forgejo-test-helper.sh push_workflow actions/example-$example $url root example-$example setup-forgejo $token + forgejo-test-helper.sh push_workflow $dir $url root example-$example setup-forgejo $token sha=$(forgejo-test-helper.sh branch_tip $url $repo main) forgejo-test-helper.sh wait_$expected $url $repo $sha } function main() { + local dir=$TMPDIR/repository + cp -a $EXAMPLE_DIR $dir + # set up passing docker action - echo "0" > $EXAMPLE_DIR/.forgejo/local-docker-action/input.txt + echo "0" >$dir/.forgejo/local-docker-action/input.txt setup_with_rebuild - run success + run $dir success # change docker action to fail - echo "1" > $EXAMPLE_DIR/.forgejo/local-docker-action/input.txt + echo "1" >$dir/.forgejo/local-docker-action/input.txt # ... but without a rebuild, it should still pass setup_without_rebuild - run success + run $dir success # now the action should fail setup_with_rebuild - run failure + run $dir failure } main From adb09f901bbeb89661e5f44daacb151687d875aa Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 12 Jan 2025 08:07:07 +0100 Subject: [PATCH 048/173] actions: force-rebuild use code.forgejo.org/oci to avoid throttling --- .../.forgejo/local-docker-action/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/example-force-rebuild/.forgejo/local-docker-action/Dockerfile b/actions/example-force-rebuild/.forgejo/local-docker-action/Dockerfile index 23e027ec..2339a39d 100644 --- a/actions/example-force-rebuild/.forgejo/local-docker-action/Dockerfile +++ b/actions/example-force-rebuild/.forgejo/local-docker-action/Dockerfile @@ -1,5 +1,5 @@ -FROM debian:bookworm-slim +FROM code.forgejo.org/oci/debian:bookworm COPY entrypoint.sh /run/entrypoint.sh # if we rebuild, we should notice this file change COPY input.txt /run/input.txt -ENTRYPOINT [ "/run/entrypoint.sh" ] \ No newline at end of file +ENTRYPOINT [ "/run/entrypoint.sh" ] From beae8629a6436a89df36b814d3922238b04dcc61 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 13 Jan 2025 05:30:48 +0100 Subject: [PATCH 049/173] fix: use code.forgejo.org instead of docker.io to avoid throttling Fixes: https://code.forgejo.org/forgejo/end-to-end/actions/runs/2316 --- .forgejo/workflows/end-to-end.yml | 2 +- actions/example-container/.forgejo/workflows/test.yml | 2 +- packages/alpine.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 6ffa514c..35b27fcb 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -23,7 +23,7 @@ jobs: build: runs-on: docker container: - image: 'docker.io/node:20-bookworm' + image: 'code.forgejo.org/oci/node:20-bookworm' steps: - uses: https://code.forgejo.org/actions/checkout@v4 - uses: https://code.forgejo.org/actions/setup-go@v5 diff --git a/actions/example-container/.forgejo/workflows/test.yml b/actions/example-container/.forgejo/workflows/test.yml index 583df87e..ded75cd8 100644 --- a/actions/example-container/.forgejo/workflows/test.yml +++ b/actions/example-container/.forgejo/workflows/test.yml @@ -3,6 +3,6 @@ jobs: test: runs-on: docker container: - image: alpine:3.19 + image: code.forgejo.org/oci/alpine:3.21 steps: - run: grep Alpine /etc/os-release diff --git a/packages/alpine.sh b/packages/alpine.sh index 4ae92ae4..092d6258 100644 --- a/packages/alpine.sh +++ b/packages/alpine.sh @@ -12,7 +12,7 @@ function test_packages_alpine_version() { local url=http://${HOST_PORT} log_info "alpine:$alpine_version & Forgejo $forgejo_version" - docker run --rm --volume $d:$d:ro --workdir $d docker.io/alpine:$alpine_version ash -c "./test.sh $url $token" + docker run --rm --volume $d:$d:ro --workdir $d code.forgejo.org/oci/alpine:$alpine_version ash -c "./test.sh $url $token" } function test_packages_alpine() { From 135bd00a26101cd317720584b31ed1562f3b6d89 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 13 Jan 2025 05:34:29 +0100 Subject: [PATCH 050/173] feat: use alpine 3.21 and forgejo 10.0 and no longer alpine 3.19 and forgejo 9.0 --- packages/{alpine-9.0 => alpine-10.0} | 0 packages/alpine-7.0/test.sh | 6 +++--- packages/alpine.sh | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) rename packages/{alpine-9.0 => alpine-10.0} (100%) diff --git a/packages/alpine-9.0 b/packages/alpine-10.0 similarity index 100% rename from packages/alpine-9.0 rename to packages/alpine-10.0 diff --git a/packages/alpine-7.0/test.sh b/packages/alpine-7.0/test.sh index d830df29..4676e7ce 100755 --- a/packages/alpine-7.0/test.sh +++ b/packages/alpine-7.0/test.sh @@ -41,7 +41,7 @@ for file in $(find . -name '*.apk' -type f | sed -e 's,./,,'); do --fail \ -H "Authorization: token $forgejo_token" \ -X DELETE \ - "$forgejo_url/api/packages/root/alpine/3.19/e2e-tests/$file" || + "$forgejo_url/api/packages/root/alpine/3.21/e2e-tests/$file" || true # upload new package @@ -49,13 +49,13 @@ for file in $(find . -name '*.apk' -type f | sed -e 's,./,,'); do --fail \ -H "Authorization: token $forgejo_token" \ -T "$file" \ - "$forgejo_url/api/packages/root/alpine/3.19/e2e-tests" + "$forgejo_url/api/packages/root/alpine/3.21/e2e-tests" done # ensure that the install-if condition works as expected apk add openrc (cd /etc/apk/keys && curl -JO $forgejo_url/api/packages/root/alpine/key) -echo "$forgejo_url/api/packages/root/alpine/3.19/e2e-tests" >>/etc/apk/repositories +echo "$forgejo_url/api/packages/root/alpine/3.21/e2e-tests" >>/etc/apk/repositories apk add forgejo-2174 forgejo-2173 [ -e /usr/bin/forgejo_2174 ] # from the installed package [ -e /usr/bin/forgejo_2173 ] # from the installed package diff --git a/packages/alpine.sh b/packages/alpine.sh index 4ae92ae4..59bc0c6b 100644 --- a/packages/alpine.sh +++ b/packages/alpine.sh @@ -1,4 +1,4 @@ -# Copyright 2024 The Forgejo Authors +# Copyright 2025 The Forgejo Authors # SPDX-License-Identifier: MIT function test_packages_alpine_version() { @@ -16,8 +16,8 @@ function test_packages_alpine_version() { } function test_packages_alpine() { - for alpine_version in 3.19 3.20; do - for forgejo_version in 7.0 9.0; do + for alpine_version in 3.20 3.21; do + for forgejo_version in 7.0 10.0; do test_packages_alpine_version $alpine_version $forgejo_version done done From 5c2eebc521b653079f822e67aface0769f31e0fd Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 15 Jan 2025 13:18:19 +0100 Subject: [PATCH 051/173] fix: upgrade must use code.forgejo.org/oci Otherwise it may get rate limited in the CI verifying it works --- upgrade/test-pprof-upload.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/upgrade/test-pprof-upload.sh b/upgrade/test-pprof-upload.sh index 5c676871..732fae7d 100644 --- a/upgrade/test-pprof-upload.sh +++ b/upgrade/test-pprof-upload.sh @@ -25,7 +25,7 @@ function test_upload_profiles() { function test_forgejo_pprof() { stop docker rm -f test_pyroscope - docker run --name test_pyroscope --rm -d -p 4040:4040 docker.io/grafana/pyroscope + docker run --name test_pyroscope --rm -d -p 4040:4040 code.forgejo.org/oci/pyroscope:1.12.0 reset_forgejo $UPGRADE_DIR/default-app.ini log_info "run 7.0" @@ -39,5 +39,4 @@ function test_forgejo_pprof() { stop docker stop test_pyroscope - } From faaa390f15099b2efe60683c6d13ce7e5d5dee58 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 16 Jan 2025 00:01:54 +0000 Subject: [PATCH 052/173] Update actions/setup-forgejo action to v2.0.6 --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index b345b28d..d86b6a51 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.5 + - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.6 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 80b6d688d001133e7748c5592fd2eca4ce4d871c Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 16 Jan 2025 09:43:45 +0100 Subject: [PATCH 053/173] feat: v9.0 is EOL and v11.0 needs testing --- lib/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib.sh b/lib/lib.sh index a2a86790..590e082a 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -26,7 +26,7 @@ IP=$(hostname -I | cut -f1 -d' ') # # Forgejo releases for which a branch exists (7.0/forgejo etc.) # -RELEASE_NUMBERS="7.0 9.0 10.0" +RELEASE_NUMBERS="7.0 10.0 11.0" PREFIX=============== export DIR=/tmp/forgejo-end-to-end From 5f9ea458446124ee41f9c901f905c4189c24f219 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 16 Jan 2025 19:23:06 +0100 Subject: [PATCH 054/173] fix: catch warnings and errors --- upgrade/upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upgrade/upgrade.sh b/upgrade/upgrade.sh index b4cab9ce..377399d1 100755 --- a/upgrade/upgrade.sh +++ b/upgrade/upgrade.sh @@ -56,7 +56,7 @@ function migration_assert() { local logfile=$work_path/log/forgejo.log grep --quiet 'ORM engine initialization successful' $logfile - if grep --fixed-strings 'serveInstalled() [W] Table' $logfile; then + if grep 'serveInstalled() \[[EW]\] Table' $logfile; then echo "unexpected warnings in database migration" return 1 fi From f8d5ecb47b33ec5d7db846668171b602c71c38a6 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Fri, 17 Jan 2025 02:22:12 +0100 Subject: [PATCH 055/173] fix: upgrade: add missing check for migration warnings and errors Refs: https://codeberg.org/forgejo/forgejo/issues/6583 --- upgrade/upgrade.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/upgrade/upgrade.sh b/upgrade/upgrade.sh index 377399d1..3248e830 100755 --- a/upgrade/upgrade.sh +++ b/upgrade/upgrade.sh @@ -57,6 +57,10 @@ function migration_assert() { grep --quiet 'ORM engine initialization successful' $logfile if grep 'serveInstalled() \[[EW]\] Table' $logfile; then + echo "unexpected warnings in database initialization" + return 1 + fi + if grep 'Migrate() \[[EW]\]' $logfile; then echo "unexpected warnings in database migration" return 1 fi @@ -64,6 +68,8 @@ function migration_assert() { function test_gitea_upgrades() { local config=$UPGRADE_DIR/default-app.ini + # The Forgejo target migration version must be 10.0 because it is the last supported. + # https://forgejo.org/2024-12-gitea-compatibility/ ( echo gitea 1.21 forgejo 10.0 echo gitea 1.22 forgejo 10.0 From ff2c6790b3293bd265b4274be29f3dbfcb260cca Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 22 Jan 2025 18:46:02 +0100 Subject: [PATCH 056/173] feat: actions: verify that container.options --hostname is valid Refs: https://code.forgejo.org/forgejo/act/pulls/95 --- actions/example-config-options/.forgejo/workflows/test.yml | 4 ++++ actions/example-config-options/runner-config.yaml | 1 + 2 files changed, 5 insertions(+) diff --git a/actions/example-config-options/.forgejo/workflows/test.yml b/actions/example-config-options/.forgejo/workflows/test.yml index 83b6b0a4..d9c03241 100644 --- a/actions/example-config-options/.forgejo/workflows/test.yml +++ b/actions/example-config-options/.forgejo/workflows/test.yml @@ -3,6 +3,8 @@ on: [push] jobs: test: runs-on: docker + container: + options: "--hostname customname" steps: - run: | test -f /srv/example-config-options-volume-valid @@ -10,3 +12,5 @@ jobs: ! test -f /srv/example-config-options-volume-invalid - run: | test "$FROB" = "NITZ" + - run: | + test "$(cat /etc/hostname)" = customname diff --git a/actions/example-config-options/runner-config.yaml b/actions/example-config-options/runner-config.yaml index 13b9b72c..dff53565 100644 --- a/actions/example-config-options/runner-config.yaml +++ b/actions/example-config-options/runner-config.yaml @@ -1,6 +1,7 @@ log: level: debug + job_level: debug runner: file: .runner From 3275d464e5b2e8d56e0ffd52913b49740e938e93 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 22 Jan 2025 22:41:13 +0000 Subject: [PATCH 057/173] Update https://code.forgejo.org/actions/setup-forgejo action to v2.0.7 --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index d86b6a51..7bc2ed0d 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.6 + - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.7 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From a3388d98dc9d01e3e15cae5de67c5381d35d56c4 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 22 Jan 2025 23:09:03 +0000 Subject: [PATCH 058/173] Update https://code.forgejo.org/actions/setup-forgejo action to v2.0.7 (#509) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://code.forgejo.org/actions/setup-forgejo](https://code.forgejo.org/actions/setup-forgejo) | action | patch | `v2.0.6` -> `v2.0.7` | --- ### Release Notes
actions/setup-forgejo (https://code.forgejo.org/actions/setup-forgejo) ### [`v2.0.7`](https://code.forgejo.org/actions/setup-forgejo/compare/v2.0.6...v2.0.7) [Compare Source](https://code.forgejo.org/actions/setup-forgejo/compare/v2.0.6...v2.0.7)
--- ### Configuration 📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/509 Reviewed-by: earl-warren Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index d86b6a51..7bc2ed0d 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.6 + - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.7 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From e38cd362d9771c7e130edfb631714854f81d7530 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 26 Jan 2025 21:24:03 +0100 Subject: [PATCH 059/173] chore(readme): explain how to use a locally built runner --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 4e7ed5bb..cdae346c 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,13 @@ cd end-to-end ## Running from locally built binary +Before injecting a manually built binary, make sure a simple test was +run so that the directories are populated. + +### Forgejo + +From a checkout of https://codeberg.org/forgejo/forgejo/ + ```sh make TAGS='bindata sqlite sqlite_unlock_notify' generate forgejo cp -a forgejo /srv/forgejo-binaries/forgejo-10.0 @@ -55,6 +62,15 @@ cp -a forgejo /srv/forgejo-binaries/forgejo-10.0 It will be used whenever the version `10.0` is specified in a test. +### Forgejo runner + +From a checkout of https://code.forgejo.org/forgejo/runner + +```sh +make --always-make forgejo-runner +cp forgejo-runner /tmp/forgejo-end-to-end/forgejo-runner +``` + ## Running actions locally To run and debug workflows from `actions/example-*`, from the root of From 429d5584e18312b1f544d4e12f522b71c63e8acb Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 28 Jan 2025 17:16:51 +0000 Subject: [PATCH 060/173] feat: actions: add LXC backend example (#520) Without such an example, there is no test that would verify a modification of the ACT LXC backend is working when running a cascading pull request. Trace of the run at: https://code.forgejo.org/forgejo/end-to-end/actions/runs/2433/jobs/2#jobstep-4-28 Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/520 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/actions.sh | 2 +- .../example-lxc/.forgejo/workflows/test.yml | 7 +++++ actions/example-lxc/runner-config.yaml | 31 +++++++++++++++++++ actions/example-lxc/setup.sh | 1 + actions/example-lxc/teardown.sh | 1 + 5 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 actions/example-lxc/.forgejo/workflows/test.yml create mode 100644 actions/example-lxc/runner-config.yaml create mode 100755 actions/example-lxc/setup.sh create mode 100755 actions/example-lxc/teardown.sh diff --git a/actions/actions.sh b/actions/actions.sh index e62debf4..0b505080 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -143,7 +143,7 @@ function test_actions() { done fi - for example in echo config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do + for example in echo lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do run actions_verify_example $example done diff --git a/actions/example-lxc/.forgejo/workflows/test.yml b/actions/example-lxc/.forgejo/workflows/test.yml new file mode 100644 index 00000000..da81c6ea --- /dev/null +++ b/actions/example-lxc/.forgejo/workflows/test.yml @@ -0,0 +1,7 @@ +on: [push] + +jobs: + build: + runs-on: lxc + steps: + - run: systemctl --no-pager list-units diff --git a/actions/example-lxc/runner-config.yaml b/actions/example-lxc/runner-config.yaml new file mode 100644 index 00000000..6698ed20 --- /dev/null +++ b/actions/example-lxc/runner-config.yaml @@ -0,0 +1,31 @@ + +log: + level: debug + job_level: debug + +runner: + file: .runner + capacity: 1 + env_file: .env + timeout: 3h + insecure: false + fetch_timeout: 5s + fetch_interval: 2s + labels: ["lxc:lxc://debian:bookworm:docker"] + +cache: + enabled: false + dir: "" + host: "" + port: 0 + +container: + network: "bridge" + privileged: false + options: + workdir_parent: + valid_volumes: ["/srv/example"] + docker_host: "" + +host: + workdir_parent: diff --git a/actions/example-lxc/setup.sh b/actions/example-lxc/setup.sh new file mode 100755 index 00000000..9c1f5adf --- /dev/null +++ b/actions/example-lxc/setup.sh @@ -0,0 +1 @@ +FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config.yaml forgejo-runner.sh reload diff --git a/actions/example-lxc/teardown.sh b/actions/example-lxc/teardown.sh new file mode 100755 index 00000000..b410c513 --- /dev/null +++ b/actions/example-lxc/teardown.sh @@ -0,0 +1 @@ +forgejo-runner.sh reload From e181f9a72a0bf2e08a60fa9c80b227e03712b5a8 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 29 Jan 2025 00:02:01 +0000 Subject: [PATCH 061/173] Update https://code.forgejo.org/actions/setup-forgejo action to v2.0.8 --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 7bc2ed0d..5df7d620 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.7 + - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.8 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From c29e1e64e720a3b87542fc308423c636e92d611a Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 29 Jan 2025 06:57:27 +0000 Subject: [PATCH 062/173] feat: actions: verify LXC backend can checkout (#522) ACT is expected to provide an LXC backend with node pre-installed by default to allow for running commonly used actions written in JS. It also includes an upgrade to setup-forgejo 2.0.8 which contains a fix to teardown the runner properly even in the event where it contains files owned by root. This happens when running a workflow within a LXC container. Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/522 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/example-lxc/.forgejo/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/actions/example-lxc/.forgejo/workflows/test.yml b/actions/example-lxc/.forgejo/workflows/test.yml index da81c6ea..5e466e72 100644 --- a/actions/example-lxc/.forgejo/workflows/test.yml +++ b/actions/example-lxc/.forgejo/workflows/test.yml @@ -4,4 +4,5 @@ jobs: build: runs-on: lxc steps: + - uses: https://data.forgejo.org/actions/checkout@v4 - run: systemctl --no-pager list-units From 7abcd0e280adf7fc04b4e22b67dcb0312572da9c Mon Sep 17 00:00:00 2001 From: limiting-factor Date: Sat, 22 Feb 2025 10:34:38 +0100 Subject: [PATCH 063/173] fix: Heptapod is not longer available The default_vcs_type setting is Heptapod specific and cannot be used for GitLab. Refs: https://code.forgejo.org/f3/gof3/issues/88 --- federation/federation.sh | 2 +- lib/lib.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/federation/federation.sh b/federation/federation.sh index e3e7ab7a..0a841901 100755 --- a/federation/federation.sh +++ b/federation/federation.sh @@ -66,7 +66,7 @@ function federation_teardown() { } function test_federation() { - # start_gitlab octobus/heptapod:1.5.3 + # start_gitlab gitlab/gitlab-ce:17.1.0-ce.0 federation_setup_variables local versions="${1:-$RELEASE_NUMBERS}" diff --git a/lib/lib.sh b/lib/lib.sh index 590e082a..1750eb79 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -204,7 +204,6 @@ function start_gitlab() { for i in $(seq 10); do if test $(curl --silent http://$IP:$GITLAB_PORT -o /dev/null -w "%{http_code}") = 302; then docker exec test-gitlab gitlab-rails runner "user = User.find_by_username 'root'; user.password = '$GITLAB_PASSWORD'; user.password_confirmation = '$GITLAB_PASSWORD'; user.password_automatically_set = false ; user.save!" - docker exec test-gitlab$serial gitlab-rails runner "Gitlab::CurrentSettings.current_application_settings.update(default_vcs_type: 'git')" log_info "GitLab is ready" return fi From 6f6466b3f6b45e7449cb62aeeb5d155f51f54e46 Mon Sep 17 00:00:00 2001 From: limiting-factor Date: Sat, 22 Feb 2025 15:55:38 +0000 Subject: [PATCH 064/173] feat: ${FORGEJO_INSTANCE:=https://codeberg.org} (#542) Do not hardcode https://codeberg.org, use the FORGEJO_INSTANCE variable instead. It can be overriden when codeberg.org is unavailable. Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/542 Reviewed-by: earl-warren Co-authored-by: limiting-factor Co-committed-by: limiting-factor --- lib/lib.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/lib.sh b/lib/lib.sh index 1750eb79..3a4cec81 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -35,6 +35,7 @@ export DOT_FORGEJO_CURL=$DIR/forgejo-curl export DOT=$DOT_FORGEJO_CURL # for backward compatibility with forgejo-curl.sh 1.0.0 : ${FORGEJO_USER:=root} : ${FORGEJO_PASSWORD:=admin1234} +: ${FORGEJO_INSTANCE:=https://codeberg.org} ORGANIZATIONS=$(cat $LIB_DIR/ORGANIZATIONS) function log_info() { @@ -93,7 +94,7 @@ function full_version() { local owner=$2 if [[ $version =~ ^[0-9]+\.[0-9]+$ ]]; then - full_version=$(curl -sS "https://codeberg.org/api/v1/repos/$owner/forgejo/releases?limit=50" | jq -r '.[] | .tag_name | select(startswith("v'$version'"))' | sort --reverse --version-sort | head -1) + full_version=$(curl -sS "$FORGEJO_INSTANCE/api/v1/repos/$owner/forgejo/releases?limit=50" | jq -r '.[] | .tag_name | select(startswith("v'$version'"))' | sort --reverse --version-sort | head -1) echo ${full_version#v} else echo $version @@ -110,7 +111,7 @@ function download_forgejo() { if test "$full_version" = ""; then continue fi - if wget -O $DIR_BINARIES/forgejo-$version --quiet https://codeberg.org/$owner/forgejo/releases/download/v$full_version/forgejo-$full_version-linux-amd64; then + if wget -O $DIR_BINARIES/forgejo-$version --quiet $FORGEJO_INSTANCE/$owner/forgejo/releases/download/v$full_version/forgejo-$full_version-linux-amd64; then break fi done From 310322d01f89c158020809245261afe02fa80fb1 Mon Sep 17 00:00:00 2001 From: limiting-factor Date: Sat, 22 Feb 2025 16:26:24 +0000 Subject: [PATCH 065/173] fix: lib: get all releases (#544) Loop over all pages instead of getting the first one only to not miss any version. Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/544 Reviewed-by: earl-warren Co-authored-by: limiting-factor Co-committed-by: limiting-factor --- lib/lib.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/lib.sh b/lib/lib.sh index 3a4cec81..96650b89 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -89,12 +89,25 @@ function retry() { fi } +function get_versions() { + local releases=$1 + local page=1 + while true; do + curl --fail -sS "$releases?limit=100&page=$page" | jq -r '.[] | .tag_name' >/tmp/page + cat /tmp/page + if ! test -s /tmp/page; then + break + fi + page=$(expr $page + 1) + done | grep -v -e '-rc' | sort --version-sort +} + function full_version() { local version=$1 local owner=$2 if [[ $version =~ ^[0-9]+\.[0-9]+$ ]]; then - full_version=$(curl -sS "$FORGEJO_INSTANCE/api/v1/repos/$owner/forgejo/releases?limit=50" | jq -r '.[] | .tag_name | select(startswith("v'$version'"))' | sort --reverse --version-sort | head -1) + full_version=$(get_versions "$FORGEJO_INSTANCE/api/v1/repos/$owner/forgejo/releases" | sed -n -e "/^v$version/p" | sort --reverse --version-sort | head -1) echo ${full_version#v} else echo $version From 13c723cb2ce54d130fc90507cdcf3782f8797423 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 23 Feb 2025 00:01:20 +0000 Subject: [PATCH 066/173] Update https://code.forgejo.org/actions/setup-forgejo action to v2.0.9 --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 5df7d620..2d11b326 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.8 + - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.9 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From e03278e4c1873a86028f94b26dbf13c2131a334f Mon Sep 17 00:00:00 2001 From: limiting-factor Date: Sun, 23 Feb 2025 13:57:36 +0100 Subject: [PATCH 067/173] fix: lib: use temporary unique file name The function may be called from scripts that run under different users and re-using the same file name will run into problems: /home/debian/.cache/act/2cc577985400de79/hostexecutor/lib/lib.sh: line 96: /tmp/page: Permission denied curl: (23) Failure writing output to destination --- lib/lib.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/lib.sh b/lib/lib.sh index 96650b89..f752ec00 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -92,10 +92,11 @@ function retry() { function get_versions() { local releases=$1 local page=1 + local tmp=$(mktemp) while true; do - curl --fail -sS "$releases?limit=100&page=$page" | jq -r '.[] | .tag_name' >/tmp/page - cat /tmp/page - if ! test -s /tmp/page; then + curl --fail -sS "$releases?limit=100&page=$page" | jq -r '.[] | .tag_name' >$tmp + cat $tmp + if ! test -s $tmp; then break fi page=$(expr $page + 1) From cd95e7375606e6a8c6ee30b2a72c43892ace455a Mon Sep 17 00:00:00 2001 From: Gusted Date: Fri, 21 Mar 2025 19:02:26 +0000 Subject: [PATCH 068/173] fix: alternative route of getting latest Gitea version https://gitea.com/gitea/gitea-mirror no longer exists, instead use https://dl.gitea.com/gitea/version.json. Simplifies logic. --- lib/lib.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/lib.sh b/lib/lib.sh index f752ec00..1435a1cc 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -147,8 +147,7 @@ function download_gitea() { if ! test -f $DIR_BINARIES/gitea-$version; then mkdir -p $DIR_BINARIES if [[ $version =~ ^[0-9]+\.[0-9]+$ ]]; then - full_version=$(curl -sS "https://gitea.com/api/v1/repos/gitea/gitea-mirror/tags" | jq -r '.[] | .name | select(startswith("v'$version'"))' | grep -v -e '-rc' | sort --reverse --version-sort | head -1) - full_version=${full_version#v} + full_version=$(curl -sS "https://dl.gitea.com/gitea/version.json" | jq -r '.latest.version') else full_version=$version fi From dd0002c7c6d82ef745012745b5a63730d4ec7c62 Mon Sep 17 00:00:00 2001 From: Gusted Date: Fri, 21 Mar 2025 19:23:49 +0000 Subject: [PATCH 069/173] Update lib/lib.sh --- lib/lib.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/lib.sh b/lib/lib.sh index 1435a1cc..8aac3578 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -147,7 +147,8 @@ function download_gitea() { if ! test -f $DIR_BINARIES/gitea-$version; then mkdir -p $DIR_BINARIES if [[ $version =~ ^[0-9]+\.[0-9]+$ ]]; then - full_version=$(curl -sS "https://dl.gitea.com/gitea/version.json" | jq -r '.latest.version') + full_version=$(curl -sS "https://api.github.com/repos/go-gitea/gitea/releases?per_page=100" | jq -r '.[] | .tag_name | select(startswith("v'$version'"))' | grep -v -e '-rc' | sort --reverse --version-sort | head -1) + full_version=${full_version#v} else full_version=$version fi From 53375283d4e23ddc55a08d3b506ffcdcedc5c603 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Fri, 21 Mar 2025 23:50:30 +0100 Subject: [PATCH 070/173] fix: alternative route of getting latest Gitea version Use a code.forgejo.org mirror instead of the GitHub API to not be subject to rate limiting. --- .forgejo/workflows/gitea-upgrade.yml | 36 ++++++++++++++++++++++++++++ lib/lib.sh | 4 +++- upgrade/upgrade.sh | 6 ++++- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 .forgejo/workflows/gitea-upgrade.yml diff --git a/.forgejo/workflows/gitea-upgrade.yml b/.forgejo/workflows/gitea-upgrade.yml new file mode 100644 index 00000000..fe1bc458 --- /dev/null +++ b/.forgejo/workflows/gitea-upgrade.yml @@ -0,0 +1,36 @@ +# +# +# https://code.forgejo.org/forgejo/end-to-end/settings/actions +# +# secrets.MIRROR_TOKEN_GITEA +# https://code.forgejo.org/forgejo-mirror scope read:repository +# + +on: + pull_request_target: + push: + branches: + - 'main' + - 'wip-gitea' + +jobs: + gitea_upgrade: + name: gitea upgrade + runs-on: lxc-bookworm + steps: + - uses: https://data.forgejo.org/actions/checkout@v4 + - name: prepare upload + run: | + mkdir -p /tmp/forgejo-upload + touch /tmp/forgejo-upload/PLACEHOLDER + - uses: actions/upload-artifact@v3 + with: + name: forgejo-dev + path: /tmp/forgejo-upload + - uses: ./.forgejo/prepare-end-to-end + - name: gitea upgrades + run: | + su forgejo -c "./end-to-end.sh test_gitea_upgrades ${{ secrets.MIRROR_TOKEN_GITEA }}" + - name: full logs + if: always() + run: su forgejo -c "./end-to-end.sh show_logs" diff --git a/lib/lib.sh b/lib/lib.sh index 8aac3578..abc3ead1 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -141,13 +141,15 @@ function download_forgejo() { fi } +: ${GITEA_AUTHORIZATION_HEADER:=} + function download_gitea() { local version=$1 if ! test -f $DIR_BINARIES/gitea-$version; then mkdir -p $DIR_BINARIES if [[ $version =~ ^[0-9]+\.[0-9]+$ ]]; then - full_version=$(curl -sS "https://api.github.com/repos/go-gitea/gitea/releases?per_page=100" | jq -r '.[] | .tag_name | select(startswith("v'$version'"))' | grep -v -e '-rc' | sort --reverse --version-sort | head -1) + full_version=$(curl -sS -H "$GITEA_AUTHORIZATION_HEADER" "https://code.forgejo.org/api/v1/repos/gitea/gitea/tags" | jq -r '.[] | .name | select(startswith("v'$version'"))' | grep -v -e '-rc' | sort --reverse --version-sort | head -1) full_version=${full_version#v} else full_version=$version diff --git a/upgrade/upgrade.sh b/upgrade/upgrade.sh index 3248e830..1d95156f 100755 --- a/upgrade/upgrade.sh +++ b/upgrade/upgrade.sh @@ -67,6 +67,11 @@ function migration_assert() { } function test_gitea_upgrades() { + local token="$1" + GITEA_AUTHORIZATION_HEADER="Authorization: token $token" + + run dependencies + local config=$UPGRADE_DIR/default-app.ini # The Forgejo target migration version must be 10.0 because it is the last supported. # https://forgejo.org/2024-12-gitea-compatibility/ @@ -104,5 +109,4 @@ function test_upgrades() { run test_successful_upgrades run test_forgejo_pprof - run test_gitea_upgrades } From f3a96726471982104d7a5e1aec9702dea5306e7f Mon Sep 17 00:00:00 2001 From: Kwonunn Date: Sat, 22 Mar 2025 12:34:06 +0000 Subject: [PATCH 071/173] add cache-proxy test (#557) test to verify that a cache stored in one repo can't be restored in another Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/557 Reviewed-by: Gusted Reviewed-by: earl-warren Co-authored-by: Kwonunn Co-committed-by: Kwonunn --- actions/actions.sh | 4 +++ .../getter/.forgejo/workflows/get.yml | 25 ++++++++++++++++ actions/example-cache-proxy/run.sh | 22 ++++++++++++++ .../example-cache-proxy/runner-config.yaml | 29 +++++++++++++++++++ actions/example-cache-proxy/setup.sh | 1 + .../storer/.forgejo/workflows/store.yml | 17 +++++++++++ actions/example-cache-proxy/teardown.sh | 1 + 7 files changed, 99 insertions(+) create mode 100644 actions/example-cache-proxy/getter/.forgejo/workflows/get.yml create mode 100644 actions/example-cache-proxy/run.sh create mode 100644 actions/example-cache-proxy/runner-config.yaml create mode 100755 actions/example-cache-proxy/setup.sh create mode 100644 actions/example-cache-proxy/storer/.forgejo/workflows/store.yml create mode 100755 actions/example-cache-proxy/teardown.sh diff --git a/actions/actions.sh b/actions/actions.sh index 0b505080..bb21e8a1 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -147,6 +147,10 @@ function test_actions() { run actions_verify_example $example done + if dpkg --compare-versions $runner_version ge 6.3.0; then + run actions_verify_example cache-proxy + fi + if dpkg --compare-versions $version lt 7.1; then for example in cron; do run actions_verify_example $example diff --git a/actions/example-cache-proxy/getter/.forgejo/workflows/get.yml b/actions/example-cache-proxy/getter/.forgejo/workflows/get.yml new file mode 100644 index 00000000..33c5f4af --- /dev/null +++ b/actions/example-cache-proxy/getter/.forgejo/workflows/get.yml @@ -0,0 +1,25 @@ +on: [push] + +jobs: + build: + runs-on: docker + container: + image: code.forgejo.org/oci/node:20-bookworm + steps: + - name: cache restore + id: cachestep + uses: https://code.forgejo.org/actions/cache/restore@v4 + with: + path: | + /usr/local/bin/something + key: thecoolsecretcachekey + + - name: verify something + run: | + set -x + test SOMETHING = $(cat /usr/local/bin/something) + + - name: cache hit + run: | + set -x + test "${{ steps.cachestep.outputs.cache-hit }}" = true diff --git a/actions/example-cache-proxy/run.sh b/actions/example-cache-proxy/run.sh new file mode 100644 index 00000000..a4b15599 --- /dev/null +++ b/actions/example-cache-proxy/run.sh @@ -0,0 +1,22 @@ +source $EXAMPLE_DIR/../../lib/lib.sh + +api=$url/api/v1 +repostorer=root/example-cache-proxy-storer +repogetter=root/example-cache-proxy-getter + +function main() { + forgejo-curl.sh api_json -X DELETE $api/repos/$repostorer >&/dev/null || true + forgejo-curl.sh api_json -X DELETE $api/repos/$repogetter >&/dev/null || true + + forgejo-test-helper.sh push_workflow actions/example-$example/storer $url root example-$example-storer setup-forgejo $token + local shastorer=$(forgejo-test-helper.sh branch_tip $url $repostorer main) + + forgejo-test-helper.sh wait_success $url $repostorer $shastorer + + forgejo-test-helper.sh push_workflow actions/example-$example/getter $url root example-$example-getter setup-forgejo $token + local shagetter=$(forgejo-test-helper.sh branch_tip $url $repogetter main) + + forgejo-test-helper.sh wait_failure $url $repogetter $shagetter +} + +main diff --git a/actions/example-cache-proxy/runner-config.yaml b/actions/example-cache-proxy/runner-config.yaml new file mode 100644 index 00000000..851c2c2a --- /dev/null +++ b/actions/example-cache-proxy/runner-config.yaml @@ -0,0 +1,29 @@ +log: + level: debug + +runner: + file: .runner + capacity: 1 + env_file: .env + timeout: 3h + insecure: false + fetch_timeout: 5s + fetch_interval: 2s + labels: ["docker:docker://code.forgejo.org/oci/node:20-bookworm"] + +cache: + enabled: true + dir: "/srv/example/cache" + host: "" + port: 0 + +container: + network: "bridge" + privileged: false + options: + workdir_parent: + valid_volumes: ["/srv/example"] + docker_host: "" + +host: + workdir_parent: diff --git a/actions/example-cache-proxy/setup.sh b/actions/example-cache-proxy/setup.sh new file mode 100755 index 00000000..9c1f5adf --- /dev/null +++ b/actions/example-cache-proxy/setup.sh @@ -0,0 +1 @@ +FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config.yaml forgejo-runner.sh reload diff --git a/actions/example-cache-proxy/storer/.forgejo/workflows/store.yml b/actions/example-cache-proxy/storer/.forgejo/workflows/store.yml new file mode 100644 index 00000000..525334af --- /dev/null +++ b/actions/example-cache-proxy/storer/.forgejo/workflows/store.yml @@ -0,0 +1,17 @@ +on: [push] + +jobs: + build: + runs-on: docker + container: + image: code.forgejo.org/oci/node:20-bookworm + steps: + - name: create something + run: echo SOMETHING > /usr/local/bin/something + + - name: cache save + uses: https://code.forgejo.org/actions/cache/save@v4 + with: + path: | + /usr/local/bin/something + key: thecoolsecretcachekey diff --git a/actions/example-cache-proxy/teardown.sh b/actions/example-cache-proxy/teardown.sh new file mode 100755 index 00000000..b410c513 --- /dev/null +++ b/actions/example-cache-proxy/teardown.sh @@ -0,0 +1 @@ +forgejo-runner.sh reload From 4f7251fdb6127d0292113992077ed0abcd86a6e9 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 22 Mar 2025 14:17:35 +0000 Subject: [PATCH 072/173] Update https://code.forgejo.org/actions/setup-forgejo action to v2.0.10 --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 2d11b326..6ecf4124 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.9 + - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.10 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From b2471a699d35634557447a5687bb604eb0d82dee Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 22 Mar 2025 15:08:22 +0100 Subject: [PATCH 073/173] chore: s/code.forgejo.org/data.forgejo.org/ for actions --- .forgejo/prepare-end-to-end/action.yml | 4 ++-- .forgejo/workflows/end-to-end.yml | 18 +++++++++--------- .../.forgejo/workflows/test.yml | 8 ++++---- .../getter/.forgejo/workflows/get.yml | 2 +- .../storer/.forgejo/workflows/store.yml | 2 +- .../example-cache/.forgejo/workflows/test.yml | 6 +++--- .../.forgejo/workflows/test.yml | 2 +- .../.forgejo/workflows/test.yml | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 6ecf4124..5d58bba5 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -3,7 +3,7 @@ runs: steps: - name: cache S3 binaries id: S3 - uses: https://code.forgejo.org/actions/cache@v4 + uses: https://data.forgejo.org/actions/cache@v4 with: path: | /usr/local/bin/minio @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.10 + - uses: https://data.forgejo.org/actions/setup-forgejo@v2.0.10 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 35b27fcb..3ab7a47b 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -25,8 +25,8 @@ jobs: container: image: 'code.forgejo.org/oci/node:20-bookworm' steps: - - uses: https://code.forgejo.org/actions/checkout@v4 - - uses: https://code.forgejo.org/actions/setup-go@v5 + - uses: https://data.forgejo.org/actions/checkout@v4 + - uses: https://data.forgejo.org/actions/setup-go@v5 with: go-version: "1.22" - name: lib/build.sh @@ -64,7 +64,7 @@ jobs: needs: [build] runs-on: lxc-bookworm steps: - - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end - run: su forgejo -c "./end-to-end.sh test_packages" - name: full logs @@ -75,7 +75,7 @@ jobs: needs: [build] runs-on: lxc-bookworm steps: - - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end - run: ./end-to-end.sh prepare_dockerd - run: su forgejo -c "./end-to-end.sh test_actions" @@ -87,14 +87,14 @@ jobs: needs: [build] runs-on: lxc-bookworm steps: - - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end - name: install zstd run: | export DEBIAN_FRONTEND=noninteractive apt-get -q install -y -qq zstd - name: cache GitLab OCI image - uses: https://code.forgejo.org/actions/cache@v4 + uses: https://data.forgejo.org/actions/cache@v4 with: path: | /srv/forgejo-binaries/gitlab @@ -120,7 +120,7 @@ jobs: forgejo: https://codeberg.org owner: forgejo steps: - - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end - name: set full-version id: full-version @@ -132,7 +132,7 @@ jobs: - run: ./end-to-end.sh prepare_dockerd - run: su forgejo -c "./end-to-end.sh test_actions ${{ matrix.info.version }}" - name: update documentation - uses: https://code.forgejo.org/actions/cascading-pr@v2.1 + uses: https://data.forgejo.org/actions/cascading-pr@v2.1 with: origin-url: ${{ env.GITHUB_SERVER_URL }} origin-repo: ${{ github.repository }} @@ -154,7 +154,7 @@ jobs: needs: [build] runs-on: lxc-bookworm steps: - - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end - run: su forgejo -c "./end-to-end.sh test_upgrades" - run: su forgejo -c "./end-to-end.sh test_storage" diff --git a/actions/example-artifacts-v4/.forgejo/workflows/test.yml b/actions/example-artifacts-v4/.forgejo/workflows/test.yml index d2153546..526def6d 100644 --- a/actions/example-artifacts-v4/.forgejo/workflows/test.yml +++ b/actions/example-artifacts-v4/.forgejo/workflows/test.yml @@ -7,7 +7,7 @@ jobs: - run: touch artifacts/ONE artifacts/TWO - - uses: https://code.forgejo.org/forgejo/upload-artifact@v4 + - uses: https://data.forgejo.org/forgejo/upload-artifact@v4 with: name: many-artifacts path: artifacts/ @@ -16,7 +16,7 @@ jobs: needs: [upload-many] runs-on: docker steps: - - uses: https://code.forgejo.org/forgejo/download-artifact@v4 + - uses: https://data.forgejo.org/forgejo/download-artifact@v4 - run: | test -f many-artifacts/ONE @@ -29,7 +29,7 @@ jobs: - run: echo hello > path/to/artifact/world.txt - - uses: https://code.forgejo.org/forgejo/upload-artifact@v4 + - uses: https://data.forgejo.org/forgejo/upload-artifact@v4 with: name: my-artifact path: path/to/artifact/world.txt @@ -40,7 +40,7 @@ jobs: steps: - run: "! test -f world.txt" - - uses: https://code.forgejo.org/forgejo/download-artifact@v4 + - uses: https://data.forgejo.org/forgejo/download-artifact@v4 with: name: my-artifact diff --git a/actions/example-cache-proxy/getter/.forgejo/workflows/get.yml b/actions/example-cache-proxy/getter/.forgejo/workflows/get.yml index 33c5f4af..ffaf9e9d 100644 --- a/actions/example-cache-proxy/getter/.forgejo/workflows/get.yml +++ b/actions/example-cache-proxy/getter/.forgejo/workflows/get.yml @@ -8,7 +8,7 @@ jobs: steps: - name: cache restore id: cachestep - uses: https://code.forgejo.org/actions/cache/restore@v4 + uses: https://data.forgejo.org/actions/cache/restore@v4 with: path: | /usr/local/bin/something diff --git a/actions/example-cache-proxy/storer/.forgejo/workflows/store.yml b/actions/example-cache-proxy/storer/.forgejo/workflows/store.yml index 525334af..f8d42047 100644 --- a/actions/example-cache-proxy/storer/.forgejo/workflows/store.yml +++ b/actions/example-cache-proxy/storer/.forgejo/workflows/store.yml @@ -10,7 +10,7 @@ jobs: run: echo SOMETHING > /usr/local/bin/something - name: cache save - uses: https://code.forgejo.org/actions/cache/save@v4 + uses: https://data.forgejo.org/actions/cache/save@v4 with: path: | /usr/local/bin/something diff --git a/actions/example-cache/.forgejo/workflows/test.yml b/actions/example-cache/.forgejo/workflows/test.yml index ab37b75d..c8d1e0bf 100644 --- a/actions/example-cache/.forgejo/workflows/test.yml +++ b/actions/example-cache/.forgejo/workflows/test.yml @@ -8,7 +8,7 @@ jobs: steps: - name: cache restore id: cachestep1 - uses: https://code.forgejo.org/actions/cache/restore@v4 + uses: https://data.forgejo.org/actions/cache/restore@v4 with: path: | /usr/local/bin/something @@ -23,7 +23,7 @@ jobs: run: echo SOMETHING > /usr/local/bin/something - name: cache save - uses: https://code.forgejo.org/actions/cache/save@v4 + uses: https://data.forgejo.org/actions/cache/save@v4 with: path: | /usr/local/bin/something @@ -34,7 +34,7 @@ jobs: - name: cache restore id: cachestep2 - uses: https://code.forgejo.org/actions/cache/restore@v4 + uses: https://data.forgejo.org/actions/cache/restore@v4 with: path: | /usr/local/bin/something diff --git a/actions/example-docker-action/.forgejo/workflows/test.yml b/actions/example-docker-action/.forgejo/workflows/test.yml index 988a81ed..6bc63c6d 100644 --- a/actions/example-docker-action/.forgejo/workflows/test.yml +++ b/actions/example-docker-action/.forgejo/workflows/test.yml @@ -7,7 +7,7 @@ jobs: # # This Docker action creates the file SOMEFILE ... # - - uses: https://code.forgejo.org/forgejo/test-setup-forgejo-docker@main + - uses: https://data.forgejo.org/forgejo/test-setup-forgejo-docker@main with: args: ${{ github.workspace }}/SOMEFILE # diff --git a/actions/example-pull-request/.forgejo/workflows/test.yml b/actions/example-pull-request/.forgejo/workflows/test.yml index 772a38f8..829d9221 100644 --- a/actions/example-pull-request/.forgejo/workflows/test.yml +++ b/actions/example-pull-request/.forgejo/workflows/test.yml @@ -139,7 +139,7 @@ jobs: ${{ toJSON(github) }} EOF - - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://data.forgejo.org/actions/checkout@v4 - name: checkout the default branch if pull_request_target run: | set -x From d25843182413f866d44762855898b4a500075984 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 25 Mar 2025 01:31:29 +0000 Subject: [PATCH 074/173] Update https://data.forgejo.org/actions/setup-forgejo action to v2.0.11 --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 5d58bba5..a713112b 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v2.0.10 + - uses: https://data.forgejo.org/actions/setup-forgejo@v2.0.11 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From e63a861f43f4d9e5de1bfd0441f7b5d8d6e2913c Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 26 Mar 2025 15:35:59 +0000 Subject: [PATCH 075/173] actions: cache: use separate jobs for restore and save --- actions/example-cache/.forgejo/workflows/test.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/actions/example-cache/.forgejo/workflows/test.yml b/actions/example-cache/.forgejo/workflows/test.yml index c8d1e0bf..a431d5f6 100644 --- a/actions/example-cache/.forgejo/workflows/test.yml +++ b/actions/example-cache/.forgejo/workflows/test.yml @@ -1,7 +1,7 @@ on: [push] jobs: - build: + save-cache: runs-on: docker container: image: code.forgejo.org/oci/node:20-bookworm @@ -29,9 +29,12 @@ jobs: /usr/local/bin/something key: ${{ steps.cachestep1.outputs.cache-primary-key }} - - name: remove something - run: rm /usr/local/bin/something - + restore-cache: + runs-on: docker + needs: [save-cache] + container: + image: code.forgejo.org/oci/node:20-bookworm + steps: - name: cache restore id: cachestep2 uses: https://data.forgejo.org/actions/cache/restore@v4 From 281992968773a5b36833e0e196688881988b30c0 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 6 Apr 2025 10:50:03 +0200 Subject: [PATCH 076/173] actions: set insecure: true for better coverage Refs: https://code.forgejo.org/forgejo/runner/pulls/535 --- actions/example-config-options/runner-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/example-config-options/runner-config.yaml b/actions/example-config-options/runner-config.yaml index dff53565..0daf906f 100644 --- a/actions/example-config-options/runner-config.yaml +++ b/actions/example-config-options/runner-config.yaml @@ -8,7 +8,7 @@ runner: capacity: 1 env_file: .env timeout: 3h - insecure: false + insecure: true fetch_timeout: 5s fetch_interval: 2s labels: ["docker:docker://code.forgejo.org/oci/node:20-bookworm"] From 63a09dbaaa966face353b2dc20e6dc94744f359b Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 10 Apr 2025 10:07:42 +0200 Subject: [PATCH 077/173] chore(release): v12.0 exists --- forgejo/sources/12.0 | 1 + 1 file changed, 1 insertion(+) create mode 100644 forgejo/sources/12.0 diff --git a/forgejo/sources/12.0 b/forgejo/sources/12.0 new file mode 100644 index 00000000..1ed248e4 --- /dev/null +++ b/forgejo/sources/12.0 @@ -0,0 +1 @@ +https://codeberg.org/forgejo/forgejo forgejo 12.0.0 From d68ee49e3bb0b7adfaf6124fd153294a4af2cf62 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 10 Apr 2025 10:43:50 +0200 Subject: [PATCH 078/173] chore(release): v12.0 needs testing --- lib/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib.sh b/lib/lib.sh index abc3ead1..1cc9addf 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -26,7 +26,7 @@ IP=$(hostname -I | cut -f1 -d' ') # # Forgejo releases for which a branch exists (7.0/forgejo etc.) # -RELEASE_NUMBERS="7.0 10.0 11.0" +RELEASE_NUMBERS="7.0 11.0 12.0" PREFIX=============== export DIR=/tmp/forgejo-end-to-end From f537340c93e41ad5bfee56359a41d59c51a953c9 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Fri, 11 Apr 2025 08:06:34 +0200 Subject: [PATCH 079/173] fix: upgrades: do not hardcode versions - upgrading v7.0 to v7.0 is a noop - pprof testing lags behind --- upgrade/test-pprof-upload.sh | 14 ++++++-------- upgrade/upgrade.sh | 6 ++++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/upgrade/test-pprof-upload.sh b/upgrade/test-pprof-upload.sh index 732fae7d..3c10638c 100644 --- a/upgrade/test-pprof-upload.sh +++ b/upgrade/test-pprof-upload.sh @@ -28,15 +28,13 @@ function test_forgejo_pprof() { docker run --name test_pyroscope --rm -d -p 4040:4040 code.forgejo.org/oci/pyroscope:1.12.0 reset_forgejo $UPGRADE_DIR/default-app.ini - log_info "run 7.0" - start 7.0 - test_upload_profiles - stop - log_info "run 9.0" - start 9.0 - test_upload_profiles - stop + for version in $RELEASE_NUMBERS; do + log_info "run $version" + start $version + test_upload_profiles + stop + done docker stop test_pyroscope } diff --git a/upgrade/upgrade.sh b/upgrade/upgrade.sh index 1d95156f..7ef854f0 100755 --- a/upgrade/upgrade.sh +++ b/upgrade/upgrade.sh @@ -30,7 +30,9 @@ function test_successful_upgrades() { log_info "using $config" upgrade_reset $config - version=7.0 + set $RELEASE_NUMBERS + version="$1" + shift log_info "run $version" cleanup_storage start $version @@ -38,7 +40,7 @@ function test_successful_upgrades() { fixture_assert doctor_run $config - for version in $RELEASE_NUMBERS; do + for version in $@; do stop log_info "run $version" start $version From efc1a9f21bdb2935c3b432eb4a2d07a059da73b2 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Fri, 11 Apr 2025 08:55:25 +0200 Subject: [PATCH 080/173] fix: upgrades: teach renovate about the pyroscope version --- upgrade/test-pprof-upload.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/upgrade/test-pprof-upload.sh b/upgrade/test-pprof-upload.sh index 3c10638c..38fdb653 100644 --- a/upgrade/test-pprof-upload.sh +++ b/upgrade/test-pprof-upload.sh @@ -22,10 +22,12 @@ function test_upload_profiles() { done } +PYROSCOPE_VERSION=1.12.0 # renovate: datasource=docker depName=data.forgejo.org/oci/pyroscope + function test_forgejo_pprof() { stop docker rm -f test_pyroscope - docker run --name test_pyroscope --rm -d -p 4040:4040 code.forgejo.org/oci/pyroscope:1.12.0 + docker run --name test_pyroscope --rm -d -p 4040:4040 data.forgejo.org/oci/pyroscope:$PYROSCOPE_VERSION reset_forgejo $UPGRADE_DIR/default-app.ini From f9025665583cf6ac1ce517bc4af7c729521f56ef Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 12 Apr 2025 00:01:01 +0000 Subject: [PATCH 081/173] Update data.forgejo.org/oci/pyroscope Docker tag to v1.12.1 --- upgrade/test-pprof-upload.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upgrade/test-pprof-upload.sh b/upgrade/test-pprof-upload.sh index 38fdb653..4495891a 100644 --- a/upgrade/test-pprof-upload.sh +++ b/upgrade/test-pprof-upload.sh @@ -22,7 +22,7 @@ function test_upload_profiles() { done } -PYROSCOPE_VERSION=1.12.0 # renovate: datasource=docker depName=data.forgejo.org/oci/pyroscope +PYROSCOPE_VERSION=1.12.1 # renovate: datasource=docker depName=data.forgejo.org/oci/pyroscope function test_forgejo_pprof() { stop From 5b5dab8c13aad6145ffb6f4ca4c5ff4bc95ad6f5 Mon Sep 17 00:00:00 2001 From: limiting-factor Date: Fri, 9 May 2025 12:22:45 +0200 Subject: [PATCH 082/173] chore(revert): fix: alternative route of getting latest Gitea version Revert 53375283d4e23ddc55a08d3b506ffcdcedc5c603 fix: alternative route of getting latest Gitea version Use git ls-remote and git-mirror instead of the API $ version=1.23 $ git ls-remote --refs --tags --sort=version:refname https://git-mirror.forgejo.org/go-gitea/gitea "v$version*" | sed -n -E -e "s|^.*/v($version[\.0-9]*)$|\1|p" 1.23.0 1.23.1 1.23.2 1.23.3 1.23.4 1.23.5 1.23.6 1.23.7 --- .forgejo/workflows/gitea-upgrade.yml | 36 ---------------------------- lib/lib.sh | 5 +--- upgrade/upgrade.sh | 6 +---- 3 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 .forgejo/workflows/gitea-upgrade.yml diff --git a/.forgejo/workflows/gitea-upgrade.yml b/.forgejo/workflows/gitea-upgrade.yml deleted file mode 100644 index fe1bc458..00000000 --- a/.forgejo/workflows/gitea-upgrade.yml +++ /dev/null @@ -1,36 +0,0 @@ -# -# -# https://code.forgejo.org/forgejo/end-to-end/settings/actions -# -# secrets.MIRROR_TOKEN_GITEA -# https://code.forgejo.org/forgejo-mirror scope read:repository -# - -on: - pull_request_target: - push: - branches: - - 'main' - - 'wip-gitea' - -jobs: - gitea_upgrade: - name: gitea upgrade - runs-on: lxc-bookworm - steps: - - uses: https://data.forgejo.org/actions/checkout@v4 - - name: prepare upload - run: | - mkdir -p /tmp/forgejo-upload - touch /tmp/forgejo-upload/PLACEHOLDER - - uses: actions/upload-artifact@v3 - with: - name: forgejo-dev - path: /tmp/forgejo-upload - - uses: ./.forgejo/prepare-end-to-end - - name: gitea upgrades - run: | - su forgejo -c "./end-to-end.sh test_gitea_upgrades ${{ secrets.MIRROR_TOKEN_GITEA }}" - - name: full logs - if: always() - run: su forgejo -c "./end-to-end.sh show_logs" diff --git a/lib/lib.sh b/lib/lib.sh index 1cc9addf..1130a5bd 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -141,16 +141,13 @@ function download_forgejo() { fi } -: ${GITEA_AUTHORIZATION_HEADER:=} - function download_gitea() { local version=$1 if ! test -f $DIR_BINARIES/gitea-$version; then mkdir -p $DIR_BINARIES if [[ $version =~ ^[0-9]+\.[0-9]+$ ]]; then - full_version=$(curl -sS -H "$GITEA_AUTHORIZATION_HEADER" "https://code.forgejo.org/api/v1/repos/gitea/gitea/tags" | jq -r '.[] | .name | select(startswith("v'$version'"))' | grep -v -e '-rc' | sort --reverse --version-sort | head -1) - full_version=${full_version#v} + full_version=$(git ls-remote --refs --tags --sort=version:refname https://git-mirror.forgejo.org/go-gitea/gitea "v$version*" | sed -n -E -e "s|^.*/v($version[\.0-9]*)$|\1|p" | tail -1) else full_version=$version fi diff --git a/upgrade/upgrade.sh b/upgrade/upgrade.sh index 7ef854f0..29142499 100755 --- a/upgrade/upgrade.sh +++ b/upgrade/upgrade.sh @@ -69,11 +69,6 @@ function migration_assert() { } function test_gitea_upgrades() { - local token="$1" - GITEA_AUTHORIZATION_HEADER="Authorization: token $token" - - run dependencies - local config=$UPGRADE_DIR/default-app.ini # The Forgejo target migration version must be 10.0 because it is the last supported. # https://forgejo.org/2024-12-gitea-compatibility/ @@ -111,4 +106,5 @@ function test_upgrades() { run test_successful_upgrades run test_forgejo_pprof + run test_gitea_upgrades } From 9c355c30c1d9965a41ff635221193d6acd40af43 Mon Sep 17 00:00:00 2001 From: famfo Date: Mon, 2 Jun 2025 02:14:34 +0200 Subject: [PATCH 083/173] add Dockerfile to run tests in --- .dockerignore | 1 + Dockerfile | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..6b8710a7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..7cf8242e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +FROM code.forgejo.org/oci/node:20-bookworm + +ENV PATH=$PATH:/setup-forgejo +ENV _CONTAINERS_USERNS_CONFIGURED="" + +ADD https://code.forgejo.org/actions/setup-forgejo.git /setup-forgejo + +RUN apt-get update && \ + apt-get --assume-yes --no-install-recommends install \ + ca-certificates \ + curl \ + daemon \ + git \ + jq \ + podman \ + podman-docker \ + procps \ + slirp4netns \ + sqlite3 \ + sudo \ + tcpdump \ + uidmap \ + wget && \ + adduser forgejo-tests && \ + groupadd wheel && \ + adduser forgejo-tests wheel && \ + echo "%wheel ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers && \ + echo "forgejo-tests:10000:9999" > /etc/subuid && \ + echo "forgejo-tests:10000:9999" > /etc/subgid && \ + mkdir /srv/forgejo-binaries && \ + chown forgejo-tests:forgejo-tests /srv/forgejo-binaries && \ + apt-get clean + +COPY . /e2e + +USER forgejo-tests + +WORKDIR /e2e + +ENTRYPOINT /bin/bash From 5a586aedfaa49a676446a8c1ea0c7adf0320bb8a Mon Sep 17 00:00:00 2001 From: famfo Date: Sat, 7 Jun 2025 12:32:28 +0200 Subject: [PATCH 084/173] README: add notes on Dockerfile usage --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index cdae346c..6efdc7b5 100644 --- a/README.md +++ b/README.md @@ -108,3 +108,11 @@ Cleanup. It will teardown the Forgejo instance. ```sh ./end-to-end.sh stop ``` + +## Running tests in Docker/Podman + +There is an included Dockerfile in which the tests can be run. Building the +conatiner will copy the the entire repo state into the container from which +changes to the tests can be tested. Note: running in podman requires the +`--privileged` flag because this will run podman in podman for some tests. + From 652cf00186eef177130797b425cdd53f344b6b77 Mon Sep 17 00:00:00 2001 From: famfo Date: Mon, 2 Jun 2025 02:14:11 +0200 Subject: [PATCH 085/173] update logger mode in forgejo configs --- actions/default-app.ini | 2 +- federation/ONE-app.ini | 3 ++- federation/TWO-app.ini | 2 +- packages/alpine-app.ini | 2 +- storage/default-app.ini | 2 +- storage/specific-app.ini | 2 +- storage/stable-s3-app.ini | 2 +- upgrade/default-app.ini | 2 +- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/actions/default-app.ini b/actions/default-app.ini index e4577a59..455262fc 100644 --- a/actions/default-app.ini +++ b/actions/default-app.ini @@ -18,7 +18,7 @@ PATH = ${WORK_PATH}/forgejo.db [log] MODE = file LEVEL = trace -ROUTER = file +logger.router.MODE = file [log.file] FILE_NAME = forgejo.log diff --git a/federation/ONE-app.ini b/federation/ONE-app.ini index 4dcdacfa..92a75b71 100644 --- a/federation/ONE-app.ini +++ b/federation/ONE-app.ini @@ -17,7 +17,7 @@ PATH = ${WORK_PATH}/forgejo.db [log] MODE = file LEVEL = trace -ROUTER = file +logger.router.MODE = file [log.file] FILE_NAME = forgejo.log @@ -31,3 +31,4 @@ DEFAULT_PUSH_CREATE_PRIVATE = false [federation] ENABLED = true + diff --git a/federation/TWO-app.ini b/federation/TWO-app.ini index 656588a1..21448bda 100644 --- a/federation/TWO-app.ini +++ b/federation/TWO-app.ini @@ -17,7 +17,7 @@ PATH = ${WORK_PATH}/forgejo.db [log] MODE = file LEVEL = trace -ROUTER = file +logger.router.MODE = file [log.file] FILE_NAME = forgejo.log diff --git a/packages/alpine-app.ini b/packages/alpine-app.ini index ee378c50..21f95ffc 100644 --- a/packages/alpine-app.ini +++ b/packages/alpine-app.ini @@ -15,7 +15,7 @@ PATH = ${WORK_PATH}/forgejo.db [log] MODE = file LEVEL = trace -ROUTER = file +logger.router.MODE = file [log.file] FILE_NAME = forgejo.log diff --git a/storage/default-app.ini b/storage/default-app.ini index ee378c50..21f95ffc 100644 --- a/storage/default-app.ini +++ b/storage/default-app.ini @@ -15,7 +15,7 @@ PATH = ${WORK_PATH}/forgejo.db [log] MODE = file LEVEL = trace -ROUTER = file +logger.router.MODE = file [log.file] FILE_NAME = forgejo.log diff --git a/storage/specific-app.ini b/storage/specific-app.ini index c30911eb..02629581 100644 --- a/storage/specific-app.ini +++ b/storage/specific-app.ini @@ -14,7 +14,7 @@ DB_TYPE = sqlite3 [log] MODE = file LEVEL = debug -ROUTER = file +logger.router.MODE = file [log.file] FILE_NAME = forgejo.log diff --git a/storage/stable-s3-app.ini b/storage/stable-s3-app.ini index cedbfa5e..ef4ff0bd 100644 --- a/storage/stable-s3-app.ini +++ b/storage/stable-s3-app.ini @@ -14,7 +14,7 @@ DB_TYPE = sqlite3 [log] MODE = file LEVEL = debug -ROUTER = file +logger.router.MODE = file [log.file] FILE_NAME = forgejo.log diff --git a/upgrade/default-app.ini b/upgrade/default-app.ini index a39c034c..49674738 100644 --- a/upgrade/default-app.ini +++ b/upgrade/default-app.ini @@ -22,7 +22,7 @@ PATH = ${WORK_PATH}/forgejo.db [log] MODE = file LEVEL = trace -ROUTER = file +logger.router.MODE = file [log.file] FILE_NAME = forgejo.log From 482065391dbc4854105e95807d5a04fb182537af Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 7 Jun 2025 14:56:08 +0100 Subject: [PATCH 086/173] chore(docs): update instructions to compile from source The frontend part was missing, make it easy to copy/paste. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cdae346c..0813ea57 100644 --- a/README.md +++ b/README.md @@ -56,11 +56,11 @@ run so that the directories are populated. From a checkout of https://codeberg.org/forgejo/forgejo/ ```sh -make TAGS='bindata sqlite sqlite_unlock_notify' generate forgejo -cp -a forgejo /srv/forgejo-binaries/forgejo-10.0 +make clean-all && make frontend && make TAGS='bindata sqlite sqlite_unlock_notify' generate forgejo +cp -a forgejo /srv/forgejo-binaries/forgejo-11.0 ``` -It will be used whenever the version `10.0` is specified in a test. +It will be used whenever the version `11.0` is specified in a test. ### Forgejo runner From 475545eddf8ee77e5b2bc4d145a93b1115c8519b Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 7 Jun 2025 15:29:08 +0100 Subject: [PATCH 087/173] fix: federation: federation_verify_scenario is missing variables --- README.md | 17 +++++++++++++++-- federation/federation.sh | 2 ++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6efdc7b5..4431c79d 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ make --always-make forgejo-runner cp forgejo-runner /tmp/forgejo-end-to-end/forgejo-runner ``` -## Running actions locally +## Running actions tests locally To run and debug workflows from `actions/example-*`, from the root of the source directory, with docker and forgejo-curl.sh installed, mimic @@ -92,6 +92,20 @@ firefox 0.0.0.0:3000 # user root / admin1234 Note that `with-docker-tcp` requires the docker daemon listens to tcp://127.0.0.1:2375. See `actions/actions.sh` for how to do that. +## Running federation tests locally + +To run and debug scenarios from `federation/*`, from the root of +the source directory, mimic what `.forgejo/workflows/end-to-end.yml` does. + +```sh +./end-to-end.sh run dependencies +./end-to-end.sh federation_setup 12.0 +firefox 0.0.0.0:3001 # user root / admin1234 +firefox 0.0.0.0:3002 # user root / admin1234 +./end-to-end.sh federation_verify_scenario star +./end-to-end.sh federation_teardown +``` + ## Running other tests locally To run and debug tests, from the root of the source directory. @@ -115,4 +129,3 @@ There is an included Dockerfile in which the tests can be run. Building the conatiner will copy the the entire repo state into the container from which changes to the tests can be tested. Note: running in podman requires the `--privileged` flag because this will run podman in podman for some tests. - diff --git a/federation/federation.sh b/federation/federation.sh index 0a841901..35a03f79 100755 --- a/federation/federation.sh +++ b/federation/federation.sh @@ -26,6 +26,8 @@ function federation_setup_variables() { function federation_verify_scenario() { local scenario=$1 + federation_setup_variables + export scenario export SCENARIO_DIR=$FEDERATION_DIR/scenario-$scenario From f8f9a1bbdace8c6917bbe45acdfe69f1a7ecd73f Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 25 Jun 2025 07:39:14 +0200 Subject: [PATCH 088/173] chore(release): v13.0 exists --- forgejo/sources/13.0 | 1 + lib/lib.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 forgejo/sources/13.0 diff --git a/forgejo/sources/13.0 b/forgejo/sources/13.0 new file mode 100644 index 00000000..24bcca16 --- /dev/null +++ b/forgejo/sources/13.0 @@ -0,0 +1 @@ +https://codeberg.org/forgejo/forgejo forgejo 13.0.0 diff --git a/lib/lib.sh b/lib/lib.sh index 1130a5bd..22055dc5 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -26,7 +26,7 @@ IP=$(hostname -I | cut -f1 -d' ') # # Forgejo releases for which a branch exists (7.0/forgejo etc.) # -RELEASE_NUMBERS="7.0 11.0 12.0" +RELEASE_NUMBERS="11.0 12.0 13.0" PREFIX=============== export DIR=/tmp/forgejo-end-to-end From 3d5a218709a8ba76dc135fb74e3eb8259c89b317 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 30 Jun 2025 17:45:12 +0200 Subject: [PATCH 089/173] actions: add test for hashFiles() As of https://code.forgejo.org/forgejo/act/commit/7c7d80ebdd4aee01bb858a828ad864aa120b4a75 a step with hashFiles('...') will lookup the file from the container running the job. --- .../.forgejo/workflows/test.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/actions/example-expression/.forgejo/workflows/test.yml b/actions/example-expression/.forgejo/workflows/test.yml index ab4bb646..e20a996a 100644 --- a/actions/example-expression/.forgejo/workflows/test.yml +++ b/actions/example-expression/.forgejo/workflows/test.yml @@ -98,10 +98,11 @@ jobs: set -x test "${{ fromJSON('["one","two"]')[0] }}" = 'one' - # As of act v1.13.0 this fails for real (before it pretended to work but did not) - # - name: hashFiles - # run: | - # set -x - # hash="bd52020371c038c4ad38a8d2df05dfa1a220d40fbe1ae83b63d6010cb527e531" - # test "${{ hashFiles('actions/example-expression/.forgejo/fileone.txt') }}" = $hash - # test "${{ hashFiles('actions/example-expression/.forgejo/fileone.*') }}" = $hash + - uses: actions/checkout@v4 + + - name: hashFiles + run: | + set -x + hash="aea6ca2329c852f5b480ec35e1fe09d39a6bd1b50f4f9cc38fbd4fef870dc107" + test "${{ hashFiles('.forgejo/fileone.txt') }}" = $hash + test "${{ hashFiles('.forgejo/fileone.*') }}" = $hash From 3bd75af38cb30c65763525901be23cf55b574362 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 2 Jul 2025 00:01:02 +0000 Subject: [PATCH 090/173] Update https://data.forgejo.org/actions/setup-forgejo action to v2.0.12 --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index a713112b..52e997a7 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v2.0.11 + - uses: https://data.forgejo.org/actions/setup-forgejo@v2.0.12 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From dd31a59c1ebade99c1f12de42a9947c41bcbe1a6 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 2 Jul 2025 10:53:36 +0000 Subject: [PATCH 091/173] actions: config-options: test for envs and env-file (#722) Refs: forgejo/runner#287 Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/722 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .../example-config-options/.forgejo/workflows/test.yml | 8 ++++++++ actions/example-config-options/env_file | 1 + actions/example-config-options/runner-config.yaml | 4 +++- actions/example-config-options/setup.sh | 5 ++++- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 actions/example-config-options/env_file diff --git a/actions/example-config-options/.forgejo/workflows/test.yml b/actions/example-config-options/.forgejo/workflows/test.yml index d9c03241..63bbc212 100644 --- a/actions/example-config-options/.forgejo/workflows/test.yml +++ b/actions/example-config-options/.forgejo/workflows/test.yml @@ -11,6 +11,14 @@ jobs: - run: | ! test -f /srv/example-config-options-volume-invalid - run: | + set -x test "$FROB" = "NITZ" - run: | + set -x + test "$VAR_FROM_ENV_FILE" = "VALUE_FROM_ENV_FILE" + - run: | + set -x + test "$VAR_FROM_ENV_IN_CONFIG" = "VALUE_FROM_ENV_IN_CONFIG" + - run: | + set -x test "$(cat /etc/hostname)" = customname diff --git a/actions/example-config-options/env_file b/actions/example-config-options/env_file new file mode 100644 index 00000000..c5b811ba --- /dev/null +++ b/actions/example-config-options/env_file @@ -0,0 +1 @@ +VAR_FROM_ENV_FILE=VALUE_FROM_ENV_FILE diff --git a/actions/example-config-options/runner-config.yaml b/actions/example-config-options/runner-config.yaml index 0daf906f..ec5d1c5d 100644 --- a/actions/example-config-options/runner-config.yaml +++ b/actions/example-config-options/runner-config.yaml @@ -6,7 +6,9 @@ log: runner: file: .runner capacity: 1 - env_file: .env + envs: + VAR_FROM_ENV_IN_CONFIG: VALUE_FROM_ENV_IN_CONFIG + env_file: env_file timeout: 3h insecure: true fetch_timeout: 5s diff --git a/actions/example-config-options/setup.sh b/actions/example-config-options/setup.sh index d9f6ea9c..1e62e683 100755 --- a/actions/example-config-options/setup.sh +++ b/actions/example-config-options/setup.sh @@ -1,3 +1,6 @@ >/srv/example-config-options-volume-valid >/srv/example-config-options-volume-invalid -FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config.yaml forgejo-runner.sh reload +TMPDIR=$(mktemp -d) +cp $EXAMPLE_DIR/runner-config.yaml $EXAMPLE_DIR/env_file $TMPDIR +sed -i -e "s|env_file:.*|env_file: $TMPDIR/env_file|" $TMPDIR/runner-config.yaml +FORGEJO_RUNNER_CONFIG=$TMPDIR/runner-config.yaml forgejo-runner.sh reload From 07b9318ff7003e3646313c753cc04fd9eeb7207b Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 2 Jul 2025 10:54:26 +0000 Subject: [PATCH 092/173] actions: config-options: mount read-only (#718) To illustrate (partially) [this feature request](https://code.forgejo.org/forgejo/runner/issues/79#issuecomment-43844) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/718 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/example-config-options/.forgejo/workflows/test.yml | 2 ++ actions/example-config-options/runner-config.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/actions/example-config-options/.forgejo/workflows/test.yml b/actions/example-config-options/.forgejo/workflows/test.yml index 63bbc212..7845e441 100644 --- a/actions/example-config-options/.forgejo/workflows/test.yml +++ b/actions/example-config-options/.forgejo/workflows/test.yml @@ -8,6 +8,8 @@ jobs: steps: - run: | test -f /srv/example-config-options-volume-valid + - run: | + ! test -w /srv/example-config-options-volume-valid - run: | ! test -f /srv/example-config-options-volume-invalid - run: | diff --git a/actions/example-config-options/runner-config.yaml b/actions/example-config-options/runner-config.yaml index ec5d1c5d..37b7b0ae 100644 --- a/actions/example-config-options/runner-config.yaml +++ b/actions/example-config-options/runner-config.yaml @@ -24,7 +24,7 @@ cache: container: network: "" privileged: false - options: "--volume /srv/example-config-options-volume-valid:/srv/example-config-options-volume-valid --volume /srv/example-config-options-volume-invalid:/srv/example-config-options-volume-invalid --env FROB=NITZ" + options: "--volume /srv/example-config-options-volume-valid:/srv/example-config-options-volume-valid:ro --volume /srv/example-config-options-volume-invalid:/srv/example-config-options-volume-invalid --env FROB=NITZ" workdir_parent: valid_volumes: ["/srv/example-config-options-volume-valid"] docker_host: "" From cd1a0f5076c34ad203036c806c4c2d452e1487fa Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 6 Jul 2025 12:15:38 +0000 Subject: [PATCH 093/173] chore: add assertions for the forge context and use it instead of github where relevant (#748) Refs forgejo/act#37 Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/748 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/workflows/end-to-end.yml | 4 ++-- .../example-context/.forgejo/workflows/test.yml | 17 +++++++++++++++++ .../action-for-context/action.yml | 2 ++ .../.forgejo/workflows/test.yml | 4 ++-- .../.forgejo/workflows/test.yml | 8 ++++---- 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 3ab7a47b..d535d37d 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -108,7 +108,7 @@ jobs: actions-docs: needs: [build] runs-on: lxc-bookworm - if: github.ref == 'refs/heads/main' + if: forge.ref == 'refs/heads/main' strategy: matrix: info: @@ -135,7 +135,7 @@ jobs: uses: https://data.forgejo.org/actions/cascading-pr@v2.1 with: origin-url: ${{ env.GITHUB_SERVER_URL }} - origin-repo: ${{ github.repository }} + origin-repo: ${{ forge.repository }} origin-token: ${{ secrets.CASCADE_DOCS_ORIGIN_TOKEN }} origin-ref: refs/heads/main destination-url: https://codeberg.org diff --git a/actions/example-context/.forgejo/workflows/test.yml b/actions/example-context/.forgejo/workflows/test.yml index a894bfd2..0f9db31b 100644 --- a/actions/example-context/.forgejo/workflows/test.yml +++ b/actions/example-context/.forgejo/workflows/test.yml @@ -21,6 +21,7 @@ jobs: echo "$GITHUB_ACTION" | grep -E '^[0-9]+$' test "$GITHUB_ACTION" = "${{ env.GITHUB_ACTION }}" test "$GITHUB_ACTION" = "${{ github.ACTION }}" + test "$GITHUB_ACTION" = "${{ forge.ACTION }}" # See also actions/example-local-action/.forgejo/local-action/action.yml - name: GITHUB_ACTION_PATH @@ -29,6 +30,7 @@ jobs: test -z "$GITHUB_ACTION_PATH" test "$GITHUB_ACTION_PATH" = "${{ env.GITHUB_ACTION_PATH }}" test "$GITHUB_ACTION_PATH" = "${{ github.ACTION_PATH }}" + test "$GITHUB_ACTION_PATH" = "${{ forge.ACTION_PATH }}" - name: when running an action if: ${{ env.GITHUB_ACTIONS }} @@ -54,6 +56,7 @@ jobs: test "$GITHUB_ACTOR" test "$GITHUB_ACTOR" = "${{ env.GITHUB_ACTOR }}" test "$GITHUB_ACTOR" = "${{ github.ACTOR }}" + test "$GITHUB_ACTOR" = "${{ forge.ACTOR }}" - name: GITHUB_API_URL shell: bash @@ -62,6 +65,7 @@ jobs: [[ "$GITHUB_API_URL" =~ /api/v1$ ]] test "$GITHUB_API_URL" = "${{ env.GITHUB_API_URL }}" test "$GITHUB_API_URL" = "${{ github.API_URL }}" + test "$GITHUB_API_URL" = "${{ forge.API_URL }}" # See also actions/example-pull-request/.forgejo/workflows/test.yml - name: GITHUB_BASE_REF @@ -70,6 +74,7 @@ jobs: test -z "$GITHUB_BASE_REF" test "$GITHUB_BASE_REF" = "${{ env.GITHUB_BASE_REF }}" test "$GITHUB_BASE_REF" = "${{ github.BASE_REF }}" + test "$GITHUB_BASE_REF" = "${{ forge.BASE_REF }}" # See also actions/example-pull-request/.forgejo/workflows/test.yml - name: GITHUB_HEAD_REF @@ -78,6 +83,7 @@ jobs: test -z "$GITHUB_HEAD_REF" test "$GITHUB_HEAD_REF" = "${{ env.GITHUB_HEAD_REF }}" test "$GITHUB_HEAD_REF" = "${{ github.HEAD_REF }}" + test "$GITHUB_HEAD_REF" = "${{ forge.HEAD_REF }}" - name: GITHUB_ENV run: | @@ -91,6 +97,7 @@ jobs: test "$GITHUB_EVENT_NAME" = push test "$GITHUB_EVENT_NAME" = "${{ env.GITHUB_EVENT_NAME }}" test "$GITHUB_EVENT_NAME" = "${{ github.EVENT_NAME }}" + test "$GITHUB_EVENT_NAME" = "${{ forge.EVENT_NAME }}" - name: GITHUB_JOB run: | @@ -98,6 +105,7 @@ jobs: test "$GITHUB_JOB" = test test "$GITHUB_JOB" = "${{ env.GITHUB_JOB }}" test "$GITHUB_JOB" = "${{ github.JOB }}" + test "$GITHUB_JOB" = "${{ forge.JOB }}" - name: GITHUB_OUTPUT run: | @@ -118,6 +126,7 @@ jobs: [[ "$GITHUB_REF" =~ ^refs/ ]] test "$GITHUB_REF" = "${{ env.GITHUB_REF }}" test "$GITHUB_REF" = "${{ github.REF }}" + test "$GITHUB_REF" = "${{ forge.REF }}" - name: GITHUB_REF_NAME shell: bash @@ -126,6 +135,7 @@ jobs: ! [[ "$GITHUB_REF_NAME" =~ ^refs/ ]] test "$GITHUB_REF_NAME" = "${{ env.GITHUB_REF_NAME }}" test "$GITHUB_REF_NAME" = "${{ github.REF_NAME }}" + test "$GITHUB_REF_NAME" = "${{ forge.REF_NAME }}" - name: GITHUB_REPOSITORY run: | @@ -133,6 +143,7 @@ jobs: test "$GITHUB_REPOSITORY" = root/example-context test "$GITHUB_REPOSITORY" = "${{ env.GITHUB_REPOSITORY }}" test "$GITHUB_REPOSITORY" = "${{ github.REPOSITORY }}" + test "$GITHUB_REPOSITORY" = "${{ forge.REPOSITORY }}" - name: GITHUB_REPOSITORY_OWNER run: | @@ -140,6 +151,7 @@ jobs: test "$GITHUB_REPOSITORY_OWNER" = root test "$GITHUB_REPOSITORY_OWNER" = "${{ env.GITHUB_REPOSITORY_OWNER }}" test "$GITHUB_REPOSITORY_OWNER" = "${{ github.REPOSITORY_OWNER }}" + test "$GITHUB_REPOSITORY_OWNER" = "${{ forge.REPOSITORY_OWNER }}" - name: GITHUB_RUN_NUMBER run: | @@ -147,6 +159,7 @@ jobs: echo "$GITHUB_RUN_NUMBER" | grep -E '^[0-9]+$' test "$GITHUB_RUN_NUMBER" = "${{ env.GITHUB_RUN_NUMBER }}" test "$GITHUB_RUN_NUMBER" = "${{ github.RUN_NUMBER }}" + test "$GITHUB_RUN_NUMBER" = "${{ forge.RUN_NUMBER }}" - name: GITHUB_SERVER_URL shell: bash @@ -155,6 +168,7 @@ jobs: [[ "$GITHUB_SERVER_URL" =~ ^http ]] test "$GITHUB_SERVER_URL" = "${{ env.GITHUB_SERVER_URL }}" test "$GITHUB_SERVER_URL" = "${{ github.SERVER_URL }}" + test "$GITHUB_SERVER_URL" = "${{ forge.SERVER_URL }}" - name: GITHUB_SHA run: | @@ -162,6 +176,7 @@ jobs: test "$GITHUB_SHA" test "$GITHUB_SHA" = "${{ env.GITHUB_SHA }}" test "$GITHUB_SHA" = "${{ github.SHA }}" + test "$GITHUB_SHA" = "${{ forge.SHA }}" - name: GITHUB_STEP_SUMMARY run: | @@ -176,6 +191,7 @@ jobs: test "$GITHUB_TOKEN" test "$GITHUB_TOKEN" = "${{ env.GITHUB_TOKEN }}" test "$GITHUB_TOKEN" = "${{ github.TOKEN }}" + test "$GITHUB_TOKEN" = "${{ forge.TOKEN }}" - name: GITHUB_WORKSPACE run: | @@ -183,6 +199,7 @@ jobs: test -d "$GITHUB_WORKSPACE" test "$GITHUB_WORKSPACE" = "${{ env.GITHUB_WORKSPACE }}" test "$GITHUB_WORKSPACE" = "${{ github.WORKSPACE }}" + test "$GITHUB_WORKSPACE" = "${{ forge.WORKSPACE }}" - name: RUNNER_ARCH run: | diff --git a/actions/example-context/action-for-context/action.yml b/actions/example-context/action-for-context/action.yml index dcb8f2b7..c1c33843 100644 --- a/actions/example-context/action-for-context/action.yml +++ b/actions/example-context/action-for-context/action.yml @@ -12,6 +12,7 @@ runs: test "$GITHUB_ACTION_REPOSITORY" = root/action-for-context test "$GITHUB_ACTION_REPOSITORY" = "${{ env.GITHUB_ACTION_REPOSITORY }}" test "$GITHUB_ACTION_REPOSITORY" = "${{ github.ACTION_REPOSITORY }}" + test "$GITHUB_ACTION_REPOSITORY" = "${{ forge.ACTION_REPOSITORY }}" touch /srv/example/example-context/GITHUB_ACTION_REPOSITORY - name: GITHUB_ACTION_PATH @@ -20,4 +21,5 @@ runs: set -x [[ "$GITHUB_ACTION_PATH" =~ action-for-context@main$ ]] test "$GITHUB_ACTION_PATH" = "${{ github.ACTION_PATH }}" + test "$GITHUB_ACTION_PATH" = "${{ forge.ACTION_PATH }}" touch /srv/example/example-context/GITHUB_ACTION_PATH diff --git a/actions/example-docker-action/.forgejo/workflows/test.yml b/actions/example-docker-action/.forgejo/workflows/test.yml index 6bc63c6d..cec2c9db 100644 --- a/actions/example-docker-action/.forgejo/workflows/test.yml +++ b/actions/example-docker-action/.forgejo/workflows/test.yml @@ -9,11 +9,11 @@ jobs: # - uses: https://data.forgejo.org/forgejo/test-setup-forgejo-docker@main with: - args: ${{ github.workspace }}/SOMEFILE + args: ${{ forge.workspace }}/SOMEFILE # # ... which then also exists in the job workspace # because both docker containers are automatically # sharing the volume that contains it. # - run: | - test -f ${{ github.workspace }}/SOMEFILE + test -f ${{ forge.workspace }}/SOMEFILE diff --git a/actions/example-pull-request/.forgejo/workflows/test.yml b/actions/example-pull-request/.forgejo/workflows/test.yml index 829d9221..2b864cb6 100644 --- a/actions/example-pull-request/.forgejo/workflows/test.yml +++ b/actions/example-pull-request/.forgejo/workflows/test.yml @@ -18,7 +18,7 @@ jobs: run: | set -x test $GITHUB_TOKEN = ${{ env.GITHUB_TOKEN }} - test $GITHUB_TOKEN = ${{ github.token }} + test $GITHUB_TOKEN = ${{ forge.token }} export DEBIAN_FRONTEND=noninteractive ; apt-get -qq update ; apt-get install -y -qq curl git >& /dev/null curl -sS -o /usr/local/bin/forgejo-curl.sh https://code.forgejo.org/forgejo/forgejo-curl/raw/branch/main/forgejo-curl.sh && chmod +x /usr/local/bin/forgejo-curl.sh forgejo-curl.sh --token "$GITHUB_TOKEN" login $GITHUB_SERVER_URL @@ -27,7 +27,7 @@ jobs: - name: determine if the PR is from a fork id: forked run: | - if test ${{ github.event.pull_request.base.repo.full_name }} = ${{ github.event.pull_request.head.repo.full_name }} ; then + if test ${{ forge.event.pull_request.base.repo.full_name }} = ${{ forge.event.pull_request.head.repo.full_name }} ; then echo value=false >> $GITHUB_OUTPUT else echo value=true >> $GITHUB_OUTPUT @@ -95,7 +95,7 @@ jobs: # # create an issue # - base_repo=${{ github.event.pull_request.base.repo.full_name }} + base_repo=${{ forge.event.pull_request.base.repo.full_name }} forgejo-curl.sh api_json --data-raw '{"title":"ISSUE"}' $GITHUB_SERVER_URL/api/v1/repos/$base_repo/issues url=$(echo $GITHUB_SERVER_URL | sed -e "s|://|://$GITHUB_TOKEN@|") git clone $url/$base_repo base @@ -133,7 +133,7 @@ jobs: - name: save event run: | - d=/srv/example/pull-request/contexts/${{ github.event.pull_request.head.repo.owner.username }}/$GITHUB_EVENT_NAME + d=/srv/example/pull-request/contexts/${{ forge.event.pull_request.head.repo.owner.username }}/$GITHUB_EVENT_NAME mkdir -p $d cat > $d/github <<'EOF' ${{ toJSON(github) }} From 0965ce216b9eda0962555b972c7f0e21ffadebb3 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 7 Jul 2025 05:10:47 +0000 Subject: [PATCH 094/173] Update https://data.forgejo.org/actions/setup-forgejo action to v2.0.13 (#759) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://data.forgejo.org/actions/setup-forgejo](https://code.forgejo.org/actions/setup-forgejo) | action | patch | `v2.0.12` -> `v2.0.13` | --- ### Release Notes
actions/setup-forgejo (https://data.forgejo.org/actions/setup-forgejo) ### [`v2.0.13`](https://code.forgejo.org/actions/setup-forgejo/compare/v2.0.12...v2.0.13) [Compare Source](https://code.forgejo.org/actions/setup-forgejo/compare/v2.0.12...v2.0.13)
--- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/759 Reviewed-by: earl-warren Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 52e997a7..782fe9eb 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v2.0.12 + - uses: https://data.forgejo.org/actions/setup-forgejo@v2.0.13 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 5988f7cde5021e293a690f3f1371004d3e45b698 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 7 Jul 2025 08:48:17 +0000 Subject: [PATCH 095/173] Update https://data.forgejo.org/actions/setup-forgejo action to v3 (#763) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://data.forgejo.org/actions/setup-forgejo](https://code.forgejo.org/actions/setup-forgejo) | action | major | `v2.0.13` -> `v3.0.0` | --- ### Release Notes
actions/setup-forgejo (https://data.forgejo.org/actions/setup-forgejo) ### [`v3.0.0`](https://code.forgejo.org/actions/setup-forgejo/compare/v2.0.13...v3.0.0) [Compare Source](https://code.forgejo.org/actions/setup-forgejo/compare/v2.0.13...v3.0.0)
--- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/763 Reviewed-by: earl-warren Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 782fe9eb..5b147db5 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v2.0.13 + - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.0 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From f0eadf960bc426afad9d026378a75b56c8556af6 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 7 Jul 2025 19:35:28 +0000 Subject: [PATCH 096/173] Update https://data.forgejo.org/actions/setup-forgejo action to v3.0.1 (#772) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://data.forgejo.org/actions/setup-forgejo](https://code.forgejo.org/actions/setup-forgejo) | action | patch | `v3.0.0` -> `v3.0.1` | --- ### Release Notes
actions/setup-forgejo (https://data.forgejo.org/actions/setup-forgejo) ### [`v3.0.1`](https://code.forgejo.org/actions/setup-forgejo/compare/v3.0.0...v3.0.1) [Compare Source](https://code.forgejo.org/actions/setup-forgejo/compare/v3.0.0...v3.0.1)
--- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/772 Reviewed-by: earl-warren Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 5b147db5..472c0938 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.0 + - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.1 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 49c2072cbe3c9b8270ac6dff2bc08ebaf7a2749e Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 8 Jul 2025 04:51:37 +0000 Subject: [PATCH 097/173] actions: use FORGEJO_* instead of GITHUB_* and test backward compatibility (#758) Refs forgejo/act#171 Refs actions/setup-forgejo#461 Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/758 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .../.forgejo/workflows/test.yml | 232 ++++++++++-------- .../action-for-context/action.yml | 24 +- 2 files changed, 140 insertions(+), 116 deletions(-) diff --git a/actions/example-context/.forgejo/workflows/test.yml b/actions/example-context/.forgejo/workflows/test.yml index 0f9db31b..1a092cd9 100644 --- a/actions/example-context/.forgejo/workflows/test.yml +++ b/actions/example-context/.forgejo/workflows/test.yml @@ -15,191 +15,213 @@ jobs: test "$CI" = true test "$CI" = "${{ env.CI }}" - - name: GITHUB_ACTION + - name: FORGEJO_ACTION run: | set -x - echo "$GITHUB_ACTION" | grep -E '^[0-9]+$' - test "$GITHUB_ACTION" = "${{ env.GITHUB_ACTION }}" - test "$GITHUB_ACTION" = "${{ github.ACTION }}" - test "$GITHUB_ACTION" = "${{ forge.ACTION }}" + echo "$FORGEJO_ACTION" | grep -E '^[0-9]+$' + test "$FORGEJO_ACTION" = "${{ env.FORGEJO_ACTION }}" + test "$FORGEJO_ACTION" = "${{ github.ACTION }}" + test "$FORGEJO_ACTION" = "${{ forge.ACTION }}" + test "$FORGEJO_ACTION" = "$GITHUB_ACTION" # See also actions/example-local-action/.forgejo/local-action/action.yml - - name: GITHUB_ACTION_PATH + - name: FORGEJO_ACTION_PATH run: | set -x - test -z "$GITHUB_ACTION_PATH" - test "$GITHUB_ACTION_PATH" = "${{ env.GITHUB_ACTION_PATH }}" - test "$GITHUB_ACTION_PATH" = "${{ github.ACTION_PATH }}" - test "$GITHUB_ACTION_PATH" = "${{ forge.ACTION_PATH }}" + test -z "$FORGEJO_ACTION_PATH" + test "$FORGEJO_ACTION_PATH" = "${{ env.FORGEJO_ACTION_PATH }}" + test "$FORGEJO_ACTION_PATH" = "${{ github.ACTION_PATH }}" + test "$FORGEJO_ACTION_PATH" = "${{ forge.ACTION_PATH }}" + test "$FORGEJO_ACTION_PATH" = "$GITHUB_ACTION_PATH" - name: when running an action - if: ${{ env.GITHUB_ACTIONS }} + if: ${{ env.FORGEJO_ACTIONS }} uses: SELF@main with: input-one: "otherone" - - name: GITHUB_ACTION_REPOSITORY - run: test -f /srv/example/example-context/GITHUB_ACTION_REPOSITORY + - name: FORGEJO_ACTION_REPOSITORY + run: test -f /srv/example/example-context/FORGEJO_ACTION_REPOSITORY - - name: GITHUB_ACTION_PATH - run: test -f /srv/example/example-context/GITHUB_ACTION_PATH + - name: FORGEJO_ACTION_PATH + run: test -f /srv/example/example-context/FORGEJO_ACTION_PATH - - name: GITHUB_ACTIONS + - name: FORGEJO_ACTIONS run: | set -x - test "$GITHUB_ACTIONS" = true - test "$GITHUB_ACTIONS" = "${{ env.GITHUB_ACTIONS }}" + test "$FORGEJO_ACTIONS" = true + test "$FORGEJO_ACTIONS" = "${{ env.FORGEJO_ACTIONS }}" + test "$FORGEJO_ACTIONS" = "$GITHUB_ACTIONS" - - name: GITHUB_ACTOR + - name: FORGEJO_ACTOR run: | set -x - test "$GITHUB_ACTOR" - test "$GITHUB_ACTOR" = "${{ env.GITHUB_ACTOR }}" - test "$GITHUB_ACTOR" = "${{ github.ACTOR }}" - test "$GITHUB_ACTOR" = "${{ forge.ACTOR }}" + test "$FORGEJO_ACTOR" + test "$FORGEJO_ACTOR" = "${{ env.FORGEJO_ACTOR }}" + test "$FORGEJO_ACTOR" = "${{ github.ACTOR }}" + test "$FORGEJO_ACTOR" = "${{ forge.ACTOR }}" + test "$FORGEJO_ACTOR" = "$GITHUB_ACTOR" - - name: GITHUB_API_URL + - name: FORGEJO_API_URL shell: bash run: | set -x - [[ "$GITHUB_API_URL" =~ /api/v1$ ]] - test "$GITHUB_API_URL" = "${{ env.GITHUB_API_URL }}" - test "$GITHUB_API_URL" = "${{ github.API_URL }}" - test "$GITHUB_API_URL" = "${{ forge.API_URL }}" + [[ "$FORGEJO_API_URL" =~ /api/v1$ ]] + test "$FORGEJO_API_URL" = "${{ env.FORGEJO_API_URL }}" + test "$FORGEJO_API_URL" = "${{ github.API_URL }}" + test "$FORGEJO_API_URL" = "${{ forge.API_URL }}" + test "$FORGEJO_API_URL" = "$GITHUB_API_URL" # See also actions/example-pull-request/.forgejo/workflows/test.yml - - name: GITHUB_BASE_REF + - name: FORGEJO_BASE_REF run: | set -x - test -z "$GITHUB_BASE_REF" - test "$GITHUB_BASE_REF" = "${{ env.GITHUB_BASE_REF }}" - test "$GITHUB_BASE_REF" = "${{ github.BASE_REF }}" - test "$GITHUB_BASE_REF" = "${{ forge.BASE_REF }}" + test -z "$FORGEJO_BASE_REF" + test "$FORGEJO_BASE_REF" = "${{ env.FORGEJO_BASE_REF }}" + test "$FORGEJO_BASE_REF" = "${{ github.BASE_REF }}" + test "$FORGEJO_BASE_REF" = "${{ forge.BASE_REF }}" + test "$FORGEJO_BASE_REF" = "$GITHUB_BASE_REF" # See also actions/example-pull-request/.forgejo/workflows/test.yml - - name: GITHUB_HEAD_REF + - name: FORGEJO_HEAD_REF run: | set -x - test -z "$GITHUB_HEAD_REF" - test "$GITHUB_HEAD_REF" = "${{ env.GITHUB_HEAD_REF }}" - test "$GITHUB_HEAD_REF" = "${{ github.HEAD_REF }}" - test "$GITHUB_HEAD_REF" = "${{ forge.HEAD_REF }}" + test -z "$FORGEJO_HEAD_REF" + test "$FORGEJO_HEAD_REF" = "${{ env.FORGEJO_HEAD_REF }}" + test "$FORGEJO_HEAD_REF" = "${{ github.HEAD_REF }}" + test "$FORGEJO_HEAD_REF" = "${{ forge.HEAD_REF }}" + test "$FORGEJO_HEAD_REF" = "$GITHUB_HEAD_REF" - - name: GITHUB_ENV + - name: FORGEJO_ENV run: | set -x - test -f "$GITHUB_ENV" - test "$GITHUB_ENV" = "${{ env.GITHUB_ENV }}" + test -f "$FORGEJO_ENV" + test "$FORGEJO_ENV" = "${{ env.FORGEJO_ENV }}" + test "$FORGEJO_ENV" = "$GITHUB_ENV" - - name: GITHUB_EVENT_NAME + - name: FORGEJO_EVENT_NAME run: | set -x - test "$GITHUB_EVENT_NAME" = push - test "$GITHUB_EVENT_NAME" = "${{ env.GITHUB_EVENT_NAME }}" - test "$GITHUB_EVENT_NAME" = "${{ github.EVENT_NAME }}" - test "$GITHUB_EVENT_NAME" = "${{ forge.EVENT_NAME }}" + test "$FORGEJO_EVENT_NAME" = push + test "$FORGEJO_EVENT_NAME" = "${{ env.FORGEJO_EVENT_NAME }}" + test "$FORGEJO_EVENT_NAME" = "${{ github.EVENT_NAME }}" + test "$FORGEJO_EVENT_NAME" = "${{ forge.EVENT_NAME }}" + test "$FORGEJO_EVENT_NAME" = "$GITHUB_EVENT_NAME" - - name: GITHUB_JOB + - name: FORGEJO_JOB run: | set -x - test "$GITHUB_JOB" = test - test "$GITHUB_JOB" = "${{ env.GITHUB_JOB }}" - test "$GITHUB_JOB" = "${{ github.JOB }}" - test "$GITHUB_JOB" = "${{ forge.JOB }}" + test "$FORGEJO_JOB" = test + test "$FORGEJO_JOB" = "${{ env.FORGEJO_JOB }}" + test "$FORGEJO_JOB" = "${{ github.JOB }}" + test "$FORGEJO_JOB" = "${{ forge.JOB }}" + test "$FORGEJO_JOB" = "$GITHUB_JOB" - - name: GITHUB_OUTPUT + - name: FORGEJO_OUTPUT run: | set -x - test -f "$GITHUB_OUTPUT" - test "$GITHUB_OUTPUT" = "${{ env.GITHUB_OUTPUT }}" + test -f "$FORGEJO_OUTPUT" + test "$FORGEJO_OUTPUT" = "${{ env.FORGEJO_OUTPUT }}" + test "$FORGEJO_OUTPUT" = "$GITHUB_OUTPUT" - - name: GITHUB_PATH + - name: FORGEJO_PATH run: | set -x - test -f "$GITHUB_PATH" - test "$GITHUB_PATH" = "${{ env.GITHUB_PATH }}" + test -f "$FORGEJO_PATH" + test "$FORGEJO_PATH" = "${{ env.FORGEJO_PATH }}" + test "$FORGEJO_PATH" = "$GITHUB_PATH" - - name: GITHUB_REF + - name: FORGEJO_REF shell: bash run: | set -x - [[ "$GITHUB_REF" =~ ^refs/ ]] - test "$GITHUB_REF" = "${{ env.GITHUB_REF }}" - test "$GITHUB_REF" = "${{ github.REF }}" - test "$GITHUB_REF" = "${{ forge.REF }}" + [[ "$FORGEJO_REF" =~ ^refs/ ]] + test "$FORGEJO_REF" = "${{ env.FORGEJO_REF }}" + test "$FORGEJO_REF" = "${{ github.REF }}" + test "$FORGEJO_REF" = "${{ forge.REF }}" + test "$FORGEJO_REF" = "$GITHUB_REF" - - name: GITHUB_REF_NAME + - name: FORGEJO_REF_NAME shell: bash run: | set -x - ! [[ "$GITHUB_REF_NAME" =~ ^refs/ ]] - test "$GITHUB_REF_NAME" = "${{ env.GITHUB_REF_NAME }}" - test "$GITHUB_REF_NAME" = "${{ github.REF_NAME }}" - test "$GITHUB_REF_NAME" = "${{ forge.REF_NAME }}" + ! [[ "$FORGEJO_REF_NAME" =~ ^refs/ ]] + test "$FORGEJO_REF_NAME" = "${{ env.FORGEJO_REF_NAME }}" + test "$FORGEJO_REF_NAME" = "${{ github.REF_NAME }}" + test "$FORGEJO_REF_NAME" = "${{ forge.REF_NAME }}" + test "$FORGEJO_REF_NAME" = "$GITHUB_REF_NAME" - - name: GITHUB_REPOSITORY + - name: FORGEJO_REPOSITORY run: | set -x - test "$GITHUB_REPOSITORY" = root/example-context - test "$GITHUB_REPOSITORY" = "${{ env.GITHUB_REPOSITORY }}" - test "$GITHUB_REPOSITORY" = "${{ github.REPOSITORY }}" - test "$GITHUB_REPOSITORY" = "${{ forge.REPOSITORY }}" + test "$FORGEJO_REPOSITORY" = root/example-context + test "$FORGEJO_REPOSITORY" = "${{ env.FORGEJO_REPOSITORY }}" + test "$FORGEJO_REPOSITORY" = "${{ github.REPOSITORY }}" + test "$FORGEJO_REPOSITORY" = "${{ forge.REPOSITORY }}" + test "$FORGEJO_REPOSITORY" = "$GITHUB_REPOSITORY" - - name: GITHUB_REPOSITORY_OWNER + - name: FORGEJO_REPOSITORY_OWNER run: | set -x - test "$GITHUB_REPOSITORY_OWNER" = root - test "$GITHUB_REPOSITORY_OWNER" = "${{ env.GITHUB_REPOSITORY_OWNER }}" - test "$GITHUB_REPOSITORY_OWNER" = "${{ github.REPOSITORY_OWNER }}" - test "$GITHUB_REPOSITORY_OWNER" = "${{ forge.REPOSITORY_OWNER }}" + test "$FORGEJO_REPOSITORY_OWNER" = root + test "$FORGEJO_REPOSITORY_OWNER" = "${{ env.FORGEJO_REPOSITORY_OWNER }}" + test "$FORGEJO_REPOSITORY_OWNER" = "${{ github.REPOSITORY_OWNER }}" + test "$FORGEJO_REPOSITORY_OWNER" = "${{ forge.REPOSITORY_OWNER }}" + test "$FORGEJO_REPOSITORY_OWNER" = "$GITHUB_REPOSITORY_OWNER" - - name: GITHUB_RUN_NUMBER + - name: FORGEJO_RUN_NUMBER run: | set -x - echo "$GITHUB_RUN_NUMBER" | grep -E '^[0-9]+$' - test "$GITHUB_RUN_NUMBER" = "${{ env.GITHUB_RUN_NUMBER }}" - test "$GITHUB_RUN_NUMBER" = "${{ github.RUN_NUMBER }}" - test "$GITHUB_RUN_NUMBER" = "${{ forge.RUN_NUMBER }}" + echo "$FORGEJO_RUN_NUMBER" | grep -E '^[0-9]+$' + test "$FORGEJO_RUN_NUMBER" = "${{ env.FORGEJO_RUN_NUMBER }}" + test "$FORGEJO_RUN_NUMBER" = "${{ github.RUN_NUMBER }}" + test "$FORGEJO_RUN_NUMBER" = "${{ forge.RUN_NUMBER }}" + test "$FORGEJO_RUN_NUMBER" = "$GITHUB_RUN_NUMBER" - - name: GITHUB_SERVER_URL + - name: FORGEJO_SERVER_URL shell: bash run: | set -x - [[ "$GITHUB_SERVER_URL" =~ ^http ]] - test "$GITHUB_SERVER_URL" = "${{ env.GITHUB_SERVER_URL }}" - test "$GITHUB_SERVER_URL" = "${{ github.SERVER_URL }}" - test "$GITHUB_SERVER_URL" = "${{ forge.SERVER_URL }}" + [[ "$FORGEJO_SERVER_URL" =~ ^http ]] + test "$FORGEJO_SERVER_URL" = "${{ env.FORGEJO_SERVER_URL }}" + test "$FORGEJO_SERVER_URL" = "${{ github.SERVER_URL }}" + test "$FORGEJO_SERVER_URL" = "${{ forge.SERVER_URL }}" + test "$FORGEJO_SERVER_URL" = "$GITHUB_SERVER_URL" - - name: GITHUB_SHA + - name: FORGEJO_SHA run: | set -x - test "$GITHUB_SHA" - test "$GITHUB_SHA" = "${{ env.GITHUB_SHA }}" - test "$GITHUB_SHA" = "${{ github.SHA }}" - test "$GITHUB_SHA" = "${{ forge.SHA }}" + test "$FORGEJO_SHA" + test "$FORGEJO_SHA" = "${{ env.FORGEJO_SHA }}" + test "$FORGEJO_SHA" = "${{ github.SHA }}" + test "$FORGEJO_SHA" = "${{ forge.SHA }}" + test "$FORGEJO_SHA" = "$GITHUB_SHA" - - name: GITHUB_STEP_SUMMARY + - name: FORGEJO_STEP_SUMMARY run: | set -x - test -f "$GITHUB_STEP_SUMMARY" - test "$GITHUB_STEP_SUMMARY" = "${{ env.GITHUB_STEP_SUMMARY }}" + test -f "$FORGEJO_STEP_SUMMARY" + test "$FORGEJO_STEP_SUMMARY" = "${{ env.FORGEJO_STEP_SUMMARY }}" + test "$FORGEJO_STEP_SUMMARY" = "$GITHUB_STEP_SUMMARY" # See also actions/example-pull-request/.forgejo/workflows/test.yml - - name: GITHUB_TOKEN + - name: FORGEJO_TOKEN run: | set -x - test "$GITHUB_TOKEN" - test "$GITHUB_TOKEN" = "${{ env.GITHUB_TOKEN }}" - test "$GITHUB_TOKEN" = "${{ github.TOKEN }}" - test "$GITHUB_TOKEN" = "${{ forge.TOKEN }}" + test "$FORGEJO_TOKEN" + test "$FORGEJO_TOKEN" = "${{ env.FORGEJO_TOKEN }}" + test "$FORGEJO_TOKEN" = "${{ github.TOKEN }}" + test "$FORGEJO_TOKEN" = "${{ forge.TOKEN }}" + test "$FORGEJO_TOKEN" = "$GITHUB_TOKEN" - - name: GITHUB_WORKSPACE + - name: FORGEJO_WORKSPACE run: | set -x - test -d "$GITHUB_WORKSPACE" - test "$GITHUB_WORKSPACE" = "${{ env.GITHUB_WORKSPACE }}" - test "$GITHUB_WORKSPACE" = "${{ github.WORKSPACE }}" - test "$GITHUB_WORKSPACE" = "${{ forge.WORKSPACE }}" + test -d "$FORGEJO_WORKSPACE" + test "$FORGEJO_WORKSPACE" = "${{ env.FORGEJO_WORKSPACE }}" + test "$FORGEJO_WORKSPACE" = "${{ github.WORKSPACE }}" + test "$FORGEJO_WORKSPACE" = "${{ forge.WORKSPACE }}" + test "$FORGEJO_WORKSPACE" = "$GITHUB_WORKSPACE" - name: RUNNER_ARCH run: | diff --git a/actions/example-context/action-for-context/action.yml b/actions/example-context/action-for-context/action.yml index c1c33843..e8e81c39 100644 --- a/actions/example-context/action-for-context/action.yml +++ b/actions/example-context/action-for-context/action.yml @@ -6,20 +6,22 @@ inputs: runs: using: "composite" steps: - - name: GITHUB_ACTION_REPOSITORY + - name: FORGEJO_ACTION_REPOSITORY run: | set -x - test "$GITHUB_ACTION_REPOSITORY" = root/action-for-context - test "$GITHUB_ACTION_REPOSITORY" = "${{ env.GITHUB_ACTION_REPOSITORY }}" - test "$GITHUB_ACTION_REPOSITORY" = "${{ github.ACTION_REPOSITORY }}" - test "$GITHUB_ACTION_REPOSITORY" = "${{ forge.ACTION_REPOSITORY }}" - touch /srv/example/example-context/GITHUB_ACTION_REPOSITORY + test "$FORGEJO_ACTION_REPOSITORY" = root/action-for-context + test "$FORGEJO_ACTION_REPOSITORY" = "${{ env.FORGEJO_ACTION_REPOSITORY }}" + test "$FORGEJO_ACTION_REPOSITORY" = "${{ github.ACTION_REPOSITORY }}" + test "$FORGEJO_ACTION_REPOSITORY" = "${{ forge.ACTION_REPOSITORY }}" + test "$FORGEJO_ACTION_REPOSITORY" = "$GITHUB_ACTION_REPOSITORY" + touch /srv/example/example-context/FORGEJO_ACTION_REPOSITORY - - name: GITHUB_ACTION_PATH + - name: FORGEJO_ACTION_PATH shell: bash run: | set -x - [[ "$GITHUB_ACTION_PATH" =~ action-for-context@main$ ]] - test "$GITHUB_ACTION_PATH" = "${{ github.ACTION_PATH }}" - test "$GITHUB_ACTION_PATH" = "${{ forge.ACTION_PATH }}" - touch /srv/example/example-context/GITHUB_ACTION_PATH + [[ "$FORGEJO_ACTION_PATH" =~ action-for-context@main$ ]] + test "$FORGEJO_ACTION_PATH" = "${{ github.ACTION_PATH }}" + test "$FORGEJO_ACTION_PATH" = "${{ forge.ACTION_PATH }}" + test "$FORGEJO_ACTION_PATH" = "$GITHUB_ACTION_PATH" + touch /srv/example/example-context/FORGEJO_ACTION_PATH From b67f9e1a70c4d230be37cc367ed19029bcd87e8b Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 9 Jul 2025 14:09:48 +0000 Subject: [PATCH 098/173] chore: s/GITHUB_*/FORGEJO_*/ & s/github./forge./ (#776) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/776 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/workflows/end-to-end.yml | 6 +-- .../example-cron/.forgejo/workflows/test.yml | 2 +- .../.forgejo/workflows/test.yml | 2 +- .../example-if/.forgejo/workflows/test.yml | 2 +- .../.forgejo/local-action/action.yml | 8 +-- .../.forgejo/workflows/test.yml | 2 +- .../.forgejo/workflows/test.yml | 50 +++++++++---------- .../example-push/.forgejo/workflows/test.yml | 2 +- .../example-tag/.forgejo/workflows/test.yml | 2 +- .../.forgejo/workflows/test.yml | 2 +- 10 files changed, 39 insertions(+), 39 deletions(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index d535d37d..28b9cd49 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -128,13 +128,13 @@ jobs: run: | set -x full_version=$(./end-to-end.sh full_version ${{ matrix.info.version }} ${{ matrix.info.owner }}) - echo value="$full_version" >> $GITHUB_OUTPUT + echo value="$full_version" >> $FORGEJO_OUTPUT - run: ./end-to-end.sh prepare_dockerd - run: su forgejo -c "./end-to-end.sh test_actions ${{ matrix.info.version }}" - name: update documentation uses: https://data.forgejo.org/actions/cascading-pr@v2.1 with: - origin-url: ${{ env.GITHUB_SERVER_URL }} + origin-url: ${{ env.FORGEJO_SERVER_URL }} origin-repo: ${{ forge.repository }} origin-token: ${{ secrets.CASCADE_DOCS_ORIGIN_TOKEN }} origin-ref: refs/heads/main @@ -143,7 +143,7 @@ jobs: destination-repo: forgejo/docs destination-branch: ${{ matrix.info.branch || format('v{0}', matrix.info.version) }} destination-token: ${{ secrets.CASCADE_DOCS_DESTINATION_TOKEN }} - prefix: ${{ env.GITHUB_REPOSITORY }}-${{ matrix.info.version }} + prefix: ${{ env.FORGEJO_REPOSITORY }}-${{ matrix.info.version }} update: .forgejo/cascading-docs env: FORCE_VERSION: "${{ vars.CASCADE_DOCS_FORCE_VERSION }}" diff --git a/actions/example-cron/.forgejo/workflows/test.yml b/actions/example-cron/.forgejo/workflows/test.yml index e2748f8a..054ddad6 100644 --- a/actions/example-cron/.forgejo/workflows/test.yml +++ b/actions/example-cron/.forgejo/workflows/test.yml @@ -12,7 +12,7 @@ jobs: steps: - name: save context run: | - d=/srv/example/cron/contexts/$GITHUB_EVENT_NAME + d=/srv/example/cron/contexts/$FORGEJO_EVENT_NAME mkdir -p $d cat > $d/github <<'EOF' ${{ toJSON(github) }} diff --git a/actions/example-expression/.forgejo/workflows/test.yml b/actions/example-expression/.forgejo/workflows/test.yml index e20a996a..ba37759e 100644 --- a/actions/example-expression/.forgejo/workflows/test.yml +++ b/actions/example-expression/.forgejo/workflows/test.yml @@ -23,7 +23,7 @@ jobs: if: ${{ env.KEY1 == 'nogood' }} - name: if does not skip id: conditional - run: echo 'check=good' >> $GITHUB_OUTPUT + run: echo 'check=good' >> $FORGEJO_OUTPUT if: env.KEY1 == 'value1' - name: verify if did not skip run: test ${{ steps.conditional.outputs.check }} = good diff --git a/actions/example-if/.forgejo/workflows/test.yml b/actions/example-if/.forgejo/workflows/test.yml index cc9401ce..355d9f20 100644 --- a/actions/example-if/.forgejo/workflows/test.yml +++ b/actions/example-if/.forgejo/workflows/test.yml @@ -8,7 +8,7 @@ jobs: - name: if true if: true id: if_true - run: echo 'check=good' >> $GITHUB_OUTPUT + run: echo 'check=good' >> $FORGEJO_OUTPUT - name: verify if true was run run: test ${{ steps.if_true.outputs.check }} = good diff --git a/actions/example-local-action/.forgejo/local-action/action.yml b/actions/example-local-action/.forgejo/local-action/action.yml index 79637578..6f5df8e1 100644 --- a/actions/example-local-action/.forgejo/local-action/action.yml +++ b/actions/example-local-action/.forgejo/local-action/action.yml @@ -13,10 +13,10 @@ outputs: runs: using: "composite" steps: - - name: GITHUB_ACTION_PATH + - name: FORGEJO_ACTION_PATH run: | set -x - test "$(basename $GITHUB_ACTION_PATH)" = local-action - test "$GITHUB_ACTION_PATH" = "${{ env.GITHUB_ACTION_PATH }}" + test "$(basename $FORGEJO_ACTION_PATH)" = local-action + test "$FORGEJO_ACTION_PATH" = "${{ env.FORGEJO_ACTION_PATH }}" - - run: echo key=${{ inputs.input-two-required }} >> $GITHUB_OUTPUT + - run: echo key=${{ inputs.input-two-required }} >> $FORGEJO_OUTPUT diff --git a/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml b/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml index 135364aa..73e9b404 100644 --- a/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml +++ b/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml @@ -12,7 +12,7 @@ jobs: steps: - name: save context run: | - d=/srv/example/post-7-0-schedule/contexts/$GITHUB_EVENT_NAME + d=/srv/example/post-7-0-schedule/contexts/$FORGEJO_EVENT_NAME mkdir -p $d cat > $d/github <<'EOF' ${{ toJSON(github) }} diff --git a/actions/example-pull-request/.forgejo/workflows/test.yml b/actions/example-pull-request/.forgejo/workflows/test.yml index 2b864cb6..320d0a86 100644 --- a/actions/example-pull-request/.forgejo/workflows/test.yml +++ b/actions/example-pull-request/.forgejo/workflows/test.yml @@ -17,45 +17,45 @@ jobs: shell: bash run: | set -x - test $GITHUB_TOKEN = ${{ env.GITHUB_TOKEN }} - test $GITHUB_TOKEN = ${{ forge.token }} + test $FORGEJO_TOKEN = ${{ env.FORGEJO_TOKEN }} + test $FORGEJO_TOKEN = ${{ forge.token }} export DEBIAN_FRONTEND=noninteractive ; apt-get -qq update ; apt-get install -y -qq curl git >& /dev/null curl -sS -o /usr/local/bin/forgejo-curl.sh https://code.forgejo.org/forgejo/forgejo-curl/raw/branch/main/forgejo-curl.sh && chmod +x /usr/local/bin/forgejo-curl.sh - forgejo-curl.sh --token "$GITHUB_TOKEN" login $GITHUB_SERVER_URL - forgejo-curl.sh api_json $GITHUB_SERVER_URL/api/v1/user + forgejo-curl.sh --token "$FORGEJO_TOKEN" login $FORGEJO_SERVER_URL + forgejo-curl.sh api_json $FORGEJO_SERVER_URL/api/v1/user - name: determine if the PR is from a fork id: forked run: | if test ${{ forge.event.pull_request.base.repo.full_name }} = ${{ forge.event.pull_request.head.repo.full_name }} ; then - echo value=false >> $GITHUB_OUTPUT + echo value=false >> $FORGEJO_OUTPUT else - echo value=true >> $GITHUB_OUTPUT + echo value=true >> $FORGEJO_OUTPUT fi # See also actions/example-context/.forgejo/workflows/test.yml - - name: env.GITHUB_BASE_REF + - name: env.FORGEJO_BASE_REF run: | set -x - test "$GITHUB_BASE_REF" = main - test "$GITHUB_BASE_REF" = "${{ env.GITHUB_BASE_REF }}" + test "$FORGEJO_BASE_REF" = main + test "$FORGEJO_BASE_REF" = "${{ env.FORGEJO_BASE_REF }}" # See also actions/example-context/.forgejo/workflows/test.yml - - name: env.GITHUB_HEAD_REF + - name: env.FORGEJO_HEAD_REF run: | set -x if ${{ steps.forked.outputs.value }} ; then - test "$GITHUB_HEAD_REF" = main + test "$FORGEJO_HEAD_REF" = main else - test "$GITHUB_HEAD_REF" = other + test "$FORGEJO_HEAD_REF" = other fi - test "$GITHUB_HEAD_REF" = "${{ env.GITHUB_HEAD_REF }}" + test "$FORGEJO_HEAD_REF" = "${{ env.FORGEJO_HEAD_REF }}" - name: secrets shell: bash run: | set -x - case $GITHUB_EVENT_NAME in + case $FORGEJO_EVENT_NAME in pull_request_target) # # all PRs: secrets @@ -76,7 +76,7 @@ jobs: fi ;; *) - echo unexpected event $GITHUB_EVENT_NAME + echo unexpected event $FORGEJO_EVENT_NAME false ;; esac @@ -96,8 +96,8 @@ jobs: # create an issue # base_repo=${{ forge.event.pull_request.base.repo.full_name }} - forgejo-curl.sh api_json --data-raw '{"title":"ISSUE"}' $GITHUB_SERVER_URL/api/v1/repos/$base_repo/issues - url=$(echo $GITHUB_SERVER_URL | sed -e "s|://|://$GITHUB_TOKEN@|") + forgejo-curl.sh api_json --data-raw '{"title":"ISSUE"}' $FORGEJO_SERVER_URL/api/v1/repos/$base_repo/issues + url=$(echo $FORGEJO_SERVER_URL | sed -e "s|://|://$FORGEJO_TOKEN@|") git clone $url/$base_repo base branch=B$RANDOM ( @@ -108,7 +108,7 @@ jobs: echo CHANGE >> README git add . git commit -m 'change' - case $GITHUB_EVENT_NAME in + case $FORGEJO_EVENT_NAME in pull_request_target|pull_request) # # repository write scope via http git passthrough @@ -117,15 +117,15 @@ jobs: # # repository write scope via the API # - assert_fail_if_forked forgejo-curl.sh api_json --data-raw '{"title":"PR","base":"main","head":"'$branch'"}' $GITHUB_SERVER_URL/api/v1/repos/$base_repo/pulls - assert_fail_if_forked forgejo-curl.sh api_json --data-raw '{"color":"#ffffff","name":"labelname"}' $GITHUB_SERVER_URL/api/v1/repos/$base_repo/labels + assert_fail_if_forked forgejo-curl.sh api_json --data-raw '{"title":"PR","base":"main","head":"'$branch'"}' $FORGEJO_SERVER_URL/api/v1/repos/$base_repo/pulls + assert_fail_if_forked forgejo-curl.sh api_json --data-raw '{"color":"#ffffff","name":"labelname"}' $FORGEJO_SERVER_URL/api/v1/repos/$base_repo/labels # # See https://codeberg.org/forgejo/forgejo/issues/1525 # - ! forgejo-curl.sh api_json --data-raw '{"new_branch_name":"B'$RANDOM'"}' $GITHUB_SERVER_URL/api/v1/repos/$base_repo/branches + ! forgejo-curl.sh api_json --data-raw '{"new_branch_name":"B'$RANDOM'"}' $FORGEJO_SERVER_URL/api/v1/repos/$base_repo/branches ;; *) - echo unexpected event $GITHUB_EVENT_NAME + echo unexpected event $FORGEJO_EVENT_NAME false ;; esac @@ -133,7 +133,7 @@ jobs: - name: save event run: | - d=/srv/example/pull-request/contexts/${{ forge.event.pull_request.head.repo.owner.username }}/$GITHUB_EVENT_NAME + d=/srv/example/pull-request/contexts/${{ forge.event.pull_request.head.repo.owner.username }}/$FORGEJO_EVENT_NAME mkdir -p $d cat > $d/github <<'EOF' ${{ toJSON(github) }} @@ -143,7 +143,7 @@ jobs: - name: checkout the default branch if pull_request_target run: | set -x - case $GITHUB_EVENT_NAME in + case $FORGEJO_EVENT_NAME in pull_request_target) ! test -f file-unique-to-the-pr-branch ;; @@ -151,7 +151,7 @@ jobs: test -f file-unique-to-the-pr-branch ;; *) - echo unexpected event $GITHUB_EVENT_NAME + echo unexpected event $FORGEJO_EVENT_NAME false ;; esac diff --git a/actions/example-push/.forgejo/workflows/test.yml b/actions/example-push/.forgejo/workflows/test.yml index 89763f29..6075b1a2 100644 --- a/actions/example-push/.forgejo/workflows/test.yml +++ b/actions/example-push/.forgejo/workflows/test.yml @@ -16,7 +16,7 @@ jobs: - name: save event run: | - d=/srv/example/push/contexts/$GITHUB_EVENT_NAME + d=/srv/example/push/contexts/$FORGEJO_EVENT_NAME mkdir -p $d cat > $d/github <<'EOF' ${{ toJSON(github) }} diff --git a/actions/example-tag/.forgejo/workflows/test.yml b/actions/example-tag/.forgejo/workflows/test.yml index c7e13570..ddc673e0 100644 --- a/actions/example-tag/.forgejo/workflows/test.yml +++ b/actions/example-tag/.forgejo/workflows/test.yml @@ -14,7 +14,7 @@ jobs: - name: save event run: | - d=/srv/example/tag/contexts/$GITHUB_EVENT_NAME + d=/srv/example/tag/contexts/$FORGEJO_EVENT_NAME mkdir -p $d cat > $d/github <<'EOF' ${{ toJSON(github) }} diff --git a/actions/example-workflow-dispatch/.forgejo/workflows/test.yml b/actions/example-workflow-dispatch/.forgejo/workflows/test.yml index 186fe563..c2dcea6d 100644 --- a/actions/example-workflow-dispatch/.forgejo/workflows/test.yml +++ b/actions/example-workflow-dispatch/.forgejo/workflows/test.yml @@ -50,7 +50,7 @@ jobs: steps: - name: save and display context run: | - d=/srv/example/workflow-dispatch/contexts/$GITHUB_EVENT_NAME + d=/srv/example/workflow-dispatch/contexts/$FORGEJO_EVENT_NAME mkdir -p $d tee $d/github <<'EOF' ${{ toJSON(github) }} From b2d99f4c4aeee43106bffe2210ea8a28e7a5c481 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 12 Jul 2025 08:08:25 +0000 Subject: [PATCH 099/173] actions: shell: assert shell behavior (#788) Refs https://code.forgejo.org/forgejo/runner/issues/150 Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/788 Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/actions.sh | 2 +- .../example-shell/.forgejo/workflows/test.yml | 78 +++++++++++++++++++ actions/example-shell/runner-config.yaml | 32 ++++++++ actions/example-shell/setup.sh | 1 + actions/example-shell/teardown.sh | 1 + 5 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 actions/example-shell/.forgejo/workflows/test.yml create mode 100644 actions/example-shell/runner-config.yaml create mode 100755 actions/example-shell/setup.sh create mode 100755 actions/example-shell/teardown.sh diff --git a/actions/actions.sh b/actions/actions.sh index bb21e8a1..b1e6bd8a 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -143,7 +143,7 @@ function test_actions() { done fi - for example in echo lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do + for example in shell echo lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do run actions_verify_example $example done diff --git a/actions/example-shell/.forgejo/workflows/test.yml b/actions/example-shell/.forgejo/workflows/test.yml new file mode 100644 index 00000000..38a2a6cd --- /dev/null +++ b/actions/example-shell/.forgejo/workflows/test.yml @@ -0,0 +1,78 @@ +on: [push] + +env: + ASSERT_SHELL: 'set -x ; readlink /proc/$$/exe ; readlink /proc/$$/exe | grep ' + +jobs: + default: + # docker:docker://code.forgejo.org/oci/node:22-bookworm + runs-on: docker + steps: + - name: default is bash + run: | + ${{ env.ASSERT_SHELL }} /bash + + defaults-run: + needs: [default] + # alpine:docker://code.forgejo.org/oci/alpine:latest + runs-on: alpine + defaults: + run: + shell: sh + steps: + - name: default is sh which is an alias for busybox in alpine + run: | + ${{ env.ASSERT_SHELL }} /busybox + + alpine: + needs: [defaults-run] + runs-on: docker + container: + image: code.forgejo.org/oci/alpine:latest + steps: + - name: default is sh which is an alias for busybox in alpine + run: | + ${{ env.ASSERT_SHELL }} /busybox + + python: + needs: [alpine] + runs-on: docker + container: + image: code.forgejo.org/oci/python:slim + steps: + - name: python => python {0} + shell: python + run: | + print("something") + + other: + needs: [python] + runs-on: docker + container: + image: code.forgejo.org/oci/node:22-bookworm + steps: + - name: default is sh which is an alias for dash in bookworm + run: | + ${{ env.ASSERT_SHELL }} /dash + + - name: bash => bash --noprofile --norc -e -o pipefail {0} + shell: bash + run: | + ${{ env.ASSERT_SHELL }} /bash + shopt -o + shopt -o | grep --quiet 'pipefail.*on' + + - name: sh => sh -e {0} + shell: sh + run: | + ${{ env.ASSERT_SHELL }} /dash + + - name: node => node {0} + shell: node + run: | + console.log("something") + + - name: dash -e {0} + shell: dash -e {0} + run: | + ${{ env.ASSERT_SHELL }} /dash diff --git a/actions/example-shell/runner-config.yaml b/actions/example-shell/runner-config.yaml new file mode 100644 index 00000000..4e4974d2 --- /dev/null +++ b/actions/example-shell/runner-config.yaml @@ -0,0 +1,32 @@ + +log: + level: debug + +runner: + file: .runner + capacity: 1 + env_file: .env + timeout: 3h + insecure: false + fetch_timeout: 5s + fetch_interval: 2s + labels: + - docker:docker://code.forgejo.org/oci/node:22-bookworm + - alpine:docker://code.forgejo.org/oci/alpine:latest + +cache: + enabled: false + dir: "" + host: "" + port: 0 + +container: + network: "" + privileged: false + options: + workdir_parent: + valid_volumes: [] + docker_host: "" + +host: + workdir_parent: diff --git a/actions/example-shell/setup.sh b/actions/example-shell/setup.sh new file mode 100755 index 00000000..9c1f5adf --- /dev/null +++ b/actions/example-shell/setup.sh @@ -0,0 +1 @@ +FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config.yaml forgejo-runner.sh reload diff --git a/actions/example-shell/teardown.sh b/actions/example-shell/teardown.sh new file mode 100755 index 00000000..b410c513 --- /dev/null +++ b/actions/example-shell/teardown.sh @@ -0,0 +1 @@ +forgejo-runner.sh reload From 0b826217a94ae3bd692c1fd0fe2bb32beef4c1db Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 12 Jul 2025 09:59:00 +0000 Subject: [PATCH 100/173] actions: shell: assert sh fallback (#790) Refs forgejo/runner#150 Local testing [following instructions](https://code.forgejo.org/forgejo/end-to-end/src/branch/main/README.md#running-from-locally-built-binary) and [the matching ACT PR](https://code.forgejo.org/forgejo/act/pulls/177). Once merged this will be a noop and actually remove coverage for shell test that was added earlier today. It will reactivate once the runner v8.0.0 is published. Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/790 Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/actions.sh | 6 +++- .../example-shell/.forgejo/workflows/test.yml | 35 ++++++++++++------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/actions/actions.sh b/actions/actions.sh index b1e6bd8a..aa2401e8 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -143,7 +143,7 @@ function test_actions() { done fi - for example in shell echo lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do + for example in echo lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do run actions_verify_example $example done @@ -151,6 +151,10 @@ function test_actions() { run actions_verify_example cache-proxy fi + if dpkg --compare-versions $runner_version ge 8.0.0; then + run actions_verify_example shell + fi + if dpkg --compare-versions $version lt 7.1; then for example in cron; do run actions_verify_example $example diff --git a/actions/example-shell/.forgejo/workflows/test.yml b/actions/example-shell/.forgejo/workflows/test.yml index 38a2a6cd..67c9f989 100644 --- a/actions/example-shell/.forgejo/workflows/test.yml +++ b/actions/example-shell/.forgejo/workflows/test.yml @@ -12,10 +12,29 @@ jobs: run: | ${{ env.ASSERT_SHELL }} /bash - defaults-run: + sh-fallback: needs: [default] # alpine:docker://code.forgejo.org/oci/alpine:latest runs-on: alpine + steps: + - name: default is bash but with a fallback to sh in case it does not exist + run: | + ${{ env.ASSERT_SHELL }} /busybox + + sh-fallback-with-container: + needs: [sh-fallback] + runs-on: docker + container: + image: code.forgejo.org/oci/alpine:latest + steps: + - name: default is bash but with a fallback to sh in case it does not exist + run: | + ${{ env.ASSERT_SHELL }} /busybox + + defaults-run: + needs: [sh-fallback-with-container] + # alpine:docker://code.forgejo.org/oci/alpine:latest + runs-on: alpine defaults: run: shell: sh @@ -24,16 +43,6 @@ jobs: run: | ${{ env.ASSERT_SHELL }} /busybox - alpine: - needs: [defaults-run] - runs-on: docker - container: - image: code.forgejo.org/oci/alpine:latest - steps: - - name: default is sh which is an alias for busybox in alpine - run: | - ${{ env.ASSERT_SHELL }} /busybox - python: needs: [alpine] runs-on: docker @@ -51,9 +60,9 @@ jobs: container: image: code.forgejo.org/oci/node:22-bookworm steps: - - name: default is sh which is an alias for dash in bookworm + - name: default is bash run: | - ${{ env.ASSERT_SHELL }} /dash + ${{ env.ASSERT_SHELL }} /bash - name: bash => bash --noprofile --norc -e -o pipefail {0} shell: bash From 606c32a2bec3593888a17d2344d993ce3e13309b Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 20 Jul 2025 04:25:19 +0000 Subject: [PATCH 101/173] fix: update the docs branches (#815) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/815 Reviewed-by: 0ko <0ko@noreply.code.forgejo.org> Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/workflows/end-to-end.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 28b9cd49..ca4a70af 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -112,11 +112,11 @@ jobs: strategy: matrix: info: - - version: "11.0" + - version: "12.0" branch: next forgejo: https://codeberg.org owner: forgejo-experimental - - version: "10.0" + - version: "11.0" forgejo: https://codeberg.org owner: forgejo steps: From 84b83250e3b8a0a7ac66333590684f9df381da30 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 20 Jul 2025 08:40:24 +0000 Subject: [PATCH 102/173] chore(renovate): use cascading-pr@v2.1.1 instead of cascading-pr@v2.1 (#817) because the branch is not maintained, only tags are used now Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/817 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/workflows/end-to-end.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index ca4a70af..c6ee4ef9 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -132,7 +132,7 @@ jobs: - run: ./end-to-end.sh prepare_dockerd - run: su forgejo -c "./end-to-end.sh test_actions ${{ matrix.info.version }}" - name: update documentation - uses: https://data.forgejo.org/actions/cascading-pr@v2.1 + uses: https://data.forgejo.org/actions/cascading-pr@v2.1.1 with: origin-url: ${{ env.FORGEJO_SERVER_URL }} origin-repo: ${{ forge.repository }} From 4e10e476898f03eca3ea2c55d7f65e311cdb21c3 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 20 Jul 2025 15:22:23 +0000 Subject: [PATCH 103/173] Update https://data.forgejo.org/actions/cascading-pr action to v2.2.1 (#819) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://data.forgejo.org/actions/cascading-pr](https://code.forgejo.org/actions/cascading-pr) | action | minor | `v2.1.1` -> `v2.2.1` | --- ### Release Notes
actions/cascading-pr (https://data.forgejo.org/actions/cascading-pr) ### [`v2.2.1`](https://code.forgejo.org/actions/cascading-pr/compare/v2.2.0...v2.2.1) [Compare Source](https://code.forgejo.org/actions/cascading-pr/compare/v2.2.0...v2.2.1) ### [`v2.2.0`](https://code.forgejo.org/actions/cascading-pr/compare/v2.1.1...v2.2.0) [Compare Source](https://code.forgejo.org/actions/cascading-pr/compare/v2.1.1...v2.2.0)
--- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/819 Reviewed-by: earl-warren Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/workflows/end-to-end.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index c6ee4ef9..85afdae1 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -132,7 +132,7 @@ jobs: - run: ./end-to-end.sh prepare_dockerd - run: su forgejo -c "./end-to-end.sh test_actions ${{ matrix.info.version }}" - name: update documentation - uses: https://data.forgejo.org/actions/cascading-pr@v2.1.1 + uses: https://data.forgejo.org/actions/cascading-pr@v2.2.1 with: origin-url: ${{ env.FORGEJO_SERVER_URL }} origin-repo: ${{ forge.repository }} From 18b2dc2e85c8019f76dce57b06d3164ab946620f Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 20 Jul 2025 18:50:38 +0000 Subject: [PATCH 104/173] chore(cosmetic): pretty names for docs generation matrix (#816) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/816 Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/workflows/end-to-end.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 85afdae1..bd461e2c 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -112,11 +112,13 @@ jobs: strategy: matrix: info: - - version: "12.0" + - name: latest + version: "12.0" branch: next forgejo: https://codeberg.org owner: forgejo-experimental - - version: "11.0" + - name: previous + version: "11.0" forgejo: https://codeberg.org owner: forgejo steps: From 841ca7c2c6038335691b0f0e67d09c8c6a8b7827 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 21 Jul 2025 20:31:52 +0000 Subject: [PATCH 105/173] actions: as of Forgejo runner v8.0.0 FORGEJO_ACTION_PATH is hash based (#823) Refs: https://code.forgejo.org/forgejo/act/pulls/186 Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/823 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/example-context/action-for-context/action.yml | 5 ++++- .../example-local-action/.forgejo/local-action/action.yml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/actions/example-context/action-for-context/action.yml b/actions/example-context/action-for-context/action.yml index e8e81c39..301d7280 100644 --- a/actions/example-context/action-for-context/action.yml +++ b/actions/example-context/action-for-context/action.yml @@ -20,7 +20,10 @@ runs: shell: bash run: | set -x - [[ "$FORGEJO_ACTION_PATH" =~ action-for-context@main$ ]] + # prior to Forgejo runner 8.0.0 the action path is built out of the file path. + # with Forgejo runner 8.0.0 and above is it a 64 character hash string + # e.g. /var/run/act/actions/1b/5c1802fa47e35716c2a0977bc907049d31aef29191cba400011c0b38b52d12 + [[ "$FORGEJO_ACTION_PATH" =~ action-for-context@main$ ]] || [[ "$FORGEJO_ACTION_PATH" =~ /[0-9a-f]{2}/[0-9a-f]{62}$ ]] test "$FORGEJO_ACTION_PATH" = "${{ github.ACTION_PATH }}" test "$FORGEJO_ACTION_PATH" = "${{ forge.ACTION_PATH }}" test "$FORGEJO_ACTION_PATH" = "$GITHUB_ACTION_PATH" diff --git a/actions/example-local-action/.forgejo/local-action/action.yml b/actions/example-local-action/.forgejo/local-action/action.yml index 6f5df8e1..900bc1c1 100644 --- a/actions/example-local-action/.forgejo/local-action/action.yml +++ b/actions/example-local-action/.forgejo/local-action/action.yml @@ -16,7 +16,7 @@ runs: - name: FORGEJO_ACTION_PATH run: | set -x - test "$(basename $FORGEJO_ACTION_PATH)" = local-action + test -e "$FORGEJO_ACTION_PATH" test "$FORGEJO_ACTION_PATH" = "${{ env.FORGEJO_ACTION_PATH }}" - run: echo key=${{ inputs.input-two-required }} >> $FORGEJO_OUTPUT From 07654423c60f4fe1d54a1dc905511c7abca1deee Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 23 Jul 2025 15:23:20 +0000 Subject: [PATCH 106/173] feat: enable Forgejo Actions email notifications (#707) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/707 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/workflows/end-to-end.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index bd461e2c..a186cc63 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -19,6 +19,8 @@ on: branches: - 'main' +enable-email-notifications: true + jobs: build: runs-on: docker From 47f50d3257045e7d4d326363a643a9871c0b2bf9 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 26 Jul 2025 11:23:39 +0000 Subject: [PATCH 107/173] actions: add test for reusable workflows (#839) It is working although undocumented. It appears that Forgejo Actions users depend on it and breaking it would meet some non negligible push back. This test ensures that future Forgejo runner versions do not break what is working. This came to light because some fixes are necessary to the schema validation to allow for that to keep working (see https://code.forgejo.org/forgejo/act/pulls/194). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/839 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/actions.sh | 2 +- .../.forgejo/workflows/reusable.yml | 27 +++++++++++++++++++ .../.forgejo/workflows/test.yml | 11 ++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 actions/example-workflow-call/.forgejo/workflows/reusable.yml create mode 100644 actions/example-workflow-call/.forgejo/workflows/test.yml diff --git a/actions/actions.sh b/actions/actions.sh index aa2401e8..8030b0e1 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -143,7 +143,7 @@ function test_actions() { done fi - for example in echo lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do + for example in echo workflow-call lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do run actions_verify_example $example done diff --git a/actions/example-workflow-call/.forgejo/workflows/reusable.yml b/actions/example-workflow-call/.forgejo/workflows/reusable.yml new file mode 100644 index 00000000..87659501 --- /dev/null +++ b/actions/example-workflow-call/.forgejo/workflows/reusable.yml @@ -0,0 +1,27 @@ +on: + workflow_call: + inputs: + parameter1: + required: true + type: string + +jobs: + callee: + runs-on: docker + container: + image: code.forgejo.org/oci/node:22-bookworm + volumes: + - /srv/example:/srv/example + steps: + + - run: | + set -x + test "${{ inputs.parameter1 }}" = "value1" + + - name: save event + run: | + d=/srv/example/push/contexts/$FORGEJO_EVENT_NAME + mkdir -p $d + cat > $d/github <<'EOF' + ${{ toJSON(github) }} + EOF diff --git a/actions/example-workflow-call/.forgejo/workflows/test.yml b/actions/example-workflow-call/.forgejo/workflows/test.yml new file mode 100644 index 00000000..e009eeef --- /dev/null +++ b/actions/example-workflow-call/.forgejo/workflows/test.yml @@ -0,0 +1,11 @@ +on: + push: + +jobs: + caller: + runs-on: docker + container: + image: code.forgejo.org/oci/node:22-bookworm + uses: ./.forgejo/workflows/reusable.yml + with: + parameter1: value1 From 15cfe2f55c79651c0a6e52f7a9218de385955558 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 12 Aug 2025 07:48:14 +0000 Subject: [PATCH 108/173] actions: add trivial matrix example (#912) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/912 Reviewed-by: Gusted Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/actions.sh | 2 +- actions/example-matrix/.forgejo/workflows/test.yml | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 actions/example-matrix/.forgejo/workflows/test.yml diff --git a/actions/actions.sh b/actions/actions.sh index 8030b0e1..ac3f5381 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -143,7 +143,7 @@ function test_actions() { done fi - for example in echo workflow-call lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do + for example in echo matrix workflow-call lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do run actions_verify_example $example done diff --git a/actions/example-matrix/.forgejo/workflows/test.yml b/actions/example-matrix/.forgejo/workflows/test.yml new file mode 100644 index 00000000..34de0a59 --- /dev/null +++ b/actions/example-matrix/.forgejo/workflows/test.yml @@ -0,0 +1,12 @@ +on: [push] +jobs: + test: + runs-on: docker + name: name-${{ matrix.version }} + strategy: + matrix: + version: [1.18, 1.19] + steps: + - run: | + set -x + test "${{ matrix.version }}" From 20f170d4a01e65f9cfc51e365ffd2d680f2908e5 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 12 Aug 2025 10:37:15 +0000 Subject: [PATCH 109/173] actions: add trivial needs output example (#915) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/915 Reviewed-by: Gusted Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/actions.sh | 2 +- .../example-needs/.forgejo/workflows/test.yml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 actions/example-needs/.forgejo/workflows/test.yml diff --git a/actions/actions.sh b/actions/actions.sh index ac3f5381..5df95569 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -143,7 +143,7 @@ function test_actions() { done fi - for example in echo matrix workflow-call lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do + for example in echo matrix needs workflow-call lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do run actions_verify_example $example done diff --git a/actions/example-needs/.forgejo/workflows/test.yml b/actions/example-needs/.forgejo/workflows/test.yml new file mode 100644 index 00000000..d38a1e75 --- /dev/null +++ b/actions/example-needs/.forgejo/workflows/test.yml @@ -0,0 +1,19 @@ +on: [push] +jobs: + job1: + runs-on: docker + outputs: + job1output: ${{ steps.step1.outputs.value }} + steps: + - id: step1 + run: | + set -x + echo "value=value1" >> $FORGEJO_OUTPUT + + job2: + needs: [job1] + runs-on: docker + steps: + - run: | + set -x + test "${{ needs.job1.outputs.job1output }}" = "value1" From 761ff8aa08522e41a5e4c1c5af7e1e8e8fa9a49b Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 15 Aug 2025 07:34:13 +0000 Subject: [PATCH 110/173] Update https://data.forgejo.org/actions/setup-forgejo action to v3.0.2 (#931) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://data.forgejo.org/actions/setup-forgejo](https://code.forgejo.org/actions/setup-forgejo) | action | patch | `v3.0.1` -> `v3.0.2` | --- ### Release Notes
actions/setup-forgejo (https://data.forgejo.org/actions/setup-forgejo) ### [`v3.0.2`](https://code.forgejo.org/actions/setup-forgejo/compare/v3.0.1...v3.0.2) [Compare Source](https://code.forgejo.org/actions/setup-forgejo/compare/v3.0.1...v3.0.2)
--- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/931 Reviewed-by: earl-warren Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 472c0938..b83c253e 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -11,7 +11,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.1 + - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.2 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 6455896fd32809610e7c2059c6888bfe0be2ccfc Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Fri, 15 Aug 2025 07:34:38 +0000 Subject: [PATCH 111/173] chore: do not needlessly upload an artifact when there is no build (#916) - ${{ needs.build.outputs.built }} is true if there is a build from source, false otherwise - prepare-end-to-end local action does not attempt to download an artifact if inputs.built is false Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/916 Reviewed-by: Gusted Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/prepare-end-to-end/action.yml | 5 +++++ .forgejo/workflows/end-to-end.yml | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index b83c253e..723e8827 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -1,3 +1,7 @@ +inputs: + built: + description: 'True if a source build is available, false otherwise' + runs: using: "composite" steps: @@ -16,6 +20,7 @@ runs: install-only: true - run: forgejo-binary.sh ensure_user forgejo - uses: actions/download-artifact@v3 + if: ${{ inputs.built == true }} with: name: forgejo-dev path: /srv/forgejo-binaries diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index a186cc63..208e83f5 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -26,18 +26,22 @@ jobs: runs-on: docker container: image: 'code.forgejo.org/oci/node:20-bookworm' + outputs: + built: "${{ steps.build.outputs.value }}" steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: https://data.forgejo.org/actions/setup-go@v5 with: go-version: "1.22" - name: lib/build.sh + id: build run: | mkdir $d /tmp/forgejo-upload touch /tmp/forgejo-upload/PLACEHOLDER if ! test -f forgejo/build-from-sources; then echo forgejo/build-from-sources is not present, do not build any version from source + echo "built=false" >> $FORGEJO_OUTPUT exit 0 fi @@ -57,7 +61,11 @@ jobs: $forgejo --version mv $forgejo /tmp/forgejo-upload/forgejo-$version done + + echo "built=true" >> $FORGEJO_OUTPUT + - uses: actions/upload-artifact@v3 + if: ${{ steps.build.outputs.built == true }} with: name: forgejo-dev path: /tmp/forgejo-upload @@ -68,6 +76,8 @@ jobs: steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end + with: + built: ${{ needs.build.outputs.built }} - run: su forgejo -c "./end-to-end.sh test_packages" - name: full logs if: always() @@ -79,6 +89,8 @@ jobs: steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end + with: + built: ${{ needs.build.outputs.built }} - run: ./end-to-end.sh prepare_dockerd - run: su forgejo -c "./end-to-end.sh test_actions" - name: full logs @@ -91,6 +103,8 @@ jobs: steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end + with: + built: ${{ needs.build.outputs.built }} - name: install zstd run: | export DEBIAN_FRONTEND=noninteractive @@ -126,6 +140,8 @@ jobs: steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end + with: + built: ${{ needs.build.outputs.built }} - name: set full-version id: full-version shell: bash @@ -160,6 +176,8 @@ jobs: steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end + with: + built: ${{ needs.build.outputs.built }} - run: su forgejo -c "./end-to-end.sh test_upgrades" - run: su forgejo -c "./end-to-end.sh test_storage" - name: full logs From 44f2cf9cf102d257b9ddc707b2d67f82228bf4fe Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 16 Aug 2025 20:47:03 +0000 Subject: [PATCH 112/173] actions: show how secrets & outputs work with workflow_call (#934) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/934 Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .../.forgejo/workflows/reusable.yml | 10 +++++++++- .../.forgejo/workflows/test.yml | 12 ++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/actions/example-workflow-call/.forgejo/workflows/reusable.yml b/actions/example-workflow-call/.forgejo/workflows/reusable.yml index 87659501..aa6d029e 100644 --- a/actions/example-workflow-call/.forgejo/workflows/reusable.yml +++ b/actions/example-workflow-call/.forgejo/workflows/reusable.yml @@ -4,6 +4,9 @@ on: parameter1: required: true type: string + outputs: + output1: + value: ${{ jobs.callee.outputs.job-output }} jobs: callee: @@ -12,11 +15,16 @@ jobs: image: code.forgejo.org/oci/node:22-bookworm volumes: - /srv/example:/srv/example + outputs: + job-output: ${{ steps.stepwithoutput.outputs.myvalue }} steps: - - run: | + - id: stepwithoutput + run: | set -x test "${{ inputs.parameter1 }}" = "value1" + test "${{ secrets.secret }}" = "keep_it_private" + echo "myvalue=outputvalue1" >> $FORGEJO_OUTPUT - name: save event run: | diff --git a/actions/example-workflow-call/.forgejo/workflows/test.yml b/actions/example-workflow-call/.forgejo/workflows/test.yml index e009eeef..6185f8f7 100644 --- a/actions/example-workflow-call/.forgejo/workflows/test.yml +++ b/actions/example-workflow-call/.forgejo/workflows/test.yml @@ -9,3 +9,15 @@ jobs: uses: ./.forgejo/workflows/reusable.yml with: parameter1: value1 + secrets: + secret: keep_it_private + + verify: + needs: [caller] + runs-on: docker + container: + image: code.forgejo.org/oci/node:22-bookworm + steps: + - run: | + set -x + test "${{ needs.caller.outputs.output1 }}" = "outputvalue1" From 1e330632274c45ef8ad829e7cb52f9eb83629be1 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 16 Aug 2025 21:43:35 +0000 Subject: [PATCH 113/173] fix: the build step output is built, not value (#947) https://code.forgejo.org/forgejo/end-to-end/src/commit/44f2cf9cf102d257b9ddc707b2d67f82228bf4fe/.forgejo/workflows/end-to-end.yml#L65 Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/947 Reviewed-by: Gusted Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/workflows/end-to-end.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 208e83f5..f650e579 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -27,7 +27,7 @@ jobs: container: image: 'code.forgejo.org/oci/node:20-bookworm' outputs: - built: "${{ steps.build.outputs.value }}" + built: "${{ steps.build.outputs.built }}" steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: https://data.forgejo.org/actions/setup-go@v5 From 95453f8fd811bceb039fcbb5d05be70d2d667311 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 17 Aug 2025 08:44:56 +0000 Subject: [PATCH 114/173] fix: use yes/no instead of true/false for using a binary built from source (#948) and add information from steps and inputs context for future debug. --- For debugging a temporary commit [that trims the tests is used](https://code.forgejo.org/forgejo/end-to-end/pulls/948/commits/5e6bd041158847de99908464d629cbd85d14b951) ## No build from source - https://code.forgejo.org/forgejo/end-to-end/actions/runs/3905 ![image](/attachments/66ef5aa0-25a8-4624-9d92-dd18dce0a427) ## Build from source A temporary commit [is used to build from sources](https://code.forgejo.org/forgejo/end-to-end/pulls/948/commits/ffa5170ba21c070208c7934d727327efc0ec248f). - https://code.forgejo.org/forgejo/end-to-end/actions/runs/3904 ![image](/attachments/e335ee9f-fa07-43e0-aaf4-dfa745aa2a6a) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/948 Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/prepare-end-to-end/action.yml | 8 +++++++- .forgejo/workflows/end-to-end.yml | 13 ++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 723e8827..fd949a20 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -19,8 +19,14 @@ runs: with: install-only: true - run: forgejo-binary.sh ensure_user forgejo + - name: inputs context dump for debug + run: | + set -x + cat <> $FORGEJO_OUTPUT + echo "built=no" >> $FORGEJO_OUTPUT exit 0 fi @@ -62,10 +62,17 @@ jobs: mv $forgejo /tmp/forgejo-upload/forgejo-$version done - echo "built=true" >> $FORGEJO_OUTPUT + echo "built=yes" >> $FORGEJO_OUTPUT + + - name: steps context dump for debug + run: | + set -x + cat < Date: Sun, 17 Aug 2025 17:50:19 +0000 Subject: [PATCH 115/173] actions: context: verify RUN_ID (#951) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/951 Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/example-context/.forgejo/workflows/test.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/actions/example-context/.forgejo/workflows/test.yml b/actions/example-context/.forgejo/workflows/test.yml index 1a092cd9..2d3576fb 100644 --- a/actions/example-context/.forgejo/workflows/test.yml +++ b/actions/example-context/.forgejo/workflows/test.yml @@ -178,6 +178,15 @@ jobs: test "$FORGEJO_RUN_NUMBER" = "${{ forge.RUN_NUMBER }}" test "$FORGEJO_RUN_NUMBER" = "$GITHUB_RUN_NUMBER" + - name: FORGEJO_RUN_ID + run: | + set -x + echo "$FORGEJO_RUN_ID" | grep -E '^[0-9]+$' + test "$FORGEJO_RUN_ID" = "${{ env.FORGEJO_RUN_ID }}" + test "$FORGEJO_RUN_ID" = "${{ github.RUN_ID }}" + test "$FORGEJO_RUN_ID" = "${{ forge.RUN_ID }}" + test "$FORGEJO_RUN_ID" = "$GITHUB_RUN_ID" + - name: FORGEJO_SERVER_URL shell: bash run: | From 8f920b4b7adcb920e435db1acd02407b2312ab74 Mon Sep 17 00:00:00 2001 From: Gusted Date: Thu, 21 Aug 2025 04:54:52 +0000 Subject: [PATCH 116/173] Add coverage (#914) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/914 Reviewed-by: earl-warren Co-authored-by: Gusted Co-committed-by: Gusted --- .forgejo/upload-coverage/action.yml | 11 +++++++++++ .forgejo/workflows/end-to-end.yml | 16 ++++++++++++++++ lib/build.sh | 2 +- lib/lib.sh | 4 +++- 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .forgejo/upload-coverage/action.yml diff --git a/.forgejo/upload-coverage/action.yml b/.forgejo/upload-coverage/action.yml new file mode 100644 index 00000000..7626f43d --- /dev/null +++ b/.forgejo/upload-coverage/action.yml @@ -0,0 +1,11 @@ +inputs: + scope: + description: 'Scope of the coverage' + +runs: + using: "composite" + steps: + - uses: actions/upload-artifact@v3 + with: + name: coverage-${{ inputs.scope }} + path: /tmp/forgejo-end-to-end/coverage diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index eef7b51d..5ca770ba 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -86,6 +86,10 @@ jobs: with: built: ${{ needs.build.outputs.built }} - run: su forgejo -c "./end-to-end.sh test_packages" + - if: ${{ needs.build.outputs.built == 'yes' }} + uses: ./.forgejo/upload-coverage + with: + scope: packages - name: full logs if: always() run: su forgejo -c "./end-to-end.sh show_logs" @@ -100,6 +104,10 @@ jobs: built: ${{ needs.build.outputs.built }} - run: ./end-to-end.sh prepare_dockerd - run: su forgejo -c "./end-to-end.sh test_actions" + - if: ${{ needs.build.outputs.built == 'yes' }} + uses: ./.forgejo/upload-coverage + with: + scope: actions - name: full logs if: always() run: su forgejo -c "./end-to-end.sh show_logs" @@ -124,6 +132,10 @@ jobs: key: gitlab - run: | su forgejo -c "./end-to-end.sh test_federation" + - if: ${{ needs.build.outputs.built == 'yes' }} + uses: ./.forgejo/upload-coverage + with: + scope: federation - name: full logs if: always() run: su forgejo -c "./end-to-end.sh show_logs" @@ -187,6 +199,10 @@ jobs: built: ${{ needs.build.outputs.built }} - run: su forgejo -c "./end-to-end.sh test_upgrades" - run: su forgejo -c "./end-to-end.sh test_storage" + - if: ${{ needs.build.outputs.built == 'yes' }} + uses: ./.forgejo/upload-coverage + with: + scope: upgrade - name: full logs if: always() run: su forgejo -c "./end-to-end.sh show_logs" diff --git a/lib/build.sh b/lib/build.sh index bbef73eb..8fac7201 100755 --- a/lib/build.sh +++ b/lib/build.sh @@ -36,7 +36,7 @@ done git fetch --update-head-ok origin +$ref:$ref git switch --force-create $v $ref -export TAGS="bindata sqlite sqlite_unlock_notify" FORGEJO_VERSION=$semver +export TAGS="bindata sqlite sqlite_unlock_notify" FORGEJO_VERSION=$semver EXTRA_GOFLAGS="-cover" make deps-backend backend make generate forgejo cp -a forgejo $dir_binaries/forgejo-$v-dev diff --git a/lib/lib.sh b/lib/lib.sh index 22055dc5..4f540cf4 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -31,6 +31,7 @@ RELEASE_NUMBERS="11.0 12.0 13.0" PREFIX=============== export DIR=/tmp/forgejo-end-to-end DIR_BINARIES=/srv/forgejo-binaries +COVERAGE_DIR="$DIR/coverage" export DOT_FORGEJO_CURL=$DIR/forgejo-curl export DOT=$DOT_FORGEJO_CURL # for backward compatibility with forgejo-curl.sh 1.0.0 : ${FORGEJO_USER:=root} @@ -262,7 +263,8 @@ function start_forgejo_daemon() { local base=$(work_path_base $config) local work_path=$DIR/$base - daemon --chdir=$DIR --unsafe --env="TERM=$TERM" --env="HOME=$HOME" --env="PATH=$PATH" --pidfile=$DIR/$base-pid --errlog=$DIR/$base-err.log --output=$DIR/$base-out.log -- $binary --config $work_path/app.ini --work-path $work_path + mkdir -p $COVERAGE_DIR + daemon --chdir=$DIR --unsafe --env="TERM=$TERM" --env="HOME=$HOME" --env="PATH=$PATH" --env="GOCOVERDIR=$COVERAGE_DIR" --pidfile=$DIR/$base-pid --errlog=$DIR/$base-err.log --output=$DIR/$base-out.log -- $binary --config $work_path/app.ini --work-path $work_path if ! retry grep --no-messages --quiet 'Starting server on' $work_path/log/forgejo.log; then grep '' $DIR/$base*.log grep '' $work_path/log/*.log 2>/dev/null From ecff9c4c70e0f90c867bf571bff911f2c1fada00 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Fri, 29 Aug 2025 13:51:34 +0000 Subject: [PATCH 117/173] actions: context: verify RUNNER_TOOL_CACHE exists (#968) As of [Forgejo runner 5.0.1](https://code.forgejo.org/forgejo/runner/commit/5889426664adb3197dfb8840ea8b6d77c28b63f9), RUNNER_TOOL_CACHE is set but it is not pre-populated. By default it does not exist but a dedicated container image my place shared tools at that location for actions / workflows that expect them to be advertised by this environment variable. Resolves forgejo/runner#901 Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/968 Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/example-context/.forgejo/workflows/test.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/actions/example-context/.forgejo/workflows/test.yml b/actions/example-context/.forgejo/workflows/test.yml index 2d3576fb..8b8b971f 100644 --- a/actions/example-context/.forgejo/workflows/test.yml +++ b/actions/example-context/.forgejo/workflows/test.yml @@ -242,11 +242,10 @@ jobs: set -x test "$RUNNER_OS" = Linux - # runner 3.3.0 $RUNNER_TOOL_CACHE is not an existing directory - # - name: RUNNER_TOOL_CACHE - # run: | - # set -x - # test -d "$RUNNER_TOOL_CACHE" + - name: RUNNER_TOOL_CACHE + run: | + set -x + test "$RUNNER_TOOL_CACHE" - name: RUNNER_TEMP run: | From d29439c5f718a154cd2e4ce383e0eef29e967103 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 1 Sep 2025 17:14:24 +0000 Subject: [PATCH 118/173] fix: actions: refactor force-rebuild tests to use a remote action (#991) The local actions are always rebuilt with a random tag and cannot be used to verify the force_rebuild setting is working. Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/991 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- README.md | 1 + actions/actions.sh | 2 +- .../.forgejo/local-docker-action/Dockerfile | 5 --- .../.forgejo/local-docker-action/action.yml | 6 --- .../local-docker-action/entrypoint.sh | 3 -- .../.forgejo/local-docker-action/input.txt | 1 - .../.forgejo/workflows/test.yml | 15 ++++--- actions/example-force-rebuild/run.sh | 45 +++++++++++++++---- .../runner-config-with-rebuild.yml | 3 +- .../runner-config-without-rebuild.yml | 3 +- 10 files changed, 50 insertions(+), 34 deletions(-) delete mode 100644 actions/example-force-rebuild/.forgejo/local-docker-action/Dockerfile delete mode 100644 actions/example-force-rebuild/.forgejo/local-docker-action/action.yml delete mode 100755 actions/example-force-rebuild/.forgejo/local-docker-action/entrypoint.sh delete mode 100644 actions/example-force-rebuild/.forgejo/local-docker-action/input.txt diff --git a/README.md b/README.md index cdcf5db0..1ffc60c1 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ admin permissions. But they do not need to run as root and must work fine when run as a regular user. ```sh +export FORGEJO_RUNNER_LOGS=/tmp/forgejo-end-to-end/forgejo-runner.log ./end-to-end.sh run dependencies ./end-to-end.sh actions_setup 10.0 firefox 0.0.0.0:3000 # user root / admin1234 diff --git a/actions/actions.sh b/actions/actions.sh index 5df95569..04629063 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -133,7 +133,7 @@ function test_actions() { done fi - if dpkg --compare-versions $runner_version gt 6.0.1; then + if dpkg --compare-versions $runner_version gt 10.0.0; then run actions_verify_example force-rebuild fi diff --git a/actions/example-force-rebuild/.forgejo/local-docker-action/Dockerfile b/actions/example-force-rebuild/.forgejo/local-docker-action/Dockerfile deleted file mode 100644 index 2339a39d..00000000 --- a/actions/example-force-rebuild/.forgejo/local-docker-action/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM code.forgejo.org/oci/debian:bookworm -COPY entrypoint.sh /run/entrypoint.sh -# if we rebuild, we should notice this file change -COPY input.txt /run/input.txt -ENTRYPOINT [ "/run/entrypoint.sh" ] diff --git a/actions/example-force-rebuild/.forgejo/local-docker-action/action.yml b/actions/example-force-rebuild/.forgejo/local-docker-action/action.yml deleted file mode 100644 index e53d6279..00000000 --- a/actions/example-force-rebuild/.forgejo/local-docker-action/action.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: local docker action -description: local docker action, build depends on "input.txt" - -runs: - using: 'docker' - image: 'Dockerfile' diff --git a/actions/example-force-rebuild/.forgejo/local-docker-action/entrypoint.sh b/actions/example-force-rebuild/.forgejo/local-docker-action/entrypoint.sh deleted file mode 100755 index e2ee36ad..00000000 --- a/actions/example-force-rebuild/.forgejo/local-docker-action/entrypoint.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env bash -set -x -exit "$(< /run/input.txt)" \ No newline at end of file diff --git a/actions/example-force-rebuild/.forgejo/local-docker-action/input.txt b/actions/example-force-rebuild/.forgejo/local-docker-action/input.txt deleted file mode 100644 index 5a944794..00000000 --- a/actions/example-force-rebuild/.forgejo/local-docker-action/input.txt +++ /dev/null @@ -1 +0,0 @@ -this file will be filled by the test \ No newline at end of file diff --git a/actions/example-force-rebuild/.forgejo/workflows/test.yml b/actions/example-force-rebuild/.forgejo/workflows/test.yml index 41510651..ee6a9bb4 100644 --- a/actions/example-force-rebuild/.forgejo/workflows/test.yml +++ b/actions/example-force-rebuild/.forgejo/workflows/test.yml @@ -1,10 +1,11 @@ ---- -on: - push: +on: [push] + jobs: - test: + ls: runs-on: docker steps: - - name: Checkout repository - uses: actions/checkout@v4 - - uses: ./.forgejo/local-docker-action + - uses: https://code.forgejo.org/forgejo/test-setup-forgejo-docker@main + with: + args: ${{ forge.workspace }}/SOMEFILE + - run: | + test -f ${{ forge.workspace }}/SOMEFILE diff --git a/actions/example-force-rebuild/run.sh b/actions/example-force-rebuild/run.sh index d82890a3..b783b3a2 100755 --- a/actions/example-force-rebuild/run.sh +++ b/actions/example-force-rebuild/run.sh @@ -19,24 +19,51 @@ function run() { forgejo-test-helper.sh wait_$expected $url $repo $sha } +function get_remote_image() { + docker image ls --format='{{ .Repository }}' | grep '^runner-remote-docker-action' +} + +function remove_remote_images() { + docker image ls --format='{{ .Repository }}' | grep '^runner-remote-docker-action' | while read image; do + docker rmi $image + done +} + +function was_built() { + grep --quiet 'docker build -t runner-remote-docker-action' $FORGEJO_RUNNER_LOGS +} + function main() { local dir=$TMPDIR/repository cp -a $EXAMPLE_DIR $dir - # set up passing docker action - echo "0" >$dir/.forgejo/local-docker-action/input.txt - setup_with_rebuild - run $dir success + remove_remote_images - # change docker action to fail - echo "1" >$dir/.forgejo/local-docker-action/input.txt - # ... but without a rebuild, it should still pass + : + : Run one + : setup_without_rebuild run $dir success + local image="$(get_remote_image)" + test "$image" + was_built - # now the action should fail + : + : Run two: verify the image was not rebuilt + : + setup_without_rebuild # resets the logs + run $dir success + test "$image" = "$(get_remote_image)" + ! was_built + + : + : Run two: verify the image was rebuilt and + : the image name stayed the same + : setup_with_rebuild - run $dir failure + run $dir success + test "$image" = "$(get_remote_image)" + was_built } main diff --git a/actions/example-force-rebuild/runner-config-with-rebuild.yml b/actions/example-force-rebuild/runner-config-with-rebuild.yml index c99a2300..6dee7b32 100644 --- a/actions/example-force-rebuild/runner-config-with-rebuild.yml +++ b/actions/example-force-rebuild/runner-config-with-rebuild.yml @@ -1,5 +1,6 @@ log: - level: debug + level: trace + job_level: trace runner: file: .runner diff --git a/actions/example-force-rebuild/runner-config-without-rebuild.yml b/actions/example-force-rebuild/runner-config-without-rebuild.yml index 793fbcd6..8d9f71bb 100644 --- a/actions/example-force-rebuild/runner-config-without-rebuild.yml +++ b/actions/example-force-rebuild/runner-config-without-rebuild.yml @@ -1,5 +1,6 @@ log: - level: debug + level: trace + job_level: trace runner: file: .runner From a3a5e22c6daf2b7b2d7f107add8adad9bfc14a74 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 7 Sep 2025 21:55:46 +0000 Subject: [PATCH 119/173] fix: actions: forgejo/test-setup-forgejo-docker is on code.forgejo.org (#1006) It was working before today because of a routing bug in the Forgejo infrastructure Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1006 Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/example-docker-action/.forgejo/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/example-docker-action/.forgejo/workflows/test.yml b/actions/example-docker-action/.forgejo/workflows/test.yml index cec2c9db..4f70fff4 100644 --- a/actions/example-docker-action/.forgejo/workflows/test.yml +++ b/actions/example-docker-action/.forgejo/workflows/test.yml @@ -7,7 +7,7 @@ jobs: # # This Docker action creates the file SOMEFILE ... # - - uses: https://data.forgejo.org/forgejo/test-setup-forgejo-docker@main + - uses: https://code.forgejo.org/forgejo/test-setup-forgejo-docker@main with: args: ${{ forge.workspace }}/SOMEFILE # From 9b17f51199dffb09898ee0a5066aee59b84bb07f Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 8 Sep 2025 20:14:08 +0000 Subject: [PATCH 120/173] chore: do not propagate contexts to the documentation (#1010) Refs forgejo/docs#1445 Notes: secrets should also be removed after this is merged Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1010 Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/workflows/end-to-end.yml | 58 ------------------------------- 1 file changed, 58 deletions(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 5ca770ba..8357355c 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -2,16 +2,6 @@ # # https://code.forgejo.org/forgejo/end-to-end/settings/actions # -# secrets.CASCADE_DOCS_ORIGIN_TOKEN -# https://code.forgejo.org/forgejo-ci scope write:issue, read:repository, read:user -# vars.CASCADE_DOCS_DESTINATION_DOER -# forgejo-cascading-pr (https://codeberg.org/forgejo-cascading-pr) -# secrets.CASCADE_DOCS_DESTINATION_TOKEN -# https://codeberg.org/forgejo-cascading-pr scope write:issue, write:repository, read:user -# vars.CASCADE_DOCS_FORCE_VERSION -# replace the generated documentation for a given version even if it has already -# been generated (e.g. v7.0.0-test) -# on: pull_request: @@ -140,54 +130,6 @@ jobs: if: always() run: su forgejo -c "./end-to-end.sh show_logs" - actions-docs: - needs: [build] - runs-on: lxc-bookworm - if: forge.ref == 'refs/heads/main' - strategy: - matrix: - info: - - name: latest - version: "12.0" - branch: next - forgejo: https://codeberg.org - owner: forgejo-experimental - - name: previous - version: "11.0" - forgejo: https://codeberg.org - owner: forgejo - steps: - - uses: https://data.forgejo.org/actions/checkout@v4 - - uses: ./.forgejo/prepare-end-to-end - with: - built: ${{ needs.build.outputs.built }} - - name: set full-version - id: full-version - shell: bash - run: | - set -x - full_version=$(./end-to-end.sh full_version ${{ matrix.info.version }} ${{ matrix.info.owner }}) - echo value="$full_version" >> $FORGEJO_OUTPUT - - run: ./end-to-end.sh prepare_dockerd - - run: su forgejo -c "./end-to-end.sh test_actions ${{ matrix.info.version }}" - - name: update documentation - uses: https://data.forgejo.org/actions/cascading-pr@v2.2.1 - with: - origin-url: ${{ env.FORGEJO_SERVER_URL }} - origin-repo: ${{ forge.repository }} - origin-token: ${{ secrets.CASCADE_DOCS_ORIGIN_TOKEN }} - origin-ref: refs/heads/main - destination-url: https://codeberg.org - destination-fork-repo: ${{ vars.CASCADE_DOCS_DESTINATION_DOER }}/docs - destination-repo: forgejo/docs - destination-branch: ${{ matrix.info.branch || format('v{0}', matrix.info.version) }} - destination-token: ${{ secrets.CASCADE_DOCS_DESTINATION_TOKEN }} - prefix: ${{ env.FORGEJO_REPOSITORY }}-${{ matrix.info.version }} - update: .forgejo/cascading-docs - env: - FORCE_VERSION: "${{ vars.CASCADE_DOCS_FORCE_VERSION }}" - VERSION: "${{ steps.full-version.outputs.value }}" - upgrade: name: upgrade and storage needs: [build] From 219059b73214b38574693c1f2d2a851299dc0dc0 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 10 Sep 2025 05:26:17 +0000 Subject: [PATCH 121/173] Update https://data.forgejo.org/actions/setup-forgejo action to v3.0.3 (#1014) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://data.forgejo.org/actions/setup-forgejo](https://code.forgejo.org/actions/setup-forgejo) | action | patch | `v3.0.2` -> `v3.0.3` | --- ### Release Notes
actions/setup-forgejo (https://data.forgejo.org/actions/setup-forgejo) ### [`v3.0.3`](https://code.forgejo.org/actions/setup-forgejo/compare/v3.0.2...v3.0.3) [Compare Source](https://code.forgejo.org/actions/setup-forgejo/compare/v3.0.2...v3.0.3)
--- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1014 Reviewed-by: earl-warren Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index fd949a20..5b5fc00d 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -15,7 +15,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.2 + - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.3 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From d3aab3b4295d2735fddf04e7f21338e9e9677f7d Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 14 Sep 2025 16:19:58 +0000 Subject: [PATCH 122/173] chore: actions: set the log level of the runner to trace (#1031) it greatly helps with debugging Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1031 Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/runner-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/actions/runner-config.yaml b/actions/runner-config.yaml index 7d9e7642..5859b08e 100644 --- a/actions/runner-config.yaml +++ b/actions/runner-config.yaml @@ -1,5 +1,6 @@ log: - level: debug + level: trace + job_level: trace runner: file: .runner From 05e7b0c2f6e3fdd0b10cd25d3917c3e70d1aedf9 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 20 Sep 2025 07:02:18 +0000 Subject: [PATCH 123/173] Update https://data.forgejo.org/actions/setup-forgejo action to v3.0.4 (#1046) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://data.forgejo.org/actions/setup-forgejo](https://code.forgejo.org/actions/setup-forgejo) | action | patch | `v3.0.3` -> `v3.0.4` | --- ### Release Notes
actions/setup-forgejo (https://data.forgejo.org/actions/setup-forgejo) ### [`v3.0.4`](https://code.forgejo.org/actions/setup-forgejo/compare/v3.0.3...v3.0.4) [Compare Source](https://code.forgejo.org/actions/setup-forgejo/compare/v3.0.3...v3.0.4)
--- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1046 Reviewed-by: earl-warren Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 5b5fc00d..1f9de15c 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -15,7 +15,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.3 + - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.4 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 8cfc202cb4720f34d26ab58ec90b9f3fd871025d Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Thu, 25 Sep 2025 15:06:50 +0000 Subject: [PATCH 124/173] chore(release): v14.0 exists (#1057) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1057 Reviewed-by: earl-warren Co-authored-by: 0ko <0ko@noreply.codeberg.org> Co-committed-by: 0ko <0ko@noreply.codeberg.org> --- forgejo/sources/14.0 | 1 + lib/lib.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 forgejo/sources/14.0 diff --git a/forgejo/sources/14.0 b/forgejo/sources/14.0 new file mode 100644 index 00000000..84203a1b --- /dev/null +++ b/forgejo/sources/14.0 @@ -0,0 +1 @@ +https://codeberg.org/forgejo/forgejo forgejo 14.0.0 diff --git a/lib/lib.sh b/lib/lib.sh index 4f540cf4..8c8cc1c8 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -26,7 +26,7 @@ IP=$(hostname -I | cut -f1 -d' ') # # Forgejo releases for which a branch exists (7.0/forgejo etc.) # -RELEASE_NUMBERS="11.0 12.0 13.0" +RELEASE_NUMBERS="11.0 12.0 13.0 14.0" PREFIX=============== export DIR=/tmp/forgejo-end-to-end From ca5f4d096bbf8a7f2c7efb0c355c7f5e91f87f52 Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Fri, 26 Sep 2025 14:15:12 +0000 Subject: [PATCH 125/173] chore(release): v12.0 is EoL (#1058) Ref https://code.forgejo.org/forgejo/end-to-end/pulls/1057 It will also need a rebase later. Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1058 Reviewed-by: earl-warren Co-authored-by: 0ko <0ko@noreply.codeberg.org> Co-committed-by: 0ko <0ko@noreply.codeberg.org> --- lib/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib.sh b/lib/lib.sh index 8c8cc1c8..6ed6afbf 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -26,7 +26,7 @@ IP=$(hostname -I | cut -f1 -d' ') # # Forgejo releases for which a branch exists (7.0/forgejo etc.) # -RELEASE_NUMBERS="11.0 12.0 13.0 14.0" +RELEASE_NUMBERS="11.0 13.0 14.0" PREFIX=============== export DIR=/tmp/forgejo-end-to-end From 2c247b8d49662f209eea0e7b3edbad05bf5e1d43 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 28 Sep 2025 14:46:16 +0000 Subject: [PATCH 126/173] feat: federation: upgrade to trixie (#1069) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1069 Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/workflows/end-to-end.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 8357355c..1096b0fa 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -104,7 +104,7 @@ jobs: federation: needs: [build] - runs-on: lxc-bookworm + runs-on: lxc-trixie steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end From 22004ebe73efb81b236562bdd0486d1d8e3e148f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 18 Oct 2025 06:11:46 +0000 Subject: [PATCH 127/173] Update code.forgejo.org/oci/debian Docker tag to v13 (#1070) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | code.forgejo.org/oci/debian | container | major | `bookworm` -> `trixie` | | code.forgejo.org/oci/debian | service | major | `bookworm` -> `trixie` | --- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1070 Reviewed-by: earl-warren Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- actions/example-cron/.forgejo/workflows/test.yml | 2 +- .../example-post-7-0-schedule/.forgejo/workflows/test.yml | 2 +- .../.forgejo/workflows/schedule_continue.yml | 2 +- actions/example-service/.forgejo/workflows/test.yml | 8 ++++---- .../example-workflow-dispatch/.forgejo/workflows/test.yml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/actions/example-cron/.forgejo/workflows/test.yml b/actions/example-cron/.forgejo/workflows/test.yml index 054ddad6..8b23779a 100644 --- a/actions/example-cron/.forgejo/workflows/test.yml +++ b/actions/example-cron/.forgejo/workflows/test.yml @@ -6,7 +6,7 @@ jobs: test: runs-on: docker container: - image: code.forgejo.org/oci/debian:bookworm + image: code.forgejo.org/oci/debian:trixie options: "--volume /srv/example:/srv/example" steps: diff --git a/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml b/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml index 73e9b404..202382dc 100644 --- a/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml +++ b/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml @@ -6,7 +6,7 @@ jobs: test: runs-on: ${{ vars.TEST_SCHEDULE_RUNSON }} container: - image: code.forgejo.org/oci/debian:bookworm + image: code.forgejo.org/oci/debian:trixie options: "--volume /srv/example:/srv/example" steps: diff --git a/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml b/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml index 58156ea3..76ee59b8 100644 --- a/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml +++ b/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml @@ -5,7 +5,7 @@ jobs: test: runs-on: docker container: - image: code.forgejo.org/oci/debian:bookworm + image: code.forgejo.org/oci/debian:trixie volumes: - /srv/example:/srv/example steps: diff --git a/actions/example-service/.forgejo/workflows/test.yml b/actions/example-service/.forgejo/workflows/test.yml index 014653aa..1eeb3ec5 100644 --- a/actions/example-service/.forgejo/workflows/test.yml +++ b/actions/example-service/.forgejo/workflows/test.yml @@ -23,7 +23,7 @@ jobs: simple: runs-on: docker container: - image: code.forgejo.org/oci/debian:bookworm + image: code.forgejo.org/oci/debian:trixie services: pgsql: @@ -43,7 +43,7 @@ jobs: needs: [simple] runs-on: docker container: - image: code.forgejo.org/oci/debian:bookworm + image: code.forgejo.org/oci/debian:trixie options: "--volume /srv/example-service-volume-valid:/srv/example-service-volume-valid --volume /srv/example-service-volume-invalid:/srv/example-service-volume-invalid" steps: @@ -58,12 +58,12 @@ jobs: needs: [volume-on-step] runs-on: docker container: - image: code.forgejo.org/oci/debian:bookworm + image: code.forgejo.org/oci/debian:trixie options: "--volume /srv/example-service-volume-valid:/srv/example-service-volume-valid" services: myservice: - image: code.forgejo.org/oci/debian:bookworm + image: code.forgejo.org/oci/debian:trixie options: "--volume /srv/example-service-volume-valid:/srv/example-service-volume-valid" cmd: ["bash", "-c", "echo -n SUCCESS > /srv/example-service-volume-valid ; sleep infinity"] diff --git a/actions/example-workflow-dispatch/.forgejo/workflows/test.yml b/actions/example-workflow-dispatch/.forgejo/workflows/test.yml index c2dcea6d..766b21d8 100644 --- a/actions/example-workflow-dispatch/.forgejo/workflows/test.yml +++ b/actions/example-workflow-dispatch/.forgejo/workflows/test.yml @@ -44,7 +44,7 @@ jobs: test: runs-on: docker container: - image: code.forgejo.org/oci/debian:bookworm + image: code.forgejo.org/oci/debian:trixie options: "--volume /srv/example:/srv/example" steps: From d2234875f0dd0d0a0cd32a3690530c28872e7bad Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 9 Nov 2025 01:01:31 +0000 Subject: [PATCH 128/173] Update https://data.forgejo.org/actions/setup-forgejo action to v3.0.5 (#1192) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://data.forgejo.org/actions/setup-forgejo](https://code.forgejo.org/actions/setup-forgejo) | action | patch | `v3.0.4` -> `v3.0.5` | --- ### Release Notes
actions/setup-forgejo (https://data.forgejo.org/actions/setup-forgejo) ### [`v3.0.5`](https://code.forgejo.org/actions/setup-forgejo/compare/v3.0.4...v3.0.5) [Compare Source](https://code.forgejo.org/actions/setup-forgejo/compare/v3.0.4...v3.0.5)
--- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1192 Reviewed-by: Mathieu Fenniak Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 1f9de15c..69a39ce9 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -15,7 +15,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.4 + - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.5 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 45620f406580f9ef05d26b80fb3f0b8e3061beb9 Mon Sep 17 00:00:00 2001 From: viceice Date: Tue, 11 Nov 2025 21:19:33 +0000 Subject: [PATCH 129/173] fix: pin docker cli to v28 (#1203) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1203 Co-authored-by: viceice Co-committed-by: viceice --- actions/example-with-docker-host/.forgejo/workflows/test.yml | 2 +- actions/example-with-docker-socket/.forgejo/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/example-with-docker-host/.forgejo/workflows/test.yml b/actions/example-with-docker-host/.forgejo/workflows/test.yml index 6089092f..277114e6 100644 --- a/actions/example-with-docker-host/.forgejo/workflows/test.yml +++ b/actions/example-with-docker-host/.forgejo/workflows/test.yml @@ -4,7 +4,7 @@ jobs: build: runs-on: docker container: - image: code.forgejo.org/oci/docker:cli + image: code.forgejo.org/oci/docker:28-cli steps: - run: ls -l /var/run/docker.sock - run: docker ps diff --git a/actions/example-with-docker-socket/.forgejo/workflows/test.yml b/actions/example-with-docker-socket/.forgejo/workflows/test.yml index 6089092f..277114e6 100644 --- a/actions/example-with-docker-socket/.forgejo/workflows/test.yml +++ b/actions/example-with-docker-socket/.forgejo/workflows/test.yml @@ -4,7 +4,7 @@ jobs: build: runs-on: docker container: - image: code.forgejo.org/oci/docker:cli + image: code.forgejo.org/oci/docker:28-cli steps: - run: ls -l /var/run/docker.sock - run: docker ps From 2cbea248e5e6c7176065f4365dc0884e934d96e3 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 11 Nov 2025 23:35:20 +0000 Subject: [PATCH 130/173] Update dependency forgejo-lxc to v13 (#1205) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1205 Reviewed-by: Michael Kriese Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/workflows/end-to-end.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 1096b0fa..a4fe2d46 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -69,7 +69,7 @@ jobs: packages: needs: [build] - runs-on: lxc-bookworm + runs-on: lxc-trixie steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end @@ -86,7 +86,7 @@ jobs: actions: needs: [build] - runs-on: lxc-bookworm + runs-on: lxc-trixie steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end @@ -133,7 +133,7 @@ jobs: upgrade: name: upgrade and storage needs: [build] - runs-on: lxc-bookworm + runs-on: lxc-trixie steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end From 7f6f69c80f6d62ecdcd3fe4c24b6190d5435caa5 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 19 Nov 2025 06:00:58 +0000 Subject: [PATCH 131/173] Update https://data.forgejo.org/actions/setup-forgejo action to v3.0.6 (#1233) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1233 Reviewed-by: Michael Kriese Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 69a39ce9..d85eb6f6 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -15,7 +15,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.5 + - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.6 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 14d2748a33154a2e7f7a12686668dc3a1c9b595c Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 1 Dec 2025 13:59:46 +0000 Subject: [PATCH 132/173] actions: use the forgejo context instead of forge and test backward compatibility (#1034) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1034 Reviewed-by: Mathieu Fenniak Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .../.forgejo/workflows/test.yml | 18 ++++++++++++++++++ .../action-for-context/action.yml | 2 ++ .../.forgejo/workflows/test.yml | 4 ++-- .../.forgejo/workflows/test.yml | 4 ++-- .../.forgejo/workflows/test.yml | 8 ++++---- 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/actions/example-context/.forgejo/workflows/test.yml b/actions/example-context/.forgejo/workflows/test.yml index 8b8b971f..6a5e6f25 100644 --- a/actions/example-context/.forgejo/workflows/test.yml +++ b/actions/example-context/.forgejo/workflows/test.yml @@ -22,6 +22,7 @@ jobs: test "$FORGEJO_ACTION" = "${{ env.FORGEJO_ACTION }}" test "$FORGEJO_ACTION" = "${{ github.ACTION }}" test "$FORGEJO_ACTION" = "${{ forge.ACTION }}" + test "$FORGEJO_ACTION" = "${{ forgejo.ACTION }}" test "$FORGEJO_ACTION" = "$GITHUB_ACTION" # See also actions/example-local-action/.forgejo/local-action/action.yml @@ -32,6 +33,7 @@ jobs: test "$FORGEJO_ACTION_PATH" = "${{ env.FORGEJO_ACTION_PATH }}" test "$FORGEJO_ACTION_PATH" = "${{ github.ACTION_PATH }}" test "$FORGEJO_ACTION_PATH" = "${{ forge.ACTION_PATH }}" + test "$FORGEJO_ACTION_PATH" = "${{ forgejo.ACTION_PATH }}" test "$FORGEJO_ACTION_PATH" = "$GITHUB_ACTION_PATH" - name: when running an action @@ -60,6 +62,7 @@ jobs: test "$FORGEJO_ACTOR" = "${{ env.FORGEJO_ACTOR }}" test "$FORGEJO_ACTOR" = "${{ github.ACTOR }}" test "$FORGEJO_ACTOR" = "${{ forge.ACTOR }}" + test "$FORGEJO_ACTOR" = "${{ forgejo.ACTOR }}" test "$FORGEJO_ACTOR" = "$GITHUB_ACTOR" - name: FORGEJO_API_URL @@ -70,6 +73,7 @@ jobs: test "$FORGEJO_API_URL" = "${{ env.FORGEJO_API_URL }}" test "$FORGEJO_API_URL" = "${{ github.API_URL }}" test "$FORGEJO_API_URL" = "${{ forge.API_URL }}" + test "$FORGEJO_API_URL" = "${{ forgejo.API_URL }}" test "$FORGEJO_API_URL" = "$GITHUB_API_URL" # See also actions/example-pull-request/.forgejo/workflows/test.yml @@ -80,6 +84,7 @@ jobs: test "$FORGEJO_BASE_REF" = "${{ env.FORGEJO_BASE_REF }}" test "$FORGEJO_BASE_REF" = "${{ github.BASE_REF }}" test "$FORGEJO_BASE_REF" = "${{ forge.BASE_REF }}" + test "$FORGEJO_BASE_REF" = "${{ forgejo.BASE_REF }}" test "$FORGEJO_BASE_REF" = "$GITHUB_BASE_REF" # See also actions/example-pull-request/.forgejo/workflows/test.yml @@ -90,6 +95,7 @@ jobs: test "$FORGEJO_HEAD_REF" = "${{ env.FORGEJO_HEAD_REF }}" test "$FORGEJO_HEAD_REF" = "${{ github.HEAD_REF }}" test "$FORGEJO_HEAD_REF" = "${{ forge.HEAD_REF }}" + test "$FORGEJO_HEAD_REF" = "${{ forgejo.HEAD_REF }}" test "$FORGEJO_HEAD_REF" = "$GITHUB_HEAD_REF" - name: FORGEJO_ENV @@ -106,6 +112,7 @@ jobs: test "$FORGEJO_EVENT_NAME" = "${{ env.FORGEJO_EVENT_NAME }}" test "$FORGEJO_EVENT_NAME" = "${{ github.EVENT_NAME }}" test "$FORGEJO_EVENT_NAME" = "${{ forge.EVENT_NAME }}" + test "$FORGEJO_EVENT_NAME" = "${{ forgejo.EVENT_NAME }}" test "$FORGEJO_EVENT_NAME" = "$GITHUB_EVENT_NAME" - name: FORGEJO_JOB @@ -115,6 +122,7 @@ jobs: test "$FORGEJO_JOB" = "${{ env.FORGEJO_JOB }}" test "$FORGEJO_JOB" = "${{ github.JOB }}" test "$FORGEJO_JOB" = "${{ forge.JOB }}" + test "$FORGEJO_JOB" = "${{ forgejo.JOB }}" test "$FORGEJO_JOB" = "$GITHUB_JOB" - name: FORGEJO_OUTPUT @@ -139,6 +147,7 @@ jobs: test "$FORGEJO_REF" = "${{ env.FORGEJO_REF }}" test "$FORGEJO_REF" = "${{ github.REF }}" test "$FORGEJO_REF" = "${{ forge.REF }}" + test "$FORGEJO_REF" = "${{ forgejo.REF }}" test "$FORGEJO_REF" = "$GITHUB_REF" - name: FORGEJO_REF_NAME @@ -149,6 +158,7 @@ jobs: test "$FORGEJO_REF_NAME" = "${{ env.FORGEJO_REF_NAME }}" test "$FORGEJO_REF_NAME" = "${{ github.REF_NAME }}" test "$FORGEJO_REF_NAME" = "${{ forge.REF_NAME }}" + test "$FORGEJO_REF_NAME" = "${{ forgejo.REF_NAME }}" test "$FORGEJO_REF_NAME" = "$GITHUB_REF_NAME" - name: FORGEJO_REPOSITORY @@ -158,6 +168,7 @@ jobs: test "$FORGEJO_REPOSITORY" = "${{ env.FORGEJO_REPOSITORY }}" test "$FORGEJO_REPOSITORY" = "${{ github.REPOSITORY }}" test "$FORGEJO_REPOSITORY" = "${{ forge.REPOSITORY }}" + test "$FORGEJO_REPOSITORY" = "${{ forgejo.REPOSITORY }}" test "$FORGEJO_REPOSITORY" = "$GITHUB_REPOSITORY" - name: FORGEJO_REPOSITORY_OWNER @@ -167,6 +178,7 @@ jobs: test "$FORGEJO_REPOSITORY_OWNER" = "${{ env.FORGEJO_REPOSITORY_OWNER }}" test "$FORGEJO_REPOSITORY_OWNER" = "${{ github.REPOSITORY_OWNER }}" test "$FORGEJO_REPOSITORY_OWNER" = "${{ forge.REPOSITORY_OWNER }}" + test "$FORGEJO_REPOSITORY_OWNER" = "${{ forgejo.REPOSITORY_OWNER }}" test "$FORGEJO_REPOSITORY_OWNER" = "$GITHUB_REPOSITORY_OWNER" - name: FORGEJO_RUN_NUMBER @@ -176,6 +188,7 @@ jobs: test "$FORGEJO_RUN_NUMBER" = "${{ env.FORGEJO_RUN_NUMBER }}" test "$FORGEJO_RUN_NUMBER" = "${{ github.RUN_NUMBER }}" test "$FORGEJO_RUN_NUMBER" = "${{ forge.RUN_NUMBER }}" + test "$FORGEJO_RUN_NUMBER" = "${{ forgejo.RUN_NUMBER }}" test "$FORGEJO_RUN_NUMBER" = "$GITHUB_RUN_NUMBER" - name: FORGEJO_RUN_ID @@ -185,6 +198,7 @@ jobs: test "$FORGEJO_RUN_ID" = "${{ env.FORGEJO_RUN_ID }}" test "$FORGEJO_RUN_ID" = "${{ github.RUN_ID }}" test "$FORGEJO_RUN_ID" = "${{ forge.RUN_ID }}" + test "$FORGEJO_RUN_ID" = "${{ forgejo.RUN_ID }}" test "$FORGEJO_RUN_ID" = "$GITHUB_RUN_ID" - name: FORGEJO_SERVER_URL @@ -195,6 +209,7 @@ jobs: test "$FORGEJO_SERVER_URL" = "${{ env.FORGEJO_SERVER_URL }}" test "$FORGEJO_SERVER_URL" = "${{ github.SERVER_URL }}" test "$FORGEJO_SERVER_URL" = "${{ forge.SERVER_URL }}" + test "$FORGEJO_SERVER_URL" = "${{ forgejo.SERVER_URL }}" test "$FORGEJO_SERVER_URL" = "$GITHUB_SERVER_URL" - name: FORGEJO_SHA @@ -204,6 +219,7 @@ jobs: test "$FORGEJO_SHA" = "${{ env.FORGEJO_SHA }}" test "$FORGEJO_SHA" = "${{ github.SHA }}" test "$FORGEJO_SHA" = "${{ forge.SHA }}" + test "$FORGEJO_SHA" = "${{ forgejo.SHA }}" test "$FORGEJO_SHA" = "$GITHUB_SHA" - name: FORGEJO_STEP_SUMMARY @@ -221,6 +237,7 @@ jobs: test "$FORGEJO_TOKEN" = "${{ env.FORGEJO_TOKEN }}" test "$FORGEJO_TOKEN" = "${{ github.TOKEN }}" test "$FORGEJO_TOKEN" = "${{ forge.TOKEN }}" + test "$FORGEJO_TOKEN" = "${{ forgejo.TOKEN }}" test "$FORGEJO_TOKEN" = "$GITHUB_TOKEN" - name: FORGEJO_WORKSPACE @@ -230,6 +247,7 @@ jobs: test "$FORGEJO_WORKSPACE" = "${{ env.FORGEJO_WORKSPACE }}" test "$FORGEJO_WORKSPACE" = "${{ github.WORKSPACE }}" test "$FORGEJO_WORKSPACE" = "${{ forge.WORKSPACE }}" + test "$FORGEJO_WORKSPACE" = "${{ forgejo.WORKSPACE }}" test "$FORGEJO_WORKSPACE" = "$GITHUB_WORKSPACE" - name: RUNNER_ARCH diff --git a/actions/example-context/action-for-context/action.yml b/actions/example-context/action-for-context/action.yml index 301d7280..e675d6ca 100644 --- a/actions/example-context/action-for-context/action.yml +++ b/actions/example-context/action-for-context/action.yml @@ -13,6 +13,7 @@ runs: test "$FORGEJO_ACTION_REPOSITORY" = "${{ env.FORGEJO_ACTION_REPOSITORY }}" test "$FORGEJO_ACTION_REPOSITORY" = "${{ github.ACTION_REPOSITORY }}" test "$FORGEJO_ACTION_REPOSITORY" = "${{ forge.ACTION_REPOSITORY }}" + test "$FORGEJO_ACTION_REPOSITORY" = "${{ forgejo.ACTION_REPOSITORY }}" test "$FORGEJO_ACTION_REPOSITORY" = "$GITHUB_ACTION_REPOSITORY" touch /srv/example/example-context/FORGEJO_ACTION_REPOSITORY @@ -26,5 +27,6 @@ runs: [[ "$FORGEJO_ACTION_PATH" =~ action-for-context@main$ ]] || [[ "$FORGEJO_ACTION_PATH" =~ /[0-9a-f]{2}/[0-9a-f]{62}$ ]] test "$FORGEJO_ACTION_PATH" = "${{ github.ACTION_PATH }}" test "$FORGEJO_ACTION_PATH" = "${{ forge.ACTION_PATH }}" + test "$FORGEJO_ACTION_PATH" = "${{ forgejo.ACTION_PATH }}" test "$FORGEJO_ACTION_PATH" = "$GITHUB_ACTION_PATH" touch /srv/example/example-context/FORGEJO_ACTION_PATH diff --git a/actions/example-docker-action/.forgejo/workflows/test.yml b/actions/example-docker-action/.forgejo/workflows/test.yml index 4f70fff4..d7ff2b98 100644 --- a/actions/example-docker-action/.forgejo/workflows/test.yml +++ b/actions/example-docker-action/.forgejo/workflows/test.yml @@ -9,11 +9,11 @@ jobs: # - uses: https://code.forgejo.org/forgejo/test-setup-forgejo-docker@main with: - args: ${{ forge.workspace }}/SOMEFILE + args: ${{ forgejo.workspace }}/SOMEFILE # # ... which then also exists in the job workspace # because both docker containers are automatically # sharing the volume that contains it. # - run: | - test -f ${{ forge.workspace }}/SOMEFILE + test -f ${{ forgejo.workspace }}/SOMEFILE diff --git a/actions/example-force-rebuild/.forgejo/workflows/test.yml b/actions/example-force-rebuild/.forgejo/workflows/test.yml index ee6a9bb4..d6f8b3e9 100644 --- a/actions/example-force-rebuild/.forgejo/workflows/test.yml +++ b/actions/example-force-rebuild/.forgejo/workflows/test.yml @@ -6,6 +6,6 @@ jobs: steps: - uses: https://code.forgejo.org/forgejo/test-setup-forgejo-docker@main with: - args: ${{ forge.workspace }}/SOMEFILE + args: ${{ forgejo.workspace }}/SOMEFILE - run: | - test -f ${{ forge.workspace }}/SOMEFILE + test -f ${{ forgejo.workspace }}/SOMEFILE diff --git a/actions/example-pull-request/.forgejo/workflows/test.yml b/actions/example-pull-request/.forgejo/workflows/test.yml index 320d0a86..f906e12f 100644 --- a/actions/example-pull-request/.forgejo/workflows/test.yml +++ b/actions/example-pull-request/.forgejo/workflows/test.yml @@ -18,7 +18,7 @@ jobs: run: | set -x test $FORGEJO_TOKEN = ${{ env.FORGEJO_TOKEN }} - test $FORGEJO_TOKEN = ${{ forge.token }} + test $FORGEJO_TOKEN = ${{ forgejo.token }} export DEBIAN_FRONTEND=noninteractive ; apt-get -qq update ; apt-get install -y -qq curl git >& /dev/null curl -sS -o /usr/local/bin/forgejo-curl.sh https://code.forgejo.org/forgejo/forgejo-curl/raw/branch/main/forgejo-curl.sh && chmod +x /usr/local/bin/forgejo-curl.sh forgejo-curl.sh --token "$FORGEJO_TOKEN" login $FORGEJO_SERVER_URL @@ -27,7 +27,7 @@ jobs: - name: determine if the PR is from a fork id: forked run: | - if test ${{ forge.event.pull_request.base.repo.full_name }} = ${{ forge.event.pull_request.head.repo.full_name }} ; then + if test ${{ forgejo.event.pull_request.base.repo.full_name }} = ${{ forge.event.pull_request.head.repo.full_name }} ; then echo value=false >> $FORGEJO_OUTPUT else echo value=true >> $FORGEJO_OUTPUT @@ -95,7 +95,7 @@ jobs: # # create an issue # - base_repo=${{ forge.event.pull_request.base.repo.full_name }} + base_repo=${{ forgejo.event.pull_request.base.repo.full_name }} forgejo-curl.sh api_json --data-raw '{"title":"ISSUE"}' $FORGEJO_SERVER_URL/api/v1/repos/$base_repo/issues url=$(echo $FORGEJO_SERVER_URL | sed -e "s|://|://$FORGEJO_TOKEN@|") git clone $url/$base_repo base @@ -133,7 +133,7 @@ jobs: - name: save event run: | - d=/srv/example/pull-request/contexts/${{ forge.event.pull_request.head.repo.owner.username }}/$FORGEJO_EVENT_NAME + d=/srv/example/pull-request/contexts/${{ forgejo.event.pull_request.head.repo.owner.username }}/$FORGEJO_EVENT_NAME mkdir -p $d cat > $d/github <<'EOF' ${{ toJSON(github) }} From 069ca6777eced4109d73a80e6c68313841322e08 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 1 Dec 2025 14:00:07 +0000 Subject: [PATCH 133/173] actions: cache-pull-request: pull request and cache isolation (#1062) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1062 Reviewed-by: Michael Kriese Reviewed-by: Mathieu Fenniak Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/actions.sh | 2 +- .../.forgejo/workflows/test.yml | 94 +++++++++++++++++++ .../assert-contexts-closed.sh | 9 ++ .../assert-contexts-opened.sh | 9 ++ actions/example-cache-pull-request/run.sh | 78 +++++++++++++++ .../runner-config.yaml | 30 ++++++ actions/example-cache-pull-request/setup.sh | 2 + .../example-cache-pull-request/teardown.sh | 1 + 8 files changed, 224 insertions(+), 1 deletion(-) create mode 100644 actions/example-cache-pull-request/.forgejo/workflows/test.yml create mode 100755 actions/example-cache-pull-request/assert-contexts-closed.sh create mode 100755 actions/example-cache-pull-request/assert-contexts-opened.sh create mode 100755 actions/example-cache-pull-request/run.sh create mode 100644 actions/example-cache-pull-request/runner-config.yaml create mode 100755 actions/example-cache-pull-request/setup.sh create mode 100755 actions/example-cache-pull-request/teardown.sh diff --git a/actions/actions.sh b/actions/actions.sh index 04629063..ceb8c04c 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -143,7 +143,7 @@ function test_actions() { done fi - for example in echo matrix needs workflow-call lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do + for example in echo matrix needs workflow-call lxc config-options cache cache-pull-request checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do run actions_verify_example $example done diff --git a/actions/example-cache-pull-request/.forgejo/workflows/test.yml b/actions/example-cache-pull-request/.forgejo/workflows/test.yml new file mode 100644 index 00000000..9c4e7230 --- /dev/null +++ b/actions/example-cache-pull-request/.forgejo/workflows/test.yml @@ -0,0 +1,94 @@ +on: + pull_request: + types: + - opened + - closed + +jobs: + save-cache: + runs-on: docker + container: + image: code.forgejo.org/oci/node:20-bookworm + steps: + - name: cache restore + id: cachestep1 + uses: https://data.forgejo.org/actions/cache/restore@v4 + with: + path: | + /usr/local/bin/something + key: cachekey-${{ forge.event.pull_request.head.repo.full_name }} + + - name: cache hit + run: | + set -x + test "${{ steps.cachestep1.outputs.cache-hit }}" != true + + - name: create something + run: echo SOMETHING > /usr/local/bin/something + + - name: cache save + uses: https://data.forgejo.org/actions/cache/save@v4 + with: + path: | + /usr/local/bin/something + key: ${{ steps.cachestep1.outputs.cache-primary-key }} + + restore-cache: + runs-on: docker + needs: [save-cache] + container: + image: code.forgejo.org/oci/node:20-bookworm + steps: + - name: cache restore + id: cachestep2 + uses: https://data.forgejo.org/actions/cache/restore@v4 + with: + path: | + /usr/local/bin/something + key: cachekey-${{ forge.event.pull_request.head.repo.full_name }} + + - name: verify something + run: | + set -x + test SOMETHING = $(cat /usr/local/bin/something) + + - name: cache hit + run: | + set -x + test "${{ steps.cachestep2.outputs.cache-hit }}" = true + + test: + runs-on: docker + needs: [restore-cache] + container: + image: code.forgejo.org/oci/node:20-bookworm + options: "--volume /srv/example:/srv/example" + + steps: + - name: setup + shell: bash + run: | + set -x + test $FORGEJO_TOKEN = ${{ env.FORGEJO_TOKEN }} + test $FORGEJO_TOKEN = ${{ forge.token }} + export DEBIAN_FRONTEND=noninteractive ; apt-get -qq update ; apt-get install -y -qq curl git >& /dev/null + curl -sS -o /usr/local/bin/forgejo-curl.sh https://code.forgejo.org/forgejo/forgejo-curl/raw/branch/main/forgejo-curl.sh && chmod +x /usr/local/bin/forgejo-curl.sh + forgejo-curl.sh --token "$FORGEJO_TOKEN" login $FORGEJO_SERVER_URL + forgejo-curl.sh api_json $FORGEJO_SERVER_URL/api/v1/user + + - name: determine if the PR is from a fork + id: forked + run: | + if test ${{ forge.event.pull_request.base.repo.full_name }} = ${{ forge.event.pull_request.head.repo.full_name }} ; then + echo value=false >> $FORGEJO_OUTPUT + else + echo value=true >> $FORGEJO_OUTPUT + fi + + - name: save event + run: | + d=/srv/example/cache-pull-request/contexts/${{ forgejo.event.pull_request.head.repo.owner.username }}/$FORGEJO_EVENT_NAME + mkdir -p $d + cat > $d/forgejo-${{ forgejo.event.action }} <<'EOF' + ${{ toJSON(forgejo) }} + EOF diff --git a/actions/example-cache-pull-request/assert-contexts-closed.sh b/actions/example-cache-pull-request/assert-contexts-closed.sh new file mode 100755 index 00000000..4c0f8e27 --- /dev/null +++ b/actions/example-cache-pull-request/assert-contexts-closed.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -ex + +c=$d/contexts + +for user in cache-fork-org root; do + test -f $c/$user/pull_request/forgejo-closed +done diff --git a/actions/example-cache-pull-request/assert-contexts-opened.sh b/actions/example-cache-pull-request/assert-contexts-opened.sh new file mode 100755 index 00000000..73fcccda --- /dev/null +++ b/actions/example-cache-pull-request/assert-contexts-opened.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -ex + +c=$d/contexts + +for user in cache-fork-org root; do + test -f $c/$user/pull_request/forgejo-opened +done diff --git a/actions/example-cache-pull-request/run.sh b/actions/example-cache-pull-request/run.sh new file mode 100755 index 00000000..544b652a --- /dev/null +++ b/actions/example-cache-pull-request/run.sh @@ -0,0 +1,78 @@ +TMPDIR=$(mktemp -d) + +trap "rm -fr $TMPDIR" EXIT + +api=$url/api/v1 +export d=/srv/example/cache-pull-request + +function main() { + mkdir -p $d + + # + # open a pull request + # - from the same repository + # - from a forked repository + # + forgejo-test-helper.sh push_workflow actions/example-$example $url root example-$example setup-forgejo $token + + forgejo-curl.sh api_json --data-raw '{"username":"cache-fork-org"}' $api/orgs + forgejo-curl.sh api_json --data-raw '{"organization":"cache-fork-org"}' $api/repos/root/example-cache-pull-request/forks + + ( + cd $d + git clone $url/cache-fork-org/example-cache-pull-request fork + cd fork + git config user.email root@example.com + git config user.name username + touch file-unique-to-the-pr-branch + git add . + git commit -m 'fork change' + git push + ) + + forgejo.sh retry forgejo-curl.sh api_json --data-raw '{"title":"PR from fork","base":"main","head":"cache-fork-org:main"}' $api/repos/root/example-cache-pull-request/pulls + + ( + cd $d + git clone $url/root/example-cache-pull-request + cd example-cache-pull-request + git checkout -b other + git config user.email root@example.com + git config user.name username + touch file-unique-to-the-forked-pr + git add . + git commit -m 'other change' + git push --force -u origin other + ) + + forgejo.sh retry forgejo-curl.sh api_json --data-raw '{"title":"PR same repo","base":"main","head":"other"}' $api/repos/root/example-cache-pull-request/pulls + + export RETRY_DELAYS="10 20 60 60 60 60 60" + + # + # wait for the opened event to succeed using the cache on all pull requests + # + if ! forgejo.sh retry $EXAMPLE_DIR/assert-contexts-opened.sh; then + find $d + sed -e 's/^/[RUNNER LOGS]/' <$FORGEJO_RUNNER_LOGS + return 1 + fi + + # + # merge all pull requests + # + forgejo-curl.sh api_json $api/repos/root/example-cache-pull-request/pulls | jq -r '.[] | .number' | while read pr; do + forgejo-curl.sh api_json --data-raw '{"Do":"merge"}' $api/repos/root/example-cache-pull-request/pulls/$pr/merge + done + + # + # wait for the closed event to succeed using the cache on all pull requests + # + if ! forgejo.sh retry $EXAMPLE_DIR/assert-contexts-closed.sh; then + find $d + sed -e 's/^/[RUNNER LOGS]/' <$FORGEJO_RUNNER_LOGS + return 1 + fi +} + +main diff --git a/actions/example-cache-pull-request/runner-config.yaml b/actions/example-cache-pull-request/runner-config.yaml new file mode 100644 index 00000000..11818cc5 --- /dev/null +++ b/actions/example-cache-pull-request/runner-config.yaml @@ -0,0 +1,30 @@ + +log: + level: debug + +runner: + file: .runner + capacity: 1 + env_file: .env + timeout: 3h + insecure: false + fetch_timeout: 5s + fetch_interval: 2s + labels: ["docker:docker://code.forgejo.org/oci/node:20-bookworm"] + +cache: + enabled: true + dir: "/srv/example/cache" + host: "" + port: 0 + +container: + network: "bridge" + privileged: false + options: + workdir_parent: + valid_volumes: ["/srv/example"] + docker_host: "" + +host: + workdir_parent: diff --git a/actions/example-cache-pull-request/setup.sh b/actions/example-cache-pull-request/setup.sh new file mode 100755 index 00000000..0fb6d859 --- /dev/null +++ b/actions/example-cache-pull-request/setup.sh @@ -0,0 +1,2 @@ +mkdir -p /srv/example/cache-pull-request +FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config.yaml forgejo-runner.sh reload diff --git a/actions/example-cache-pull-request/teardown.sh b/actions/example-cache-pull-request/teardown.sh new file mode 100755 index 00000000..b410c513 --- /dev/null +++ b/actions/example-cache-pull-request/teardown.sh @@ -0,0 +1 @@ +forgejo-runner.sh reload From 74b8bebbe8c76471c6c22ca7bf94a20896014bdf Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 1 Dec 2025 15:25:21 +0000 Subject: [PATCH 134/173] actions: parallel LXC jobs (#1149) This is not guaranteed to fail if parallel jobs is broken, but it is likely to. That could create transient errors detecting race conditions similar to https://code.forgejo.org/forgejo/lxc-helpers/issues/50. Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1149 Reviewed-by: Mathieu Fenniak Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/example-lxc/.forgejo/workflows/test.yml | 10 +++++++++- actions/example-lxc/runner-config.yaml | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/actions/example-lxc/.forgejo/workflows/test.yml b/actions/example-lxc/.forgejo/workflows/test.yml index 5e466e72..e7aa3fd9 100644 --- a/actions/example-lxc/.forgejo/workflows/test.yml +++ b/actions/example-lxc/.forgejo/workflows/test.yml @@ -1,8 +1,16 @@ on: [push] jobs: - build: + job1: runs-on: lxc steps: - uses: https://data.forgejo.org/actions/checkout@v4 - run: systemctl --no-pager list-units + job2: + runs-on: lxc + steps: + - run: echo OK2 + job3: + runs-on: lxc + steps: + - run: echo OK3 diff --git a/actions/example-lxc/runner-config.yaml b/actions/example-lxc/runner-config.yaml index 6698ed20..617b3920 100644 --- a/actions/example-lxc/runner-config.yaml +++ b/actions/example-lxc/runner-config.yaml @@ -11,7 +11,7 @@ runner: insecure: false fetch_timeout: 5s fetch_interval: 2s - labels: ["lxc:lxc://debian:bookworm:docker"] + labels: ["lxc:lxc://debian:bookworm"] cache: enabled: false From ec2d8e96b75e0fd9d798aff10b2e5532c0c4d1ab Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 1 Dec 2025 15:41:41 +0000 Subject: [PATCH 135/173] Replace Node.js with data.forgejo.org/oci/node (#1239) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [code.forgejo.org/oci/node](https://hub.docker.com/_/node) ([source](https://github.com/nodejs/docker-node)) → [data.forgejo.org/oci/node](https://hub.docker.com/_/node) | container | replacement | `22-bookworm` -> `22-bookworm` | | [code.forgejo.org/oci/node](https://hub.docker.com/_/node) ([source](https://github.com/nodejs/docker-node)) → [data.forgejo.org/oci/node](https://hub.docker.com/_/node) | container | replacement | `20-bookworm` -> `20-bookworm` | | [code.forgejo.org/oci/node](https://hub.docker.com/_/node) ([source](https://github.com/nodejs/docker-node)) → [data.forgejo.org/oci/node](https://hub.docker.com/_/node) | final | replacement | `20-bookworm` -> `20-bookworm` | This is a special PR that replaces `code.forgejo.org/oci/node` with the community suggested minimal stable replacement version. --- ### Configuration 📅 **Schedule**: Branch creation - "" (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1239 Reviewed-by: earl-warren Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/workflows/end-to-end.yml | 2 +- Dockerfile | 2 +- actions/example-automerge/.forgejo/workflows/test.yml | 2 +- .../example-cache-proxy/getter/.forgejo/workflows/get.yml | 2 +- .../example-cache-proxy/storer/.forgejo/workflows/store.yml | 2 +- .../example-cache-pull-request/.forgejo/workflows/test.yml | 6 +++--- actions/example-cache/.forgejo/workflows/test.yml | 4 ++-- actions/example-context/.forgejo/workflows/test.yml | 2 +- actions/example-pull-request/.forgejo/workflows/test.yml | 2 +- actions/example-push/.forgejo/workflows/test.yml | 2 +- actions/example-shell/.forgejo/workflows/test.yml | 2 +- actions/example-tag/.forgejo/workflows/test.yml | 2 +- actions/example-with-docker-tcp/.forgejo/workflows/test.yml | 2 +- .../example-workflow-call/.forgejo/workflows/reusable.yml | 2 +- actions/example-workflow-call/.forgejo/workflows/test.yml | 4 ++-- 15 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index a4fe2d46..9cc24682 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -15,7 +15,7 @@ jobs: build: runs-on: docker container: - image: 'code.forgejo.org/oci/node:20-bookworm' + image: 'data.forgejo.org/oci/node:20-bookworm' outputs: built: "${{ steps.build.outputs.built }}" steps: diff --git a/Dockerfile b/Dockerfile index 7cf8242e..bfd7ed57 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM code.forgejo.org/oci/node:20-bookworm +FROM data.forgejo.org/oci/node:20-bookworm ENV PATH=$PATH:/setup-forgejo ENV _CONTAINERS_USERNS_CONFIGURED="" diff --git a/actions/example-automerge/.forgejo/workflows/test.yml b/actions/example-automerge/.forgejo/workflows/test.yml index 3ce5da04..7bb4ce29 100644 --- a/actions/example-automerge/.forgejo/workflows/test.yml +++ b/actions/example-automerge/.forgejo/workflows/test.yml @@ -5,7 +5,7 @@ jobs: test: runs-on: docker container: - image: code.forgejo.org/oci/node:20-bookworm + image: data.forgejo.org/oci/node:20-bookworm options: "--volume /srv/example:/srv/example" steps: diff --git a/actions/example-cache-proxy/getter/.forgejo/workflows/get.yml b/actions/example-cache-proxy/getter/.forgejo/workflows/get.yml index ffaf9e9d..5dc434dd 100644 --- a/actions/example-cache-proxy/getter/.forgejo/workflows/get.yml +++ b/actions/example-cache-proxy/getter/.forgejo/workflows/get.yml @@ -4,7 +4,7 @@ jobs: build: runs-on: docker container: - image: code.forgejo.org/oci/node:20-bookworm + image: data.forgejo.org/oci/node:20-bookworm steps: - name: cache restore id: cachestep diff --git a/actions/example-cache-proxy/storer/.forgejo/workflows/store.yml b/actions/example-cache-proxy/storer/.forgejo/workflows/store.yml index f8d42047..db9b101a 100644 --- a/actions/example-cache-proxy/storer/.forgejo/workflows/store.yml +++ b/actions/example-cache-proxy/storer/.forgejo/workflows/store.yml @@ -4,7 +4,7 @@ jobs: build: runs-on: docker container: - image: code.forgejo.org/oci/node:20-bookworm + image: data.forgejo.org/oci/node:20-bookworm steps: - name: create something run: echo SOMETHING > /usr/local/bin/something diff --git a/actions/example-cache-pull-request/.forgejo/workflows/test.yml b/actions/example-cache-pull-request/.forgejo/workflows/test.yml index 9c4e7230..aad6b08b 100644 --- a/actions/example-cache-pull-request/.forgejo/workflows/test.yml +++ b/actions/example-cache-pull-request/.forgejo/workflows/test.yml @@ -8,7 +8,7 @@ jobs: save-cache: runs-on: docker container: - image: code.forgejo.org/oci/node:20-bookworm + image: data.forgejo.org/oci/node:20-bookworm steps: - name: cache restore id: cachestep1 @@ -37,7 +37,7 @@ jobs: runs-on: docker needs: [save-cache] container: - image: code.forgejo.org/oci/node:20-bookworm + image: data.forgejo.org/oci/node:20-bookworm steps: - name: cache restore id: cachestep2 @@ -61,7 +61,7 @@ jobs: runs-on: docker needs: [restore-cache] container: - image: code.forgejo.org/oci/node:20-bookworm + image: data.forgejo.org/oci/node:20-bookworm options: "--volume /srv/example:/srv/example" steps: diff --git a/actions/example-cache/.forgejo/workflows/test.yml b/actions/example-cache/.forgejo/workflows/test.yml index a431d5f6..7acc5c59 100644 --- a/actions/example-cache/.forgejo/workflows/test.yml +++ b/actions/example-cache/.forgejo/workflows/test.yml @@ -4,7 +4,7 @@ jobs: save-cache: runs-on: docker container: - image: code.forgejo.org/oci/node:20-bookworm + image: data.forgejo.org/oci/node:20-bookworm steps: - name: cache restore id: cachestep1 @@ -33,7 +33,7 @@ jobs: runs-on: docker needs: [save-cache] container: - image: code.forgejo.org/oci/node:20-bookworm + image: data.forgejo.org/oci/node:20-bookworm steps: - name: cache restore id: cachestep2 diff --git a/actions/example-context/.forgejo/workflows/test.yml b/actions/example-context/.forgejo/workflows/test.yml index 6a5e6f25..07f80fa9 100644 --- a/actions/example-context/.forgejo/workflows/test.yml +++ b/actions/example-context/.forgejo/workflows/test.yml @@ -4,7 +4,7 @@ jobs: test: runs-on: docker container: - image: code.forgejo.org/oci/node:20-bookworm + image: data.forgejo.org/oci/node:20-bookworm volumes: - /srv/example:/srv/example steps: diff --git a/actions/example-pull-request/.forgejo/workflows/test.yml b/actions/example-pull-request/.forgejo/workflows/test.yml index f906e12f..34a915a0 100644 --- a/actions/example-pull-request/.forgejo/workflows/test.yml +++ b/actions/example-pull-request/.forgejo/workflows/test.yml @@ -9,7 +9,7 @@ jobs: test: runs-on: docker container: - image: code.forgejo.org/oci/node:20-bookworm + image: data.forgejo.org/oci/node:20-bookworm options: "--volume /srv/example:/srv/example" steps: diff --git a/actions/example-push/.forgejo/workflows/test.yml b/actions/example-push/.forgejo/workflows/test.yml index 6075b1a2..ebf53d1b 100644 --- a/actions/example-push/.forgejo/workflows/test.yml +++ b/actions/example-push/.forgejo/workflows/test.yml @@ -9,7 +9,7 @@ jobs: test: runs-on: docker container: - image: code.forgejo.org/oci/node:20-bookworm + image: data.forgejo.org/oci/node:20-bookworm volumes: - /srv/example:/srv/example steps: diff --git a/actions/example-shell/.forgejo/workflows/test.yml b/actions/example-shell/.forgejo/workflows/test.yml index 67c9f989..cede5140 100644 --- a/actions/example-shell/.forgejo/workflows/test.yml +++ b/actions/example-shell/.forgejo/workflows/test.yml @@ -58,7 +58,7 @@ jobs: needs: [python] runs-on: docker container: - image: code.forgejo.org/oci/node:22-bookworm + image: data.forgejo.org/oci/node:22-bookworm steps: - name: default is bash run: | diff --git a/actions/example-tag/.forgejo/workflows/test.yml b/actions/example-tag/.forgejo/workflows/test.yml index ddc673e0..1a2e4b91 100644 --- a/actions/example-tag/.forgejo/workflows/test.yml +++ b/actions/example-tag/.forgejo/workflows/test.yml @@ -7,7 +7,7 @@ jobs: test: runs-on: docker container: - image: code.forgejo.org/oci/node:20-bookworm + image: data.forgejo.org/oci/node:20-bookworm volumes: - /srv/example:/srv/example steps: diff --git a/actions/example-with-docker-tcp/.forgejo/workflows/test.yml b/actions/example-with-docker-tcp/.forgejo/workflows/test.yml index c33c2e7a..c4388ae8 100644 --- a/actions/example-with-docker-tcp/.forgejo/workflows/test.yml +++ b/actions/example-with-docker-tcp/.forgejo/workflows/test.yml @@ -4,7 +4,7 @@ jobs: build: runs-on: docker container: - image: code.forgejo.org/oci/node:20-bookworm + image: data.forgejo.org/oci/node:20-bookworm steps: - run: | ! test -e /var/run/docker.sock diff --git a/actions/example-workflow-call/.forgejo/workflows/reusable.yml b/actions/example-workflow-call/.forgejo/workflows/reusable.yml index aa6d029e..6181aff6 100644 --- a/actions/example-workflow-call/.forgejo/workflows/reusable.yml +++ b/actions/example-workflow-call/.forgejo/workflows/reusable.yml @@ -12,7 +12,7 @@ jobs: callee: runs-on: docker container: - image: code.forgejo.org/oci/node:22-bookworm + image: data.forgejo.org/oci/node:22-bookworm volumes: - /srv/example:/srv/example outputs: diff --git a/actions/example-workflow-call/.forgejo/workflows/test.yml b/actions/example-workflow-call/.forgejo/workflows/test.yml index 6185f8f7..fef61667 100644 --- a/actions/example-workflow-call/.forgejo/workflows/test.yml +++ b/actions/example-workflow-call/.forgejo/workflows/test.yml @@ -5,7 +5,7 @@ jobs: caller: runs-on: docker container: - image: code.forgejo.org/oci/node:22-bookworm + image: data.forgejo.org/oci/node:22-bookworm uses: ./.forgejo/workflows/reusable.yml with: parameter1: value1 @@ -16,7 +16,7 @@ jobs: needs: [caller] runs-on: docker container: - image: code.forgejo.org/oci/node:22-bookworm + image: data.forgejo.org/oci/node:22-bookworm steps: - run: | set -x From 4622f0fe78b0b094e44687a5f215db6ca64b58b2 Mon Sep 17 00:00:00 2001 From: Mathieu Fenniak Date: Mon, 1 Dec 2025 18:59:50 +0000 Subject: [PATCH 136/173] test: add Actions dynamic matrix end-to-end test (#1261) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1261 Reviewed-by: earl-warren Co-authored-by: Mathieu Fenniak Co-committed-by: Mathieu Fenniak --- actions/actions.sh | 4 ++ .../.forgejo/workflows/test.yml | 49 +++++++++++++++++++ actions/example-matrix-dynamic/run.sh | 10 ++++ 3 files changed, 63 insertions(+) create mode 100644 actions/example-matrix-dynamic/.forgejo/workflows/test.yml create mode 100644 actions/example-matrix-dynamic/run.sh diff --git a/actions/actions.sh b/actions/actions.sh index ceb8c04c..5ddffd1f 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -176,5 +176,9 @@ function test_actions() { if dpkg --compare-versions $version ge 9.0; then run actions_verify_example schedule-noncancel fi + + if dpkg --compare-versions $version ge 14.0; then + run actions_verify_example matrix-dynamic + fi done } diff --git a/actions/example-matrix-dynamic/.forgejo/workflows/test.yml b/actions/example-matrix-dynamic/.forgejo/workflows/test.yml new file mode 100644 index 00000000..170a009b --- /dev/null +++ b/actions/example-matrix-dynamic/.forgejo/workflows/test.yml @@ -0,0 +1,49 @@ +on: [push] +jobs: + define-matrix: + runs-on: docker + outputs: + scalar-value: ${{ steps.define.outputs.scalar }} + array-value: ${{ steps.define.outputs.array }} + matrix-value: ${{ steps.define.outputs.matrix }} + steps: + - id: define + run: | + echo 'scalar=scalar value' >> "$FORGEJO_OUTPUT" + echo 'array=["value 1", "value 2"]' >> "$FORGEJO_OUTPUT" + echo 'matrix={"dimension-1": ["d1 v1", "d1 v2"], "dimension-2": ["d2 v1", "d2 v2"]}' >> "$GITHUB_OUTPUT" + + scalar-job: + runs-on: docker + needs: define-matrix + strategy: + matrix: + scalar: + - "${{ needs.define-matrix.outputs.scalar-value }}" + - hard-coded value + steps: + - run: | + set -x + [ "${{ matrix.scalar }}" = "scalar value" ] || [ "${{ matrix.scalar }}" = "hard-coded value" ] || exit 1 + + array-job: + runs-on: docker + needs: define-matrix + strategy: + matrix: + array: ${{ fromJSON(needs.define-matrix.outputs.array-value) }} + steps: + - run: | + set -x + [ "${{ matrix.array }}" = "value 1" ] || [ "${{ matrix.array }}" = "value 2" ] || exit 1 + + matrix-job: + runs-on: docker + needs: define-matrix + strategy: + matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix-value) }} + steps: + - run: | + set -x + [ "${{ matrix.dimension-1 }}" = "d1 v1" ] || [ "${{ matrix.dimension-1 }}" = "d1 v2" ] || exit 1 + [ "${{ matrix.dimension-2 }}" = "d2 v1" ] || [ "${{ matrix.dimension-2 }}" = "d2 v2" ] || exit 1 diff --git a/actions/example-matrix-dynamic/run.sh b/actions/example-matrix-dynamic/run.sh new file mode 100644 index 00000000..18b8fc05 --- /dev/null +++ b/actions/example-matrix-dynamic/run.sh @@ -0,0 +1,10 @@ +forgejo-test-helper.sh run_workflow actions/example-$example $url root example-$example setup-forgejo $token + +# Verify that the matrix in the job was expanded correctly by checking that +# there are 9 completed jobs, by their commit statuses being present on the +# main branch's HEAD. +api=$url/api/v1 +sha=$(forgejo-curl.sh api_json $api/repos/root/example-matrix-dynamic/branches/main | jq -r ".commit.id") +num_runs=$(forgejo-curl.sh api_json $api/repos/root/example-matrix-dynamic/commits/$sha/status | jq ".total_count") +echo "Expecting 9 commit statuses, found $num_runs commit statuses" +test $num_runs = 9 From 891e8f2d81026a138248cfb4ede8f63136cba0c6 Mon Sep 17 00:00:00 2001 From: famfo Date: Fri, 5 Dec 2025 10:40:47 +0000 Subject: [PATCH 137/173] mastodon/gotosocial e2e tests: infrastructure changes (#1273) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1273 Reviewed-by: earl-warren Reviewed-by: Gusted Co-authored-by: famfo Co-committed-by: famfo --- .forgejo/workflows/end-to-end.yml | 8 +++++++- Dockerfile | 24 +++++++++++++++++------- end-to-end.sh | 2 +- federation/federation.sh | 18 ++++++++++++------ lib/lib.sh | 4 ++-- 5 files changed, 39 insertions(+), 17 deletions(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 9cc24682..27c917a6 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -120,7 +120,13 @@ jobs: path: | /srv/forgejo-binaries/gitlab key: gitlab - - run: | + - name: setup dbus + run: | + apt-get -q install -y -qq dbus + systemctl enable --now dbus + - name: run test_federation + run: | + chown -R forgejo:forgejo . su forgejo -c "./end-to-end.sh test_federation" - if: ${{ needs.build.outputs.built == 'yes' }} uses: ./.forgejo/upload-coverage diff --git a/Dockerfile b/Dockerfile index bfd7ed57..b49a1ed5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,33 @@ -FROM data.forgejo.org/oci/node:20-bookworm +FROM code.forgejo.org/oci/node:22-trixie ENV PATH=$PATH:/setup-forgejo ENV _CONTAINERS_USERNS_CONFIGURED="" -ADD https://code.forgejo.org/actions/setup-forgejo.git /setup-forgejo - RUN apt-get update && \ apt-get --assume-yes --no-install-recommends install \ + aardvark-dns \ ca-certificates \ curl \ daemon \ + fuse-overlayfs \ + gettext \ git \ jq \ + libcap2-bin \ + neovim \ + nftables \ + passt \ podman \ + podman-compose \ podman-docker \ procps \ + pup \ slirp4netns \ - sqlite3 \ sudo \ tcpdump \ uidmap \ wget && \ - adduser forgejo-tests && \ + adduser -u 1001 forgejo-tests && \ groupadd wheel && \ adduser forgejo-tests wheel && \ echo "%wheel ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers && \ @@ -29,9 +35,13 @@ RUN apt-get update && \ echo "forgejo-tests:10000:9999" > /etc/subgid && \ mkdir /srv/forgejo-binaries && \ chown forgejo-tests:forgejo-tests /srv/forgejo-binaries && \ - apt-get clean + apt-get clean && \ + apt-get autoremove --purge && \ + apt-get autoclean -COPY . /e2e +COPY --chown=1001:1001 . /e2e + +RUN git clone https://code.forgejo.org/actions/setup-forgejo.git /setup-forgejo USER forgejo-tests diff --git a/end-to-end.sh b/end-to-end.sh index 3b3a702a..e57c8b1b 100755 --- a/end-to-end.sh +++ b/end-to-end.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: MIT SELF_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" diff --git a/federation/federation.sh b/federation/federation.sh index 35a03f79..5dbc596d 100755 --- a/federation/federation.sh +++ b/federation/federation.sh @@ -74,15 +74,21 @@ function test_federation() { local versions="${1:-$RELEASE_NUMBERS}" for version in $versions; do + # name, minimum version + # NOTE: newline seperated, not comma :> + scenarios=( + "star 7.1" + ) - if dpkg --compare-versions $version lt 7.1; then - continue - fi + for scenario_version_str in "${scenarios[@]}"; do + IFS=' ' declare -a scenario_version="($scenario_version_str)" - federation_setup $version + if dpkg --compare-versions "$version" lt "${scenario_version[1]}"; then + continue + fi - for scenario in star; do - run federation_verify_scenario $scenario + federation_setup "$version" + run federation_verify_scenario "${scenario_version[0]}" done done } diff --git a/lib/lib.sh b/lib/lib.sh index 6ed6afbf..691acc6f 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -50,9 +50,9 @@ function dependencies() { $SUDO chmod +x /usr/local/bin/forgejo-curl.sh fi - if ! which make curl daemon git-lfs jq sqlite3 skopeo >/dev/null; then + if ! which make curl daemon git-lfs jq sqlite3 skopeo podman podman-compose pup >/dev/null; then $SUDO apt-get update -qq - $SUDO apt-get install -y -qq make curl daemon git-lfs jq sqlite3 skopeo + $SUDO apt-get install -y -qq make curl daemon git-lfs jq sqlite3 skopeo podman podman-compose pup fi if ! test -f /usr/local/bin/mc || ! test -f /usr/local/bin/minio; then From 8f910d71daf027df1060e970df16b7ad535c5310 Mon Sep 17 00:00:00 2001 From: famfo Date: Fri, 5 Dec 2025 10:42:14 +0000 Subject: [PATCH 138/173] mastodon/gotosocial e2e tests: documentation changes (#1277) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1277 Reviewed-by: earl-warren Co-authored-by: famfo Co-committed-by: famfo --- README.md | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1ffc60c1..33fcfdbd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,18 @@ # Forgejo end-to-end tests +- [Forgejo end-to-end tests](#forgejo-end-to-end-tests) + - [Removing legacy tests](#removing-legacy-tests) + - [Hacking](#hacking) + - [Running from locally built binary](#running-from-locally-built-binary) + - [Forgejo](#forgejo) + - [Forgejo runner](#forgejo-runner) + - [Running from locally built container image](#running-from-locally-built-container-image) + - [Running actions tests locally](#running-actions-tests-locally) + - [Running federation tests locally](#running-federation-tests-locally) + - [Federated Mastodon Follow Test](#federated-mastodon-follow-test) + - [Running other tests locally](#running-other-tests-locally) + - [Running tests in Docker/Podman](#running-tests-in-dockerpodman) + A series of tests scenarios and assertions covering [Forgejo](https://codeberg.org/forgejo/forgejo) and the [Forgejo runner](https://code.forgejo.org/forgejo/runner). @@ -7,7 +20,7 @@ runner](https://code.forgejo.org/forgejo/runner). They are designed to run using Forgejo releases and development versions compiled from designated repositories. -# Removing legacy tests +## Removing legacy tests End-to-end tests cover the supported range of releases and when one of them is EOL, it must be removed as well as the tests that target it @@ -17,7 +30,7 @@ When a release is EOL, a branch is cut with a name following the pattern `legacy/vX.Y-vA.B`. For instance when `v8.0` is published and `v1.21` is EOL, the branch `legacy/v8.0-v1.21` is cut. -# Hacking +## Hacking docker and sudo must be installed with insecure registries allowed in /etc/docker/daemon.json for the IP that will be used for forgejo such @@ -46,12 +59,12 @@ git clone https://code.forgejo.org/forgejo/end-to-end cd end-to-end ``` -## Running from locally built binary +### Running from locally built binary Before injecting a manually built binary, make sure a simple test was run so that the directories are populated. -### Forgejo +#### Forgejo From a checkout of https://codeberg.org/forgejo/forgejo/ @@ -62,7 +75,7 @@ cp -a forgejo /srv/forgejo-binaries/forgejo-11.0 It will be used whenever the version `11.0` is specified in a test. -### Forgejo runner +#### Forgejo runner From a checkout of https://code.forgejo.org/forgejo/runner @@ -71,6 +84,12 @@ make --always-make forgejo-runner cp forgejo-runner /tmp/forgejo-end-to-end/forgejo-runner ``` +### Running from locally built container image + +```bash +docker buildx build --output=type=docker --tag codeberg.org/forgejo/forgejo:latest . +``` + ## Running actions tests locally To run and debug workflows from `actions/example-*`, from the root of @@ -103,7 +122,10 @@ the source directory, mimic what `.forgejo/workflows/end-to-end.yml` does. ./end-to-end.sh federation_setup 12.0 firefox 0.0.0.0:3001 # user root / admin1234 firefox 0.0.0.0:3002 # user root / admin1234 +firefox 0.0.0.0:3003 # user root / admin1234 ./end-to-end.sh federation_verify_scenario star +./end-to-end.sh federation_verify_scenario gotosocial +./end-to-end.sh federation_verify_scenario mastodon ./end-to-end.sh federation_teardown ``` From c1cfa1f39cf6c0828a606414a23a77794c887080 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 5 Dec 2025 15:38:42 +0000 Subject: [PATCH 139/173] Replace Node.js with data.forgejo.org/oci/node (#1278) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [code.forgejo.org/oci/node](https://hub.docker.com/_/node) ([source](https://github.com/nodejs/docker-node)) → [data.forgejo.org/oci/node](https://hub.docker.com/_/node) | final | replacement | `22-trixie` -> `22-trixie` | This is a special PR that replaces `code.forgejo.org/oci/node` with the community suggested minimal stable replacement version. --- ### Configuration 📅 **Schedule**: Branch creation - "" (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1278 Reviewed-by: earl-warren Reviewed-by: Mathieu Fenniak Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b49a1ed5..781aa497 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM code.forgejo.org/oci/node:22-trixie +FROM data.forgejo.org/oci/node:22-trixie ENV PATH=$PATH:/setup-forgejo ENV _CONTAINERS_USERNS_CONFIGURED="" From 1ff059023a8d2d81c03e2ec0d4d50593cf70c8bc Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Sun, 21 Dec 2025 16:53:06 +0000 Subject: [PATCH 140/173] chore(release): v15.0 exists (#1310) Like https://code.forgejo.org/forgejo/end-to-end/pulls/710 and https://code.forgejo.org/forgejo/end-to-end/pulls/1057 (+ https://code.forgejo.org/forgejo/end-to-end/pulls/1058/files) End-to-end for latest nonLTS is usually retired earlier than EoL to save power per https://code.forgejo.org/forgejo/end-to-end/pulls/1058#issuecomment-61424. Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1310 Reviewed-by: Michael Kriese Co-authored-by: 0ko <0ko@noreply.codeberg.org> Co-committed-by: 0ko <0ko@noreply.codeberg.org> --- forgejo/sources/15.0 | 1 + lib/lib.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 forgejo/sources/15.0 diff --git a/forgejo/sources/15.0 b/forgejo/sources/15.0 new file mode 100644 index 00000000..595283d3 --- /dev/null +++ b/forgejo/sources/15.0 @@ -0,0 +1 @@ +https://codeberg.org/forgejo/forgejo forgejo 15.0.0 diff --git a/lib/lib.sh b/lib/lib.sh index 691acc6f..843c9b53 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -26,7 +26,7 @@ IP=$(hostname -I | cut -f1 -d' ') # # Forgejo releases for which a branch exists (7.0/forgejo etc.) # -RELEASE_NUMBERS="11.0 13.0 14.0" +RELEASE_NUMBERS="11.0 14.0 15.0" PREFIX=============== export DIR=/tmp/forgejo-end-to-end From 37fdd131e21e13d60fd27cb9fb6ce1b9ec402497 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 28 Dec 2025 14:42:32 +0000 Subject: [PATCH 141/173] Update https://data.forgejo.org/actions/setup-forgejo action to v3.0.7 (#1343) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1343 Reviewed-by: Michael Kriese Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index d85eb6f6..3c1153c0 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -15,7 +15,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.6 + - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.7 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From a8a26c92961a1a84577f0d274a2d84e52aa744e8 Mon Sep 17 00:00:00 2001 From: Mathieu Fenniak Date: Sun, 28 Dec 2025 16:29:05 +0000 Subject: [PATCH 142/173] test: add reusable workflow expansion test (#1316) end-to-end test covering https://codeberg.org/forgejo/forgejo/pulls/10525. ![image](/attachments/2bca39ea-67d9-4ae6-a940-e2b5f77b11d4) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1316 Co-authored-by: Mathieu Fenniak Co-committed-by: Mathieu Fenniak --- actions/actions.sh | 4 +++ .../.forgejo/workflows/reusable.yml | 28 +++++++++++++++++++ .../.forgejo/workflows/test.yml | 20 +++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 actions/example-workflow-call-expansion/.forgejo/workflows/reusable.yml create mode 100644 actions/example-workflow-call-expansion/.forgejo/workflows/test.yml diff --git a/actions/actions.sh b/actions/actions.sh index 5ddffd1f..1dc6b14e 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -180,5 +180,9 @@ function test_actions() { if dpkg --compare-versions $version ge 14.0; then run actions_verify_example matrix-dynamic fi + + if dpkg --compare-versions $version ge 15.0; then + run actions_verify_example workflow-call-expansion + fi done } diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable.yml new file mode 100644 index 00000000..b5bcdde4 --- /dev/null +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable.yml @@ -0,0 +1,28 @@ +on: + workflow_call: + +jobs: + callee-1: + runs-on: docker + container: + image: data.forgejo.org/oci/node:22-bookworm + volumes: + - /srv/example:/srv/example + steps: + - name: indicate callee-1 hit + run: touch /srv/example/callee-1 + + callee-2: + needs: callee-1 + runs-on: docker + container: + image: data.forgejo.org/oci/node:22-bookworm + volumes: + - /srv/example:/srv/example + steps: + - name: verify callee-1 completed + run: | + set -x + test -f /srv/example/callee-1 + - name: indicate callee-2 hit + run: touch /srv/example/callee-2 diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml new file mode 100644 index 00000000..484cdc29 --- /dev/null +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml @@ -0,0 +1,20 @@ +on: + push: + +jobs: + caller: + uses: ./.forgejo/workflows/reusable.yml + + verify: + needs: [caller] + runs-on: docker + container: + image: data.forgejo.org/oci/node:22-bookworm + volumes: + - /srv/example:/srv/example + steps: + - name: verify callee-1 & callee-2 completed + run: | + set -x + test -f /srv/example/callee-1 + test -f /srv/example/callee-2 From cc2a2e85f7a65f2ec6771a75ce83492cfb51e839 Mon Sep 17 00:00:00 2001 From: Mathieu Fenniak Date: Mon, 29 Dec 2025 02:58:01 +0000 Subject: [PATCH 143/173] test: add reusable workflow expansion test for outputs (#1322) In the "reusable workflow expansion" case (that is, when `runs-on` is not provided), this PR adds tests for `on.workflow_call.outputs`, and expands the test case to have two layers of reusable workflows to cover quirky behaviours that were discovered during manual testing. Manual invocation successful: ![image](/attachments/0406a783-4ef6-4854-a376-421ccc86b854) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1322 Co-authored-by: Mathieu Fenniak Co-committed-by: Mathieu Fenniak --- .../.forgejo/workflows/reusable-layer-1.yml | 49 +++++++++++++++++++ .../.forgejo/workflows/reusable-layer-2.yml | 37 ++++++++++++++ .../.forgejo/workflows/reusable.yml | 28 ----------- .../.forgejo/workflows/test.yml | 17 +++++-- 4 files changed, 99 insertions(+), 32 deletions(-) create mode 100644 actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml create mode 100644 actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml delete mode 100644 actions/example-workflow-call-expansion/.forgejo/workflows/reusable.yml diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml new file mode 100644 index 00000000..bc0b7dc9 --- /dev/null +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml @@ -0,0 +1,49 @@ +on: + workflow_call: + outputs: + output1: + value: ${{ jobs.callee-1.outputs.job-output }} + output2: + value: ${{ jobs.callee-2.outputs.job-output }} + output3: + value: ${{ jobs.layer-2.outputs.output3 }} + output4: + value: ${{ jobs.layer-2.outputs.output4 }} + +jobs: + callee-1: + runs-on: docker + outputs: + job-output: callee-1-output + container: + image: data.forgejo.org/oci/node:22-bookworm + volumes: + - /srv/example:/srv/example + steps: + - name: indicate callee-1 hit + run: touch /srv/example/callee-1 + + layer-2: + uses: ./.forgejo/workflows/reusable-layer-2.yml + + callee-2: + needs: [callee-1, layer-2] + runs-on: docker + outputs: + job-output: callee-2-output + container: + image: data.forgejo.org/oci/node:22-bookworm + volumes: + - /srv/example:/srv/example + steps: + - name: verify callee-1 completed + run: | + set -x + test -f /srv/example/callee-1 + - name: verify layer-2 completed + run: | + set -x + test -f /srv/example/callee-3 + test -f /srv/example/callee-4 + - name: indicate callee-2 hit + run: touch /srv/example/callee-2 diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml new file mode 100644 index 00000000..1633ff7c --- /dev/null +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml @@ -0,0 +1,37 @@ +on: + workflow_call: + outputs: + output3: + value: ${{ jobs.callee-3.outputs.job-output }} + output4: + value: ${{ jobs.callee-4.outputs.job-output }} + +jobs: + callee-3: + runs-on: docker + outputs: + job-output: callee-3-output + container: + image: data.forgejo.org/oci/node:22-bookworm + volumes: + - /srv/example:/srv/example + steps: + - name: indicate callee-3 hit + run: touch /srv/example/callee-3 + + callee-4: + needs: callee-3 + runs-on: docker + outputs: + job-output: callee-4-output + container: + image: data.forgejo.org/oci/node:22-bookworm + volumes: + - /srv/example:/srv/example + steps: + - name: verify callee-3 completed + run: | + set -x + test -f /srv/example/callee-3 + - name: indicate callee-4 hit + run: touch /srv/example/callee-4 diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable.yml deleted file mode 100644 index b5bcdde4..00000000 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable.yml +++ /dev/null @@ -1,28 +0,0 @@ -on: - workflow_call: - -jobs: - callee-1: - runs-on: docker - container: - image: data.forgejo.org/oci/node:22-bookworm - volumes: - - /srv/example:/srv/example - steps: - - name: indicate callee-1 hit - run: touch /srv/example/callee-1 - - callee-2: - needs: callee-1 - runs-on: docker - container: - image: data.forgejo.org/oci/node:22-bookworm - volumes: - - /srv/example:/srv/example - steps: - - name: verify callee-1 completed - run: | - set -x - test -f /srv/example/callee-1 - - name: indicate callee-2 hit - run: touch /srv/example/callee-2 diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml index 484cdc29..564475ec 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml @@ -2,19 +2,28 @@ on: push: jobs: - caller: - uses: ./.forgejo/workflows/reusable.yml + layer-1: + uses: ./.forgejo/workflows/reusable-layer-1.yml verify: - needs: [caller] + needs: [layer-1] runs-on: docker container: image: data.forgejo.org/oci/node:22-bookworm volumes: - /srv/example:/srv/example steps: - - name: verify callee-1 & callee-2 completed + - name: verify callee-[0-4] completed run: | set -x test -f /srv/example/callee-1 test -f /srv/example/callee-2 + test -f /srv/example/callee-3 + test -f /srv/example/callee-4 + - name: verify workflow outputs + run: | + set -x + test "callee-1-output" = "${{ needs.layer-1.outputs.output1 }}" + test "callee-2-output" = "${{ needs.layer-1.outputs.output2 }}" + test "callee-3-output" = "${{ needs.layer-1.outputs.output3 }}" + test "callee-4-output" = "${{ needs.layer-1.outputs.output4 }}" From 1fbbc4277c7275ebfcc1f15e6f96bc10c8c3b1e2 Mon Sep 17 00:00:00 2001 From: Mathieu Fenniak Date: Tue, 30 Dec 2025 14:49:39 +0000 Subject: [PATCH 144/173] test: add reusable workflow expansion test for inputs (#1323) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1323 Co-authored-by: Mathieu Fenniak Co-committed-by: Mathieu Fenniak --- .../.forgejo/workflows/reusable-layer-1.yml | 11 +++++++++++ .../.forgejo/workflows/reusable-layer-2.yml | 12 ++++++++++++ .../.forgejo/workflows/test.yml | 2 ++ 3 files changed, 25 insertions(+) diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml index bc0b7dc9..c6b165b5 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml @@ -1,5 +1,9 @@ on: workflow_call: + inputs: + input1: + required: true + type: string outputs: output1: value: ${{ jobs.callee-1.outputs.job-output }} @@ -20,11 +24,18 @@ jobs: volumes: - /srv/example:/srv/example steps: + - name: verify workflow inputs + run: | + set -x + test "top-level-input1" = "${{ inputs.input1 }}" - name: indicate callee-1 hit run: touch /srv/example/callee-1 layer-2: uses: ./.forgejo/workflows/reusable-layer-2.yml + with: + input1: ${{ inputs.input1 }} + input2: mid-level-input2 callee-2: needs: [callee-1, layer-2] diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml index 1633ff7c..099c0331 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml @@ -1,5 +1,12 @@ on: workflow_call: + inputs: + input1: + required: true + type: string + input2: + required: true + type: string outputs: output3: value: ${{ jobs.callee-3.outputs.job-output }} @@ -16,6 +23,11 @@ jobs: volumes: - /srv/example:/srv/example steps: + - name: verify workflow inputs + run: | + set -x + test "top-level-input1" = "${{ inputs.input1 }}" + test "mid-level-input2" = "${{ inputs.input2 }}" - name: indicate callee-3 hit run: touch /srv/example/callee-3 diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml index 564475ec..29e04d80 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml @@ -4,6 +4,8 @@ on: jobs: layer-1: uses: ./.forgejo/workflows/reusable-layer-1.yml + with: + input1: top-level-input1 verify: needs: [layer-1] From 0e0b1429e675b4e842fa80788d99d3112370a728 Mon Sep 17 00:00:00 2001 From: Mathieu Fenniak Date: Tue, 30 Dec 2025 20:16:02 +0000 Subject: [PATCH 145/173] test: add reusable workflow expansion test for secrets (#1351) Local test: ![image](/attachments/2357b06f-2506-4a31-ae51-a372e4eb4704) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1351 Co-authored-by: Mathieu Fenniak Co-committed-by: Mathieu Fenniak --- .../.forgejo/workflows/reusable-layer-1.yml | 7 +++++++ .../.forgejo/workflows/reusable-layer-2.yml | 6 ++++++ .../.forgejo/workflows/test.yml | 10 ++++++++++ actions/example-workflow-call-expansion/run.sh | 12 ++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 actions/example-workflow-call-expansion/run.sh diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml index c6b165b5..1e806711 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml @@ -28,6 +28,12 @@ jobs: run: | set -x test "top-level-input1" = "${{ inputs.input1 }}" + - name: verify workflow secrets + run: | + set -x + test "AAAA" = "${{ secrets.secret1 }}" + test "BBBB1234" = "${{ secrets.secret2 }}" + test "" = "${{ secrets.secret3 }}" # wasn't specified to the workflow, should be absent - name: indicate callee-1 hit run: touch /srv/example/callee-1 @@ -36,6 +42,7 @@ jobs: with: input1: ${{ inputs.input1 }} input2: mid-level-input2 + secrets: inherit callee-2: needs: [callee-1, layer-2] diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml index 099c0331..eaf37ba1 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml @@ -28,6 +28,12 @@ jobs: set -x test "top-level-input1" = "${{ inputs.input1 }}" test "mid-level-input2" = "${{ inputs.input2 }}" + - name: verify workflow secrets inherited + run: | + set -x + test "AAAA" = "${{ secrets.secret1 }}" + test "BBBB1234" = "${{ secrets.secret2 }}" + test "" = "${{ secrets.secret3 }}" # wasn't specified to the workflow, should be absent - name: indicate callee-3 hit run: touch /srv/example/callee-3 diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml index 29e04d80..dfa29afc 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml @@ -6,6 +6,9 @@ jobs: uses: ./.forgejo/workflows/reusable-layer-1.yml with: input1: top-level-input1 + secrets: + secret1: AAAA + secret2: BBBB1234 verify: needs: [layer-1] @@ -15,6 +18,13 @@ jobs: volumes: - /srv/example:/srv/example steps: + - name: verify test config secret + run: | + set -x + # SECRET3 is set on the repo, but not passed into `reusable-layer-1.yml` so that we can test secrets don't + # leak into the workflow if they're not explicitly defined. This check verifies that the test environment has + # that secret, otherwise the test assertions that it isn't present within the workflow would be meaningless. + test "CCCC" = "${{ secrets.secret3 }}" - name: verify callee-[0-4] completed run: | set -x diff --git a/actions/example-workflow-call-expansion/run.sh b/actions/example-workflow-call-expansion/run.sh new file mode 100644 index 00000000..07ca4cb7 --- /dev/null +++ b/actions/example-workflow-call-expansion/run.sh @@ -0,0 +1,12 @@ +repo=root/example-$example +api=$url/api/v1 + +# Prepare test repo +forgejo-test-helper.sh push_workflow actions/example-$example $url root example-$example setup-forgejo $token +sha=$(forgejo-test-helper.sh branch_tip $url $repo main) + +# Install a repo secret +forgejo-curl.sh api_json -X PUT --data-raw '{"data":"CCCC"}' $api/repos/$repo/actions/secrets/SECRET3 + +# Wait for action to complete +forgejo-test-helper.sh wait_success $url root/example-$example $sha From 6e89c972c3911dd1efeac512cfbda0f87355620a Mon Sep 17 00:00:00 2001 From: Mathieu Fenniak Date: Thu, 1 Jan 2026 18:17:58 +0000 Subject: [PATCH 146/173] test: add reusable workflow expansion test for ${{ needs... }} (#1362) end-to-end tests for https://codeberg.org/forgejo/forgejo/pulls/10647 Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1362 Co-authored-by: Mathieu Fenniak Co-committed-by: Mathieu Fenniak --- .../.forgejo/workflows/reusable-layer-1.yml | 7 +++++++ .../.forgejo/workflows/reusable-layer-2.yml | 8 ++++++++ .../.forgejo/workflows/test.yml | 12 ++++++++++++ 3 files changed, 27 insertions(+) diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml index 1e806711..649392c1 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml @@ -4,6 +4,9 @@ on: input1: required: true type: string + input3: + required: true + type: string outputs: output1: value: ${{ jobs.callee-1.outputs.job-output }} @@ -28,6 +31,7 @@ jobs: run: | set -x test "top-level-input1" = "${{ inputs.input1 }}" + test "dynamic output" = "${{ inputs.input3 }}" - name: verify workflow secrets run: | set -x @@ -38,10 +42,13 @@ jobs: run: touch /srv/example/callee-1 layer-2: + needs: [callee-1] uses: ./.forgejo/workflows/reusable-layer-2.yml with: input1: ${{ inputs.input1 }} input2: mid-level-input2 + input3: ${{ inputs.input3 }} + input4: ${{ needs.callee-1.outputs.job-output }} secrets: inherit callee-2: diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml index eaf37ba1..3b633ebd 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml @@ -7,6 +7,12 @@ on: input2: required: true type: string + input3: + required: true + type: string + input4: + required: true + type: string outputs: output3: value: ${{ jobs.callee-3.outputs.job-output }} @@ -28,6 +34,8 @@ jobs: set -x test "top-level-input1" = "${{ inputs.input1 }}" test "mid-level-input2" = "${{ inputs.input2 }}" + test "dynamic output" = "${{ inputs.input3 }}" + test "callee-1-output" = "${{ inputs.input4 }}" - name: verify workflow secrets inherited run: | set -x diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml index dfa29afc..cd9290a2 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml @@ -2,10 +2,22 @@ on: push: jobs: + pre-job: + runs-on: docker + container: + image: data.forgejo.org/oci/node:22-bookworm + outputs: + dynamic: "${{ steps.dynamic-step.outputs.dynamic }}" + steps: + - id: dynamic-step + run: echo "dynamic=dynamic output" >> $FORGEJO_OUTPUT + layer-1: + needs: [pre-job] uses: ./.forgejo/workflows/reusable-layer-1.yml with: input1: top-level-input1 + input3: ${{ needs.pre-job.outputs.dynamic }} secrets: secret1: AAAA secret2: BBBB1234 From 1064337c896760f28a02dc01377a632683958df2 Mon Sep 17 00:00:00 2001 From: Mathieu Fenniak Date: Thu, 1 Jan 2026 22:16:33 +0000 Subject: [PATCH 147/173] ci: run Forgejo Actions & Packages test w/ dynamic matrix (#1367) Incorporates these changes: - When `forgejo/build-from-sources` is present, Actions & Packages tests are run only against the built versions. Otherwise, they are run against the versions defined in `$RELEASE_NUMBERS` - Updates Packages tests which are testing Alpine publishing to use currently supported Alpine releases - Actions & Packages tests are run in a matrix, allowing parallel execution Only the Actions & Packages tests take a significant amount of time (>10 minutes), so changes have been limited to those test suites -- every test suite that is moved into a matrix adds additional overhead in the 1 minute `prepare-end-to-end` step. Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1367 Co-authored-by: Mathieu Fenniak Co-committed-by: Mathieu Fenniak --- .forgejo/workflows/end-to-end.yml | 14 ++++++++++++-- .../.forgejo/workflows/test.yml | 2 ++ actions/example-cache-pull-request/run.sh | 2 ++ packages/alpine-10.0 | 1 - packages/alpine.sh | 8 +++++--- .../package-source/forgejo-2173/APKBUILD | 0 .../package-source/forgejo-2173/forgejo_2173 | 0 .../package-source/forgejo-2173/forgejo_2173.init | 0 .../package-source/forgejo-2174/APKBUILD | 0 .../package-source/forgejo-2174/forgejo_2174 | 0 .../package-source/forgejo-2174/forgejo_2174.init | 0 packages/{alpine-7.0 => alpine}/test.sh | 0 packages/packages.sh | 4 +++- 13 files changed, 24 insertions(+), 7 deletions(-) delete mode 120000 packages/alpine-10.0 rename packages/{alpine-7.0 => alpine}/package-source/forgejo-2173/APKBUILD (100%) rename packages/{alpine-7.0 => alpine}/package-source/forgejo-2173/forgejo_2173 (100%) rename packages/{alpine-7.0 => alpine}/package-source/forgejo-2173/forgejo_2173.init (100%) rename packages/{alpine-7.0 => alpine}/package-source/forgejo-2174/APKBUILD (100%) rename packages/{alpine-7.0 => alpine}/package-source/forgejo-2174/forgejo_2174 (100%) rename packages/{alpine-7.0 => alpine}/package-source/forgejo-2174/forgejo_2174.init (100%) rename packages/{alpine-7.0 => alpine}/test.sh (100%) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 27c917a6..3921e400 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -18,6 +18,7 @@ jobs: image: 'data.forgejo.org/oci/node:20-bookworm' outputs: built: "${{ steps.build.outputs.built }}" + forgejo_versions_json: "${{ steps.build.outputs.forgejo_versions_json }}" steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: https://data.forgejo.org/actions/setup-go@v5 @@ -31,6 +32,8 @@ jobs: if ! test -f forgejo/build-from-sources; then echo forgejo/build-from-sources is not present, do not build any version from source + source lib/lib.sh + echo "forgejo_versions_json=$(node -p "JSON.stringify(process.argv[1].split(' '))" "$RELEASE_NUMBERS")" >> $FORGEJO_OUTPUT echo "built=no" >> $FORGEJO_OUTPUT exit 0 fi @@ -52,6 +55,7 @@ jobs: mv $forgejo /tmp/forgejo-upload/forgejo-$version done + echo "forgejo_versions_json=$(node -p "JSON.stringify(process.argv[1].split(' '))" "$(cat forgejo/build-from-sources)")" >> $FORGEJO_OUTPUT echo "built=yes" >> $FORGEJO_OUTPUT - name: steps context dump for debug @@ -70,12 +74,15 @@ jobs: packages: needs: [build] runs-on: lxc-trixie + strategy: + matrix: + forgejo_version: ${{ fromJSON(needs.build.outputs.forgejo_versions_json) }} steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end with: built: ${{ needs.build.outputs.built }} - - run: su forgejo -c "./end-to-end.sh test_packages" + - run: su forgejo -c "./end-to-end.sh test_packages ${{ matrix.forgejo_version }}" - if: ${{ needs.build.outputs.built == 'yes' }} uses: ./.forgejo/upload-coverage with: @@ -87,13 +94,16 @@ jobs: actions: needs: [build] runs-on: lxc-trixie + strategy: + matrix: + forgejo_version: ${{ fromJSON(needs.build.outputs.forgejo_versions_json) }} steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/prepare-end-to-end with: built: ${{ needs.build.outputs.built }} - run: ./end-to-end.sh prepare_dockerd - - run: su forgejo -c "./end-to-end.sh test_actions" + - run: su forgejo -c "./end-to-end.sh test_actions ${{ matrix.forgejo_version }}" - if: ${{ needs.build.outputs.built == 'yes' }} uses: ./.forgejo/upload-coverage with: diff --git a/actions/example-cache-pull-request/.forgejo/workflows/test.yml b/actions/example-cache-pull-request/.forgejo/workflows/test.yml index aad6b08b..43a96d41 100644 --- a/actions/example-cache-pull-request/.forgejo/workflows/test.yml +++ b/actions/example-cache-pull-request/.forgejo/workflows/test.yml @@ -79,6 +79,7 @@ jobs: - name: determine if the PR is from a fork id: forked run: | + set -x if test ${{ forge.event.pull_request.base.repo.full_name }} = ${{ forge.event.pull_request.head.repo.full_name }} ; then echo value=false >> $FORGEJO_OUTPUT else @@ -87,6 +88,7 @@ jobs: - name: save event run: | + set -x d=/srv/example/cache-pull-request/contexts/${{ forgejo.event.pull_request.head.repo.owner.username }}/$FORGEJO_EVENT_NAME mkdir -p $d cat > $d/forgejo-${{ forgejo.event.action }} <<'EOF' diff --git a/actions/example-cache-pull-request/run.sh b/actions/example-cache-pull-request/run.sh index 544b652a..85020281 100755 --- a/actions/example-cache-pull-request/run.sh +++ b/actions/example-cache-pull-request/run.sh @@ -53,6 +53,7 @@ function main() { # wait for the opened event to succeed using the cache on all pull requests # if ! forgejo.sh retry $EXAMPLE_DIR/assert-contexts-opened.sh; then + echo "assert-contexts-opened.sh failed; printing related logs and information:" find $d sed -e 's/^/[RUNNER LOGS]/' <$FORGEJO_RUNNER_LOGS return 1 @@ -69,6 +70,7 @@ function main() { # wait for the closed event to succeed using the cache on all pull requests # if ! forgejo.sh retry $EXAMPLE_DIR/assert-contexts-closed.sh; then + echo "assert-contexts-closed.sh failed; printing related logs and information:" find $d sed -e 's/^/[RUNNER LOGS]/' <$FORGEJO_RUNNER_LOGS return 1 diff --git a/packages/alpine-10.0 b/packages/alpine-10.0 deleted file mode 120000 index b34295a0..00000000 --- a/packages/alpine-10.0 +++ /dev/null @@ -1 +0,0 @@ -alpine-7.0 \ No newline at end of file diff --git a/packages/alpine.sh b/packages/alpine.sh index c8679a51..ce5c4ac8 100644 --- a/packages/alpine.sh +++ b/packages/alpine.sh @@ -7,7 +7,7 @@ function test_packages_alpine_version() { reset_forgejo $PACKAGES_DIR/alpine-app.ini start_forgejo $forgejo_version - local d=$PACKAGES_DIR/alpine-$forgejo_version + local d=$PACKAGES_DIR/alpine local token=$(cat $DIR/forgejo-curl/token) local url=http://${HOST_PORT} @@ -16,8 +16,10 @@ function test_packages_alpine_version() { } function test_packages_alpine() { - for alpine_version in 3.20 3.21; do - for forgejo_version in 7.0 10.0; do + local forgejo_versions="${1:-$RELEASE_NUMBERS}" + + for alpine_version in 3.22 3.23; do + for forgejo_version in $forgejo_versions; do test_packages_alpine_version $alpine_version $forgejo_version done done diff --git a/packages/alpine-7.0/package-source/forgejo-2173/APKBUILD b/packages/alpine/package-source/forgejo-2173/APKBUILD similarity index 100% rename from packages/alpine-7.0/package-source/forgejo-2173/APKBUILD rename to packages/alpine/package-source/forgejo-2173/APKBUILD diff --git a/packages/alpine-7.0/package-source/forgejo-2173/forgejo_2173 b/packages/alpine/package-source/forgejo-2173/forgejo_2173 similarity index 100% rename from packages/alpine-7.0/package-source/forgejo-2173/forgejo_2173 rename to packages/alpine/package-source/forgejo-2173/forgejo_2173 diff --git a/packages/alpine-7.0/package-source/forgejo-2173/forgejo_2173.init b/packages/alpine/package-source/forgejo-2173/forgejo_2173.init similarity index 100% rename from packages/alpine-7.0/package-source/forgejo-2173/forgejo_2173.init rename to packages/alpine/package-source/forgejo-2173/forgejo_2173.init diff --git a/packages/alpine-7.0/package-source/forgejo-2174/APKBUILD b/packages/alpine/package-source/forgejo-2174/APKBUILD similarity index 100% rename from packages/alpine-7.0/package-source/forgejo-2174/APKBUILD rename to packages/alpine/package-source/forgejo-2174/APKBUILD diff --git a/packages/alpine-7.0/package-source/forgejo-2174/forgejo_2174 b/packages/alpine/package-source/forgejo-2174/forgejo_2174 similarity index 100% rename from packages/alpine-7.0/package-source/forgejo-2174/forgejo_2174 rename to packages/alpine/package-source/forgejo-2174/forgejo_2174 diff --git a/packages/alpine-7.0/package-source/forgejo-2174/forgejo_2174.init b/packages/alpine/package-source/forgejo-2174/forgejo_2174.init similarity index 100% rename from packages/alpine-7.0/package-source/forgejo-2174/forgejo_2174.init rename to packages/alpine/package-source/forgejo-2174/forgejo_2174.init diff --git a/packages/alpine-7.0/test.sh b/packages/alpine/test.sh similarity index 100% rename from packages/alpine-7.0/test.sh rename to packages/alpine/test.sh diff --git a/packages/packages.sh b/packages/packages.sh index 002ed796..4fc9c6a4 100644 --- a/packages/packages.sh +++ b/packages/packages.sh @@ -7,5 +7,7 @@ PACKAGES_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $PACKAGES_DIR/alpine.sh function test_packages() { - run test_packages_alpine + local forgejo_versions="${1:-$RELEASE_NUMBERS}" + + run test_packages_alpine $forgejo_versions } From a57c631faedbb9a17ad86383e06bacd27ae77dea Mon Sep 17 00:00:00 2001 From: famfo Date: Mon, 5 Jan 2026 14:34:58 +0000 Subject: [PATCH 148/173] feat(federation): add scenario-mastodon setup and teardown (#1274) 2/5 taken out of #1269 This patch adds the setup and teardown of Mastodon for use in the end-to-end tests Co-Authored-By: zam Co-Authored-By: erik Co-Authored-By: Michael Jerger Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1274 Reviewed-by: earl-warren Reviewed-by: Beowulf Co-authored-by: famfo Co-committed-by: famfo --- federation/federation.sh | 1 + federation/scenario-mastodon/.gitignore | 3 + .../scenario-mastodon/TEST_INSTRUCTION.md | 38 ++++++++ federation/scenario-mastodon/compose.yaml | 95 +++++++++++++++++++ .../forgejo-app/config/app.ini | 32 +++++++ .../forgejo-app/init/create_test_account.sh | 7 ++ .../forgejo-app/init/init.sh | 10 ++ .../scenario-mastodon/forgejo/certs/.gitkeep | 0 .../forgejo/etc/lighttpd.conf | 22 +++++ .../scenario-mastodon/forgejo/init/init.sh | 6 ++ federation/scenario-mastodon/functions.sh | 32 +++++++ .../mastodon-app/init/create_test_account.sh | 14 +++ .../mastodon-app/init/init.sh | 8 ++ .../mastodon-sidekiq/init/init.sh | 7 ++ .../certs/custom-snakeoil-rootCA.crt | 19 ++++ .../certs/custom-snakeoil-rootCA.key | 28 ++++++ federation/scenario-mastodon/run.sh | 17 ++++ federation/scenario-mastodon/setup.sh | 48 ++++++++++ federation/scenario-mastodon/teardown.sh | 8 ++ 19 files changed, 395 insertions(+) create mode 100644 federation/scenario-mastodon/.gitignore create mode 100644 federation/scenario-mastodon/TEST_INSTRUCTION.md create mode 100644 federation/scenario-mastodon/compose.yaml create mode 100644 federation/scenario-mastodon/forgejo-app/config/app.ini create mode 100755 federation/scenario-mastodon/forgejo-app/init/create_test_account.sh create mode 100755 federation/scenario-mastodon/forgejo-app/init/init.sh create mode 100644 federation/scenario-mastodon/forgejo/certs/.gitkeep create mode 100644 federation/scenario-mastodon/forgejo/etc/lighttpd.conf create mode 100755 federation/scenario-mastodon/forgejo/init/init.sh create mode 100644 federation/scenario-mastodon/functions.sh create mode 100755 federation/scenario-mastodon/mastodon-app/init/create_test_account.sh create mode 100755 federation/scenario-mastodon/mastodon-app/init/init.sh create mode 100755 federation/scenario-mastodon/mastodon-sidekiq/init/init.sh create mode 100644 federation/scenario-mastodon/resources/certs/custom-snakeoil-rootCA.crt create mode 100644 federation/scenario-mastodon/resources/certs/custom-snakeoil-rootCA.key create mode 100644 federation/scenario-mastodon/run.sh create mode 100755 federation/scenario-mastodon/setup.sh create mode 100644 federation/scenario-mastodon/teardown.sh diff --git a/federation/federation.sh b/federation/federation.sh index 5dbc596d..95682c8c 100755 --- a/federation/federation.sh +++ b/federation/federation.sh @@ -78,6 +78,7 @@ function test_federation() { # NOTE: newline seperated, not comma :> scenarios=( "star 7.1" + "mastodon 14.0" ) for scenario_version_str in "${scenarios[@]}"; do diff --git a/federation/scenario-mastodon/.gitignore b/federation/scenario-mastodon/.gitignore new file mode 100644 index 00000000..041e9d6f --- /dev/null +++ b/federation/scenario-mastodon/.gitignore @@ -0,0 +1,3 @@ +/resources/certs/forgejo* +/forgejo/certs/* +!/forgejo/certs/.gitkeep diff --git a/federation/scenario-mastodon/TEST_INSTRUCTION.md b/federation/scenario-mastodon/TEST_INSTRUCTION.md new file mode 100644 index 00000000..82d957b0 --- /dev/null +++ b/federation/scenario-mastodon/TEST_INSTRUCTION.md @@ -0,0 +1,38 @@ +# Manual testing + +1. compile forgejo binary to test on a debian/ubuntu system +2. start applications + * local forgejo: + ```sh + cd federation/scenario-mastodon + # create cert & startup & create test accounts + SCENARIO_DIR="." ./setup.sh + # Mastodon password in "/tmp/forgejo-end-to-end/federation_scenario-mastodon-env" + # Bind forgejo to localhost:3003 and set the domain to `forgejo` + ``` + * containerized forgejo: + ```sh + cd federation/scenario-mastodon + # Generate self-signed certs on first run + source ./functions.sh + generate_certs forgejo "./resources/certs" + mv "./resources/certs/forgejo"* "forgejo/certs" + + # Setup container + export FORGEJO_PATH="/path/to/forgejo/binary" + export COMPOSE_PROFILES="forgejo_container" + export MASTODON_HOST="mastodon-app" + + podman-compose up -d + podman-compose exec forgejo-app bash -c "/init/create_test_account.sh" + # Mastodon password is the last line of the output + podman-compose exec mastodon-app bash -c "/init/create_test_account.sh" + ``` +3. login to mastodon: http://localhost:4000 + 1. test@localhost - password from start app. +4. search for forgejo user: `https://forgejo/api/v1/activitypub/user-id/1` +5. Press follow +6. FYI: + 1. login to forgejo: http://localhost:3003/ + 2. me - me + 3. swagger-uri: http://localhost:3003/api/swagger#/activitypub diff --git a/federation/scenario-mastodon/compose.yaml b/federation/scenario-mastodon/compose.yaml new file mode 100644 index 00000000..0a39c17e --- /dev/null +++ b/federation/scenario-mastodon/compose.yaml @@ -0,0 +1,95 @@ +networks: + external_network: + internal_network: + internal: true + +services: + forgejo: + image: code.forgejo.org/oci/alpine:latest + volumes: + - ./forgejo/certs/:/usr/local/share/ca-certificates/ + - ./forgejo/init/:/init/ + - ./forgejo/etc/lighttpd.conf:/etc/lighttpd.conf + restart: unless-stopped + entrypoint: "sh /init/init.sh" + networks: + - external_network + - internal_network + + forgejo-app: + profiles: + - forgejo_container + # built from https://code.forgejo.org/federation/build-mastodon/src/branch/main/debian-containerfile + image: code.forgejo.org/federation/debian:trixie-cacerts + tmpfs: + - /data + volumes: + - ./forgejo-app/init/:/init/ + - ./forgejo-app/config/:/config/ + - ./resources/certs/:/usr/local/share/ca-certificates/ + - "${FORGEJO_PATH}:/usr/local/bin/forgejo" + ports: + - 3003:3003 + entrypoint: "sh /init/init.sh" + networks: + - external_network + - internal_network + + postgres: + image: code.forgejo.org/oci/postgres:14 + tmpfs: + - /var/lib/postgresql/data + environment: + POSTGRES_USER: postgres + POSTGRES_DB: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_HOST_AUTH_METHOD: trust + networks: + - internal_network + + redis: + image: code.forgejo.org/oci/redis:7.2 + tmpfs: + - /var/lib/redis/ + networks: + - internal_network + + mastodon-app: + # built from https://code.forgejo.org/federation/build-mastodon/src/branch/main/mastodon-containerfile + image: code.forgejo.org/federation/mastodon:v4.5-test + volumes: + - ./resources/certs:/usr/local/share/ca-certificates/ + - ./mastodon-app/init/:/init/ + environment: &mastodon_env + DB_HOST: postgres + DB_USER: postgres + DB_PASS: postgres + REDIS_HOST: redis + PORT: 4000 + LOCAL_DOMAIN: ${MASTODON_HOST}:4000 + ALTERNATE_DOMAINS: ${MASTODON_HOST},localhost + EMAIL_DOMAIN_ALLOWLIST: localhost + AUTHORIZED_FETCH: "true" + ALLOWED_PRIVATE_ADDRESSES: 0.0.0.0/0,::/0 + SECRET_KEY_BASE: bc1bdb4d3d57a2c292a8f145d5d3c921 + ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY: fkSxKD2bF396kdQbrP1EJ7WbU7ZgNokR + ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT: r0hvVmzBVsjxC7AMlwhOzmtc36ZCOS1E + ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY: PhdFyyfy5xJ7WVd2lWBpcPScRQHzRTNr + ports: + - "4000:4000" + entrypoint: "sh /init/init.sh" + networks: + - external_network + - internal_network + + mastodon-sidekiq: + # built from https://code.forgejo.org/federation/build-mastodon/src/branch/main/mastodon-containerfile + image: code.forgejo.org/federation/mastodon:v4.5-test + volumes: + - ./resources/certs:/usr/local/share/ca-certificates/ + - ./mastodon-sidekiq/init/:/init/ + restart: unless-stopped + environment: *mastodon_env + entrypoint: "sh /init/init.sh" + networks: + - internal_network diff --git a/federation/scenario-mastodon/forgejo-app/config/app.ini b/federation/scenario-mastodon/forgejo-app/config/app.ini new file mode 100644 index 00000000..55ef4f61 --- /dev/null +++ b/federation/scenario-mastodon/forgejo-app/config/app.ini @@ -0,0 +1,32 @@ +RUN_MODE = prod + +[server] +APP_DATA_PATH = /data +DOMAIN = forgejo +ROOT_URL = https://forgejo/ +HTTP_PORT = 3003 +PROTOCOL = http + +[queue] +TYPE = immediate + +[database] +DB_TYPE = sqlite3 +PATH = /data/forgejo.db + +[log] +MODE = console +LEVEL = debug + +[security] +INSTALL_LOCK = true + +[repository] +ENABLE_PUSH_CREATE_USER = true +DEFAULT_PUSH_CREATE_PRIVATE = false + +[federation] +ENABLED = true + +[session] +COOKIE_SECURE = false diff --git a/federation/scenario-mastodon/forgejo-app/init/create_test_account.sh b/federation/scenario-mastodon/forgejo-app/init/create_test_account.sh new file mode 100755 index 00000000..33fc4807 --- /dev/null +++ b/federation/scenario-mastodon/forgejo-app/init/create_test_account.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +sleep 10 + +/usr/local/bin/forgejo -c /etc/forgejo/app.ini admin user create --username me --password me --email "me@example.com" --admin --must-change-password=false +/usr/local/bin/forgejo -c /etc/forgejo/app.ini admin user create --username to-be-followd --password to-be-followd --email "to-be-followd@example.com" --admin --must-change-password=false +/usr/local/bin/forgejo -c /etc/forgejo/app.ini admin user generate-access-token -u me -t token --scopes write:activitypub,write:repository,write:user diff --git a/federation/scenario-mastodon/forgejo-app/init/init.sh b/federation/scenario-mastodon/forgejo-app/init/init.sh new file mode 100755 index 00000000..3848fa53 --- /dev/null +++ b/federation/scenario-mastodon/forgejo-app/init/init.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +sudo update-ca-certificates + +sudo mkdir -p /data/forgejo +sudo chown forgejo:forgejo /data/forgejo +sudo install -D -o forgejo -g forgejo /config/app.ini /etc/forgejo/app.ini + +/usr/local/bin/forgejo -c /etc/forgejo/app.ini + diff --git a/federation/scenario-mastodon/forgejo/certs/.gitkeep b/federation/scenario-mastodon/forgejo/certs/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/federation/scenario-mastodon/forgejo/etc/lighttpd.conf b/federation/scenario-mastodon/forgejo/etc/lighttpd.conf new file mode 100644 index 00000000..325779ad --- /dev/null +++ b/federation/scenario-mastodon/forgejo/etc/lighttpd.conf @@ -0,0 +1,22 @@ +server.document-root = "/var/www" + +server.modules = ( + "mod_openssl", + "mod_proxy" +) + +$SERVER["socket"] == ":443" { + ssl.engine = "enable" + ssl.pemfile = "/usr/local/share/ca-certificates/forgejo-snakeoil.crt" + ssl.privkey = "/usr/local/share/ca-certificates/forgejo-snakeoil.key" +} + +proxy.server = ( + "" => ( + "forgejo" => ( + "host" => "host.containers.internal", + "port" => 3003, + ) + ) +) + diff --git a/federation/scenario-mastodon/forgejo/init/init.sh b/federation/scenario-mastodon/forgejo/init/init.sh new file mode 100755 index 00000000..6660768d --- /dev/null +++ b/federation/scenario-mastodon/forgejo/init/init.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +apk add lighttpd + +lighttpd -D -f /etc/lighttpd.conf + diff --git a/federation/scenario-mastodon/functions.sh b/federation/scenario-mastodon/functions.sh new file mode 100644 index 00000000..507131cc --- /dev/null +++ b/federation/scenario-mastodon/functions.sh @@ -0,0 +1,32 @@ +function generate_certs() { + + host=${1} + cert_location=${2} + + rootCertificate="${cert_location}/custom-snakeoil-rootCA.crt" + rootCertKey="${cert_location}/custom-snakeoil-rootCA.key" + extensionFile="${cert_location}/${host}-snakeoil.ext" + keyFile="${cert_location}/${host}-snakeoil.key" + csrFile="${cert_location}/${host}-snakeoil.csr" + crtAltSubFile="${cert_location}/${host}-snakeoil.crt" + + cat << EOF > ${extensionFile} +authorityKeyIdentifier=keyid,issuer +basicConstraints=CA:FALSE +subjectAltName = @alt_names +[alt_names] +DNS.1 = ${host} +DNS.2 = localhost +EOF + + # Create CSR + openssl req -newkey rsa:2048 -nodes -keyout ${keyFile} \ + -out ${csrFile} -subj "/CN=${host}" -addext "subjectAltName=DNS:localhost" + + # Sign Our CSR with the root CA cert + openssl x509 -req -CA ${rootCertificate} \ + -CAkey ${rootCertKey} \ + -in ${csrFile} \ + -out ${crtAltSubFile} \ + -days 3650 -CAcreateserial -extfile ${extensionFile} +} \ No newline at end of file diff --git a/federation/scenario-mastodon/mastodon-app/init/create_test_account.sh b/federation/scenario-mastodon/mastodon-app/init/create_test_account.sh new file mode 100755 index 00000000..283000fb --- /dev/null +++ b/federation/scenario-mastodon/mastodon-app/init/create_test_account.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +account_create="$(tootctl accounts create test --email test@localhost --role Owner --confirmed)" +tootctl account modify test --approve + +echo "${account_create}" + +password=$(echo "${account_create}" | + tail -n 1 | + sed 's/New password: //' | + sed 's/\r//' +) + +echo "$password" diff --git a/federation/scenario-mastodon/mastodon-app/init/init.sh b/federation/scenario-mastodon/mastodon-app/init/init.sh new file mode 100755 index 00000000..731aa55d --- /dev/null +++ b/federation/scenario-mastodon/mastodon-app/init/init.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +sudo update-ca-certificates +sudo touch /opt/mastodon/log/prod.log +sudo chown mastodon: /opt/mastodon/log/prod.log +rails db:setup +bundle exec puma -C config/puma.rb +#sleep 2h diff --git a/federation/scenario-mastodon/mastodon-sidekiq/init/init.sh b/federation/scenario-mastodon/mastodon-sidekiq/init/init.sh new file mode 100755 index 00000000..af9c5190 --- /dev/null +++ b/federation/scenario-mastodon/mastodon-sidekiq/init/init.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +sudo update-ca-certificates +sudo touch /opt/mastodon/log/prod.log +sudo chown mastodon: /opt/mastodon/log/prod.log +bundle exec sidekiq +#sleep 2h diff --git a/federation/scenario-mastodon/resources/certs/custom-snakeoil-rootCA.crt b/federation/scenario-mastodon/resources/certs/custom-snakeoil-rootCA.crt new file mode 100644 index 00000000..91a0d144 --- /dev/null +++ b/federation/scenario-mastodon/resources/certs/custom-snakeoil-rootCA.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDGTCCAgGgAwIBAgIUU+o53CfULAHTgPuCq/Ua8JRTWLIwDQYJKoZIhvcNAQEL +BQAwGzEZMBcGA1UEAwwQY29kZS5mb3JnZWpvLm9yZzAgFw0yNTEwMjMwODI2NTVa +GA8yMTI1MDkyOTA4MjY1NVowGzEZMBcGA1UEAwwQY29kZS5mb3JnZWpvLm9yZzCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKJl1YjGLoYK5J7wCbgL7WCZ +DGznwmp2SxpxJx/9Y6Pldt1QXTp0/VrR/H8iu3bNh13jmupXTKyGHU94MTNHER1T +/jbGw8LRPWCIYNjpYFZU17glTGs/DOieh7acuuvu+imoamk1oRLVaaHDewz09Tc2 +wkklCH+2ME2TC6mHIqpHOLO//ESEU0Glo+/mVMEcTJf9zdDhSGhZPKhXEaWgrLMo +EV3r0hpxHCE21OeaRrOKjMtOfp6/v0yKAsJ0QbLHXw1JDauiMWHUxp1H3jIHGgtc +0ALdiS1fhYi8zX3bkbMfctjREVtbhO0Aqps5pvDjhjTNyTmSQ3dkkU37W7Mz+WkC +AwEAAaNTMFEwHQYDVR0OBBYEFKXOSikliKVL6VYbbcaOR3k3khKyMB8GA1UdIwQY +MBaAFKXOSikliKVL6VYbbcaOR3k3khKyMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI +hvcNAQELBQADggEBADE4RGzIXT3LsLGxqRiuOPrXnOTy6izD0sXraJGPWOTEm0MB +H+MnV1YmqRiafwCTbKyiTfzF50JX0zwa6NnkK7k7tyht7O2B0/1VfsrIaXGBP05B +pZMC1bMSaDEu+zvRUDFvNiE5Oxkw0LGy44o36e3SNCEXMCYU3fiTX/5IxfB/a1Bk ++5tNfpK4CKwyk2/pb8ClgBldYGxfp/hyzTVh7y4c5bSRzoawGxq2ipfmJbSBYEme +vyySFXJI1W9ih8utE2sQKbRS7YrwxSNS9Uj6qwixTlHB5a/MzlFmD630VkmkI1qq +5VkQxq7dJSTlVHX8qiQqvGoPPIp5ucbBDmyj2A8= +-----END CERTIFICATE----- diff --git a/federation/scenario-mastodon/resources/certs/custom-snakeoil-rootCA.key b/federation/scenario-mastodon/resources/certs/custom-snakeoil-rootCA.key new file mode 100644 index 00000000..b4b13057 --- /dev/null +++ b/federation/scenario-mastodon/resources/certs/custom-snakeoil-rootCA.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCiZdWIxi6GCuSe +8Am4C+1gmQxs58JqdksacScf/WOj5XbdUF06dP1a0fx/Irt2zYdd45rqV0yshh1P +eDEzRxEdU/42xsPC0T1giGDY6WBWVNe4JUxrPwzonoe2nLrr7vopqGppNaES1Wmh +w3sM9PU3NsJJJQh/tjBNkwuphyKqRzizv/xEhFNBpaPv5lTBHEyX/c3Q4UhoWTyo +VxGloKyzKBFd69IacRwhNtTnmkaziozLTn6ev79MigLCdEGyx18NSQ2rojFh1Mad +R94yBxoLXNAC3YktX4WIvM1925GzH3LY0RFbW4TtAKqbOabw44Y0zck5kkN3ZJFN ++1uzM/lpAgMBAAECggEAAdGmR0j0k/ISyfhYnFJfFAfBN+x0a1wl7rOjDP/Tg7r9 +Ln21yzYTJJcfnu5TaOfLH84KrRwrT6JhhfaYn64PC8PmH/rXDftPsFSOt/DZo2+B +vaSgGyWcMVqdnNOOep6IXq36rr3krwQra14Rmbbm36AYihh+iuzbB4w0vPvpwDwv +G9DITTLrIwDRbXReZ13FjqphP5dqT6jG7BnRLe7vyQ7CJwYdUDLkg2YLykwbHvco +DISS3IoYgF5R7KaGpwH2iFmeHYwXaVH9Y0RyjEvxp87iK8Awvm4yn7hWBx9NsMm2 +of7107TlFBU81JbG09KQZ+mS3S4C9XfQScqBoP66tQKBgQDYS4QhwkYFNusN8z+U +63IGMxJXMF0bvF1zqjhrfkdX16jDD7v8cMbZAjk80obmRdhFpNiuaCT7dbnXpt7L +Ppfu6IkcJsAJc32lbWGc56XzfzDnNecvQbCbMnRYI5GDzcTTY+ObgyhJv4SwuD3E +kdHhxOFPuxlLFey9eg9vC6ADnQKBgQDANX5oEqvVty8gn+cOU3fEiqQ+ZqvcgMcL +CUQYIAUDvXjZuXTbU0cSzgZnZi3JwtEVwj0u+0eXXlju6AVgKC/yd4aIpQ2f6hXO +UlODWIqiNq3lVgjatO6zQ2CXuBeV7crX6odNrhkvSwSPNlC2Ra7QZ8Uk0PpX0sTm +JyuMA/WBPQKBgQCkqulPYj44nhTZrAUN9Sn7+knOQy2/feqPsln9zEe4YqFCz+nI +SHu6nuzAl27IRQhgDR5BuVvebUQtIAeiKGc3JaWs3vt4topDtUCJWfqHpJ+whuMY +oSQ5I3Jb38ha1f8xCG0x6ep0KvB0MfAkhPeKsH7wWnrpJSn1HsY9PlZ2KQKBgQCS +/xZKb6UdEDipocDqkukw1bsgwhLD03TmOtLqBGrxXlFzacM2DW14sznwkBOKj0Sq +eF+kc6Zf3Fb1d1rNHE73B3RLQre1yiedIBcgh3GW92xszSx+XwuC64+O2Mqo7jBI +iuOpg/Fc2umEwUxe6dH1Lrd2HaCn09ikD+bc8RYsHQKBgQDXfAiAf3MdzG8+4zgD +kzfZsUXRUm3ACqrkhlUOzPsh2y5yGO0gxkrUR4ps2+wn0aapwYi+JdbEHpDqI4Ze +vE3d8ZgLF4ER+uuiayuItMIFa8T0AiH1oJMptUY4kgj1AaG0b3+ZxU/uGXjpciyA +a7/psxJ+in3AQ005JGir8rx+gA== +-----END PRIVATE KEY----- diff --git a/federation/scenario-mastodon/run.sh b/federation/scenario-mastodon/run.sh new file mode 100644 index 00000000..7e07a1b8 --- /dev/null +++ b/federation/scenario-mastodon/run.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +source "$DIR/federation_scenario-$scenario-env" + +if [[ -z "$password" ]]; then + exit 1 +fi + +if [[ -z "$port" ]]; then + exit 1 +fi + +status_code="$(curl -o /dev/null -w '%{http_code}' "http://localhost:$port/")" +if [[ "$status_code" != "200" ]]; then + exit 1 +fi + diff --git a/federation/scenario-mastodon/setup.sh b/federation/scenario-mastodon/setup.sh new file mode 100755 index 00000000..cb9efb98 --- /dev/null +++ b/federation/scenario-mastodon/setup.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +source "$SCENARIO_DIR/../../lib/lib.sh" +source "$SCENARIO_DIR/functions.sh" + +echo "Setting up Forgejo x Mastodon" + +if [[ ! -d "$DIR" ]]; then + mkdir -p "$DIR" +fi + +echo "Generating forgejo & mastodon self-signed certificate" + +generate_certs forgejo "$SCENARIO_DIR/resources/certs" + +mv "$SCENARIO_DIR/resources/certs/forgejo"* "$SCENARIO_DIR/forgejo/certs/" + +export MASTODON_HOST="localhost" + +podman-compose \ + -f "$SCENARIO_DIR/compose.yaml" \ + up -d + +function wait_up() { + command="$(podman-compose \ + -f "$SCENARIO_DIR/compose.yaml" \ + exec mastodon-app \ + bin/tootctl accounts + )" + + first="$(head -n 1 <<< "$command")" + [[ "$first" == *"Commands:"* ]] && echo "ready" +} + +retry wait_up + +password="$(podman-compose \ + -f "$SCENARIO_DIR/compose.yaml" \ + exec mastodon-app \ + bash -c "/init/create_test_account.sh" | \ + tail -n 1 | \ + sed 's/\r//' +)" + +cat << EOF > "$DIR/federation_scenario-mastodon-env" +password="$password" +port="4000" +EOF diff --git a/federation/scenario-mastodon/teardown.sh b/federation/scenario-mastodon/teardown.sh new file mode 100644 index 00000000..5e5d35f4 --- /dev/null +++ b/federation/scenario-mastodon/teardown.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +podman-compose \ + -f "$SCENARIO_DIR/compose.yaml" \ + down + +rm "$DIR/federation_scenario-mastodon-env" + From 45417622c0bf1446b572cde22e70bdf4df290a29 Mon Sep 17 00:00:00 2001 From: famfo Date: Mon, 5 Jan 2026 17:36:57 +0000 Subject: [PATCH 149/173] feat(federation): add scenario-gotosocial setup and teardown (#1275) 3/5 taken out of #1269 This patch adds the setup and teardown of GoToSocial for use in the end-to-end tests Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1275 Reviewed-by: earl-warren Reviewed-by: Beowulf Co-authored-by: famfo Co-committed-by: famfo --- federation/federation.sh | 1 + federation/scenario-gotosocial/.gitignore | 0 federation/scenario-gotosocial/run.sh | 16 ++++++ federation/scenario-gotosocial/setup.sh | 58 ++++++++++++++++++++++ federation/scenario-gotosocial/teardown.sh | 12 +++++ run.sh | 11 ++++ 6 files changed, 98 insertions(+) create mode 100644 federation/scenario-gotosocial/.gitignore create mode 100644 federation/scenario-gotosocial/run.sh create mode 100644 federation/scenario-gotosocial/setup.sh create mode 100644 federation/scenario-gotosocial/teardown.sh create mode 100755 run.sh diff --git a/federation/federation.sh b/federation/federation.sh index 95682c8c..4d7c09a5 100755 --- a/federation/federation.sh +++ b/federation/federation.sh @@ -79,6 +79,7 @@ function test_federation() { scenarios=( "star 7.1" "mastodon 14.0" + "gotosocial 14.0" ) for scenario_version_str in "${scenarios[@]}"; do diff --git a/federation/scenario-gotosocial/.gitignore b/federation/scenario-gotosocial/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/federation/scenario-gotosocial/run.sh b/federation/scenario-gotosocial/run.sh new file mode 100644 index 00000000..9fd57a7b --- /dev/null +++ b/federation/scenario-gotosocial/run.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +source "$DIR/federation_scenario-$scenario-env" + +if [[ -z "$password" ]]; then + exit 1 +fi + +if [[ -z "$port" ]]; then + exit 1 +fi + +status_code="$(curl -o /dev/null -w '%{http_code}' "http://localhost:$port/")" +if [[ "$status_code" != "200" ]]; then + exit 1 +fi diff --git a/federation/scenario-gotosocial/setup.sh b/federation/scenario-gotosocial/setup.sh new file mode 100644 index 00000000..13d97057 --- /dev/null +++ b/federation/scenario-gotosocial/setup.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +source $SCENARIO_DIR/../../lib/lib.sh + +GTS_VERSION="0.20.2" # renovate: datasource=docker depName=data.forgejo.org/oci/gotosocial + +echo "setting up gotosocial" + +tmpdir="$(mktemp --tmpdir -d gts.XXXXXXXXXX)" +cat << EOF > "$tmpdir/config.yaml" +host: "localhost:8080" +protocol: http +db-type: sqlite +db-address: /mount/gts.db3 + +http-client: + allow-ips: ["0.0.0.0/0", "::/0"] + insecure-outgoing: true +EOF + +podman unshare \ + chown 1000:1000 -R $tmpdir + +container_id="$( + podman run \ + -d \ + --env "GTS_CONFIG_PATH=/mount/config.yaml" \ + -v "$tmpdir:/mount" \ + -p "8080:8080" \ + --network=host \ + "data.forgejo.org/oci/gotosocial:$GTS_VERSION" \ + server start +)" + +function wait_gts_ready() { + http_status=$(curl -s -w \ + "%{http_code}" -o /dev/null \ + "http://localhost:8080/" + ) + + [[ "$http_status" == 200 ]] && echo "ready" +} + +retry wait_gts_ready + +password="verysecurepassword" +podman exec -it "$container_id" /gotosocial/gotosocial admin \ + account create \ + --username "test" \ + --email "test@localhost" \ + --password "$password" + +cat << EOF > "$DIR/federation_scenario-gotosocial-env" +password="$password" +port="8080" +container_id="$container_id" +EOF + diff --git a/federation/scenario-gotosocial/teardown.sh b/federation/scenario-gotosocial/teardown.sh new file mode 100644 index 00000000..6e6d556a --- /dev/null +++ b/federation/scenario-gotosocial/teardown.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +source "$DIR/federation_scenario-gotosocial-env" + +if [[ -z "$container_id" ]]; then + echo "gotosocial container ID not found, container may not be stopped" + exit 1 +fi + +podman stop "$container_id" +rm "$DIR/federation_scenario-gotosocial-env" + diff --git a/run.sh b/run.sh new file mode 100755 index 00000000..92a91611 --- /dev/null +++ b/run.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +podman build -t forgejo-e2e . +patchelf ../forgejo/forgejo --set-interpreter /lib64/ld-linux-x86-64.so.2 +podman run \ + -it --privileged \ + -v ../forgejo/gitea:/srv/forgejo-binaries/forgejo-14.0 \ + -p 3001-3003:3001-3003 \ + -p 4000:4000 \ + -p 8080:8080 \ + forgejo-e2e From 0ddc6beceb3b20722256d14fd7103224520b7311 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 10 Jan 2026 15:21:40 +0000 Subject: [PATCH 150/173] Update https://data.forgejo.org/actions/setup-forgejo action to v3.1.0 (#1402) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://data.forgejo.org/actions/setup-forgejo](https://code.forgejo.org/actions/setup-forgejo) | action | minor | `v3.0.7` → `v3.1.0` | --- ### Release Notes
actions/setup-forgejo (https://data.forgejo.org/actions/setup-forgejo) ### [`v3.1.0`](https://code.forgejo.org/actions/setup-forgejo/compare/v3.0.7...v3.1.0) [Compare Source](https://code.forgejo.org/actions/setup-forgejo/compare/v3.0.7...v3.1.0)
--- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1402 Reviewed-by: Mathieu Fenniak Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 3c1153c0..cd4b0f37 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -15,7 +15,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.7 + - uses: https://data.forgejo.org/actions/setup-forgejo@v3.1.0 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 03ee700046df0332c6d6d7d94205836d74b911c0 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 18 Jan 2026 15:20:42 +0000 Subject: [PATCH 151/173] Update https://data.forgejo.org/actions/setup-forgejo action to v3.1.1 (#1465) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1465 Reviewed-by: Mathieu Fenniak Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index cd4b0f37..1d41fa79 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -15,7 +15,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v3.1.0 + - uses: https://data.forgejo.org/actions/setup-forgejo@v3.1.1 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 25c472b90bc1886a5d3c45770eb6196d1b833ccb Mon Sep 17 00:00:00 2001 From: Andreas Ahlenstorf Date: Sun, 18 Jan 2026 20:15:11 +0000 Subject: [PATCH 152/173] test: test cloning of private reusable workflows (#1436) Verify that Forgejo Runner can access a reusable workflow that is stored in a private repository. That should help prevent https://code.forgejo.org/forgejo/runner/issues/1274 from happening again. Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1436 Reviewed-by: Mathieu Fenniak Co-authored-by: Andreas Ahlenstorf Co-committed-by: Andreas Ahlenstorf --- actions/actions.sh | 2 +- .../.forgejo/workflows/reusable.yaml | 10 +++++ .../.forgejo/workflows/test.yaml | 11 +++++ actions/example-private-workflow-call/run.sh | 42 +++++++++++++++++++ .../example-private-workflow-call/setup.sh | 1 + 5 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 actions/example-private-workflow-call/.forgejo/workflows/reusable.yaml create mode 100644 actions/example-private-workflow-call/.forgejo/workflows/test.yaml create mode 100644 actions/example-private-workflow-call/run.sh create mode 100644 actions/example-private-workflow-call/setup.sh diff --git a/actions/actions.sh b/actions/actions.sh index 1dc6b14e..f97fd8a5 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -143,7 +143,7 @@ function test_actions() { done fi - for example in echo matrix needs workflow-call lxc config-options cache cache-pull-request checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do + for example in echo matrix needs workflow-call lxc config-options cache cache-pull-request checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context private-workflow-call; do run actions_verify_example $example done diff --git a/actions/example-private-workflow-call/.forgejo/workflows/reusable.yaml b/actions/example-private-workflow-call/.forgejo/workflows/reusable.yaml new file mode 100644 index 00000000..48832449 --- /dev/null +++ b/actions/example-private-workflow-call/.forgejo/workflows/reusable.yaml @@ -0,0 +1,10 @@ +on: + workflow_call: + +jobs: + build: + runs-on: "docker" + container: + image: data.forgejo.org/oci/node:24-trixie + steps: + - run: echo 'OK' diff --git a/actions/example-private-workflow-call/.forgejo/workflows/test.yaml b/actions/example-private-workflow-call/.forgejo/workflows/test.yaml new file mode 100644 index 00000000..9bb279b3 --- /dev/null +++ b/actions/example-private-workflow-call/.forgejo/workflows/test.yaml @@ -0,0 +1,11 @@ +on: + push: + +jobs: + test: + # `runs-on` disables workflow expansion. We want that in this case, because then Forgejo Runner has to authenticate + # itself to access the reusable workflow. + runs-on: docker + container: + image: data.forgejo.org/oci/node:24-trixie + uses: ./.forgejo/workflows/reusable.yaml diff --git a/actions/example-private-workflow-call/run.sh b/actions/example-private-workflow-call/run.sh new file mode 100644 index 00000000..e71dc991 --- /dev/null +++ b/actions/example-private-workflow-call/run.sh @@ -0,0 +1,42 @@ +api="$url/api/v1" +export d=/srv/example/private-workflow-call + +function main() { + mkdir -p "$d" + + local repo + repo="root/example-$example" + + forgejo-test-helper.sh push_workflow "actions/example-$example" "$url" root "example-$example" setup-forgejo "$token" + + # push_workflow creates the repository and triggers a first workflow run. Wait for it to succeed. Ensures that the + # workflow is valid. + local sha + sha="$(forgejo-test-helper.sh branch_tip "$url" "$repo" main)" + forgejo-test-helper.sh wait_success "$url" "$repo" "$sha" + + # Make the repository private. That is necessary to verify that Forgejo Runner includes the correct credentials when + # cloning the workflow. + forgejo-curl.sh api_json -X PATCH --data-raw '{"private":true}' "$api/repos/root/example-$example" + + # Create a new commit that triggers a new workflow run that can be identified uniquely. + ( + cd "$d" || exit 1 + git clone "$url/root/example-$example" + cd "example-$example" || exit 1 + git config user.email root@example.com + git config user.name username + echo "A new file" > test.txt + git add . + git commit -m 'Commit a new file' + git push + ) + + # Wait for the workflow pulled from the private repository to succeed. + local new_sha + new_sha="$(forgejo-test-helper.sh branch_tip "$url" "$repo" main)" + [[ "$new_sha" != "$sha" ]] || exit 1 + forgejo-test-helper.sh wait_success "$url" "$repo" "$new_sha" +} + +main diff --git a/actions/example-private-workflow-call/setup.sh b/actions/example-private-workflow-call/setup.sh new file mode 100644 index 00000000..fd443948 --- /dev/null +++ b/actions/example-private-workflow-call/setup.sh @@ -0,0 +1 @@ +mkdir -p /srv/example/private-workflow-call From 372409f76b946f9fabed82d6154aa1dc841b8c93 Mon Sep 17 00:00:00 2001 From: Andreas Ahlenstorf Date: Mon, 19 Jan 2026 01:47:27 +0000 Subject: [PATCH 153/173] test: test offline runner registration (#1449) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1449 Reviewed-by: Mathieu Fenniak Co-authored-by: Andreas Ahlenstorf Co-committed-by: Andreas Ahlenstorf --- actions/actions.sh | 2 +- .../.forgejo/workflows/test.yaml | 9 +++++ actions/example-create-runner-file/run.sh | 40 +++++++++++++++++++ .../runner-config.yaml | 31 ++++++++++++++ lib/lib.sh | 11 +++++ 5 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 actions/example-create-runner-file/.forgejo/workflows/test.yaml create mode 100644 actions/example-create-runner-file/run.sh create mode 100644 actions/example-create-runner-file/runner-config.yaml diff --git a/actions/actions.sh b/actions/actions.sh index f97fd8a5..9ee52ef0 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -143,7 +143,7 @@ function test_actions() { done fi - for example in echo matrix needs workflow-call lxc config-options cache cache-pull-request checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context private-workflow-call; do + for example in echo matrix needs workflow-call lxc config-options cache cache-pull-request checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context private-workflow-call create-runner-file; do run actions_verify_example $example done diff --git a/actions/example-create-runner-file/.forgejo/workflows/test.yaml b/actions/example-create-runner-file/.forgejo/workflows/test.yaml new file mode 100644 index 00000000..e44397dd --- /dev/null +++ b/actions/example-create-runner-file/.forgejo/workflows/test.yaml @@ -0,0 +1,9 @@ +on: + push: + +jobs: + test: + runs-on: create-runner-file + steps: + - run: | + echo "OK" diff --git a/actions/example-create-runner-file/run.sh b/actions/example-create-runner-file/run.sh new file mode 100644 index 00000000..637132e5 --- /dev/null +++ b/actions/example-create-runner-file/run.sh @@ -0,0 +1,40 @@ +source "lib/lib.sh" + +api="$url/api/v1" + +function main() { + local repo + repo="root/example-$example" + + secret="$(openssl rand -hex 20)" + runner_name="runner-$(openssl rand -hex 5)" + + create_offline_registration_token "$runner_name" root "$secret" + + # Changing to $DIR is necessary so that `.runner` gets created there. Otherwise, `forgejo-runner` would not pick it up. + pushd "$DIR" || exit 1 + ./forgejo-runner -c "$EXAMPLE_DIR/runner-config.yaml" create-runner-file --instance "http://$IP:3000" --name "$runner_name" --secret "$secret" --connect + popd || exit 1 + + FORGEJO_RUNNER_CONFIG="$EXAMPLE_DIR/runner-config.yaml" forgejo-runner.sh reload + + label_count=$(jq '.labels | length ' "$DIR/.runner") + if [[ "$label_count" != "1" ]] ; then + echo "Unexpected number of labels in .runner file: $label_count instead of 1" >&2 + exit 1 + fi + + runner_label=$(jq -r '.labels[0]' "$DIR/.runner") + if [[ "$runner_label" != "create-runner-file:docker://code.forgejo.org/oci/node:24-trixie" ]] ; then + echo "Unexpected runner label: '$runner_label' instead of create-runner-file:docker://code.forgejo.org/oci/node:24-trixie" >&2 + exit 1 + fi + + forgejo-test-helper.sh push_workflow "actions/example-$example" "$url" root "example-$example" setup-forgejo "$token" + + local sha + sha="$(forgejo-test-helper.sh branch_tip "$url" "$repo" main)" + forgejo-test-helper.sh wait_success "$url" "$repo" "$sha" +} + +main diff --git a/actions/example-create-runner-file/runner-config.yaml b/actions/example-create-runner-file/runner-config.yaml new file mode 100644 index 00000000..7096728f --- /dev/null +++ b/actions/example-create-runner-file/runner-config.yaml @@ -0,0 +1,31 @@ + +log: + level: debug + +runner: + file: .runner + capacity: 1 + env_file: .env + timeout: 3h + insecure: false + fetch_timeout: 5s + fetch_interval: 2s + labels: + - "create-runner-file:docker://code.forgejo.org/oci/node:24-trixie" + +cache: + enabled: true + dir: "/srv/example/cache" + host: "" + port: 0 + +container: + network: "bridge" + privileged: false + options: + workdir_parent: + valid_volumes: ["/srv/example"] + docker_host: "" + +host: + workdir_parent: diff --git a/lib/lib.sh b/lib/lib.sh index 843c9b53..b1e9409f 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -415,6 +415,17 @@ EOF cp -a $DOT_FORGEJO_CURL $work_path/forgejo-curl } +function create_offline_registration_token() { + local name="$1" + local scope="$2" + local secret="$3" + + local work_path + work_path="$DIR/$(work_path_base "$config")" + + "$work_path/forgejocli" forgejo-cli actions register --name "$name" --scope "$scope" --secret "$secret" +} + function stop_daemon() { local daemon=$1 From e05f0b5bf84d471cf4b8ee1c3c67831815b73252 Mon Sep 17 00:00:00 2001 From: famfo Date: Mon, 19 Jan 2026 08:45:35 +0000 Subject: [PATCH 154/173] fix(federation): downgrade GoToSocial (#1448) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1448 Reviewed-by: Michael Kriese Co-authored-by: famfo Co-committed-by: famfo --- federation/scenario-gotosocial/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/federation/scenario-gotosocial/setup.sh b/federation/scenario-gotosocial/setup.sh index 13d97057..fcf9a432 100644 --- a/federation/scenario-gotosocial/setup.sh +++ b/federation/scenario-gotosocial/setup.sh @@ -2,7 +2,7 @@ source $SCENARIO_DIR/../../lib/lib.sh -GTS_VERSION="0.20.2" # renovate: datasource=docker depName=data.forgejo.org/oci/gotosocial +GTS_VERSION="0.20.0" # renovate: datasource=docker depName=data.forgejo.org/oci/gotosocial echo "setting up gotosocial" From b3299acd69207c9c0802d14988ff83e4337cba17 Mon Sep 17 00:00:00 2001 From: Mario Minardi Date: Thu, 22 Jan 2026 15:22:22 +0000 Subject: [PATCH 155/173] feat: add OIDC workload identity federation tests (#1364) Add end-to-end tests for workload identity federation. Depends on https://code.forgejo.org/forgejo/runner/pulls/1232 Depends on https://codeberg.org/forgejo/forgejo/pulls/10481 Signed-off-by: Mario Minardi Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1364 Reviewed-by: Michael Kriese Reviewed-by: Mathieu Fenniak Co-authored-by: Mario Minardi Co-committed-by: Mario Minardi --- actions/actions.sh | 1 + .../.forgejo/workflows/test.yml | 78 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 actions/example-id-tokens/.forgejo/workflows/test.yml diff --git a/actions/actions.sh b/actions/actions.sh index 9ee52ef0..0b200824 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -183,6 +183,7 @@ function test_actions() { if dpkg --compare-versions $version ge 15.0; then run actions_verify_example workflow-call-expansion + run actions_verify_example id-tokens fi done } diff --git a/actions/example-id-tokens/.forgejo/workflows/test.yml b/actions/example-id-tokens/.forgejo/workflows/test.yml new file mode 100644 index 00000000..31c49156 --- /dev/null +++ b/actions/example-id-tokens/.forgejo/workflows/test.yml @@ -0,0 +1,78 @@ +on: [push] + +env: + JWT_CLI_VERSION: 6.2.0 # renovate: datasource=github-releases depName=jwt-cli packageName=mike-engel/jwt-cli + +jobs: + generation-allowed: + enable-openid-connect: true + runs-on: docker + container: + image: data.forgejo.org/oci/ci:1 + steps: + - run: curl -L -o jwt-linux.tar.gz https://github.com/mike-engel/jwt-cli/releases/download/${{ env.JWT_CLI_VERSION }}/jwt-linux-musl.tar.gz && tar -xvzf ./jwt-linux.tar.gz && chmod a+x ./jwt + - name: validate token generation works + run: | + RAW_JWT=$(curl -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=exampleAudience" | jq -r ".value") + if [[ -z "RAW_JWT" ]]; then + echo "Error: RAW_JWT should be set" + exit 1 + fi + + DECODED_JWT_BODY=$(echo $RAW_JWT | jq -R 'split(".") | .[1] | @base64d | fromjson') + if [[ -z "$DECODED_JWT_BODY" ]]; then + echo "Error: DECODED_JWT_BODY should be set" + exit 1 + fi + + ISS=$(echo $DECODED_JWT_BODY | jq -r '.iss') + if [[ -z "$ISS" ]]; then + echo "Error: ISS should be set" + exit 1 + fi + + curl "$ISS/.well-known/keys" > jwks.json + JWKS=$(cat ./jwks.json) + if [[ -z "$JWKS" ]]; then + echo "Error: JWKS should be set" + exit 1 + fi + + # Verify that the JWT decodes with the JWKS data + ./jwt decode -S @./jwks.json -A RS256 $RAW_JWT || (echo "Error: failed signature validation" && exit 1) + + WORKFLOW=$(echo $DECODED_JWT_BODY | jq -r '.workflow') + AUD=$(echo $DECODED_JWT_BODY | jq -r '.aud') + EVENT_NAME=$(echo $DECODED_JWT_BODY | jq -r '.event_name') + SUB=$(echo $DECODED_JWT_BODY | jq -r '.sub') + if [[ "$WORKFLOW" != "test.yml" ]]; then + echo "Error: WORKFLOW should be test.yml but is $WORKFLOW" + exit 1 + fi + if [[ "$AUD" != "exampleAudience" ]]; then + echo "Error: AUD should be exampleAudience but is $AUD" + exit 1 + fi + if [[ "$EVENT_NAME" != "push" ]]; then + echo "Error: EVENT_NAME should be push but is $EVENT_NAME" + exit 1 + fi + if [[ "$SUB" != "repo:root/example-id-tokens:ref:refs/heads/main" ]]; then + echo "Error: SUB should be repo:root/example-id-tokens:ref:refs/heads/main but is $SUB" + exit 1 + fi + + generation-not-allowed: + enable-openid-connect: false + runs-on: docker + steps: + - name: check variables are unset + run: | + if [[ -n "$ACTIONS_ID_TOKEN_REQUEST_TOKEN" ]]; then + echo "Error: ACTIONS_ID_TOKEN_REQUEST_TOKEN should be unset" + exit 1 + fi + if [[ -n "$ACTIONS_ID_TOKEN_REQUEST_URL" ]]; then + echo "Error: ACTIONS_ID_TOKEN_REQUEST_TOKEN should be unset" + exit 1 + fi From 47a8f5147b333c91edcd6ab491c0a646669b2502 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 23 Jan 2026 09:08:34 +0000 Subject: [PATCH 156/173] Replace code.forgejo.org/federation/mastodon Docker tag with data.forgejo.org/federation/mastodon v4.5-test (#1489) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1489 Reviewed-by: Michael Kriese Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- federation/scenario-mastodon/compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/federation/scenario-mastodon/compose.yaml b/federation/scenario-mastodon/compose.yaml index 0a39c17e..47f242e3 100644 --- a/federation/scenario-mastodon/compose.yaml +++ b/federation/scenario-mastodon/compose.yaml @@ -56,7 +56,7 @@ services: mastodon-app: # built from https://code.forgejo.org/federation/build-mastodon/src/branch/main/mastodon-containerfile - image: code.forgejo.org/federation/mastodon:v4.5-test + image: data.forgejo.org/federation/mastodon:v4.5-test volumes: - ./resources/certs:/usr/local/share/ca-certificates/ - ./mastodon-app/init/:/init/ @@ -84,7 +84,7 @@ services: mastodon-sidekiq: # built from https://code.forgejo.org/federation/build-mastodon/src/branch/main/mastodon-containerfile - image: code.forgejo.org/federation/mastodon:v4.5-test + image: data.forgejo.org/federation/mastodon:v4.5-test volumes: - ./resources/certs:/usr/local/share/ca-certificates/ - ./mastodon-sidekiq/init/:/init/ From 6821a5adb5d5b31cea9b6b2424b7fb7922f87ae2 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 24 Jan 2026 02:43:17 +0000 Subject: [PATCH 157/173] Update https://data.forgejo.org/actions/setup-forgejo action to v3.1.2 (#1505) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://data.forgejo.org/actions/setup-forgejo](https://code.forgejo.org/actions/setup-forgejo) | action | patch | `v3.1.1` → `v3.1.2` | --- ### Release Notes
actions/setup-forgejo (https://data.forgejo.org/actions/setup-forgejo) ### [`v3.1.2`](https://code.forgejo.org/actions/setup-forgejo/releases/tag/v3.1.2) [Compare Source](https://code.forgejo.org/actions/setup-forgejo/compare/v3.1.1...v3.1.2) - other - [PR](https://code.forgejo.org/actions/setup-forgejo/pulls/852): Update dependency forgejo/runner to v12.6.1 - [PR](https://code.forgejo.org/actions/setup-forgejo/pulls/846): Update dependency forgejo/runner to v12.6.0
--- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1505 Reviewed-by: Mathieu Fenniak Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index 1d41fa79..fab4de3c 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -15,7 +15,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v3.1.1 + - uses: https://data.forgejo.org/actions/setup-forgejo@v3.1.2 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 736c1dd909ed99ddbe056656589f1830bfde3abc Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 26 Jan 2026 04:02:25 +0000 Subject: [PATCH 158/173] Update https://data.forgejo.org/actions/setup-forgejo action to v3.1.3 (#1515) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://data.forgejo.org/actions/setup-forgejo](https://code.forgejo.org/actions/setup-forgejo) | action | patch | `v3.1.2` → `v3.1.3` | --- ### Release Notes
actions/setup-forgejo (https://data.forgejo.org/actions/setup-forgejo) ### [`v3.1.3`](https://code.forgejo.org/actions/setup-forgejo/releases/tag/v3.1.3) [Compare Source](https://code.forgejo.org/actions/setup-forgejo/compare/v3.1.2...v3.1.3) - other - [PR](https://code.forgejo.org/actions/setup-forgejo/pulls/860): Update dependency forgejo/runner to v12.6.2
--- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1515 Reviewed-by: Mathieu Fenniak Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index fab4de3c..a26695dd 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -15,7 +15,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v3.1.2 + - uses: https://data.forgejo.org/actions/setup-forgejo@v3.1.3 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 390c68f447e2d494de18332f106afb836b391856 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 26 Jan 2026 21:17:01 +0000 Subject: [PATCH 159/173] Replace code.forgejo.org/oci/python Docker tag with data.forgejo.org/oci/python slim (#1497) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | code.forgejo.org/oci/python → data.forgejo.org/oci/python | container | replacement | `slim` → `slim` | This is a special PR that replaces `code.forgejo.org/oci/python` with the community suggested minimal stable replacement version. --- ### Configuration 📅 **Schedule**: Branch creation - "" (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1497 Reviewed-by: Mathieu Fenniak Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- actions/example-shell/.forgejo/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/example-shell/.forgejo/workflows/test.yml b/actions/example-shell/.forgejo/workflows/test.yml index cede5140..71f098ab 100644 --- a/actions/example-shell/.forgejo/workflows/test.yml +++ b/actions/example-shell/.forgejo/workflows/test.yml @@ -47,7 +47,7 @@ jobs: needs: [alpine] runs-on: docker container: - image: code.forgejo.org/oci/python:slim + image: data.forgejo.org/oci/python:slim steps: - name: python => python {0} shell: python From d4dfeef16a87a5a46c0f68ec38585663b1d8831a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 26 Jan 2026 21:43:39 +0000 Subject: [PATCH 160/173] Replace code.forgejo.org/oci/postgres Docker tag with data.forgejo.org/oci/postgres (#1496) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [code.forgejo.org/oci/postgres](https://hub.docker.com/_/postgres) ([source](https://github.com/docker-library/postgres)) → [data.forgejo.org/oci/postgres](https://hub.docker.com/_/postgres) | service | replacement | `15` → `15` | | [code.forgejo.org/oci/postgres](https://hub.docker.com/_/postgres) ([source](https://github.com/docker-library/postgres)) → [data.forgejo.org/oci/postgres](https://hub.docker.com/_/postgres) | | replacement | `14` → `14` | This is a special PR that replaces `code.forgejo.org/oci/postgres` with the community suggested minimal stable replacement version. --- ### Configuration 📅 **Schedule**: Branch creation - "" (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1496 Reviewed-by: Mathieu Fenniak Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- actions/example-service/.forgejo/workflows/test.yml | 4 ++-- federation/scenario-mastodon/compose.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actions/example-service/.forgejo/workflows/test.yml b/actions/example-service/.forgejo/workflows/test.yml index 1eeb3ec5..aa39890c 100644 --- a/actions/example-service/.forgejo/workflows/test.yml +++ b/actions/example-service/.forgejo/workflows/test.yml @@ -8,7 +8,7 @@ jobs: runs-on: docker services: pgsql: - image: code.forgejo.org/oci/postgres:15 + image: data.forgejo.org/oci/postgres:15 env: POSTGRES_DB: test POSTGRES_PASSWORD: postgres @@ -27,7 +27,7 @@ jobs: services: pgsql: - image: code.forgejo.org/oci/postgres:15 + image: data.forgejo.org/oci/postgres:15 env: POSTGRES_DB: test POSTGRES_PASSWORD: postgres diff --git a/federation/scenario-mastodon/compose.yaml b/federation/scenario-mastodon/compose.yaml index 47f242e3..54d937ce 100644 --- a/federation/scenario-mastodon/compose.yaml +++ b/federation/scenario-mastodon/compose.yaml @@ -36,7 +36,7 @@ services: - internal_network postgres: - image: code.forgejo.org/oci/postgres:14 + image: data.forgejo.org/oci/postgres:14 tmpfs: - /var/lib/postgresql/data environment: From cd91235a8652dd70302a0b6c7d64dabc3755e02c Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 26 Jan 2026 21:44:02 +0000 Subject: [PATCH 161/173] Replace code.forgejo.org/oci/docker Docker tag with data.forgejo.org/oci/docker (#1494) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [code.forgejo.org/oci/docker](https://hub.docker.com/_/docker) ([source](https://github.com/docker-library/docker)) → [data.forgejo.org/oci/docker](https://hub.docker.com/_/docker) | container | replacement | `28-cli` → `28-cli` | This is a special PR that replaces `code.forgejo.org/oci/docker` with the community suggested minimal stable replacement version. --- ### Configuration 📅 **Schedule**: Branch creation - "" (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1494 Reviewed-by: Mathieu Fenniak Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- actions/example-with-docker-host/.forgejo/workflows/test.yml | 2 +- actions/example-with-docker-socket/.forgejo/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/example-with-docker-host/.forgejo/workflows/test.yml b/actions/example-with-docker-host/.forgejo/workflows/test.yml index 277114e6..454a10da 100644 --- a/actions/example-with-docker-host/.forgejo/workflows/test.yml +++ b/actions/example-with-docker-host/.forgejo/workflows/test.yml @@ -4,7 +4,7 @@ jobs: build: runs-on: docker container: - image: code.forgejo.org/oci/docker:28-cli + image: data.forgejo.org/oci/docker:28-cli steps: - run: ls -l /var/run/docker.sock - run: docker ps diff --git a/actions/example-with-docker-socket/.forgejo/workflows/test.yml b/actions/example-with-docker-socket/.forgejo/workflows/test.yml index 277114e6..454a10da 100644 --- a/actions/example-with-docker-socket/.forgejo/workflows/test.yml +++ b/actions/example-with-docker-socket/.forgejo/workflows/test.yml @@ -4,7 +4,7 @@ jobs: build: runs-on: docker container: - image: code.forgejo.org/oci/docker:28-cli + image: data.forgejo.org/oci/docker:28-cli steps: - run: ls -l /var/run/docker.sock - run: docker ps From ed965a3179b863499fcd7cdf635370c0ba9d4e16 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 26 Jan 2026 21:44:43 +0000 Subject: [PATCH 162/173] Replace code.forgejo.org/oci/debian Docker tag with data.forgejo.org/oci/debian trixie (#1493) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | code.forgejo.org/oci/debian → data.forgejo.org/oci/debian | container | replacement | `trixie` → `trixie` | | code.forgejo.org/oci/debian → data.forgejo.org/oci/debian | service | replacement | `trixie` → `trixie` | This is a special PR that replaces `code.forgejo.org/oci/debian` with the community suggested minimal stable replacement version. --- ### Configuration 📅 **Schedule**: Branch creation - "" (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1493 Reviewed-by: Mathieu Fenniak Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- actions/example-cron/.forgejo/workflows/test.yml | 2 +- .../example-post-7-0-schedule/.forgejo/workflows/test.yml | 2 +- .../.forgejo/workflows/schedule_continue.yml | 2 +- actions/example-service/.forgejo/workflows/test.yml | 8 ++++---- .../example-workflow-dispatch/.forgejo/workflows/test.yml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/actions/example-cron/.forgejo/workflows/test.yml b/actions/example-cron/.forgejo/workflows/test.yml index 8b23779a..58ae70a6 100644 --- a/actions/example-cron/.forgejo/workflows/test.yml +++ b/actions/example-cron/.forgejo/workflows/test.yml @@ -6,7 +6,7 @@ jobs: test: runs-on: docker container: - image: code.forgejo.org/oci/debian:trixie + image: data.forgejo.org/oci/debian:trixie options: "--volume /srv/example:/srv/example" steps: diff --git a/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml b/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml index 202382dc..94eb4961 100644 --- a/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml +++ b/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml @@ -6,7 +6,7 @@ jobs: test: runs-on: ${{ vars.TEST_SCHEDULE_RUNSON }} container: - image: code.forgejo.org/oci/debian:trixie + image: data.forgejo.org/oci/debian:trixie options: "--volume /srv/example:/srv/example" steps: diff --git a/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml b/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml index 76ee59b8..7cc5bdb3 100644 --- a/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml +++ b/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml @@ -5,7 +5,7 @@ jobs: test: runs-on: docker container: - image: code.forgejo.org/oci/debian:trixie + image: data.forgejo.org/oci/debian:trixie volumes: - /srv/example:/srv/example steps: diff --git a/actions/example-service/.forgejo/workflows/test.yml b/actions/example-service/.forgejo/workflows/test.yml index aa39890c..11132c96 100644 --- a/actions/example-service/.forgejo/workflows/test.yml +++ b/actions/example-service/.forgejo/workflows/test.yml @@ -23,7 +23,7 @@ jobs: simple: runs-on: docker container: - image: code.forgejo.org/oci/debian:trixie + image: data.forgejo.org/oci/debian:trixie services: pgsql: @@ -43,7 +43,7 @@ jobs: needs: [simple] runs-on: docker container: - image: code.forgejo.org/oci/debian:trixie + image: data.forgejo.org/oci/debian:trixie options: "--volume /srv/example-service-volume-valid:/srv/example-service-volume-valid --volume /srv/example-service-volume-invalid:/srv/example-service-volume-invalid" steps: @@ -58,12 +58,12 @@ jobs: needs: [volume-on-step] runs-on: docker container: - image: code.forgejo.org/oci/debian:trixie + image: data.forgejo.org/oci/debian:trixie options: "--volume /srv/example-service-volume-valid:/srv/example-service-volume-valid" services: myservice: - image: code.forgejo.org/oci/debian:trixie + image: data.forgejo.org/oci/debian:trixie options: "--volume /srv/example-service-volume-valid:/srv/example-service-volume-valid" cmd: ["bash", "-c", "echo -n SUCCESS > /srv/example-service-volume-valid ; sleep infinity"] diff --git a/actions/example-workflow-dispatch/.forgejo/workflows/test.yml b/actions/example-workflow-dispatch/.forgejo/workflows/test.yml index 766b21d8..3839f7b5 100644 --- a/actions/example-workflow-dispatch/.forgejo/workflows/test.yml +++ b/actions/example-workflow-dispatch/.forgejo/workflows/test.yml @@ -44,7 +44,7 @@ jobs: test: runs-on: docker container: - image: code.forgejo.org/oci/debian:trixie + image: data.forgejo.org/oci/debian:trixie options: "--volume /srv/example:/srv/example" steps: From 5cbe4d73dd9155f9d7226dacb5336b5748320357 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 26 Jan 2026 21:46:01 +0000 Subject: [PATCH 163/173] Replace alpine packages with data.forgejo.org/oci/alpine latest (#1490) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | code.forgejo.org/oci/alpine → data.forgejo.org/oci/alpine | container | replacement | `latest` → `latest` | | [code.forgejo.org/oci/alpine](https://hub.docker.com/_/alpine) ([source](https://github.com/alpinelinux/docker-alpine)) → [data.forgejo.org/oci/alpine](https://hub.docker.com/_/alpine) | container | replacement | `3.21` → `3.21` | | code.forgejo.org/oci/alpine → data.forgejo.org/oci/alpine | | replacement | `latest` → `latest` | This is a special PR that replaces `code.forgejo.org/oci/alpine` with the community suggested minimal stable replacement version. --- ### Configuration 📅 **Schedule**: Branch creation - "" (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1490 Reviewed-by: Mathieu Fenniak Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- actions/example-container/.forgejo/workflows/test.yml | 2 +- actions/example-shell/.forgejo/workflows/test.yml | 2 +- federation/scenario-mastodon/compose.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actions/example-container/.forgejo/workflows/test.yml b/actions/example-container/.forgejo/workflows/test.yml index ded75cd8..aad6cb73 100644 --- a/actions/example-container/.forgejo/workflows/test.yml +++ b/actions/example-container/.forgejo/workflows/test.yml @@ -3,6 +3,6 @@ jobs: test: runs-on: docker container: - image: code.forgejo.org/oci/alpine:3.21 + image: data.forgejo.org/oci/alpine:3.21 steps: - run: grep Alpine /etc/os-release diff --git a/actions/example-shell/.forgejo/workflows/test.yml b/actions/example-shell/.forgejo/workflows/test.yml index 71f098ab..5dad0b6e 100644 --- a/actions/example-shell/.forgejo/workflows/test.yml +++ b/actions/example-shell/.forgejo/workflows/test.yml @@ -25,7 +25,7 @@ jobs: needs: [sh-fallback] runs-on: docker container: - image: code.forgejo.org/oci/alpine:latest + image: data.forgejo.org/oci/alpine:latest steps: - name: default is bash but with a fallback to sh in case it does not exist run: | diff --git a/federation/scenario-mastodon/compose.yaml b/federation/scenario-mastodon/compose.yaml index 54d937ce..fbd7c20d 100644 --- a/federation/scenario-mastodon/compose.yaml +++ b/federation/scenario-mastodon/compose.yaml @@ -5,7 +5,7 @@ networks: services: forgejo: - image: code.forgejo.org/oci/alpine:latest + image: data.forgejo.org/oci/alpine:latest volumes: - ./forgejo/certs/:/usr/local/share/ca-certificates/ - ./forgejo/init/:/init/ From d50ffce2a0010b271d20b9654693d709fd895df2 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 27 Jan 2026 03:04:58 +0000 Subject: [PATCH 164/173] Update data.forgejo.org/oci/alpine Docker tag to v3.23 (#1518) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [data.forgejo.org/oci/alpine](https://hub.docker.com/_/alpine) ([source](https://github.com/alpinelinux/docker-alpine)) | container | minor | `3.21` → `3.23` | --- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1518 Reviewed-by: Mathieu Fenniak Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- actions/example-container/.forgejo/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/example-container/.forgejo/workflows/test.yml b/actions/example-container/.forgejo/workflows/test.yml index aad6cb73..ecf04290 100644 --- a/actions/example-container/.forgejo/workflows/test.yml +++ b/actions/example-container/.forgejo/workflows/test.yml @@ -3,6 +3,6 @@ jobs: test: runs-on: docker container: - image: data.forgejo.org/oci/alpine:3.21 + image: data.forgejo.org/oci/alpine:3.23 steps: - run: grep Alpine /etc/os-release From de9eafb57450f198004619fbce1df815b5f04be0 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 30 Jan 2026 05:55:18 +0000 Subject: [PATCH 165/173] Update https://data.forgejo.org/actions/setup-forgejo action to v3.1.4 (#1536) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1536 Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index a26695dd..bdb69f96 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -15,7 +15,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v3.1.3 + - uses: https://data.forgejo.org/actions/setup-forgejo@v3.1.4 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 35a7a26227acecca7e686720a4b31c9eaa298cf7 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 30 Jan 2026 05:55:37 +0000 Subject: [PATCH 166/173] Replace code.forgejo.org/oci/redis Docker tag with data.forgejo.org/oci/redis 7.2 (#1498) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1498 Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- federation/scenario-mastodon/compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/federation/scenario-mastodon/compose.yaml b/federation/scenario-mastodon/compose.yaml index fbd7c20d..655585be 100644 --- a/federation/scenario-mastodon/compose.yaml +++ b/federation/scenario-mastodon/compose.yaml @@ -48,7 +48,7 @@ services: - internal_network redis: - image: code.forgejo.org/oci/redis:7.2 + image: data.forgejo.org/oci/redis:7.2 tmpfs: - /var/lib/redis/ networks: From be5b4438faf65a7bb650af083b5cf5c11eec4a0b Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 30 Jan 2026 05:55:51 +0000 Subject: [PATCH 167/173] Replace code.forgejo.org/federation/debian Docker tag with data.forgejo.org/federation/debian trixie-cacerts (#1495) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1495 Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- federation/scenario-mastodon/compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/federation/scenario-mastodon/compose.yaml b/federation/scenario-mastodon/compose.yaml index 655585be..ea7c28a6 100644 --- a/federation/scenario-mastodon/compose.yaml +++ b/federation/scenario-mastodon/compose.yaml @@ -20,7 +20,7 @@ services: profiles: - forgejo_container # built from https://code.forgejo.org/federation/build-mastodon/src/branch/main/debian-containerfile - image: code.forgejo.org/federation/debian:trixie-cacerts + image: data.forgejo.org/federation/debian:trixie-cacerts tmpfs: - /data volumes: From 83c2cbcfad793688c0f4df496f8494a987c58b4b Mon Sep 17 00:00:00 2001 From: viceice Date: Thu, 19 Feb 2026 10:57:55 +0000 Subject: [PATCH 168/173] chore(renovate): separate test actions (#1595) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1595 Co-authored-by: viceice Co-committed-by: viceice --- renovate.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/renovate.json b/renovate.json index cd7ea572..17dfc86a 100644 --- a/renovate.json +++ b/renovate.json @@ -2,5 +2,13 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ "local>forgejo/renovate-config" + ], + "packagesRules": [ + { + "description": "Separate test actions", + "matchFileNames": ["actions/**"], + "additionalBranchPrefix": "actions", + "commitMessageTopic": "{{depName}} (test actions)" + } ] } From ea59d6dbabb5e0cc0bffd05fdccfb2c417a9debc Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 19 Feb 2026 10:58:31 +0000 Subject: [PATCH 169/173] Update https://data.forgejo.org/actions/setup-forgejo action to v3.1.6 (#1591) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1591 Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/prepare-end-to-end/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/prepare-end-to-end/action.yml b/.forgejo/prepare-end-to-end/action.yml index bdb69f96..8ae5cdd8 100644 --- a/.forgejo/prepare-end-to-end/action.yml +++ b/.forgejo/prepare-end-to-end/action.yml @@ -15,7 +15,7 @@ runs: /usr/local/bin/garage key: S3 - - uses: https://data.forgejo.org/actions/setup-forgejo@v3.1.4 + - uses: https://data.forgejo.org/actions/setup-forgejo@v3.1.6 with: install-only: true - run: forgejo-binary.sh ensure_user forgejo From 68e5105bfefa98f688f1bc7424fa4cd812d8b3f3 Mon Sep 17 00:00:00 2001 From: viceice Date: Thu, 19 Feb 2026 11:00:40 +0000 Subject: [PATCH 170/173] chore(renovate): typo --- renovate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index 17dfc86a..6b4cadc2 100644 --- a/renovate.json +++ b/renovate.json @@ -3,7 +3,7 @@ "extends": [ "local>forgejo/renovate-config" ], - "packagesRules": [ + "packageRules": [ { "description": "Separate test actions", "matchFileNames": ["actions/**"], From 1b43342fa00eb0a56267b0d086622655cce4fa80 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 19 Feb 2026 14:26:22 +0000 Subject: [PATCH 171/173] Update dependency go to v1.25 (#1597) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1597 Reviewed-by: Michael Kriese Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/workflows/end-to-end.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 3921e400..3d7c59a6 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -23,7 +23,7 @@ jobs: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: https://data.forgejo.org/actions/setup-go@v5 with: - go-version: "1.22" + go-version: "1.25" - name: lib/build.sh id: build run: | From d0470cb8eab4f2d941fa38bbd53a3f0c793ee88e Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 20 Feb 2026 11:53:05 +0000 Subject: [PATCH 172/173] Update Node.js to v24 (#1594) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1594 Reviewed-by: Michael Kriese Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/workflows/end-to-end.yml | 2 +- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index 3d7c59a6..d5d877f6 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -15,7 +15,7 @@ jobs: build: runs-on: docker container: - image: 'data.forgejo.org/oci/node:20-bookworm' + image: 'data.forgejo.org/oci/node:24-bookworm' outputs: built: "${{ steps.build.outputs.built }}" forgejo_versions_json: "${{ steps.build.outputs.forgejo_versions_json }}" diff --git a/Dockerfile b/Dockerfile index 781aa497..e31cb6d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM data.forgejo.org/oci/node:22-trixie +FROM data.forgejo.org/oci/node:24-trixie ENV PATH=$PATH:/setup-forgejo ENV _CONTAINERS_USERNS_CONFIGURED="" From 10e19db36615ca7eba19923f7998b35bec6cffdb Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 21 Feb 2026 02:15:00 +0000 Subject: [PATCH 173/173] Replace Node.js with data.forgejo.org/oci/node 24-trixie (#1604) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [data.forgejo.org/oci/node](https://hub.docker.com/_/node) ([source](https://github.com/nodejs/docker-node)) | container | replacement | `24-bookworm` → `24-trixie` | This is a special PR that replaces `data.forgejo.org/oci/node` with the community suggested minimal stable replacement version. --- ### Configuration 📅 **Schedule**: Branch creation - "" (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1604 Reviewed-by: Mathieu Fenniak Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- .forgejo/workflows/end-to-end.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index d5d877f6..eab71f76 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -15,7 +15,7 @@ jobs: build: runs-on: docker container: - image: 'data.forgejo.org/oci/node:24-bookworm' + image: 'data.forgejo.org/oci/node:24-trixie' outputs: built: "${{ steps.build.outputs.built }}" forgejo_versions_json: "${{ steps.build.outputs.forgejo_versions_json }}"