-
Notifications
You must be signed in to change notification settings - Fork 208
Support writing .env files from Test Resources #10579
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
Conversation
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.
Pull Request Overview
This PR adds support for writing .env files from test resources when certain conditions are met. The primary changes include:
- Adding a new function to lint Bicep files and check for secret outputs before writing .env files.
- Conditional logic to handle .env file generation for both .NET (DPAPI-protected) and Bicep templates.
- Updates to related documentation and cleanup scripts to remove .env files.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
eng/common/TestResources/TestResources-Helpers.ps1 | Added LintBicepFile function and new branch to conditionally write .env files for Bicep templates. |
eng/common/TestResources/Remove-TestResources.ps1 | Enhanced removal logic to delete generated .env files. |
eng/common/TestResources/README.md | Updated documentation to explain new .env file behavior and prerequisites. |
eng/common/TestResources/New-TestResources.ps1 & .md | Revised logic and documentation for OutFile behavior including support for .env file generation on multiple platforms. |
See Azure/azure-sdk-for-rust#2498 for history and comments. This was developed initially in the Azure/azure-sdk-for-rust repo so I could test it. This does not include the reformatting with the |
If a language repo opts into it *and* if a `test-resources.bicep` file exists and lints clean of writing secrets *and* if the `.env` file is gitignore'd, write a `.env` file next to `test-resources.bicep`.
dcaa516
to
da5aca8
Compare
The following pipelines have been queued for testing: |
Blocking this on review because I want to test this in at least a couple languages and need to update Rust's |
The following pipelines have been queued for testing: |
46a6fec
to
7b1488f
Compare
The following pipelines have been queued for testing: |
I've tested the following:
All tests were done setting |
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#10579 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) --------- Co-authored-by: Heath Stewart <heaths@microsoft.com>
* Support writing .env files from Test Resources If a language repo opts into it *and* if a `test-resources.bicep` file exists and lints clean of writing secrets *and* if the `.env` file is gitignore'd, write a `.env` file next to `test-resources.bicep`. * Resolve PR feedback * Pass -Force for . hidden files on non-Windows
If a language repo opts into it and if a
test-resources.bicep
file exists and lints clean of writing secrets and if the.env
file is gitignore'd, write a.env
file next totest-resources.bicep
.