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

chore(cli): improves error message for missing infra resources#94

Merged
jyecusch merged 2 commits intomainfrom
depends-on-err
Oct 7, 2025
Merged

chore(cli): improves error message for missing infra resources#94
jyecusch merged 2 commits intomainfrom
depends-on-err

Conversation

@raksiv
Copy link
Copy Markdown
Member

@raksiv raksiv commented Sep 29, 2025

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 29, 2025

📝 Walkthrough

Walkthrough

The change updates engines/terraform/deployment.go so that when resolveInfraResource fails to find an infra resource, it builds a list of available InfraSpecs keys (using maps.Keys and slices.Collect) and returns an error that includes the missing resource name and the list of available resources. Control flow and exported/public declarations remain unchanged.

Possibly related PRs

Suggested reviewers

  • tjholm
  • jyecusch

Pre-merge checks

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description Check ❓ Inconclusive The pull request has no description, leaving reviewers without any information about the purpose or impact of the change. Without any text it is impossible to understand the rationale or context behind the improved error messaging. Therefore the description check is inconclusive due to the absence of descriptive content. Please add a brief description explaining the change to the error message for missing infra resources, outlining why the update was made and how it improves the user experience.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title succinctly indicates that this chore enhances the error message for missing infrastructure resources, directly reflecting the main change without extraneous detail.

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.

@raksiv raksiv changed the title chore(cli): Improves error message for missing infra resources in dependencies chore(cli): improves error message for missing infra resources in dependencies Sep 29, 2025
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: 0

🧹 Nitpick comments (1)
engines/terraform/deployment.go (1)

64-68: Consider sorting available resources for consistent output.

The error message improvement is excellent and actionable. However, since Go map iteration order is non-deterministic, the available resources list will vary between runs. Sorting would provide a better developer experience.

Apply this diff:

 		availableResources := make([]string, 0, len(td.engine.platform.InfraSpecs))
 		for name := range td.engine.platform.InfraSpecs {
 			availableResources = append(availableResources, name)
 		}
+		slices.Sort(availableResources)
 		return nil, fmt.Errorf("infra resource '%s' not found in depends_on. Available resources: %v. Update the depends_on references in your platform definition", infraName, availableResources)

Note: slices.Sort is already imported at line 7.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 37afed9 and 5014f4d.

📒 Files selected for processing (1)
  • engines/terraform/deployment.go (1 hunks)

Comment thread engines/terraform/deployment.go
@coderabbitai coderabbitai bot requested review from jyecusch and tjholm October 6, 2025 18:48
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 5014f4d and fbcbf61.

📒 Files selected for processing (1)
  • engines/terraform/deployment.go (1 hunks)
⏰ 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). (4)
  • GitHub Check: Build (windows-latest, amd64)
  • GitHub Check: Build (macos-latest, amd64)
  • GitHub Check: Test
  • GitHub Check: Security Scan

Comment thread engines/terraform/deployment.go Outdated
@raksiv raksiv changed the title chore(cli): improves error message for missing infra resources in dependencies chore(cli): improves error message for missing infra resources Oct 6, 2025
@jyecusch jyecusch merged commit 25b13a4 into main Oct 7, 2025
4 checks passed
@jyecusch jyecusch deleted the depends-on-err branch October 7, 2025 00:10
@nitric-bot
Copy link
Copy Markdown

🎉 This PR is included in version 0.1.15 🎉

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.

4 participants