-
Notifications
You must be signed in to change notification settings - Fork 166
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
Fix New-TestResources.ps1 to run pre/post deployment script #1876
Merged
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d41510d
Fix New-TestResources.ps1 to run pre/post deployment script
ckairen 965ec79
Revert "Fix New-TestResources.ps1 to run pre/post deployment script"
ckairen a3fd406
Merge branch 'main' of https://github.com/Azure/azure-sdk-tools into …
ckairen ffdaf09
Fix New-TestResources.ps1 to run pre/post deployment script
ckairen cefef4c
Revert "Fix New-TestResources.ps1 to run pre/post deployment script"
ckairen 9568545
Merge branch 'main' of https://github.com/ckairen/azure-sdk-tools
ckairen 250e34f
Changing template file path in log msg for clarity
ckairen ed3a66f
Merge branch 'main' of https://github.com/Azure/azure-sdk-tools
ckairen 196e5bf
rebase
ckairen 0772836
Merge branch 'albertcheng/new-testresources.ps1' of https://github.co…
ckairen 663f2f8
Resolve conflict
ckairen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm honestly not a fan of this change, @benbp. The temp file that gets returned and printed everywhere is an implementation detail of this script with no obvious tie-back to the original .bicep file. At the very least
BuildBicepFile
should print the source and destination paths, but that's still requiring users to look up through the logs to find it. How it was with the object I thought was a great idea, so you could even print both if someone needed to find the actual JSON template (I've ran into a few issues where this was needed with bicep files).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you might be commenting on an outdated commit? Sorry for the messy commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, at the time I commented, the variable was just a single string path. You had it as a multi-property object but Ben asked you to change it. Did you chances it back to an object? We shouldn't be printing the path to a temp JSON file that the user can't use to diagnose failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is an outdated diff. The main code is object based: https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/TestResources/New-TestResources.ps1#L170-L171
I think it may actually be helpful to print both paths, because when debugging bicep scripts, I often need to see the compiled output to help diagnose the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's what I originally commented as well. The commit that had the original and transformed names as properties was best. My only comment from then was that the message printed when the two were different should list both. From the number of people I help set up their test resources (rather, customize them) it's clear expecting them to know how it works e.g., that it transforms the bicep file into json behind the scenes would be unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep makes sense. I plan to roll in those changes with my fix to #1824 (I promise I'll get to it @pakrym, just dealing with weird windows encryption API issues).