Skip to content

chole(deploy): publish verified MCP deployment state - #35

Draft
borgesius wants to merge 3 commits into
mainfrom
codex/publish-deployment-state
Draft

chole(deploy): publish verified MCP deployment state#35
borgesius wants to merge 3 commits into
mainfrom
codex/publish-deployment-state

Conversation

@borgesius

@borgesius borgesius commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What this changes

The hosted MCP deployment records an immutable source revision, built container image digest, running ECS image verification, and deployment evidence through the shared deployment-result contract.

A successful manual deployment publishes the verified service and environment baseline. Automatic deployments retain their evidence but do not seed or move that baseline. This change does not activate automatic deployment rejection behavior.

Validation

Current head b211a21 is based on current main.

  • lint and TypeScript typecheck: passed
  • unit tests: 184 passed
  • production build: passed
  • GitHub Actions validation: passed
  • hosted verification: passed
  • no deployment or infrastructure mutation was performed

Greptile Summary

The PR extends the hosted MCP deployment workflow to validate deployment metadata, resolve immutable image identity, verify the running ECS tasks, record deployment evidence, and publish manual deployment state.

  • Maps public deployment environments to canonical staging and production names.
  • Captures the built ECR digest and verifies running ECS container digests.
  • Uploads a shared deployment-result artifact and publishes the manual deployment baseline.
  • Adds workflow-content tests for the verification and publication steps.

Confidence Score: 4/5

The PR appears safe to merge after considering one non-blocking supply-chain hardening issue: the privileged deployment-state action should be pinned to an immutable commit.

The deployment flow has no established blocking defect, but resolving the publisher from main allows its executable code to change independently while retaining repository-write and AWS OIDC access.

Files Needing Attention: .github/workflows/deploy.yml

Security Review

The deployment-state publisher uses a mutable branch reference in a job holding repository-write and AWS OIDC permissions. Pinning the action to a reviewed commit would keep the privileged dependency immutable.

Reviews (1): Last reviewed commit: "chole(deploy): follow merged Switchboard..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The deployment workflow now normalizes deployment inputs and exposes them as job outputs. It records the pushed image digest and verifies running ECS tasks against the expected repository and digest. It creates and uploads structured deployment evidence. Manual promotions publish the verified deployment state through the Switchboard action. Tests cover canonical environments, digest verification, mismatch handling, evidence publication, and promotion behavior.

Suggested reviewers: callumreid

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes publishing verified MCP deployment state, which is the main change.
Description check ✅ Passed The description directly explains the deployment evidence, baseline publishing behavior, validation, and scope of the changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@borgesius
borgesius marked this pull request as ready for review August 7, 2026 18:10
@borgesius
borgesius marked this pull request as draft August 7, 2026 18:11

- name: Publish manually selected deployment state
if: needs.validate.outputs.promotion_origin == 'manual'
uses: coval-ai/ci-cd-switchboard/.github/actions/switchboard-publish-deployment-state@main

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 security Mutable privileged deployment action

The deployment-state publisher now resolves from main, allowing its executable code to change independently while retaining repository-write and AWS OIDC access. Pinning the previously reviewed commit keeps this privileged dependency immutable.

How this was verified: The action executes in the deploy job granted contents: write and id-token: write and receives ${{ github.token }}.

Suggested change
uses: coval-ai/ci-cd-switchboard/.github/actions/switchboard-publish-deployment-state@main
uses: coval-ai/ci-cd-switchboard/.github/actions/switchboard-publish-deployment-state@a973276e4639129a06cef4cf92409d4aa8e1e305

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/deploy.yml:
- Around line 63-70: Update the promotion_origin handling in
.github/workflows/deploy.yml lines 63-70 so an omitted value defaults to
automatic, or otherwise requires an explicit manual value; do not allow omission
to publish deployment baseline state as manual. Add a deterministic regression
assertion in tests/unit/deploy-workflow.test.ts lines 52-60 covering the
omitted-origin path and its expected automatic behavior.
- Around line 266-274: Update the manual “Publish manually selected deployment
state” step to reference a full reviewed commit SHA for
switchboard-publish-deployment-state instead of the mutable `@main` ref. Preserve
the existing inputs and permissions.
- Around line 55-62: Update the deployment workflow’s mode handling around
deploy_mode so plan mode skips image build/push, ECS service rollout, and any
other mutating deployment steps. Ensure plan records a non-mutating result with
deployment_performed set to false, while safe and deploy_only retain their
existing deployment behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cd3890f9-b45f-4c24-b809-b119858a3414

📥 Commits

Reviewing files that changed from the base of the PR and between 2b166a9 and b211a21.

📒 Files selected for processing (2)
  • .github/workflows/deploy.yml
  • tests/unit/deploy-workflow.test.ts

Comment on lines +55 to +62
deploy_mode="${DEPLOY_MODE:-safe}"
case "$deploy_mode" in
safe|plan|deploy_only) ;;
*)
echo "::error::Unsupported deployment mode."
exit 1
;;
esac

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 4 'deploy_only|DEPLOY_MODE|deploy_mode|mode:.*plan|plan.*mode' \
  .github tests README.md 2>/dev/null || true

Repository: coval-ai/mcp-server

