Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(compose): template files during compose operations #686

Merged
merged 18 commits into from
Oct 8, 2024

Conversation

meganwolf0
Copy link
Collaborator

@meganwolf0 meganwolf0 commented Sep 27, 2024

Description

Sorry for another massive PR - just to hopefully make the review a little easier going to try and enumerate the bigger things that changed here -

  • src/cmd/common/viper.go -> made TemplateConstants and TemplateVariables global. Don't love this pattern but in the interest of not totally redoing this and not having to call "GetTemplateConfig" in every template-able workflow, just ideally will run this once in InitViper
  • src/cmd/tools/compose.go -> refactored this command a bit to enable just calling the cmd (mostly for testing, but also I feel like returning the command is a better pattern?)
  • src/pkg/common/composition -> added the CompositionContext so it would more easily pass the TemplateRenderer, which basically get used in the sub functions to do the template rendering pieces. Includes options to set those values, I am a fan of this pattern but may not have really done this the best way so if some of this is an anti-pattern lmk
  • src/pkg/common/network -> network fetch options to allow for a set base directory, instead of doing the cwd changes. This is pretty coupled to the composition implementation but could possibly be split to a separate PR, it just wouldn't fix the UDS issue on it's own

Related Issue

Fixes #642

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

@meganwolf0 meganwolf0 changed the title 642 template files during persistent writes feat(compose): template files during compose operations Sep 30, 2024
@meganwolf0 meganwolf0 self-assigned this Oct 1, 2024
@meganwolf0
Copy link
Collaborator Author

Noticed when testing that case-sensitive keys in constants don't turn into case-sensitive keys in the map[string]interface{} that's created from that key (viper thing) - added a note in the configuration.md and filed associated issue

@meganwolf0 meganwolf0 marked this pull request as ready for review October 1, 2024 18:57
@meganwolf0 meganwolf0 requested a review from a team as a code owner October 1, 2024 18:57
src/cmd/tools/compose.go Outdated Show resolved Hide resolved
@meganwolf0 meganwolf0 marked this pull request as draft October 3, 2024 18:29
Copy link
Member

@brandtkeller brandtkeller left a comment

Choose a reason for hiding this comment

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

Partial review - getting a baseline understanding and a super minor fix.

src/cmd/tools/compose.go Outdated Show resolved Hide resolved
@meganwolf0 meganwolf0 marked this pull request as ready for review October 3, 2024 23:55
Copy link
Member

@brandtkeller brandtkeller left a comment

Choose a reason for hiding this comment

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

Review cont - Can we run lula internal gen-cli-docs to update docs?

src/pkg/common/composition/resource-store.go Outdated Show resolved Hide resolved
@brandtkeller brandtkeller merged commit c1745a4 into main Oct 8, 2024
5 checks passed
@brandtkeller brandtkeller deleted the 642-template-files-during-persistent-writes branch October 8, 2024 14:46
This was referenced Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Template files during persistent writes
3 participants