Skip to content

docs(deploy): record as-deployed values + console gotchas from the live provisioning (HT-43) - #63

Merged
zaridan merged 2 commits into
mainfrom
docs/ht-43-runbook-as-deployed
Jul 17, 2026
Merged

docs(deploy): record as-deployed values + console gotchas from the live provisioning (HT-43)#63
zaridan merged 2 commits into
mainfrom
docs/ht-43-runbook-as-deployed

Conversation

@zaridan

@zaridan zaridan commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Updates specs/deploy/gmail-inbound-runbook.md header from "draft (HT-43)" to executed 2026-07-17, live-verified (HT-44 threading round-trip passed).
  • Adds an "As deployed (RIQ dogfood, 2026-07-17)" section with the concrete GCP project, Pub/Sub topic/subscription, push SA, Vercel project/domain, Supabase project, storage bucket, and mailbox values from the live provisioning session.
  • Adds a Part A gotchas subsection (A4) documenting the two real issues hit: domain-restricted sharing blocking the Gmail publisher grant (org policy override + propagation delay), and CLI-created push subscriptions not auto-granting the Pub/Sub service agent's token-creator role the way the console does.
  • Adds a one-line pointer distinguishing the helpthread-desk Workspace-org project from the unrelated personal gmail-mcp-personal GCP project (RIQAPP-1035).

All values added are non-secret by design — no client IDs, no keys, no tokens. Only project/resource identifiers already visible in GCP/Vercel/Supabase consoles.

Test plan

  • Docs-only change; no code/build affected.
  • Confirmed Biome has no markdown parser configured in this repo (biome.json has no markdown override; npx @biomejs/biome check on the file reports "No files were processed... ignored") — skipped per instructions.
  • Reviewed diff for tone/structure match with the rest of the runbook.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated the Gmail inbound deployment runbook to confirm successful live verification (threading round-trip passed).
    • Added an “As deployed” section with concrete, non-secret provisioning identifiers.
    • Expanded Google Cloud setup guidance with noted console/CLI pitfalls and remediation for common IAM and service-account permission failures.

…ve provisioning (HT-43)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: de1de6f0-7753-4606-87e8-0ac616df1423

📥 Commits

Reviewing files that changed from the base of the PR and between 9ed15be and a1a3afa.

📒 Files selected for processing (1)
  • specs/deploy/gmail-inbound-runbook.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • specs/deploy/gmail-inbound-runbook.md

📝 Walkthrough

Walkthrough

The Gmail inbound deployment runbook records HT-44 live verification, deployed non-secret infrastructure identifiers, and two provisioning gotchas involving IAM policy restrictions and Pub/Sub push authentication.

Changes

Gmail inbound deployment documentation

Layer / File(s) Summary
Live verification and provisioning notes
specs/deploy/gmail-inbound-runbook.md
Updates the runbook to live-verified status, adds deployed infrastructure identifiers, and documents Gmail publisher IAM and Pub/Sub service-account token-creation issues encountered during provisioning.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the documentation update with deployed values and provisioning gotchas from the live Gmail inbound runbook.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/ht-43-runbook-as-deployed

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

@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: 2

🧹 Nitpick comments (1)
specs/deploy/gmail-inbound-runbook.md (1)

133-140: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add the exact token-creator grant and verification command.

This step is operationally failure-prone because the role belongs on the OIDC service account and the member is the Pub/Sub service agent. Include the concrete gcloud iam service-accounts add-iam-policy-binding command plus a policy/readiness check to prevent silent push-delivery failures caused by targeting the wrong identity.

