-
Notifications
You must be signed in to change notification settings - Fork 1
feat: consolidate daemon/autonomous into squads run (#587) #608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kokevidaurre
wants to merge
1
commit into
develop
Choose a base branch
from
feat/consolidate-daemon-587
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| #!/usr/bin/env bash | ||
| # E2E Docker test: builds a clean Ubuntu container, installs squads-cli from | ||
| # tarball (like a real user), and runs smoke tests inside it. | ||
| # | ||
| # Catches issues that local tests miss: | ||
| # - Missing files in npm package | ||
| # - Broken bin entry / shebang | ||
| # - Node version incompatibilities | ||
| # - Permission issues (non-root user) | ||
| # - Missing runtime dependencies | ||
| # | ||
| # Usage: bash scripts/e2e-docker.sh | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" | ||
| DOCKERFILE="$REPO_ROOT/test/e2e/Dockerfile.first-run" | ||
| IMAGE_NAME="squads-cli-e2e" | ||
|
|
||
| echo "▶ Building package..." | ||
| cd "$REPO_ROOT" | ||
| npm run build | ||
|
|
||
| echo "▶ Packing tarball..." | ||
| TARBALL=$(npm pack --quiet) | ||
| TARBALL_PATH="$REPO_ROOT/$TARBALL" | ||
|
|
||
| cleanup() { | ||
| echo "▶ Cleaning up..." | ||
| rm -f "$TARBALL_PATH" | ||
| docker rmi "$IMAGE_NAME" 2>/dev/null || true | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| echo "▶ Building Docker image (clean Ubuntu + squads-cli from tarball)..." | ||
| docker build \ | ||
| -f "$DOCKERFILE" \ | ||
| --build-arg "TARBALL=$TARBALL" \ | ||
| -t "$IMAGE_NAME" \ | ||
| "$REPO_ROOT" | ||
|
|
||
| echo "▶ Running tests inside container..." | ||
| docker run --rm "$IMAGE_NAME" bash -c ' | ||
| set -euo pipefail | ||
|
|
||
| step() { echo ""; echo "=== STEP: $1 ==="; } | ||
|
|
||
| step "squads --version" | ||
| squads --version | ||
|
|
||
| step "squads --help" | ||
| squads --help | head -20 | ||
|
|
||
| step "squads init --yes --force" | ||
| mkdir -p /tmp/test-project && cd /tmp/test-project | ||
| git init -q && git commit --allow-empty -q -m "init" | ||
| squads init --yes --force | ||
|
|
||
| step "squads status" | ||
| squads status | ||
|
|
||
| step "squads run --status (daemon status)" | ||
| squads run --status | ||
|
|
||
| step "squads run --dry-run --once (autopilot preview)" | ||
| squads run --dry-run --once || true | ||
|
|
||
| step "squads run company --dry-run (single squad preview)" | ||
| squads run company --dry-run || true | ||
|
|
||
| step "squads run --pause \"e2e test\"" | ||
| squads run --pause "e2e test" | ||
|
|
||
| step "squads run --status (should show paused)" | ||
| squads run --status | ||
|
|
||
| step "squads run --resume" | ||
| squads run --resume | ||
|
|
||
| step "squads run --status (should show not running)" | ||
| squads run --status | ||
|
|
||
| step "squads autonomous status (deprecated alias)" | ||
| squads autonomous status || true | ||
|
|
||
| step "squads doctor" | ||
| squads doctor || true | ||
|
|
||
| echo "" | ||
| echo "✅ All Docker E2E tests passed" | ||
| ' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| #!/usr/bin/env bash | ||
| # ───────────────────────────────────────────────────────────────────── | ||
| # Git history secret scrub for squads-cli (PUBLIC REPO) | ||
| # | ||
| # Removes leaked secrets from git history using git-filter-repo. | ||
| # This rewrites history — all collaborators must re-clone after. | ||
| # | ||
| # Prerequisites: | ||
| # brew install git-filter-repo (or pip install git-filter-repo) | ||
| # | ||
| # What gets scrubbed: | ||
| # 1. Telemetry API key (base64-encoded) | ||
| # 2. Telemetry endpoint URL (base64-encoded) | ||
| # 3. Local DB credentials (two connection strings) | ||
| # | ||
| # Usage: | ||
| # 1. Review this script | ||
| # 2. Run: bash scripts/scrub-secrets.sh | ||
| # 3. Verify: git log -p --all -S '<pattern>' should return nothing | ||
| # 4. Force push: git push --force --all && git push --force --tags | ||
| # ───────────────────────────────────────────────────────────────────── | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | ||
| cd "$REPO_ROOT" | ||
|
|
||
| # Preflight | ||
| if ! command -v git-filter-repo &>/dev/null; then | ||
| echo "ERROR: git-filter-repo not found" | ||
| echo "Install: brew install git-filter-repo" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Safety: must be on a clean working tree | ||
| if [ -n "$(git status --porcelain)" ]; then | ||
| echo "ERROR: Working tree not clean. Commit or stash changes first." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "=== Strings to scrub from git history ===" | ||
| echo "" | ||
| echo "1. Telemetry API key (base64): c3FfdGVsX3YxXzdmOGE5YjJjM2Q0ZTVmNmE=" | ||
| echo "2. Telemetry endpoint (base64): aHR0cHM6Ly9zcXVhZHMtdGVsZW1ldHJ5LTk3ODg3MTgxNzYxMC51cy1jZW50cmFsMS5ydW4uYXBwL3Bpbmc=" | ||
| echo "3. DB credential 1: postgresql://user:password@localhost:5432/squads" | ||
| echo "4. DB credential 2: postgresql://squads:squads_local_dev@localhost:5433/squads" | ||
| echo "" | ||
| echo "This will REWRITE git history. All collaborators must re-clone." | ||
| echo "" | ||
| read -p "Continue? (yes/no): " CONFIRM | ||
| if [ "$CONFIRM" != "yes" ]; then | ||
| echo "Aborted." | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Create the replacements file | ||
| REPLACEMENTS=$(mktemp) | ||
| cat > "$REPLACEMENTS" <<'REPLACE' | ||
| c3FfdGVsX3YxXzdmOGE5YjJjM2Q0ZTVmNmE===>REDACTED_TELEMETRY_KEY | ||
| aHR0cHM6Ly9zcXVhZHMtdGVsZW1ldHJ5LTk3ODg3MTgxNzYxMC51cy1jZW50cmFsMS5ydW4uYXBwL3Bpbmc===>REDACTED_TELEMETRY_ENDPOINT | ||
| postgresql://user:password@localhost:5432/squads==>REDACTED_DB_URL | ||
| postgresql://squads:squads_local_dev@localhost:5433/squads==>REDACTED_DB_URL | ||
| REPLACE | ||
|
|
||
| echo "▶ Running git-filter-repo with blob replacements..." | ||
| git filter-repo --replace-text "$REPLACEMENTS" --force | ||
|
|
||
| rm -f "$REPLACEMENTS" | ||
|
|
||
| echo "" | ||
| echo "=== Verification ===" | ||
| echo "" | ||
|
|
||
| # Verify scrub worked | ||
| FOUND=0 | ||
| for pattern in "c3FfdGVsX3YxXzdm" "aHR0cHM6Ly9zcXVhZHMtdGVsZW1ldHJ5" "user:password@localhost" "squads_local_dev"; do | ||
| HITS=$(git log --all -p | grep -c "$pattern" 2>/dev/null || true) | ||
| if [ "$HITS" -gt 0 ]; then | ||
| echo "FAIL: '$pattern' still found $HITS time(s)" | ||
| FOUND=1 | ||
| else | ||
| echo "OK: '$pattern' scrubbed" | ||
| fi | ||
| done | ||
|
|
||
| echo "" | ||
| if [ "$FOUND" -eq 0 ]; then | ||
| echo "All secrets scrubbed from git history." | ||
| echo "" | ||
| echo "Next steps:" | ||
| echo " 1. git push --force --all" | ||
| echo " 2. git push --force --tags" | ||
| echo " 3. Tell collaborators to re-clone (git pull won't work after rewrite)" | ||
| echo " 4. Rotate the telemetry API key server-side (if not already done)" | ||
| else | ||
| echo "WARNING: Some secrets still found. Manual investigation needed." | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of
|| trueforsquads doctorcan mask unexpected failures in the E2E test. Thedoctorcommand is intended to diagnose environment issues, and it should ideally pass. If it fails for an unexpected reason,|| truewill prevent the CI from catching the problem.If a non-zero exit code is expected in this test environment, it would be more robust to check for that specific exit code rather than ignoring all errors. If it's expected to succeed,
|| trueshould be removed.For example, if a specific failure is expected:
This makes the test's intent clearer and more reliable.