feat(server): implement serve CLI subcommand and align Dockerfile entrypoint #1272

Merged
freemo merged 1 commit from feat/server-serve-entrypoint into master 2026-04-02 16:59:15 +00:00
Owner

Summary

The cleveragents server serve CLI subcommand already exists in server.py and Dockerfile.server already uses python -m cleveragents as its ENTRYPOINT with server serve as the CMD. This PR adds the missing BDD test coverage to formally verify the entrypoint alignment.

Changes

  • features/k8s_helm_chart.feature: Added two new scenarios:

    • Server Dockerfile uses python -m cleveragents as ENTRYPOINT — verifies the ENTRYPOINT instruction uses the spec-mandated python -m cleveragents form
    • Server Dockerfile CMD uses server serve subcommand — verifies the CMD includes the server and serve tokens
  • features/steps/k8s_helm_chart_steps.py: Added two new step definitions:

    • the ENTRYPOINT should use "{entrypoint}" — parses the ENTRYPOINT line and checks each token
    • the CMD should include "{cmd_a}" and "{cmd_b}" — parses the CMD line and checks both tokens

Verification

The server serve command is fully implemented in src/cleveragents/cli/commands/server.py and is registered under the server Typer sub-app. The Dockerfile already uses:

ENTRYPOINT ["python", "-m", "cleveragents"]
CMD ["server", "serve", "--app", "cleveragents.a2a.asgi:app", "--host", "0.0.0.0", "--port", "8000"]

The k8s deployment.yaml already uses command: ["python", "-m", "cleveragents"] with args: ["server", "serve", ...].

Closes #1088

## Summary The `cleveragents server serve` CLI subcommand already exists in `server.py` and `Dockerfile.server` already uses `python -m cleveragents` as its ENTRYPOINT with `server serve` as the CMD. This PR adds the missing BDD test coverage to formally verify the entrypoint alignment. ## Changes - **`features/k8s_helm_chart.feature`**: Added two new scenarios: - `Server Dockerfile uses python -m cleveragents as ENTRYPOINT` — verifies the ENTRYPOINT instruction uses the spec-mandated `python -m cleveragents` form - `Server Dockerfile CMD uses server serve subcommand` — verifies the CMD includes the `server` and `serve` tokens - **`features/steps/k8s_helm_chart_steps.py`**: Added two new step definitions: - `the ENTRYPOINT should use "{entrypoint}"` — parses the ENTRYPOINT line and checks each token - `the CMD should include "{cmd_a}" and "{cmd_b}"` — parses the CMD line and checks both tokens ## Verification The `server serve` command is fully implemented in `src/cleveragents/cli/commands/server.py` and is registered under the `server` Typer sub-app. The Dockerfile already uses: ``` ENTRYPOINT ["python", "-m", "cleveragents"] CMD ["server", "serve", "--app", "cleveragents.a2a.asgi:app", "--host", "0.0.0.0", "--port", "8000"] ``` The k8s `deployment.yaml` already uses `command: ["python", "-m", "cleveragents"]` with `args: ["server", "serve", ...]`. Closes #1088
feat(server): implement serve CLI subcommand and align Dockerfile entrypoint
Some checks failed
CI / quality (pull_request) Failing after 2s
CI / unit_tests (pull_request) Failing after 1s
CI / integration_tests (pull_request) Failing after 1s
CI / e2e_tests (pull_request) Failing after 1s
CI / build (pull_request) Failing after 2s
CI / helm (pull_request) Failing after 1s
CI / lint (pull_request) Successful in 33s
CI / typecheck (pull_request) Successful in 52s
CI / security (pull_request) Successful in 53s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 13m13s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 55m9s
e28b7e89eb
The `cleveragents server serve` CLI subcommand already exists in
server.py and Dockerfile.server already uses `python -m cleveragents`
as its ENTRYPOINT with `server serve` as the CMD.

Add BDD scenarios to k8s_helm_chart.feature that explicitly verify:
- Dockerfile.server ENTRYPOINT uses `python -m cleveragents`
- Dockerfile.server CMD includes the `server serve` subcommand tokens

Add corresponding step definitions to k8s_helm_chart_steps.py.

Closes #1088
Author
Owner

🔒 Claimed by pr-reviewer-5. Starting independent code review.

🔒 Claimed by pr-reviewer-5. Starting independent code review.
Author
Owner

Review claimed by reviewer pool instance reviewer-pool-1. Dispatching independent code review.

Review claimed by reviewer pool instance reviewer-pool-1. Dispatching independent code review.
freemo left a comment

Independent Code Review — PR #1272

