Conversation
- production/preview/development 以外の environments 値を Custom Environment slug として許容
- GET /v9/projects/{id}/custom-environments で slug→ID を解決し customEnvironmentIds で送信
- 標準環境と Custom Environment の混在指定に対応(target と customEnvironmentIds を同居)
- 存在しない slug は利用可能一覧付きの i18n エラー(en/ja)
- custom slug 未使用ターゲットでは API を呼ばず後方互換を維持
- README / README.ja / env-sync.yaml に指定方法を追記
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Vercel provider が production/preview/development 以外の environments 値(Custom Environment の slug、例: staging)を許容し、Vercel の Custom Environment へも環境変数を同期できるようにする変更です。既存の標準環境のみの挙動を維持しつつ、slug→ID 解決と送信ペイロード(customEnvironmentIds)対応を追加しています。
Changes:
entriesToVercelItemsで標準環境はTarget、それ以外は Custom Environment slug としてcustomEnvSlugsに振り分けGET /v9/projects/{idOrName}/custom-environmentsにより slug→ID を解決してcustomEnvironmentIdsを埋め、標準+カスタム混在送信を可能に- i18n(en/ja)エラーメッセージ追加、README/サンプル設定コメント更新、関連ユニットテスト追加
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Custom Environment slug の指定方法を追記 |
| README.ja.md | Custom Environment slug の指定方法を追記(日本語) |
| internal/provider/vercel/vercel.go | Custom Environment slug の解決・送信ペイロード拡張・一覧表示の改善を実装 |
| internal/provider/vercel/vercel_test.go | slug 振り分け、slug→ID 解決、混在時の JSON などのユニットテストを追加 |
| internal/i18n/keys.go | Custom Environment 関連の i18n キーを追加(旧 invalid env キーを整理) |
| internal/i18n/catalog_ja.go | Custom Environment 関連メッセージ(ja)を追加 |
| internal/i18n/catalog_en.go | Custom Environment 関連メッセージ(en)を追加 |
| env-sync.yaml | environments に Custom Environment slug を指定できる旨をコメント追記 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
# Conflicts: # internal/provider/vercel/vercel.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
タスク
Closes #39
env-sync の Vercel provider は環境変数の送信先環境として production / preview / development の 3 種のみ対応しており、Vercel の Custom Environment(例: staging)を environments に指定するとエラーになっていた。Custom Environment にも変数を同期できるようにする。
entriesToVercelItemsの validTargets を「エラー判定」から「標準環境 / Custom Environment slug の振り分け判定」に変更GET /v9/projects/{idOrName}/custom-environments(teamId 対応)で slug → ID(env_*)を解決するvercelFetchCustomEnvironments/applyCustomEnvironmentsを追加item構造体にcustomEnvironmentIds(omitempty)を追加。標準環境は従来どおりtarget、Custom Environment はcustomEnvironmentIdsで送信(混在時は 1 item に同居)environments=...)は標準環境 + Custom Environment slug を結合して表示(dry-run 含む)完了条件
動作確認
設計メモ
品質チェック結果
🔴 Critical: なし
🟡 Warning: 1 件(複数ターゲット時のエラー中止方針の非対称性)→ 上記「設計メモ」のとおり意図的な挙動として整理済み
🔵 Info: available 一覧の非決定的順序・重複 ID・0 件時メッセージ・パース失敗テスト不足 → すべて修正済み
パフォーマンス診断
指摘なし。slug → ID 解決はターゲットごとに GET 1 回のみ(エントリごとの都度呼び出しなし)、custom slug 未使用ターゲット・dry-run では API を呼ばない設計。
🤖 Generated with Claude Code