Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

fix(cli): update suga.yaml to support a single target only#106

Merged
tjholm merged 1 commit intomainfrom
single-target-apps
Oct 7, 2025
Merged

fix(cli): update suga.yaml to support a single target only#106
tjholm merged 1 commit intomainfrom
single-target-apps

Conversation

@jyecusch
Copy link
Copy Markdown
Member

@jyecusch jyecusch commented Oct 7, 2025

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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 7, 2025

📝 Walkthrough

Walkthrough

This 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

released

Suggested reviewers

  • tjholm
  • davemooreuws
  • HomelessDinosaur

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.26% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly indicates the move to a single target in the suga.yaml configuration, which captures an important aspect of the refactor even though the changes span code, docs, and tests.
Description Check ✅ Passed The description references the tracked issues and explains the breaking nature of the change in preview, which is directly related to the single-target refactor.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c1befef and 2d1a949.

📒 Files selected for processing (10)
  • cli/internal/build/build.go (2 hunks)
  • cli/internal/devserver/build.go (2 hunks)
  • cli/pkg/app/suga.go (4 hunks)
  • cli/pkg/schema/schema.go (1 hunks)
  • cli/pkg/schema/schema_test.go (18 hunks)
  • docs/cli.mdx (1 hunks)
  • docs/guides/add-suga.mdx (1 hunks)
  • docs/platforms.mdx (1 hunks)
  • docs/projects.mdx (2 hunks)
  • docs/quickstart.mdx (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/cli.mdx
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/projects.mdx
  • docs/platforms.mdx
  • docs/quickstart.mdx
🧰 Additional context used
🧬 Code graph analysis (4)
cli/pkg/schema/schema_test.go (1)
cli/pkg/schema/errors.go (1)
  • GetSchemaValidationErrors (190-216)
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/build/build.go (3)
cli/pkg/schema/schema.go (1)
  • Application (13-23)
engines/terraform/platform.go (1)
  • PlatformFromId (230-252)
cli/pkg/schema/file.go (1)
  • LoadFromFile (13-58)
cli/internal/devserver/build.go (1)
cli/internal/version/version.go (1)
  • ConfigFileName (16-16)
⏰ 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: Test
🔇 Additional comments (1)
cli/pkg/schema/schema_test.go (1)

13-474: LGTM! Single-target migration implemented correctly.

All test fixtures, assertions, and struct construction have been properly updated from the multi-target model to the single-target model. The changes are consistent throughout and align with the schema modifications.


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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 347bbf7 and c1befef.

📒 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.mdx
  • docs/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.

Comment thread cli/pkg/schema/schema.go
@jyecusch jyecusch changed the title fix: update suga.yaml to support a single target only fix(cli): update suga.yaml to support a single target only Oct 7, 2025
@jyecusch jyecusch force-pushed the single-target-apps branch from c1befef to 2d1a949 Compare October 7, 2025 02:26
@tjholm tjholm merged commit daa286d into main Oct 7, 2025
14 checks passed
@tjholm tjholm deleted the single-target-apps branch October 7, 2025 05:21
@nitric-bot
Copy link
Copy Markdown

🎉 This PR is included in version 0.1.17 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants