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

[test resources] Consolidate naming logic and generate short hash names for local use #5242

Merged
5 commits merged into from
Jan 27, 2023

Conversation

benbp
Copy link
Member

@benbp benbp commented Jan 26, 2023

Follow up fix related to discussion on Azure/azure-sdk-for-net#33262

  • Make name generation simpler and more consistent across test resource scripts (found a bug where remove-testresources.ps1 would not have worked for nested service directories like data/aztables)
  • Use a short hash for resource names deployed locally, to avoid edge cases where a long service directory or username causes resource names to be too long for validation (e.g. keyvault).
  • Fix issue with EnvironmentVariables ref getting updated from the parameters when splatting in CI mode and polluting the env variable outputs on subsequent runs in the same shell.
  • Add more warning logging if we're overwriting environment variables, for New-TestResources should warn when overwriting existing env variables with the subscription config #4931

Fixes #4931

@benbp benbp added the Central-EngSys This issue is owned by the Engineering System team. label Jan 26, 2023
@benbp benbp requested a review from weshaggard as a code owner January 26, 2023 21:59
@benbp benbp self-assigned this Jan 26, 2023
@benbp benbp requested a review from heaths as a code owner January 26, 2023 21:59
@benbp benbp force-pushed the benbp/test-resource-base-name branch from d269c11 to 2796617 Compare January 26, 2023 22:00
@benbp benbp removed request for heaths and weshaggard January 26, 2023 22:37
@benbp benbp marked this pull request as draft January 26, 2023 22:37
eng/common/TestResources/SubConfig-Helpers.ps1 Outdated Show resolved Hide resolved
eng/common/TestResources/build-test-resource-config.yml Outdated Show resolved Hide resolved
@benbp benbp force-pushed the benbp/test-resource-base-name branch from a5e28f6 to 669646b Compare January 27, 2023 19:13
@benbp benbp marked this pull request as ready for review January 27, 2023 19:13
@benbp
Copy link
Member Author

benbp commented Jan 27, 2023

@heaths @weshaggard I marked this ready for review now. If you look at the commits I'm rolling in a couple bug fixes and quality of life updates here.

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

Copy link
Member

@weshaggard weshaggard left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me

@ghost
Copy link

ghost commented Jan 27, 2023

Hello @azure-sdk!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit a03f747 into Azure:main Jan 27, 2023
@benbp benbp deleted the benbp/test-resource-base-name branch January 27, 2023 20:27
ghost pushed a commit that referenced this pull request Apr 5, 2023
This PR fixes an issue introduced in #5242 which stopped respecting BaseName parameter overrides in CI mode. This caused issues in stress deployments where we intentionally override BaseName to get a short name hash and need the value to match up with other places where inject it.

CC @richardpark-msft @lmolkova
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Central-EngSys This issue is owned by the Engineering System team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New-TestResources should warn when overwriting existing env variables with the subscription config
4 participants