From f33657370c350c0aff035337807a77e61c6cd250 Mon Sep 17 00:00:00 2001 From: keyman-server Date: Mon, 8 Jun 2026 12:57:03 +0000 Subject: [PATCH 1/7] chore: update BOOTSTRAP_VERSION to v1.0.13 --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 11f7cdc..7a3b92d 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ ## START STANDARD SITE BUILD SCRIPT INCLUDE readonly THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" readonly BOOTSTRAP="$(dirname "$THIS_SCRIPT")/resources/bootstrap.inc.sh" -readonly BOOTSTRAP_VERSION=v1.0.12 +readonly BOOTSTRAP_VERSION=v1.0.13 if ! [ -f "$BOOTSTRAP" ] || ! source "$BOOTSTRAP"; then curl -H "Cache-Control: no-cache" --fail --silent --show-error -w "curl: Finished attempt to download %{url}" "https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh" -o "$BOOTSTRAP.tmp" || exit 1 source "$BOOTSTRAP.tmp" From c7641cdb786da0e75ba637b7cf481279924d4cdd Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Mon, 15 Jun 2026 09:54:09 +0200 Subject: [PATCH 2/7] chore: linkinator Based-on: keymanapp/keyman.com#788 Test-bot: skip --- .github/workflows/ci.yml | 74 +++++++++++++++++++++++----------------- .gitignore | 4 +++ build.sh | 32 +++-------------- 3 files changed, 52 insertions(+), 58 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ab1645..995279d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,9 @@ jobs: runs-on: ubuntu-latest env: KEYMANHOSTS_TIER: TIER_TEST + CONTAINER_DESC: web-keyman-com-app + CONTAINER_PORT: 8057 + # Composer started complaining about running as root, but we don't care in a GHA COMPOSER_ALLOW_SUPERUSER: 1 @@ -25,49 +28,58 @@ jobs: fail-fast: true # - # Finally, run the tests; note that this is almost all replicated in build.sh; here logging is reduced (TODO sync) + # Run tests -- these step definitions are NEARLY identical across: + # help.keyman.com, keyman.com, keymanweb.com, api.keyman.com + # + # No differences on this site # - - name: PHP unit tests + - name: Test setup + shell: bash + run: | + source ./_common/tests.inc.sh + set -e + do_test_record_start_time + echo "TEST_START_TIME=${TEST_START_TIME}" >> "$GITHUB_ENV" + + - name: PHP test + if: ${{ !cancelled() }} shell: bash run: | - docker exec web-keyman-com-app sh -c "vendor/bin/phpunit --testdox" + source ./_common/tests.inc.sh + set -e + do_test_unit_tests "$CONTAINER_DESC" - name: Lint + if: ${{ !cancelled() }} shell: bash run: | - ( set +e; set +o pipefail; find . -name '*.php' | grep -v '/vendor/' | xargs -n 1 -d '\n' php -l | grep -v "No syntax errors detected"; exit ${PIPESTATUS[2]} ) + source ./_common/tests.inc.sh + set -e + do_test_lint "$CONTAINER_DESC" - name: Check broken links + if: ${{ !cancelled() }} shell: bash run: | - set +e; - set +o pipefail; - npx broken-link-checker http://localhost:8057 --ordered --recursive --requests 50 --host-requests 50 -e --filter-level 3 | \ - grep -E "BROKEN|Getting links from" | \ - grep -B 1 "BROKEN" - exit ${PIPESTATUS[0]} + source ./_common/tests.inc.sh + set -e + do_test_links "http://localhost:${CONTAINER_PORT}" / - - name: Check PHP errors - shell: bash + # We split the reporting of broken links into a separate step for ease of + # viewing because the broken links are otherwise hidden in a sea of good + # links in a very long report + + - name: Report on broken links + if: ${{ !cancelled() }} run: | - CONTAINER=`docker container ls -l -q` - if docker container logs $CONTAINER 2>&1 | grep -q 'php7'; then - echo 'PHP reported errors or warnings:' - docker container logs $CONTAINER 2>&1 | grep 'php7' - exit 1 - else - echo 'No PHP errors found' - exit 0 - fi - # - # If any of the tests fail, let's grab a bit more detail on the environment - # - - name: Report errors - if: ${{ failure() }} + source ./_common/tests.inc.sh + set -e + do_test_print_link_report + + - name: Check PHP errors + if: ${{ !cancelled() }} shell: bash run: | - CONTAINER=`docker container ls -l -q` - echo "--- tier.txt ---" - cat tier.txt - echo "--- PHP errors in Docker log ---" - docker container logs $CONTAINER 2>&1 | grep 'php7' + source ./_common/tests.inc.sh + set -e + do_test_print_container_error_logs "$CONTAINER_DESC" diff --git a/.gitignore b/.gitignore index bbdab99..be43cc8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,10 @@ cdn/deploy /vendor .data/ +# unit test artifacts +linkinator-results.json +.phpunit.result.cache + # Shared files are bootstrapped: resources/bootstrap.inc.sh resources/.bootstrap-version diff --git a/build.sh b/build.sh index 7a3b92d..6e9cadc 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ ## START STANDARD SITE BUILD SCRIPT INCLUDE readonly THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" readonly BOOTSTRAP="$(dirname "$THIS_SCRIPT")/resources/bootstrap.inc.sh" -readonly BOOTSTRAP_VERSION=v1.0.13 +readonly BOOTSTRAP_VERSION=feat/linkinator-and-central-test-script if ! [ -f "$BOOTSTRAP" ] || ! source "$BOOTSTRAP"; then curl -H "Cache-Control: no-cache" --fail --silent --show-error -w "curl: Finished attempt to download %{url}" "https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh" -o "$BOOTSTRAP.tmp" || exit 1 source "$BOOTSTRAP.tmp" @@ -29,38 +29,16 @@ builder_describe \ start \ stop \ test \ + "--no-unit-test" \ + "--no-lint" \ + "--no-link-check" builder_parse "$@" -function test_docker_container() { - # Note: ci.yml replicates these - echo "TIER_TEST" > tier.txt - - # Run unit tests - docker exec $KEYMANWEB_CONTAINER_DESC sh -c "vendor/bin/phpunit --testdox" - - # Lint .php files for obvious errors - docker exec $KEYMANWEB_CONTAINER_DESC sh -c "find . -name '*.php' | grep -v '/vendor/' | xargs -n 1 -d '\\n' php -l" - - # Check all internal links - # NOTE: link checker runs on host rather than in docker image - npx broken-link-checker http://localhost:${PORT_KEYMANWEB_COM} --ordered --recursive --host-requests 10 -e --filter-level 3 - - # Check for errors - if docker container logs $KEYMANWEB_CONTAINER_DESC 2>&1 | grep -q 'php7'; then - echo 'PHP reported errors or warnings:' - docker container logs $KEYMANWEB_CONTAINER_DESC 2>&1 | grep 'php7' - exit 1 - else - echo 'No PHP errors found' - exit 0 - fi -} - builder_run_action configure bootstrap_configure builder_run_action clean clean_docker_container $KEYMANWEB_IMAGE_NAME $KEYMANWEB_CONTAINER_NAME builder_run_action stop stop_docker_container $KEYMANWEB_IMAGE_NAME $KEYMANWEB_CONTAINER_NAME builder_run_action build build_docker_container $KEYMANWEB_IMAGE_NAME $KEYMANWEB_CONTAINER_NAME builder_run_action start start_docker_container $KEYMANWEB_IMAGE_NAME $KEYMANWEB_CONTAINER_NAME $KEYMANWEB_CONTAINER_DESC $HOST_KEYMANWEB_COM $PORT_KEYMANWEB_COM $BUILDER_CONFIGURATION -builder_run_action test test_docker_container +builder_run_action test test_docker_container $KEYMANWEB_CONTAINER_DESC $PORT_KEYMANWEB_COM / From f5c5d3ae28111e370de4ac6a3a400a8d3aa8a9cf Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 16 Jun 2026 10:38:53 +0200 Subject: [PATCH 3/7] chore: update multi-labeler to 5.0.0 This moves to node v24. Relates-to: keymanapp/s.keyman.com#1607 Test-bot: skip --- .github/workflows/labeler.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 1ab4d7a..b15a172 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -9,8 +9,7 @@ jobs: steps: - name: Update labels based on PR title id: labeler - # latest, but still Node 20 - uses: fuxingloh/multi-labeler@b15a54460c38f54043fa75f7b08a0e2aa5b94b5b # v4.0.0 + uses: fuxingloh/multi-labeler@bcd50af464202999e57f556b4aefcf05a34abf85 # v5.0.0 with: github-token: ${{secrets.GITHUB_TOKEN}} config-path: .github/multi-labeler.yml From 4e67f8102d6c23c9df081cea26abc05a1a90840e Mon Sep 17 00:00:00 2001 From: keyman-server Date: Tue, 16 Jun 2026 13:27:55 +0000 Subject: [PATCH 4/7] chore: update BOOTSTRAP_VERSION to v1.0.14 --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 7a3b92d..2d54d12 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ ## START STANDARD SITE BUILD SCRIPT INCLUDE readonly THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" readonly BOOTSTRAP="$(dirname "$THIS_SCRIPT")/resources/bootstrap.inc.sh" -readonly BOOTSTRAP_VERSION=v1.0.13 +readonly BOOTSTRAP_VERSION=v1.0.14 if ! [ -f "$BOOTSTRAP" ] || ! source "$BOOTSTRAP"; then curl -H "Cache-Control: no-cache" --fail --silent --show-error -w "curl: Finished attempt to download %{url}" "https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh" -o "$BOOTSTRAP.tmp" || exit 1 source "$BOOTSTRAP.tmp" From 6e4cfa1cfef3c38c318da51fac7102fdde6d24f6 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 16 Jun 2026 15:17:54 +0200 Subject: [PATCH 5/7] chore: verify bootstrap version format before merge Relates-to: keymanapp/keyman.com#794 Test-bot: skip --- .github/workflows/ci.yml | 13 +++++++++++++ build.sh | 3 ++- resources/.bootstrap-required-version | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 resources/.bootstrap-required-version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 995279d..d54248f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,3 +83,16 @@ jobs: source ./_common/tests.inc.sh set -e do_test_print_container_error_logs "$CONTAINER_DESC" + + - name: Verify .bootstrap-required-version + if: ${{ !cancelled() }} + shell: bash + run: | + # We want to avoid merging a bootstrap version that is not based on a published tag + # in the shared-sites repo. We will do this with a heuristic based on the normal + # shape of the tags, which is `v#.#.#`. Any other shape we will assume is a test + # branch. + cat resources/.bootstrap-required-version | grep -qP '^v\d+\.\d+\.\d+$' || ( + echo "::error file=resources/.bootstrap-required-version,line=1,col=1::This branch cannot be merged, because resources/.bootstrap-required-version references \`$(cat resources/.bootstrap-required-version)\`, which does not appear to be a published tag -- is it a test branch?" + exit 1 + ) diff --git a/build.sh b/build.sh index 6e9cadc..3a38456 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,8 @@ ## START STANDARD SITE BUILD SCRIPT INCLUDE readonly THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" readonly BOOTSTRAP="$(dirname "$THIS_SCRIPT")/resources/bootstrap.inc.sh" -readonly BOOTSTRAP_VERSION=feat/linkinator-and-central-test-script +BOOTSTRAP_VERSION="$(cat "$(dirname "THIS_SCRIPT")/resources/.bootstrap-required-version")" || exit 1 +readonly BOOTSTRAP_VERSION if ! [ -f "$BOOTSTRAP" ] || ! source "$BOOTSTRAP"; then curl -H "Cache-Control: no-cache" --fail --silent --show-error -w "curl: Finished attempt to download %{url}" "https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh" -o "$BOOTSTRAP.tmp" || exit 1 source "$BOOTSTRAP.tmp" diff --git a/resources/.bootstrap-required-version b/resources/.bootstrap-required-version new file mode 100644 index 0000000..eca15ab --- /dev/null +++ b/resources/.bootstrap-required-version @@ -0,0 +1 @@ +v1.0.14 \ No newline at end of file From ccd5d638d91503c05495e34b13f23546abdbb33e Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 17 Jun 2026 07:13:24 +0200 Subject: [PATCH 6/7] Apply suggestion from @ermshiperete Co-authored-by: Eberhard Beilharz --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d54248f..d2634fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,6 +71,7 @@ jobs: - name: Report on broken links if: ${{ !cancelled() }} + shell: bash run: | source ./_common/tests.inc.sh set -e From f1c378f040ebca8a920c94b5bf9aa4b77b96fd2a Mon Sep 17 00:00:00 2001 From: keyman-server Date: Thu, 18 Jun 2026 09:37:44 +0000 Subject: [PATCH 7/7] chore: update BOOTSTRAP_VERSION to v1.0.15 --- resources/.bootstrap-required-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/.bootstrap-required-version b/resources/.bootstrap-required-version index eca15ab..0275cf6 100644 --- a/resources/.bootstrap-required-version +++ b/resources/.bootstrap-required-version @@ -1 +1 @@ -v1.0.14 \ No newline at end of file +v1.0.15