Skip to content

chore(helm): load the hosted-MCP allowlist from a runner-only overlay - #2950

Merged
lilyshen0722 merged 2 commits into
mainfrom
chore/instance-values-overlay
Oct 31, 2026
Merged

lilyshen0722 merged 2 commits into
mainfrom
chore/instance-values-overlay

Conversation

@lilyshen0722

@lilyshen0722 lilyshen0722 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Hold: press after launch. The DEV_HELM_HIDDENMCP_ALLOWLIST secret is set with all six entries (2026-10-28). Before this merges it does nothing, since nothing reads it yet.

Deploy Dev writes hostedMcp.hiddenEntryUserAllowlist from that secret to a runner-only overlay, which loads after the private values in both the gateway check and the upgrade. The value leaves values-dev.yaml. When the secret is unset, the overlay is empty and the chart default applies.

Checked with helm template: an empty overlay renders {}, and an overlay with entries renders them into HOSTED_MCP_HIDDEN_ENTRY_USER_ALLOWLIST.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MDs9DRK3nqxjeAV7xL8uhg

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 45aafe8 and 47f9892.

Files selected for processing: 1
  • k8s/helm/commonly/values-dev.yaml
Files with no reviewable changes: 1
  • k8s/helm/commonly/values-dev.yaml

Limit details: You’ve used all 10 included reviews currently available.

Walkthrough

Deploy Dev now loads the hosted-MCP allowlist from a runner-only values overlay. The development values file no longer contains the Atlassian, Sentry, and Airtable user-ID lists. The workflow applies the overlay to its gateway template check and Helm upgrade.

Changes: Hosted-MCP allowlist deployment

Layer / File(s) Summary
Move allowlist to runner overlay
.github/workflows/deploy-dev.yml, k8s/helm/commonly/values-dev.yaml
The workflow creates allowlist.yaml from DEV_HELM_HIDDENMCP_ALLOWLIST. When the secret is unset, the chart default ({}) applies. The development values file no longer contains the Atlassian, Sentry, and Airtable user-ID lists.
Apply overlay to gateway deployment
.github/workflows/deploy-dev.yml
The workflow includes the overlay in the Helm values used to check whether the gateway template renders and in the Helm upgrade.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related issues

  • Team-Commonly/commonly#2168: The issue concerns access gates for hidden hosted-MCP entries. This change supplies the allowlist used by that gate through the deployment workflow.

Possibly related PRs

Merge Risk: Minimal · up to 47f98

No actionable code issue is established. Confirm that the deployment secret includes Atlassian, Sentry, and Airtable before lifting the stated launch hold.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: loading the hosted-MCP allowlist from a runner-only overlay.
Description check Passed The description directly explains the workflow overlay, secret source, Helm behavior, and deployment hold status.
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 unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

# Conflicts:
#	k8s/helm/commonly/values-dev.yaml
@lilyshen0722

Copy link
Copy Markdown
Contributor Author

Merged main in (new head 47f9892). Main had added an airtable entry to the allowlist in values-dev.yaml. This PR removes the whole block, so before this merges, the DEV_HELM_HIDDENMCP_ALLOWLIST secret must carry atlassian, sentry and airtable, or the airtable walk loses its allowlist on the next deploy. It stays on its hold.

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Gate on 47f9892 (hosted-MCP allowlist moved to a runner-only overlay). Two files: .github/workflows/deploy-dev.yml and k8s/helm/commonly/values-dev.yaml.

Checked by rendering the backend deployment with helm template against values.yaml + values-dev.yaml + each overlay:

  1. Unset secret. The overlay is one newline, which parses as YAML null. The render exits 0 and HOSTED_MCP_HIDDEN_ENTRY_USER_ALLOWLIST is "{}". The chart default applies.

  2. Failure modes. Split by kind:

    • Malformed YAML and a bare scalar (6a47...): helm template exits 1 with a parse error. The gateway check step runs the same render, and any error other than "could not find template" exits 1 before build or upgrade. So a broken secret fails Deploy Dev loudly, before any change.
    • Wrong nesting (top-level hiddenEntryUserAllowlist:, not under hostedMcp:): the render exits 0 and the env is "{}". This is a silent no-op. Nothing in the chart or the workflow catches it.
    • Mistyped entry ID, or a user ID that is not lowercase 24-hex: the render passes. visibility.ts then returns {} for the whole map (any invalid member, or a key not in hiddenEntries, drops every exception). No log line. The walker loses access with no error. The runbook documents this behaviour, but the deploy does not surface it.
      So the answer to your question: a wrongly keyed or mistyped secret is a silent no-op, and only YAML syntax errors fail the job.
  3. Order and merge. The overlay loads after values-private in the gateway check (line 189-190) and in the upgrade (297-298). A render with the overlay still emits HOSTED_MCP_HIDDEN_ENTRIES with all seven values-dev entries, so the overlay deep-merges under hostedMcp and does not replace the block.

  4. Staging. deploy-staging.yml loads values.yaml, values-staging.yaml and its private overlay. It never loads the allowlist overlay, and values-staging.yaml has no hiddenEntryUserAllowlist key. Staging still renders "{}".

  5. References. The only readers of the key are the two templates, which read .Values.hostedMcp.hiddenEntryUserAllowlist, and they now get it from the overlay. Nothing else reads the removed key from values-dev.yaml. docs/runbooks/hosted-mcp-hidden-entry-walks.md still shows the YAML example and says to put IDs in "operator-local deployment values". It doesn't name the DEV_HELM_HIDDENMCP_ALLOWLIST secret, so it now points at the wrong place.

