Skip to content

multiple changes to improve logging and output#170

Merged
chrisghill merged 4 commits into
mainfrom
chris/grab-bag-07112025
Jul 13, 2025
Merged

multiple changes to improve logging and output#170
chrisghill merged 4 commits into
mainfrom
chris/grab-bag-07112025

Conversation

@chrisghill
Copy link
Copy Markdown
Member

@chrisghill chrisghill commented Jul 11, 2025

Multiple small changes:

  • Improved output while hydrating schemas if the schema can't be found
  • Better output during mass bundle new if errors happen
  • Using new airlock version which handles any better

@chrisghill chrisghill requested a review from coryodaniel as a code owner July 11, 2025 22:47
@chrisghill chrisghill requested a review from Copilot July 12, 2025 04:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 GetFromPath for better visibility when loading params.
  • Refactored bundle new to return errors (using RunE), 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 fragmentPattern branch 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 name and template-name to 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 favor err in short declarations. Consider using if cache, err := …; err != nil { … } to improve readability and consistency.
	cache, cacheErr := templatecache.NewBundleTemplateCache(templatecache.GithubTemplatesFetcher)

@chrisghill chrisghill merged commit 2c61ad4 into main Jul 13, 2025
2 of 4 checks passed
@chrisghill chrisghill deleted the chris/grab-bag-07112025 branch July 13, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants