Files
openclaw/scripts/e2e/docker-selected-plugins.sh
T
Sliverp 84c7d45f15 refactor(qqbot): install plugin from Tencent package (#107295)
* refactor(qqbot): remove bundled extension source

Mechanical deletion half of the #107295 squashed rebase; the catalog
repoint and host integration land in the follow-up commit.

Co-authored-by: sliverp <870080352@qq.com>

* refactor(qqbot): install plugin from Tencent package

Squashed rebase of #107295 onto current main. Repoints the official
external channel catalog at @tencent-connect/openclaw-qqbot@2.0.1 and
adapts onboarding, doctor migrations, secrets, build guards, and tests.

Documents the known limitation that the external package does not
support structured SecretRef clientSecret values; operators move those
to QQBOT_CLIENT_SECRET or clientSecretFile before upgrading.

Co-authored-by: sliverp <870080352@qq.com>

* fix(doctor): reuse shared hasOwnKey record helper

The rebased QQBot migration carried its own hasOwnKey export, colliding
with the one main now ships in legacy-config-record-shared.ts.

Co-authored-by: sliverp <870080352@qq.com>

* fix(plugins): carry catalog integrity through the update bridge

The externalized-bundled-plugin bridge dropped the official catalog's
expectedIntegrity pin, so bundled-user updates installed the external
npm package without integrity verification. The bridge now carries the
pin for the catalog's exact npm spec and both bridge install calls pass
it through; update-channel spec overrides intentionally skip the pin
since it only covers the pinned version.

Co-authored-by: sliverp <870080352@qq.com>

* chore(plugin-sdk): refresh per-entrypoint API baselines

The QQBot compat export and bundled-type removal shift 26 entrypoint
closure hashes in the new split baseline layout.

Co-authored-by: sliverp <870080352@qq.com>

* refactor(qqbot): drop helper reintroduced during rebase

Main's coercion consolidation added this file after the deletion
commit's base; its only consumers were the removed qqbot sources.

Co-authored-by: sliverp <870080352@qq.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-08-11 15:10:27 -07:00

88 lines
3.5 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
source "$ROOT_DIR/scripts/lib/docker-build.sh"
source "$ROOT_DIR/scripts/lib/docker-e2e-container.sh"
IMAGE_NAME="${OPENCLAW_DOCKER_SELECTED_PLUGINS_E2E_IMAGE:-openclaw-docker-selected-plugins-e2e:local}"
DEPENDENCY_ONLY_IMAGE="${IMAGE_NAME}-dependency-only"
CONTAINER_NAME="openclaw-docker-selected-plugins-e2e-$$"
SELECTED_PLUGINS="${OPENCLAW_DOCKER_SELECTED_PLUGINS:-slack,msteams clickclack,slack}"
BUILD_GIT_COMMIT="${OPENCLAW_DOCKER_SELECTED_PLUGINS_E2E_GIT_COMMIT:-0123456789abcdef0123456789abcdef01234567}"
BUILD_TIMESTAMP="${OPENCLAW_DOCKER_SELECTED_PLUGINS_E2E_BUILD_TIMESTAMP:-2026-07-10T12:34:56.000Z}"
UNKNOWN_LOG="$(mktemp -t openclaw-docker-selected-plugins-unknown.XXXXXX)"
RUN_LOG="$(mktemp -t openclaw-docker-selected-plugins-run.XXXXXX)"
DOCKER_COMMAND_TIMEOUT="${OPENCLAW_DOCKER_SELECTED_PLUGINS_RUN_TIMEOUT:-900s}"
DEPENDENCY_ONLY_IMAGE_BUILT=0
cleanup() {
docker_e2e_docker_cmd rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true
if [ "$DEPENDENCY_ONLY_IMAGE_BUILT" = "1" ]; then
docker_e2e_docker_cmd image rm -f "$DEPENDENCY_ONLY_IMAGE" >/dev/null 2>&1 || true
fi
rm -f "$UNKNOWN_LOG" "$RUN_LOG"
}
trap cleanup EXIT
if [ "${OPENCLAW_SKIP_DOCKER_BUILD:-0}" = "1" ]; then
echo "Reusing selected-plugin image: $IMAGE_NAME"
docker_e2e_docker_cmd image inspect "$IMAGE_NAME" >/dev/null
else
echo "Proving unknown selected plugins fail closed..."
set +e
docker_e2e_timeout_cmd "${OPENCLAW_DOCKER_SELECTED_PLUGINS_BUILD_TIMEOUT:-3600s}" \
env DOCKER_BUILDKIT=1 docker build \
--target workspace-deps \
--build-arg OPENCLAW_EXTENSIONS=missing-plugin \
-f "$ROOT_DIR/Dockerfile" \
"$ROOT_DIR" >"$UNKNOWN_LOG" 2>&1
unknown_status=$?
set -e
if [ "$unknown_status" -eq 0 ] || ! grep -Fq \
"unknown OPENCLAW_EXTENSIONS plugin id: missing-plugin" "$UNKNOWN_LOG"; then
echo "Unknown selected-plugin build did not fail closed as expected" >&2
docker_e2e_print_log "$UNKNOWN_LOG"
exit 1
fi
echo "Proving manifest ids and known dependency-only plugins remain stageable..."
docker_build_run docker-selected-plugins-dependency-only \
--target workspace-deps \
--build-arg OPENCLAW_EXTENSIONS=whatsapp,kimi \
-t "$DEPENDENCY_ONLY_IMAGE" \
-f "$ROOT_DIR/Dockerfile" \
"$ROOT_DIR"
DEPENDENCY_ONLY_IMAGE_BUILT=1
docker_e2e_docker_run_cmd run --rm \
--entrypoint sh \
"$DEPENDENCY_ONLY_IMAGE" \
-c 'test -f /out/extensions/whatsapp/package.json && test -f /out/extensions/kimi-coding/package.json && grep -qx kimi-coding /out/openclaw-selected-plugin-dirs'
echo "Building selected-plugin runtime image: $IMAGE_NAME"
docker_build_run docker-selected-plugins-build \
--build-arg "GIT_COMMIT=$BUILD_GIT_COMMIT" \
--build-arg "OPENCLAW_BUILD_TIMESTAMP=$BUILD_TIMESTAMP" \
--build-arg "OPENCLAW_EXTENSIONS=$SELECTED_PLUGINS" \
-t "$IMAGE_NAME" \
-f "$ROOT_DIR/Dockerfile" \
"$ROOT_DIR"
fi
echo "Inspecting selected plugins from the final runtime image..."
if ! docker_e2e_docker_run_cmd run --rm \
--name "$CONTAINER_NAME" \
--entrypoint bash \
-e "OPENCLAW_E2E_EXPECTED_GIT_COMMIT=$BUILD_GIT_COMMIT" \
-e "OPENCLAW_E2E_EXPECTED_BUILD_TIMESTAMP=$BUILD_TIMESTAMP" \
-v "$ROOT_DIR/scripts/e2e/lib/docker-selected-plugins:/openclaw-e2e:ro" \
"$IMAGE_NAME" \
/openclaw-e2e/scenario.sh >"$RUN_LOG" 2>&1; then
echo "Selected-plugin Docker E2E failed" >&2
docker_e2e_print_log "$RUN_LOG"
exit 1
fi
docker_e2e_print_log "$RUN_LOG"
echo "Selected-plugin Docker E2E passed"