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

error on unsubstituted vars #175

Merged

Conversation

davidgamero
Copy link
Collaborator

@davidgamero davidgamero commented Feb 1, 2023

Description

When executing a variable substitution via CopyDir, an error should be thrown if a variable is not supplied but exists in the templates.

Doing this validation at a lower level in the os package allows us to gain this protection across all the commands

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration. Is it a breaking change which will impact consuming tool(s).

  • Added new unit tests to confirm unsubstituted variable detection is working
  • updated existing tests to make sure we don't have missing variables in them as well

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link
Member

@Tatsinnit Tatsinnit left a comment

Choose a reason for hiding this comment

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

☕️💡 Thank you for adding me to this review and for the ping, please take a look at few observation, rest looks good, thanks.

pkg/osutil/osutil.go Outdated Show resolved Hide resolved
pkg/osutil/osutil.go Show resolved Hide resolved
pkg/osutil/osutil.go Outdated Show resolved Hide resolved
pkg/osutil/osutil.go Outdated Show resolved Hide resolved
Copy link
Member

@Tatsinnit Tatsinnit left a comment

Choose a reason for hiding this comment

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

🎊👍☕️

@davidgamero davidgamero merged commit 76029f7 into Azure:main Feb 3, 2023
@davidgamero davidgamero mentioned this pull request Feb 13, 2023
aamgayle pushed a commit to aamgayle/draft that referenced this pull request Mar 23, 2023
@davidgamero davidgamero deleted the davidgamero/error-on-unsubstituted-vars branch April 18, 2023 18:50
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.

5 participants