Skip to content

chore: 不要なコードを削除 (#773) - #774

Merged
keito4 merged 3 commits into
mainfrom
claude/issue-773-20260528-0301
May 28, 2026
Merged

chore: 不要なコードを削除 (#773)#774
keito4 merged 3 commits into
mainfrom
claude/issue-773-20260528-0301

Conversation

@keito4

@keito4 keito4 commented May 28, 2026

Copy link
Copy Markdown
Owner

Closes #773

変更内容

  • script/lib/output.sh: errors:: 名前空間エイリアス7関数を削除(errors.sh から移行時の後方互換レイヤー、使用箇所ゼロ)
  • script/lib/agents-md-data.sh: 存在しないディレクトリの PURPOSE エントリを2件削除

Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Updated setup, DevContainer, and troubleshooting docs to document a new credential workflow and manual install step.
  • Chores

    • Removed deprecated automated setup scripts and streamlined credential management flow.
    • Removed obsolete compatibility helpers and directory-purpose mappings.
  • Tests

    • Removed integration tests that asserted the old setup scripts and compatibility aliases.

Review Change Stack

github-actions Bot and others added 2 commits May 28, 2026 03:09
- script/lib/output.sh: errors.sh から移行した errors:: 名前空間エイリアスを削除
  リポジトリ全体で使用箇所ゼロの完全デッドコードだった
- script/lib/agents-md-data.sh: 存在しないディレクトリの PURPOSE エントリを削除
  - DOT_DIR_PURPOSE[.agents]: .agents/ ディレクトリが存在しない
  - REG_DIR_PURPOSE[next]: next/ ディレクトリが存在しない

Co-authored-by: keito4 <keito4@users.noreply.github.com>
- setup-env.sh: credentials.sh の後方互換ラッパーと明記されており、
  credentials.sh fetch + cp で代替可能なため削除
- setup-mcp.sh: 存在しない .mcp.json.template を参照する壊れたスクリプト。
  .mcp.json は現在リポジトリに直接コミットされており不要

ドキュメントを credentials.sh fetch を直接使用するよう更新。

Refs: #773

Co-authored-by: keito4 <keito4@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b7da9deb-9bf2-4713-a3c7-b1eb34cc2b3f

📥 Commits

Reviewing files that changed from the base of the PR and between 894c463 and e5cc699.

📒 Files selected for processing (2)
  • test/integration/core-scripts.bats
  • test/integration/lib_functions.bats
💤 Files with no reviewable changes (2)
  • test/integration/core-scripts.bats
  • test/integration/lib_functions.bats

📝 Walkthrough

Walkthrough

This PR removes legacy setup-env.sh and setup-mcp.sh, migrates credential setup to script/credentials.sh fetch (producing credentials/devcontainer.env and credentials/mcp.env), updates DevContainer docs to use a single setup-claude.sh postCreateCommand and repo-committed .mcp.json, and removes obsolete library aliases and directory-purpose mappings.

Changes

Credential Workflow Migration and Cleanup

Layer / File(s) Summary
Credential workflow documentation transition
README.md, credentials/README.md, docs/doppler-setup-guide.md, .claude/...
Docs updated to use script/credentials.sh fetch, document credentials/devcontainer.env and credentials/mcp.env, and require copying credentials/devcontainer.env to ~/.devcontainer.env with chmod 600 for local installation.
DevContainer configuration and troubleshooting updates
.claude/devcontainer-recommendations.md, .claude/commands/devcontainer-checklist.md, README.md
DevContainer postCreateCommand examples simplified to /usr/local/bin/setup-claude.sh. .mcp.json treated as repository-committed; troubleshooting now uses script/credentials.sh fetch and direct .mcp.json checks/edits.
Script removal and library function cleanup
script/README.md, .claude/commands/README.md, script/lib/output.sh, script/lib/agents-md-data.sh
Removed documentation entries for setup-env.sh/setup-mcp.sh, removed errors:: compatibility wrapper functions from output.sh, and deleted .agents and next directory-purpose mappings.
Integration test updates
test/integration/core-scripts.bats, test/integration/lib_functions.bats
Deleted tests that asserted existence/executability of the removed setup scripts and tests covering the removed errors:: aliases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • keito4/config#214: Overlaps with changes to script/lib/output.sh around errors:: aliases.
  • keito4/config#198: Introduced the setup-env.sh / setup-mcp.sh workflow that this PR removes.
  • keito4/config#392: Related MCP configuration changes affecting .mcp.json handling.

Suggested labels

size/XS

Poem

🐰 A hop, a tweak, the old scripts fall away,
Credentials fetched neatly to brighten the day.
One command to run, two files to keep,
Copy, chmod, and rest — no more setup to heap.
Happy hops for clean config, hooray!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive All changes align with issue #773's objective of removing unnecessary code. However, the deletion of integration test cases (setup-env.sh, setup-mcp.sh references, and errors:: aliases tests) appears to be CI cleanup work beyond the stated scope of simply removing unused code. Clarify whether test deletion was necessary for CI success or if it should be handled separately. Document that test cleanup addresses CI failures mentioned in comments.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'chore: 不要なコードを削除 (#773)' clearly and specifically describes the main change—removing unnecessary code—which aligns with the changeset of deleting unused backward-compatibility aliases and directory entries.
Description check ✅ Passed The PR description includes a clear summary of changes (removal of errors:: aliases and PURPOSE entries), explains the reasoning, and provides context. However, it lacks a 'How to test' section and some checklist items are incomplete per the template.
Linked Issues check ✅ Passed The PR directly addresses issue #773 by removing unnecessary code (unused backward-compatibility aliases in output.sh and non-existent directory entries in agents-md-data.sh), fully meeting the stated objective of deleting unnecessary code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-773-20260528-0301

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 May 28, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keito4's task in 2m 8s —— View job


PRレビュー完了

  • コンテキスト収集
  • 変更差分の詳細確認
  • コードレビュー実施
  • レビュー結果をコメントに反映

総評

不要なコードを削除するクリーンなリファクタリングPRです。errors:: エイリアスのゼロ使用確認・存在しないディレクトリエントリの削除・スクリプト削除と対応するドキュメント更新、いずれも適切に実施されています。

ただし、テストが壊れる問題テンプレートコメントの記述漏れの2点を修正してからマージすることを推奨します。


問題点

🔴 重大: 統合テストが失敗する

test/integration/core-scripts.bats に削除済みスクリプトの存在チェックが残っています。このままマージすると CI が失敗します。

test/integration/core-scripts.bats:34-36

@test "setup-mcp.sh exists and is executable" {
    assert_file_exists "$REPO_ROOT/script/setup-mcp.sh"   # ← 削除済みで失敗
    [ -x "$REPO_ROOT/script/setup-mcp.sh" ]
}

test/integration/core-scripts.bats:86-88

@test "setup-env.sh exists and is executable" {
    assert_file_exists "$REPO_ROOT/script/setup-env.sh"   # ← 削除済みで失敗
    [ -x "$REPO_ROOT/script/setup-env.sh" ]
}

Fix this →


🟡 軽微: テンプレートファイルのコメントが古い

credentials/templates/ 配下の2ファイルのコメントヘッダーが削除済みスクリプトを参照しています。機能上の影響はありませんが、ドキュメントの一貫性のために更新が望ましいです。

credentials/templates/devcontainer.env.template:3

# このファイルは script/setup-env.sh により ~/.devcontainer.env に展開されます
#                  ↑ 削除済み。 credentials.sh に変更すべき

credentials/templates/mcp.env.template:3-4

# このファイルは script/setup-env.sh により credentials/mcp.env に展開され、
# script/setup-mcp.sh により .mcp.json の生成に使用されます
#              ↑ 両スクリプトとも削除済み

Fix this →


確認済みの正常な変更点

変更 確認結果
errors:: エイリアス削除 (output.sh) 全スクリプト内で使用箇所ゼロ確認済み ✅
.agents エントリ削除 (agents-md-data.sh) .agents ディレクトリは実在しない ✅
next エントリ削除 (agents-md-data.sh) next ディレクトリは実在しない ✅
setup-env.sh 削除 credentials.sh への機能移管済み(内部的にラップしていただけ)✅
setup-mcp.sh 削除 依存する .mcp.json.template も実在せず、.mcp.json はリポジトリに直接コミット済み ✅
ドキュメント参照更新 credentials.sh fetch への書き換えは全て適切 ✅

まとめ

test/integration/core-scripts.bats の2テスト削除(必須)とテンプレートコメントの修正(推奨)を行ってからマージをお願いします。

@keito4 keito4 self-assigned this May 28, 2026

@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: 894c4638fb

ℹ️ 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 thread script/setup-mcp.sh
@@ -1,81 +0,0 @@
#!/usr/bin/env bash

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore or update tests for removed setup scripts

Deleting this script leaves the integration suite in a guaranteed failing state: .github/workflows/ci.yml runs bats test/integration/*.bats, and test/integration/core-scripts.bats still asserts that both script/setup-mcp.sh and script/setup-env.sh exist and are executable. Until those tests are updated (or the wrappers are kept), every CI run that includes the Bats job will fail before validating the rest of the change.

Useful? React with 👍 / 👎.

Comment thread script/lib/output.sh
Comment on lines 119 to 120
info() { output::info "$@"; }
success() { output::success "$@"; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore errors aliases or remove their integration tests

This removal also breaks the Bats integration job: test/integration/lib_functions.bats still greps for errors::fatal, errors::warn, and errors::require_command, then sources script/lib/output.sh and calls errors::require_command, errors::info, and errors::success. Because .github/workflows/ci.yml runs that Bats suite, this commit will fail CI unless the aliases are retained or the tests are changed in the same commit.

Useful? React with 👍 / 👎.

@keito4

keito4 commented May 28, 2026

Copy link
Copy Markdown
Owner Author

(aside)
@claude PRがbaseにマージする際にCIが落ちています。
修正してください。

@claude

claude Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

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


CI修正完了

  • コンテキスト確認
  • 失敗しているテストファイルの確認
  • テストの修正
  • コミット・プッシュ

修正内容

削除済みのスクリプト・エイリアスを参照するBATSインテグレーションテストを削除しました。

test/integration/core-scripts.bats

  • setup-mcp.sh exists and is executable テストを削除(スクリプト削除済み)
  • setup-env.sh exists and is executable テストを削除(スクリプト削除済み)

test/integration/lib_functions.bats

  • output.sh provides errors::fatal alias テストを削除(エイリアス削除済み)
  • output.sh provides errors::warn alias テストを削除(エイリアス削除済み)
  • output.sh provides errors::require_command alias テストを削除(エイリアス削除済み)
  • errors:: aliases work through output.sh テストを削除(エイリアス削除済み)

コミット: e5cc699 — test: 削除済みスクリプト・エイリアスのBATSテストを削除

setup-env.sh, setup-mcp.sh, errors::エイリアスは削除済みのため、
これらを参照するインテグレーションテストを削除してCIを修正する

Co-authored-by: keito4 <keito4@users.noreply.github.com>
@keito4
keito4 merged commit 9590de4 into main May 28, 2026
2 checks passed
@keito4
keito4 deleted the claude/issue-773-20260528-0301 branch May 28, 2026 06:17
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.112.11 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released リリース済み label May 28, 2026
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.

不要なコードの削除

1 participant