Skip to content

Conversation

@ScottSuarez
Copy link
Contributor

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.


@ScottSuarez ScottSuarez requested a review from nicdumz January 6, 2026 19:24
@ScottSuarez
Copy link
Contributor Author

@modular-magician assign-review @melinath

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@melinath, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@github-actions github-actions bot requested a review from melinath January 6, 2026 19:27
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

}

loader := loader.NewLoader(loader.Config{Version: version, BaseDirectory: baseDirectory, OverrideDirectory: overrideDirectory, Sysfs: ofs})
loadedProducts := loader.LoadProducts()
Copy link
Contributor

Choose a reason for hiding this comment

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

I may be missing the "why" of the change overall, but I had a slight preference for the well encapsulated, low coupling previous version of the code.

loadedProducts := loader.LoadProducts() lets the loader do everything behind the scenes and return the products.

Could you keep that? It seems a bit "complicated" for users of the Loader type to need to know that they need to call LoadProducts, AddExtraFields, and Validate in that order, then access .Products.

I think I preferred having all of those methods private implementation details, and only have one public LoadProducts().

The rest of the change LGTM.

Copy link
Member

Choose a reason for hiding this comment

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

@nicdumz we need to be able to load the yaml files, modify them in-memory, and write them out again - which means we need to separate loading from any "post-processing" like AddExtraFields.

loader := loader.NewLoader(loader.Config{Version: version, BaseDirectory: baseDirectory, OverrideDirectory: overrideDirectory, Sysfs: ofs})
loadedProducts := loader.LoadProducts()
loader.LoadProducts()
loader.AddExtraFields()
Copy link
Member

Choose a reason for hiding this comment

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

@nicdumz pointed out this returns an error that should be handled.

@ScottSuarez ScottSuarez added this pull request to the merge queue Jan 8, 2026
Merged via the queue into GoogleCloudPlatform:main with commit a7c1168 Jan 8, 2026
24 checks passed
@ScottSuarez ScottSuarez deleted the loader-after branch January 8, 2026 17:40
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.

4 participants