Skip to content

feat(deploy): add optional post-deploy verification hook#36

Merged
Abdulmuiz44 merged 1 commit into
feat/codra-deploy-verify-agent-browserfrom
feat/codra-deploy-post-verify-hook
Jun 10, 2026
Merged

feat(deploy): add optional post-deploy verification hook#36
Abdulmuiz44 merged 1 commit into
feat/codra-deploy-verify-agent-browserfrom
feat/codra-deploy-post-verify-hook

Conversation

@Abdulmuiz44

Copy link
Copy Markdown
Collaborator

Summary

Adds optional post-deploy Agent Browser verification to Codra Deploy. Verification is never automatic — it runs only when --verify is passed and service.verify.enabled is true.

Depends on: #35 (codra deploy verify)

Config

Optional per-service verify block in codra.deploy.json:

"verify": {
  "enabled": true,
  "url": "https://example.com",
  "vision": false,
  "allowWarnings": false,
  "screenshotOut": "agent-browser-screenshot.png"
}

CLI

codra deploy up --verify
codra deploy up --verify --service web
  • codra deploy plan shows verification settings when present
  • Missing verify.url prints warning and skips (no URL guessing)
  • Verification failure returns non-zero from deploy up
  • allowWarnings from config is respected

Testing

  • cargo test -p codra-deploy -p codra-cli — all pass
  • cargo build -p codra-cli — success
  • Agent Browser mocked in tests (no real browser in CI)

Add optional service.verify config, show settings in deploy plan,
and run Agent Browser verification from deploy up only when --verify
is passed.

@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: 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".

Comment on lines +106 to +111

deploy_result?;
if parsed.verify {
run_post_deploy_verification(
&config,
parsed.service.as_deref(),

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 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 👍 / 👎.

Comment on lines +108 to +114
if parsed.verify {
run_post_deploy_verification(
&config,
parsed.service.as_deref(),
parsed.json,
verify_executor,
)?;

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 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);

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 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 👍 / 👎.

@Abdulmuiz44 Abdulmuiz44 merged commit bc78fe1 into feat/codra-deploy-verify-agent-browser Jun 10, 2026
1 check passed
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