From 2deee2190f6cf9fe974b97c6445037f17c7f4eda Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 9 Sep 2026 21:05:21 +0000 Subject: [PATCH 1/2] Add Cloud Agent environment config for Dart w_common monorepo Install the CI-pinned Dart SDK (2.19.6) and fetch pub dependencies for the w_common and w_common_tools packages. Chrome (needed for browser tests) is already present in the base image, and all dependencies are public pub.dev packages, so no wk/Artifactory auth is required. Co-authored-by: Edward Weymouth --- .cursor/environment.json | 4 ++++ .cursor/install.sh | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .cursor/environment.json create mode 100755 .cursor/install.sh diff --git a/.cursor/environment.json b/.cursor/environment.json new file mode 100644 index 0000000..df8ae3c --- /dev/null +++ b/.cursor/environment.json @@ -0,0 +1,4 @@ +{ + "name": "w_common", + "install": "bash .cursor/install.sh" +} diff --git a/.cursor/install.sh b/.cursor/install.sh new file mode 100755 index 0000000..89f6b95 --- /dev/null +++ b/.cursor/install.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Cloud Agent VM only — refuse to mutate a developer machine. +[ "$(uname -s)" = "Linux" ] || { echo "refusing: not a Linux Cloud Agent VM" >&2; exit 1; } +[ "$(hostname)" = "cursor" ] || { echo "refusing: hostname is not 'cursor' — stop and ask" >&2; exit 1; } + +# Pinned Dart SDK version — matches the version enforced by .github/workflows/dart_ci.yml +# (the `format` job and the lower bound of the test matrix). +DART_VERSION=2.19.6 +DART_SDK_DIR=/usr/lib/dart-sdk + +# Install the pinned Dart SDK if it is missing or a different version. Idempotent: +# a matching SDK short-circuits the download so re-runs are cheap. +if ! command -v dart >/dev/null 2>&1 || ! dart --version 2>&1 | grep -q "$DART_VERSION"; then + echo "Installing Dart SDK ${DART_VERSION}..." + tmpzip="$(mktemp --suffix=.zip)" + curl -fsSL "https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip" -o "$tmpzip" + sudo rm -rf "$DART_SDK_DIR" + sudo unzip -q "$tmpzip" -d /usr/lib/ + sudo ln -sf "$DART_SDK_DIR/bin/dart" /usr/local/bin/dart + rm -f "$tmpzip" +fi +dart --version + +# Fetch dependencies for both packages. All dependencies are public pub.dev +# packages, so no Workiva (wk) / Artifactory / pub.workiva.org auth is required. +for pkg in w_common w_common_tools; do + echo "== dart pub get (${pkg}) ==" + (cd "$pkg" && dart pub get) +done From ecd801579ef174d4ec1f0ed46c39d984c67272ba Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 9 Sep 2026 21:29:14 +0000 Subject: [PATCH 2/2] Inline Dart environment install into environment.json Move the self-contained Dart SDK install + pub get into the environment.json install field and remove the separate .cursor/install.sh. This makes the config a single source of truth and lets a promotable default-branch environment build be produced (a build is required for the dashboard Save flow to attach a valid environment). Co-authored-by: Edward Weymouth --- .cursor/environment.json | 2 +- .cursor/install.sh | 31 ------------------------------- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100755 .cursor/install.sh diff --git a/.cursor/environment.json b/.cursor/environment.json index df8ae3c..b8abf3d 100644 --- a/.cursor/environment.json +++ b/.cursor/environment.json @@ -1,4 +1,4 @@ { "name": "w_common", - "install": "bash .cursor/install.sh" + "install": "set -e\n[ \"$(uname -s)\" = \"Linux\" ] || { echo \"refusing: not a Linux Cloud Agent VM\" >&2; exit 1; }\n# Pinned Dart SDK — matches .github/workflows/dart_ci.yml (format job + test matrix lower bound).\nDART_VERSION=2.19.6\nDART_SDK_DIR=/usr/lib/dart-sdk\nif ! command -v dart >/dev/null 2>&1 || ! dart --version 2>&1 | grep -q \"$DART_VERSION\"; then\n echo \"Installing Dart SDK ${DART_VERSION}...\"\n tmpzip=\"$(mktemp --suffix=.zip)\"\n curl -fsSL \"https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip\" -o \"$tmpzip\"\n sudo rm -rf \"$DART_SDK_DIR\"\n sudo unzip -q \"$tmpzip\" -d /usr/lib/\n sudo ln -sf \"$DART_SDK_DIR/bin/dart\" /usr/local/bin/dart\n rm -f \"$tmpzip\"\nfi\ndart --version\n# All dependencies are public pub.dev packages, so no wk/Artifactory auth is required.\n(cd w_common && dart pub get)\n(cd w_common_tools && dart pub get)\n" } diff --git a/.cursor/install.sh b/.cursor/install.sh deleted file mode 100755 index 89f6b95..0000000 --- a/.cursor/install.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Cloud Agent VM only — refuse to mutate a developer machine. -[ "$(uname -s)" = "Linux" ] || { echo "refusing: not a Linux Cloud Agent VM" >&2; exit 1; } -[ "$(hostname)" = "cursor" ] || { echo "refusing: hostname is not 'cursor' — stop and ask" >&2; exit 1; } - -# Pinned Dart SDK version — matches the version enforced by .github/workflows/dart_ci.yml -# (the `format` job and the lower bound of the test matrix). -DART_VERSION=2.19.6 -DART_SDK_DIR=/usr/lib/dart-sdk - -# Install the pinned Dart SDK if it is missing or a different version. Idempotent: -# a matching SDK short-circuits the download so re-runs are cheap. -if ! command -v dart >/dev/null 2>&1 || ! dart --version 2>&1 | grep -q "$DART_VERSION"; then - echo "Installing Dart SDK ${DART_VERSION}..." - tmpzip="$(mktemp --suffix=.zip)" - curl -fsSL "https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip" -o "$tmpzip" - sudo rm -rf "$DART_SDK_DIR" - sudo unzip -q "$tmpzip" -d /usr/lib/ - sudo ln -sf "$DART_SDK_DIR/bin/dart" /usr/local/bin/dart - rm -f "$tmpzip" -fi -dart --version - -# Fetch dependencies for both packages. All dependencies are public pub.dev -# packages, so no Workiva (wk) / Artifactory / pub.workiva.org auth is required. -for pkg in w_common w_common_tools; do - echo "== dart pub get (${pkg}) ==" - (cd "$pkg" && dart pub get) -done