Skip to content

fix(services): make agnostic — remove hardcoded paths [v0.3.0]#738

Merged
kokevidaurre merged 2 commits intodevelopfrom
fix/services-agnostic
Apr 14, 2026
Merged

fix(services): make agnostic — remove hardcoded paths [v0.3.0]#738
kokevidaurre merged 2 commits intodevelopfrom
fix/services-agnostic

Conversation

@kokevidaurre
Copy link
Copy Markdown
Contributor

Summary

Services command had hardcoded paths to our engineering repo and internal DB table names. Now fully agnostic.

Changes

  • Discovers docker-compose.yml from project root, ./docker/, ./infra/, or SQUADS_COMPOSE_FILE env var
  • Added --file flag for explicit path
  • Uses docker compose ps against user's compose file
  • Removed hardcoded port numbers, container names, DB introspection
  • Works for any user's Docker setup

Test plan

  • npm run build passes
  • Zero lint warnings
  • squads services status with Docker running
  • squads services status without Docker

Closes hardcoded paths issue found during v0.3.0 review.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the squads services command to enhance Docker Compose file discovery, supporting environment variables and project-root-based searching, while adding a --file option for manual overrides. The feedback highlights several areas for improvement: correcting the health check logic to ensure services are actually running rather than just not transitioning, validating the existence of user-provided file paths, ensuring consistent support for .yaml extensions in the infra directory, and maintaining feature parity for the --file option across all subcommands.

Comment thread src/commands/services.ts Outdated
Comment thread src/commands/services.ts
Comment thread src/commands/services.ts Outdated
Comment thread src/commands/services.ts Outdated
Comment thread src/commands/services.ts Outdated
Comment thread src/commands/services.ts Outdated
Comment thread src/commands/services.ts Outdated
@kokevidaurre
Copy link
Copy Markdown
Contributor Author

Closing — services command is Tier 2 tooling, not needed for v0.3.0. Will redesign if needed for v0.4.0.

…sumptions

Before: searched for docker-compose.yml in ~/agents-squads/engineering/docker/
and hardcoded squads-postgres container name, internal DB table names.

Now:
- Discovers docker-compose.yml from project root, ./docker/, ./infra/,
  SQUADS_COMPOSE_FILE env var, or --file flag
- Uses docker compose ps against user's compose file
- Removed hardcoded port output and DB introspection
- --file option on all 3 subcommands (up/down/status)
- Health check verifies containers are actually running
- Updated tests to match new agnostic implementation

Co-Authored-By: Claude <noreply@anthropic.com>
@kokevidaurre kokevidaurre force-pushed the fix/services-agnostic branch from dc356c5 to ec72900 Compare April 14, 2026 03:45
- Use SQUADS_COMPOSE_FILE env var instead of hardcoded engineering path
- Check --file option on all subcommands
- Fix health check mock to return 'running' state
- Updated status test for Docker not installed case

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added the tests label Apr 14, 2026
@kokevidaurre kokevidaurre merged commit aa09e59 into develop Apr 14, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant