Skip to content

fix: settle environment source of truth - #854

Merged
keito4 merged 3 commits into
mainfrom
fix/issue-819-env-decisions
Jun 18, 2026
Merged

fix: settle environment source of truth#854
keito4 merged 3 commits into
mainfrom
fix/issue-819-env-decisions

Conversation

@keito4

@keito4 keito4 commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Record ADR 0012 for DevContainer, package-manager, macOS/Linux tool, and MCP ownership decisions
  • Remove duplicate base-image tools from DevContainer Features and declare npm as the canonical package manager
  • Document Codex/Gemini MCP differences and align credential templates/docs with configured token env vars
  • Add a BATS guard that extracts MCP env references from committed settings and verifies template/docs coverage

Closes #819

Verification

  • npm run format:check
  • npm run lint
  • npm test
  • npm run test:integration
  • npm run shellcheck
  • git diff --check
  • node JSON parse for devcontainer, codespaces, Gemini, and package.json settings
  • npm ci --ignore-scripts --dry-run --no-audit (passed; local Node 24.4.0 is below repo engine and emitted EBADENGINE warnings)

Summary by CodeRabbit

  • New Features

    • Streamlined credential setup with automated environment configuration via script/credentials.sh fetch.
  • Documentation

    • Enhanced guides for credentials and environment variable management.
    • Clarified MCP server policies and differences between tool configurations.
    • Added decision documentation for environment configuration best practices.
  • Chores

    • Updated DevContainer configuration and removed redundant tool features.
    • Specified npm as the project package manager.
    • Added security vulnerability ignore entries.
    • Added automated validation tests for credential templates.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@keito4, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 59 minutes and 59 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4444e3a4-02ed-4a43-873b-5b1f6a4f5ab4

📥 Commits

Reviewing files that changed from the base of the PR and between 32aa5fe and b7db0ba.

📒 Files selected for processing (1)
  • package.json
📝 Walkthrough

Walkthrough

Establishes ADR 0012 as the environment ownership record for the repository. DevContainer feature lists are pruned to remove tools already present in the base image. npm is declared the canonical package manager while pnpm is retained solely for supply-chain guardrails. Intentional Codex/Gemini MCP server set differences are documented in config comments. Credential templates are updated to reflect the script/credentials.sh fetch expansion flow and validated by a new BATS test.

Changes

Environment Source of Truth Refactor

Layer / File(s) Summary
ADR 0012 and environment diff report
docs/adr/0012-environment-source-of-truth.md, docs/adr/README.md, .context/issue-819-environment-diff.md
ADR 0012 records ownership boundaries for DevContainer tools, Linux/macOS tooling, npm vs pnpm intent, and Codex vs Gemini MCP differences; the issue-819 diff report captures decision tables; the ADR index is updated.
DevContainer features cleanup and tool-catalog update
.devcontainer/devcontainer.json, .devcontainer/codespaces/devcontainer.json, docs/tool-catalog.md
Removes 1password, github-cli, git, and supabase-cli features from both devcontainer configs; switches VS Code npm.packageManager from pnpm to npm; updates tool-catalog with ADR 0012 source-of-truth note, revised Features table, Codespaces guidance, macOS tool boundary, and duplication policy.
npm canonical + pnpm supply-chain guardrails
package.json, pnpm-workspace.yaml
Declares npm@11.16.0 as packageManager in package.json; adds clarifying comments to pnpm-workspace.yaml and introduces minimumReleaseAge: 2880 to block packages published within 2 days.
Codex vs Gemini MCP server set differentiation
.codex/config.toml, .gemini/README.md
Adds a policy comment to .codex/config.toml explaining the wider Codex MCP set; adds .gemini/README.md documenting Gemini's restricted MCP policy, both referencing ADR 0012.
Credential templates update and BATS validation
credentials/templates/mcp.env.template, credentials/templates/devcontainer.env.template, credentials/README.md, credentials/setup.md, test/integration/credentials_templates.bats
Updates mcp.env.template with Codex/Gemini MCP env vars using op://Dev/... references; updates devcontainer.env.template header; revises credentials/README.md with MCP server table, vault structure, and debug commands; updates credentials/setup.md with per-service vault item examples; adds a BATS test verifying every configured MCP env var appears in both the template and README.

