multiple changes to improve logging and output#170
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Enhance logging and error handling across schema hydration and the bundle new CLI, update a Terraform lint test case, and bump the airlock dependency.
- Added console output in
GetFromPathfor better visibility when loading params. - Refactored
bundle newto return errors (usingRunE), silence usage on failure, and print a success message. - Improved schema dereferencing: tightened Massdriver ref regex and introduced fragment‐ref support.
Reviewed Changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/params/params.go | Added progress messages when importing and successfully loading schemas |
| pkg/bundle/testdata/lint/module/variables.tf | Replaced type = any with type = object({}) for Terraform lint test |
| pkg/bundle/dereference.go | Updated Massdriver ref regex and added handling for fragment refs |
| pkg/api/artifact_defintions.go | Wrapped GraphQL errors with context for get/list/publish operations |
| go.mod | Bumped github.com/massdriver-cloud/airlock from v0.0.6 to v0.0.7 |
| cmd/bundle.go | Switched to RunE, propagated errors instead of using log.Fatal, updated flag help text, and added success output |
Comments suppressed due to low confidence (4)
pkg/bundle/dereference.go:66
- The new
fragmentPatternbranch skips schema dereferencing for fragment refs but lacks dedicated tests. Please add unit tests to verify that fragment references are correctly ignored.
var fragmentPattern = regexp.MustCompile(`^#`)
cmd/bundle.go:80
- [nitpick] The flag help text implies that setting this flag alone disables the interactive prompt, but the code requires both
nameandtemplate-nameto be set to skip prompting. Consider clarifying that both flags must be provided.
bundleNewCmd.Flags().StringVarP(&bundleNewInput.name, "name", "n", "", "Name of the new bundle. Setting this will disable the interactive prompt.")
pkg/api/artifact_defintions.go:1
- The file name 'artifact_defintions.go' appears to contain a typo in 'definitions'. Consider renaming it to 'artifact_definitions.go' for correct spelling and consistency.
package api
cmd/bundle.go:207
- [nitpick] Using distinct error variable names (e.g.,
cacheErr,refreshErr) deviates from Go conventions that favorerrin short declarations. Consider usingif cache, err := …; err != nil { … }to improve readability and consistency.
cache, cacheErr := templatecache.NewBundleTemplateCache(templatecache.GithubTemplatesFetcher)
coryodaniel
approved these changes
Jul 13, 2025
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.
Multiple small changes:
mass bundle newif errors happenanybetter