feat(deploy): add optional post-deploy verification hook#36
Conversation
Add optional service.verify config, show settings in deploy plan, and run Agent Browser verification from deploy up only when --verify is passed.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85e34c7583
ℹ️ 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 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 address that feedback".
|
|
||
| deploy_result?; | ||
| if parsed.verify { | ||
| run_post_deploy_verification( | ||
| &config, | ||
| parsed.service.as_deref(), |
There was a problem hiding this comment.
Preserve single JSON output when verifying
When codra deploy up --json --verify is used, this passes parsed.json into post-deploy verification, so finish_up first prints the deploy JSON and then run_verify_with_executor prints another verification JSON object (or a warning line for a missing URL). That makes stdout invalid as a single machine-readable JSON document for any configured verify.enabled service, unlike the existing --json behavior that callers can parse directly.
Useful? React with 👍 / 👎.
| if parsed.verify { | ||
| run_post_deploy_verification( | ||
| &config, | ||
| parsed.service.as_deref(), | ||
| parsed.json, | ||
| verify_executor, | ||
| )?; |
There was a problem hiding this comment.
Validate verification URLs before executing
With --execute --verify, deploy_result? means Docker execution has already completed before configured verification URLs are safety-checked by run_verify_with_executor; for example, a service verify.url of http://localhost:3000 is rejected only after containers are started. Since validate_config does not preflight these URLs, configs that the verifier will reject still cause deployment side effects before returning an error, so the post-deploy URL validation should happen before LocalDockerRunner::execute in execute mode.
Useful? React with 👍 / 👎.
| json: bool, | ||
| executor: &dyn AgentBrowserExecutor, | ||
| ) -> Result<(), String> { | ||
| let services = matching_services(config, service_filter); |
There was a problem hiding this comment.
Limit post-deploy checks to deployed services
This selects services directly from the config, so codra deploy up --execute --verify will still run verification for configured static or cron services even though LocalDockerRunner::plan_runtime marks those service types as skipped with runtime execution for static/cron is not implemented yet. In a config containing a skipped service with verify.enabled, the hook can report success for a service that this command did not deploy; it should filter against the runtime plan's executable services instead.
Useful? React with 👍 / 👎.
bc78fe1
into
feat/codra-deploy-verify-agent-browser
Summary
Adds optional post-deploy Agent Browser verification to Codra Deploy. Verification is never automatic — it runs only when
--verifyis passed andservice.verify.enabledis true.Depends on: #35 (
codra deploy verify)Config
Optional per-service
verifyblock incodra.deploy.json:CLI
codra deploy planshows verification settings when presentverify.urlprints warning and skips (no URL guessing)deploy upallowWarningsfrom config is respectedTesting
cargo test -p codra-deploy -p codra-cli— all passcargo build -p codra-cli— success