CI / Security: Trivy CVE Ignore List Update

Layer / File(s) Summary
Ubuntu 24.04 linux-libc-dev CVE suppressions
.trivyignore
Adds a new block of 11 linux-libc-dev kernel header CVE entries for the Ubuntu 24.04 base image with severity notes, tracking URLs, and a 2026-07-17 review date.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • keito4/config#116: Adds the initial Codex mirror config including MCP server definitions in .codex/config.toml, which this PR extends with the Codex vs Gemini scope comments.
  • keito4/config#482: Introduced docs/tool-catalog.md, which this PR directly updates to reflect ADR 0012 ownership rules and the removal of base-image duplicate Features entries.
  • keito4/config#774: Deleted script/setup-env.sh and script/setup-mcp.sh; this PR's new BATS test explicitly asserts the credential templates no longer reference those removed scripts.

Suggested labels

docs

🐇 A bunny hopped through config land,
Where each tool found its rightful hand.
npm leads, pnpm guards the gate,
Codex and Gemini — separate fate!
ADR 0012 seals the deal in sight,
No duplicate features, everything right. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: settle environment source of truth' directly reflects the main objective of the PR, which is establishing and documenting the source of truth for environment configuration decisions.
Description check ✅ Passed The PR description covers summary, why (Closes #819), what (list of changes), and verification steps, though it omits the formal template structure (checklist items are missing).
Linked Issues check ✅ Passed The PR successfully addresses all five sub-tasks from issue #819: ADR 0012 recorded [docs/adr/0012-environment-source-of-truth.md], DevContainer features cleaned [.devcontainer/], npm declared canonical [package.json], MCP differences documented [.codex/config.toml, .gemini/README.md], and BATS validation added [test/integration/credentials_templates.bats].
Out of Scope Changes check ✅ Passed All changes align with issue #819 scope: ADR documentation, DevContainer config, package manager setup, MCP alignment, credentials validation, and documentation updates. The .trivyignore CVE additions address DevContainer base image security, which is in scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-819-env-decisions

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 and usage tips.

@claude

claude Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keito4's task in 0s —— View job


I'll analyze this and get back to you.

@keito4 keito4 self-assigned this Jun 17, 2026

@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

🤖 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 `@credentials/README.md`:
- Around line 48-60: The table in the credentials README is missing entries for
two MCP servers that are configured in .codex/config.toml: aws-knowledge and
context7. Add two new rows to the table following the same structure as the
existing entries, with aws-knowledge and context7 as the MCPサーバー names, .codex
as the 設定ファイル value, no required environment variables (なし in the 必要な環境変数
column), and appropriate Japanese descriptions for each server's functionality
in the 説明 column.

In `@credentials/setup.md`:
- Around line 61-63: In the credentials/setup.md file, split the current
combined N8N configuration item into two separate items to match the
mcp.env.template expectations. Create one item for N8N_API_URL with its
description and configuration details, then create a second separate item for
N8N_API_KEY with its own description and configuration details. Each should be
independently documented as separate 1Password lookups rather than being grouped
together as a single combined item.
🪄 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

Run ID: 9287efb4-ef96-419d-ad12-c2c7b210254d

📥 Commits

Reviewing files that changed from the base of the PR and between 09d632d and 32aa5fe.

📒 Files selected for processing (16)
  • .codex/config.toml
  • .context/issue-819-environment-diff.md
  • .devcontainer/codespaces/devcontainer.json
  • .devcontainer/devcontainer.json
  • .gemini/README.md
  • .trivyignore
  • credentials/README.md
  • credentials/setup.md
  • credentials/templates/devcontainer.env.template
  • credentials/templates/mcp.env.template
  • docs/adr/0012-environment-source-of-truth.md
  • docs/adr/README.md
  • docs/tool-catalog.md
  • package.json
  • pnpm-workspace.yaml
  • test/integration/credentials_templates.bats

Comment thread credentials/README.md
Comment on lines +48 to +60
| MCPサーバー | 設定ファイル | 必要な環境変数 | 説明 |
| ------------------- | ------------------- | --------------------------------------------- | ------------------------- |
| **Playwright** | `.codex`, `.gemini` | なし | ブラウザ自動化とテスト |
| **AWS Docs** | `.codex`, `.gemini` | なし | AWS ドキュメント検索 |
| **Chrome DevTools** | `.codex`, `.gemini` | なし | ブラウザデバッグ |
| **Next DevTools** | `.codex`, `.gemini` | なし | Next.js 開発支援 |
| **Supabase** | `.codex`, `.gemini` | `SUPABASE_ACCESS_TOKEN`, `SUPABASE_MCP_TOKEN` | Supabase プロジェクト操作 |
| **Vercel** | `.codex`, `.gemini` | `VERCEL_TOKEN`, `VERCEL_MCP_TOKEN` | Vercel 操作 |
| **GitHub** | `.gemini` | `GITHUB_COPILOT_MCP_TOKEN` | Gemini の GitHub MCP 接続 |
| **o3** | `.codex` | `OPENAI_API_KEY` | Web/検索支援 |
| **Linear** | `.codex` | `LINEAR_API_KEY` | Linear 課題操作 |
| **Doppler** | `.codex` | `DOPPLER_TOKEN` | Secret 管理 |
| **n8n** | optional/manual | `N8N_API_URL`, `N8N_API_KEY` | n8n ワークフロー自動化 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add the missing Codex-only MCP servers.

aws-knowledge and context7 are still configured in .codex/config.toml, but this table never mentions them. Please add rows for both (they need no extra env vars) or explicitly say the table is env-backed only; otherwise the new MCP inventory is incomplete.

🛠 Suggested rows
+| **AWS Knowledge** | `.codex` | なし | AWS Knowledge lookup |
+| **Context7**       | `.codex` | なし | Context7 docs lookup |
🤖 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 `@credentials/README.md` around lines 48 - 60, The table in the credentials
README is missing entries for two MCP servers that are configured in
.codex/config.toml: aws-knowledge and context7. Add two new rows to the table
following the same structure as the existing entries, with aws-knowledge and
context7 as the MCPサーバー names, .codex as the 設定ファイル value, no required
environment variables (なし in the 必要な環境変数 column), and appropriate Japanese
descriptions for each server's functionality in the 説明 column.

Comment thread credentials/setup.md
Comment on lines +61 to +63
- アイテム名: `N8N_API_URL`, `N8N_API_KEY`
- フィールド:
- `value`: optional n8n MCP 用

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Split the N8N setup example into two items.

credentials/templates/mcp.env.template expects separate 1Password lookups for N8N_API_URL and N8N_API_KEY, but this section reads like a single combined item. Split them so the setup guide matches the template contract.

🛠 Suggested fix
-- アイテム名: `N8N_API_URL`, `N8N_API_KEY`
-- フィールド:
--   - `value`: optional n8n MCP 用
+- アイテム名: `N8N_API_URL`
+- フィールド:
+-   - `value`: n8n MCP 用
+
+- アイテム名: `N8N_API_KEY`
+- フィールド:
+-   - `value`: n8n MCP 用
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- アイテム名: `N8N_API_URL`, `N8N_API_KEY`
- フィールド:
- `value`: optional n8n MCP 用
- アイテム名: `N8N_API_URL`
- フィールド:
- `value`: n8n MCP 用
- アイテム名: `N8N_API_KEY`
- フィールド:
- `value`: n8n MCP 用
🤖 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 `@credentials/setup.md` around lines 61 - 63, In the credentials/setup.md file,
split the current combined N8N configuration item into two separate items to
match the mcp.env.template expectations. Create one item for N8N_API_URL with
its description and configuration details, then create a second separate item
for N8N_API_KEY with its own description and configuration details. Each should
be independently documented as separate 1Password lookups rather than being
grouped together as a single combined item.

@keito4
keito4 merged commit 8ec3c36 into main Jun 18, 2026
19 checks passed
@keito4
keito4 deleted the fix/issue-819-env-decisions branch June 18, 2026 05:48
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.118.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released リリース済み

Projects

None yet

Development

Successfully merging this pull request may close these issues.

リファクタリング フェーズ7: 環境設定の整理(要・意思決定)

1 participant