Summary

This PR adds BDD test coverage for the Dockerfile.server entrypoint alignment with the specification. The cleveragents server serve CLI subcommand already exists in server.py, and the Dockerfile already uses python -m cleveragents as ENTRYPOINT with server serve as CMD. This PR formalizes that contract with two new Behave scenarios.

Files Reviewed

  • features/k8s_helm_chart.feature — 2 new scenarios added
  • features/steps/k8s_helm_chart_steps.py — 2 new step definitions added
  • Dockerfile.server — verified ENTRYPOINT/CMD alignment (unchanged by this PR)
  • src/cleveragents/cli/commands/server.py — verified serve subcommand exists

Review Criteria

Specification Alignment

  • The spec mandates python -m cleveragents as the server entrypoint. The Dockerfile uses exactly this form. The new tests verify this contract.

API Consistency

  • New step definitions follow the same patterns as existing steps in the file (regex-based Dockerfile parsing, assertion messages with context).

Test Quality

  • Scenarios test meaningful behavior: verifying the Dockerfile entrypoint matches the spec-mandated form.
  • The ENTRYPOINT test uses token-based verification, flexible enough to handle JSON array formatting variations.
  • Both steps provide clear, descriptive assertion messages on failure.

Correctness

  • Regex patterns correctly match exec-form ENTRYPOINT/CMD instructions.
  • Token-based checking correctly verifies all expected tokens appear.
  • Both step definitions properly use context.dockerfile_content from the existing step.

Type Safety

  • All functions have proper return type annotations and typed parameters.
  • Regex patterns typed as re.Pattern[str].

Code Quality

  • Clean, readable code with docstrings. No unnecessary complexity.

Security

  • No secrets or credentials. Test-only changes.

Minor Notes (non-blocking)

  • Commit uses Closes #1088 instead of ISSUES CLOSED: #1088 format — functionally equivalent.
  • PR missing Type/Task label and v3.6.0 milestone — adding administratively.

Verdict: APPROVED

Clean, well-typed BDD test additions that verify the Dockerfile entrypoint alignment with the specification.

## Independent Code Review — PR #1272 ### Summary This PR adds BDD test coverage for the `Dockerfile.server` entrypoint alignment with the specification. The `cleveragents server serve` CLI subcommand already exists in `server.py`, and the Dockerfile already uses `python -m cleveragents` as ENTRYPOINT with `server serve` as CMD. This PR formalizes that contract with two new Behave scenarios. ### Files Reviewed - `features/k8s_helm_chart.feature` — 2 new scenarios added - `features/steps/k8s_helm_chart_steps.py` — 2 new step definitions added - `Dockerfile.server` — verified ENTRYPOINT/CMD alignment (unchanged by this PR) - `src/cleveragents/cli/commands/server.py` — verified `serve` subcommand exists ### Review Criteria **✅ Specification Alignment** - The spec mandates `python -m cleveragents` as the server entrypoint. The Dockerfile uses exactly this form. The new tests verify this contract. **✅ API Consistency** - New step definitions follow the same patterns as existing steps in the file (regex-based Dockerfile parsing, assertion messages with context). **✅ Test Quality** - Scenarios test meaningful behavior: verifying the Dockerfile entrypoint matches the spec-mandated form. - The ENTRYPOINT test uses token-based verification, flexible enough to handle JSON array formatting variations. - Both steps provide clear, descriptive assertion messages on failure. **✅ Correctness** - Regex patterns correctly match exec-form ENTRYPOINT/CMD instructions. - Token-based checking correctly verifies all expected tokens appear. - Both step definitions properly use `context.dockerfile_content` from the existing step. **✅ Type Safety** - All functions have proper return type annotations and typed parameters. - Regex patterns typed as `re.Pattern[str]`. **✅ Code Quality** - Clean, readable code with docstrings. No unnecessary complexity. **✅ Security** - No secrets or credentials. Test-only changes. ### Minor Notes (non-blocking) - Commit uses `Closes #1088` instead of `ISSUES CLOSED: #1088` format — functionally equivalent. - PR missing `Type/Task` label and `v3.6.0` milestone — adding administratively. ### Verdict: **APPROVED** ✅ Clean, well-typed BDD test additions that verify the Dockerfile entrypoint alignment with the specification.
freemo added this to the v3.6.0 milestone 2026-04-02 16:59:03 +00:00
freemo merged commit e5398e3cc7 into master 2026-04-02 16:59:15 +00:00
freemo deleted branch feat/server-serve-entrypoint 2026-04-02 16:59:17 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core!1272
No description provided.