Non-blocking:

  • Add a guard for the silent case. When the secret is set, fail if the rendered env is "{}". A one-line check after the gateway render would do. Until then, check the rendered env in the first Deploy Dev log after the secret is used.
  • Update the runbook to name the secret as the source of the map.

Written by Rhea, a Commonly agent — https://commonly.me/v2/pods/6a8f6dc7a1dccf2e02f31015

GATE: PASS

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Gate review at 47f9892 (Tier 2, deploy path).

I rendered the chart locally (helm v4.2.3; CI uses v3.14.0, and the two error strings the check step relies on are the same in both) with values.yaml + values-dev.yaml from this head, an empty stand-in for values-private.yaml, and one overlay variant per case below. I used a made-up 24-hex id. I did not read the secret.

(1) Secret unset. printf '%s\n' "" writes a single newline. Helm reads that as empty values, and the backend gets HOSTED_MCP_HIDDEN_ENTRY_USER_ALLOWLIST="{}", the chart default. hiddenEntries is unchanged, so all seven entries stay hidden. Verified.

(2) Malformed or wrongly keyed secret: it depends on the mistake. Some fail loudly at the check, others are a silent no-op.

Fails loudly. The gateway helm template check exits 1 before any build or helm upgrade:

  • invalid YAML (an unterminated list): failed to parse .../allowlist.yaml
  • a top-level list instead of a map: cannot unmarshal array into ... map
  • hostedMcp: with no body (null): the null deletes the whole hostedMcp block, and templates/secrets/api-keys.yaml:215 fails with a nil pointer on .Values.hostedMcp.googleCalendar.enabled. --show-only still renders every template, so this error reaches the check even though the check only shows the gateway Deployment.

None of these errors contains "could not find template", so none of them reads as "gateway disabled".

Silent no-op. Render succeeds, the deploy succeeds, and the walker loses access:

  • the right map under the wrong key (a top-level hiddenEntryUserAllowlist:, or a typo such as hostedMCP:): the chart has no values.schema.json, so unknown keys are dropped, and the env renders {}
  • a bare JSON map, {"atlassian":[...]}: valid YAML, but at the top level, so it is ignored the same way and renders {}
  • the right key with the wrong shape, e.g. atlassian: "notalist", or an id that is not 24-hex lowercase: helm renders it as-is. allowedHiddenEntryUsers in backend/integrations/hostedMcp/visibility.ts then rejects it and returns {} for every entry. The same happens for a key that names an entry not in hiddenEntries. One bad member voids the whole map.

In every silent case the failure is closed. Nobody gains access; the walk user loses it, and the first sign is the walk getting 404 unknown_entry. That was already true of the in-repo value. The difference is that a reviewer could read the in-repo value and nobody can read the secret.

(3) Order and merge. -f "$RUNNER_TEMP/allowlist.yaml" comes after values-private.yaml in both the check step and helm upgrade. The two use the same four files in the same order. With a correctly keyed overlay, the env renders exactly the overlay's map, and HOSTED_MCP_HIDDEN_ENTRIES keeps all seven entries from values-dev.yaml. So the overlay deep-merges under hostedMcp rather than replacing the block. ops-runner renders the same env (2 occurrences in the full render).

The secret now replaces the whole three-entry map that main's values-dev.yaml carries (atlassian, sentry, airtable, one id each). If the secret covers fewer entries, the others lose their exception, and nothing in the deploy output shows it.

(4) Staging untouched. deploy-staging.yml reads only values.yaml and its own STAGING_HELM_VALUES_PRIVATE overlay, with no values-dev.yaml and no allowlist. Verified.

(5) No other reader of the removed key. At this head, hiddenEntryUserAllowlist appears only in values.yaml:78 (the {} default), the two templates (backend-deployment.yaml:85, ops-runner-deployment.yaml:52), the runbook example, and the workflow comment. tests.yml renders values-dev.yaml three times, and none of its assertions touches this key. The runbook already says "set real IDs only in operator-local deployment values" and uses a placeholder id, so it is not stale. It could name the secret, but that is optional.

Nit, non-blocking: the comment above the check step still says "the same three values files the upgrade uses"; there are now four.

Named risk, non-blocking: a mis-keyed or misshaped secret is a silent no-op (2b). This PR has no guard that would catch it. Two ways to close it:

  • After the first Deploy Dev that carries this change, confirm that the backend Deployment's HOSTED_MCP_HIDDEN_ENTRY_USER_ALLOWLIST has the expected entry keys (atlassian, sentry, airtable) and is not {}. Check the key names only and don't print the ids.
  • Or add a step: when the secret is non-empty, render backend-deployment.yaml and fail if that env is {}. This catches the wrong-key cases. The bad-shape cases fail closed in the backend and would still be silent.

The change itself does what it says, it is ordered correctly in both helm calls, staging is untouched, and nothing else reads the removed key.

Written by Keel, a Commonly agent — https://commonly.me/v2/pods/6addc5e87f8fc798a6f2f5d2

GATE: PASS

@lilyshen0722
lilyshen0722 added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit bf30005 Oct 31, 2026
29 checks 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