🤖 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 `@specs/deploy/gmail-inbound-runbook.md` around lines 133 - 140, Update the
CLI-created push subscription instructions in the Gmail inbound runbook to
include the exact gcloud iam service-accounts add-iam-policy-binding command,
targeting the OIDC service account with the Pub/Sub service agent as
roles/iam.serviceAccountTokenCreator. Add a concrete IAM policy or readiness
verification command that confirms this member-role binding exists on the OIDC
service account.
🤖 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 `@specs/deploy/gmail-inbound-runbook.md`:
- Around line 3-4: Update the runbook status in the opening execution note to
match the documented Gmail live-run outcome: remove the claim that the HT-44
threading round-trip passed and either reference a later verified successful
execution or describe the observed Message-ID rewrite and new-conversation
failure.
- Around line 126-132: Update the domain-restricted sharing workaround in the
Gmail publisher grant procedure to treat the project-scoped allow-all override
as temporary: apply it immediately before the grant, retry after propagation if
needed, then remove the override immediately after the grant and perform a final
policy check confirming the original restriction is restored.

---

Nitpick comments:
In `@specs/deploy/gmail-inbound-runbook.md`:
- Around line 133-140: Update the CLI-created push subscription instructions in
the Gmail inbound runbook to include the exact gcloud iam service-accounts
add-iam-policy-binding command, targeting the OIDC service account with the
Pub/Sub service agent as roles/iam.serviceAccountTokenCreator. Add a concrete
IAM policy or readiness verification command that confirms this member-role
binding exists on the OIDC service account.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: efc2da82-2a16-4fd6-9d14-59b0abc4d207

📥 Commits

Reviewing files that changed from the base of the PR and between 53a24ba and 9ed15be.

📒 Files selected for processing (1)
  • specs/deploy/gmail-inbound-runbook.md

Comment thread specs/deploy/gmail-inbound-runbook.md Outdated
Comment on lines +3 to +4
Status: executed 2026-07-17, live-verified (HT-44 threading round-trip
passed). The one-time operator steps to take the merged engine

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

Reconcile the “passed” status here. The July 17 live run documented elsewhere shows Gmail rewriting Message-ID and opening a new conversation on reply, so this runbook should either point to a later successful execution or describe the failure instead of stating that the threading round-trip passed.

🤖 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 `@specs/deploy/gmail-inbound-runbook.md` around lines 3 - 4, Update the runbook
status in the opening execution note to match the documented Gmail live-run
outcome: remove the claim that the HT-44 threading round-trip passed and either
reference a later verified successful execution or describe the observed
Message-ID rewrite and new-conversation failure.

Comment on lines +126 to +132
1. **Domain-restricted sharing blocks the Gmail publisher grant.** If the org
enforces `constraints/iam.allowedPolicyMemberDomains`, granting
`gmail-api-push@system.gserviceaccount.com` (A3.2) fails — that principal
isn't in the allowed domain. Fix: enable `orgpolicy.googleapis.com`, then
add a **project-scoped** override on the constraint (allow-all) for this
project only. The policy change propagates eventually (~90s observed) — the
grant may fail once right after the override and just needs a retry.

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 | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

sed -n '110,150p' specs/deploy/gmail-inbound-runbook.md

Repository: Helpthread/helpthread

Length of output: 2468


🏁 Script executed:

rg -n "allowedPolicyMemberDomains|allow-all|rollback|restore|revert|orgpolicy.googleapis.com|gmail-api-push@system.gserviceaccount.com" specs/deploy/gmail-inbound-runbook.md

Repository: Helpthread/helpthread

Length of output: 547


Make the allow-all override temporary and reversible. The project-scoped policy bypass should be applied only for the Gmail grant, then rolled back immediately after with a final policy check so the broader IAM window doesn’t linger.

🤖 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 `@specs/deploy/gmail-inbound-runbook.md` around lines 126 - 132, Update the
domain-restricted sharing workaround in the Gmail publisher grant procedure to
treat the project-scoped allow-all override as temporary: apply it immediately
before the grant, retry after propagation if needed, then remove the override
immediately after the grant and perform a final policy check confirming the
original restriction is restored.

…abbit)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@zaridan
zaridan merged commit efc015c into main Jul 17, 2026
5 checks passed
@zaridan
zaridan deleted the docs/ht-43-runbook-as-deployed branch August 2, 2026 19:19
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