fix(cli): update suga.yaml to support a single target only#106
Conversation
📝 WalkthroughWalkthroughThis change replaces multi-target support with a single target across CLI, schema, devserver, and docs. Builder methods now derive the target from Application.Target and remove target parameters and membership validation. Devserver build messages read the target from the project file. CLI build flow is simplified to a single target path. The Application schema changes from Targets []string to Target string, with tests updated accordingly. Documentation examples and descriptions are updated to use a single target field. Suggested labels
Suggested reviewers
Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (10)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
🧰 Additional context used🧬 Code graph analysis (4)cli/pkg/schema/schema_test.go (1)
cli/pkg/app/suga.go (2)
cli/internal/build/build.go (3)
cli/internal/devserver/build.go (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (1)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
cli/internal/build/build.go(2 hunks)cli/internal/devserver/build.go(2 hunks)cli/pkg/app/suga.go(1 hunks)cli/pkg/schema/schema.go(1 hunks)cli/pkg/schema/schema_test.go(18 hunks)docs/guides/add-suga.mdx(1 hunks)docs/platforms.mdx(1 hunks)docs/projects.mdx(2 hunks)docs/quickstart.mdx(3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-08T23:49:28.580Z
Learnt from: jyecusch
PR: nitrictech/suga#49
File: docs/quickstart.mdx:0-0
Timestamp: 2025-09-08T23:49:28.580Z
Learning: Suga currently only officially supports AWS (`suga/aws1`) and GCP (`suga/gcp1`) as deployment targets. Azure is not yet supported as a deployment target, despite `az login` being a valid Azure CLI authentication command.
Applied to files:
docs/platforms.mdxdocs/quickstart.mdx
🧬 Code graph analysis (4)
cli/pkg/app/suga.go (2)
cli/internal/version/version.go (2)
GetCommand(44-46)ConfigFileName(16-16)cli/internal/style/icons/icons.go (1)
Check(9-9)
cli/internal/devserver/build.go (1)
cli/internal/version/version.go (1)
ConfigFileName(16-16)
cli/internal/build/build.go (4)
cli/pkg/schema/schema.go (1)
Application(13-23)cli/internal/platforms/repository.go (1)
NewPlatformRepository(98-103)engines/terraform/platform.go (1)
PlatformFromId(230-252)cli/pkg/schema/file.go (1)
LoadFromFile(13-58)
cli/pkg/schema/schema_test.go (1)
cli/pkg/schema/errors.go (1)
GetSchemaValidationErrors(190-216)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build (macos-latest, arm64)
🔇 Additional comments (9)
docs/guides/add-suga.mdx (1)
53-53: Documentation updated correctly for single-target model.The YAML example properly demonstrates the new single-target syntax.
docs/platforms.mdx (1)
41-41: Clear single-target example with GCP alternative documented.The inline comment effectively shows users how to switch targets.
docs/projects.mdx (1)
36-36: Documentation consistently reflects single-target model.Both YAML examples and descriptive text properly use singular "target" throughout.
Also applies to: 80-85
docs/quickstart.mdx (1)
88-88: Quickstart guide properly updated for single-target workflow.Examples and guidance clearly demonstrate AWS as the default with GCP as an alternative.
Also applies to: 114-114, 213-220
cli/pkg/app/suga.go (2)
453-456: Build validation correctly checks for missing target.Error message appropriately guides users to add a target via the editor.
459-464: Build call and success message updated correctly.The BuildProject call derives target from appSpec, and the newline improves output formatting.
cli/internal/devserver/build.go (1)
19-21: Devserver correctly reads target from project file.The struct simplification and updated build call align with the single-target model.
Also applies to: 49-49
cli/internal/build/build.go (2)
34-54: BuildProject correctly derives target from appSpec.Method signature simplified, and all references to target properly use appSpec.Target.
56-63: BuildProjectFromFile correctly delegates to BuildProject.The wrapper method properly loads the spec and passes it to BuildProject.
c1befef to
2d1a949
Compare
|
🎉 This PR is included in version 0.1.17 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Fixes NIT-393, NIT-395, NIT-397
Note for the future, this would be a breaking change and avoided or supported with backwards compatibility. We'll push it as a fix, since the software is currently in preview.