Length of output: 4004


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '--- deploy.yml outline/section ---\n'
wc -l .github/workflows/deploy.yml
sed -n '1,120p' .github/workflows/deploy.yml
printf '\n--- mutating steps region ---\n'
sed -n '200,280p' .github/workflows/deploy.yml
printf '\n--- deployment_performed references ---\n'
rg -n -C 3 'deployment_performed|deploy_only|DEPLOY_MODE|DEPLOY_ACTION|deploy_action|appspec|elastic-beanstalk|aws ecs|aws deploy|aws appconfig|rollback|rollback-target|rollback-mode|rollback-mode' .github tests README.md 2>/dev/null || true

Repository: coval-ai/mcp-server

Length of output: 248


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '--- file diff stat/name status (if available) ---\n'
git diff --stat -- .github/workflows/deploy.yml 2>/dev/null || true
printf '\n--- deploy.yml only diff line numbers and context? (avoid full diff size) ---\n'
git diff --unified=0 -- .github/workflows/deploy.yml 2>/dev/null | sed -n '1,240p' || true

Repository: coval-ai/mcp-server

Length of output: 248


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- deploy.yml full ---'
wc -l .github/workflows/deploy.yml 2>/dev/null || true
cat -n .github/workflows/deploy.yml 2>/dev/null || true

printf '%s\n' '\n--- deployment_performed references ---'
rg -n -C 3 'deployment_performed|deploy_only|DEPLOY_MODE|DEPLOY_ACTION|deploy_action|rollback' .github tests README.md 2>/dev/null || true

printf '%s\n' '\n--- workflow usage/diff status ---'
git diff --stat -- .github/workflows/deploy.yml 2>/dev/null || true
git diff --unified=0 -- .github/workflows/deploy.yml 2>/dev/null | sed -n '1,240p' || true

Repository: coval-ai/mcp-server

Length of output: 20218


Skip mutating deployment steps for plan mode.

DEPLOY_MODE currently accepts plan, but the workflow still builds, pushes, rolls the ECS service, and records deployment_performed: true. Guard the image and service steps so mode=plan only records a non-mutating result.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy.yml around lines 55 - 62, Update the deployment
workflow’s mode handling around deploy_mode so plan mode skips image build/push,
ECS service rollout, and any other mutating deployment steps. Ensure plan
records a non-mutating result with deployment_performed set to false, while safe
and deploy_only retain their existing deployment behavior.

Comment on lines +63 to +70
promotion_origin="${PROMOTION_ORIGIN:-manual}"
case "$promotion_origin" in
automatic|manual) ;;
*)
echo "::error::Unsupported promotion origin."
exit 1
;;
esac

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not treat an omitted promotion origin as manual.

An omitted promotion_origin becomes manual and can publish deployment baseline state without an explicit manual promotion.

  • .github/workflows/deploy.yml#L63-L70: require an explicit manual value, or default omitted values to automatic.
  • tests/unit/deploy-workflow.test.ts#L52-L60: add a deterministic regression assertion for the omitted-origin path.

As per coding guidelines, “Add focused regression coverage for behavior changes, including failure paths at trust boundaries.”

📍 Affects 2 files
  • .github/workflows/deploy.yml#L63-L70 (this comment)
  • tests/unit/deploy-workflow.test.ts#L52-L60
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy.yml around lines 63 - 70, Update the
promotion_origin handling in .github/workflows/deploy.yml lines 63-70 so an
omitted value defaults to automatic, or otherwise requires an explicit manual
value; do not allow omission to publish deployment baseline state as manual. Add
a deterministic regression assertion in tests/unit/deploy-workflow.test.ts lines
52-60 covering the omitted-origin path and its expected automatic behavior.

Source: Coding guidelines

Comment on lines +266 to +274
- name: Publish manually selected deployment state
if: needs.validate.outputs.promotion_origin == 'manual'
uses: coval-ai/ci-cd-switchboard/.github/actions/switchboard-publish-deployment-state@main
with:
environment: ${{ needs.validate.outputs.canonical_environment }}
repository: coval-ai/mcp-server
result-path: ${{ runner.temp }}/switchboard-deploy-result.json
service: mcp_server.remote
token: ${{ github.token }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

git ls-remote https://github.com/coval-ai/ci-cd-switchboard.git refs/heads/main

Repository: coval-ai/mcp-server

Length of output: 272


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "workflow excerpt:"
sed -n '240,285p' .github/workflows/deploy.yml

echo
echo "all coval-ai ci-cd-switchboard references:"
rg -n "coval-ai/ci-cd-switchboard|switchboard-publish-deployment-state" .github . || true

Repository: coval-ai/mcp-server

Length of output: 2327


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "permissions and deploy job outline:"
rg -n -A 3 -B 3 "permissions:|contents: write|id-token: write|switchboard-publish-deployment-state" .github/workflows/deploy.yml .github/workflows || true

echo
echo "deploy workflow permission/action context:"
sed -n '1,120p' .github/workflows/deploy.yml

Repository: coval-ai/mcp-server

Length of output: 7956


Pin the deployment-state publishing action to a reviewed commit SHA.

The manual publish step calls coval-ai/ci-cd-switchboard/.github/actions/switchboard-publish-deployment-state@main and passes github.token, while the deploy job grants contents: write and id-token: write. Use a full reviewed commit SHA instead of mutable @main.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy.yml around lines 266 - 274, Update the manual
“Publish manually selected deployment state” step to reference a full reviewed
commit SHA for switchboard-publish-deployment-state instead of the mutable `@main`
ref. Preserve the existing inputs and permissions.

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