feat(cli): add per-service selection to "devcloud up"#18
Merged
Conversation
devcloud up に位置引数を渡すと、その名前のサービスだけを起動できるよう にする。指定がなければ従来通り .devcloud/config.yaml の services.*.enabled に従う。ダッシュボードは常に起動する。 devcloud up s3 redis # S3 と Redis のみ devcloud up bq pubsub # bigquery と pubsub のみ (エイリアスも可) devcloud up # 既存挙動 (config に従う) internal/app/services.go に ApplyServiceSelection と ServiceNames を 追加し、サービス名と利用可能なエイリアス (smtp/ddb/bq/pub-sub/ app-autoscaling 等) を一元管理。未知のサービスは known list を含む エラーで失敗する。 テスト: 空入力で no-op、選んだサービスのみ enable + 他は disable、 unknown サービスのエラーメッセージ、入力 Config を mutate しない、 ServiceNames が全 toggle を網羅、をカバー。
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.
Summary
devcloud upに位置引数を渡すと、その名前のサービスだけを起動できるようにする.devcloud/config.yamlのservices.*.enabledに従う(ダッシュボードは常時起動)smtp/ddb/bq/pub-sub/app-autoscaling等)をinternal/app/services.goで一元管理Usage
```
devcloud up s3 redis # S3 と Redis のみ
devcloud up bq pubsub # bigquery と pubsub のみ (エイリアスも可)
devcloud up # 既存挙動 (config に従う)
```
未知のサービスを渡した場合は known list を含むエラーで失敗します。
Changes
ApplyServiceSelection(cfg, selected)とServiceNames()を追加。serviceTogglesで canonical 名 → enable setter を、serviceAliasesでユーザー入力の小文字正規化マップを一元管理。ServiceNamesがserviceTogglesを全網羅、かつ重複なしupサブコマンドでargs[1:]をApplyServiceSelectionに渡し、usage に new syntax と known services リストを追記。Test plan
go test ./internal/app/...通過 (1.350s)go vet ./...通過go build ./...通過go run ./cmd/devcloud up s3 redisで S3 と Redis のみ起動することを確認go run ./cmd/devcloud up kinesisで known list を含むエラーで失敗することを確認go run ./cmd/devcloud upで従来挙動が維持されることを確認Risk
Low — CLI レイヤーの追加のみ、empty selection で従来動作維持、関数は純粋(入力 Config を mutate しない値コピー)、外部 API/protocol 変更なし。