Skip to content

feat(project): add dev status command#1062

Merged
Soner (shyim) merged 4 commits into
nextfrom
feat/project-dev-status
May 26, 2026
Merged

feat(project): add dev status command#1062
Soner (shyim) merged 4 commits into
nextfrom
feat/project-dev-status

Conversation

@shyim

Copy link
Copy Markdown
Member

What

Adds shopware-cli project dev status, a counterpart to dev start / dev stop that reports whether the development environment is running.

  • Prints a human-readable status line (✓ Development environment is up / ✗ Development environment is down).
  • Exits 0 when up and 1 when down, so it works in scripts, CI, and health checks.
  • For non-Docker environments (local / symfony-cli) it reports that there is no managed environment to check.

How

  • Adds EnvironmentStatus(ctx) (bool, error) to the Executor interface.
  • Docker reuses the existing docker compose ps --status=running -q check (same definition the dev TUI uses).
  • Local and symfony-cli executors return ErrNotSupported, mirroring their Start/StopEnvironment.
  • A sentinel ErrEnvironmentDown drives the exit-1-without-error-noise behavior in cmd/root.go; the command sets SilenceUsage so a status of "down" doesn't print usage.

Test plan

  • go test ./...
  • Added unit tests asserting local and symfony-cli executors return ErrNotSupported from EnvironmentStatus.

Add `shopware-cli project dev status` reporting whether the development
environment is running. Prints a human-readable status and exits 0 when
up, 1 when down, so it can be used in scripts and health checks.

Adds EnvironmentStatus to the Executor interface; Docker reuses the
`docker compose ps --status=running` check, while local and symfony-cli
executors report it as unsupported.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1f6deb363

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread cmd/root.go Outdated
if cmd, _, findErr := rootCmd.Find(os.Args[1:]); findErr == nil && cmd != rootCmd && cmd.RunE != nil {
result := "success"
if err != nil {
if err != nil && !errors.Is(err, project.ErrEnvironmentDown) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Record down status as non-success in telemetry

The new err != nil && !errors.Is(err, project.ErrEnvironmentDown) condition leaves result as success when project dev status detects a down environment, even though the same error is handled a few lines later by exiting with status code 1. This causes status-check failures to be tracked as successes, which will skew command result analytics and any experiment/reporting that relies on the result tag.

Useful? React with 👍 / 👎.

A down environment exits with code 1, so tracking it as a successful
command result was inconsistent and skewed analytics. Let it fall through
to the failure bucket; the clean exit-without-error-log behavior is still
handled separately via the ErrEnvironmentDown exit check.
golangci-lint (gocritic exitAfterDefer) flagged os.Exit running while
deferred cleanup was still pending. Extract the body into run() which
returns an exit code, so its defers run before Execute calls os.Exit.
@shyim Soner (shyim) merged commit c33c740 into next May 26, 2026
2 checks passed
@shyim Soner (shyim) deleted the feat/project-dev-status branch May 26, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant