Azure / Azure/azure-sdk-tools

Add integration testing for `Azure.Sdk.BuildTools.SecretRotation`

Open
#5,432 1 comment 0 reactions 0 assignees View on GitHub
Central-EngSys
Dominant language
C#
Stars
135
Forks
260
Avg merge
3d 1h
Merged PRs (30d)
143

Description

I just had a good discussion with Patrick about what we can do to ensure that we aren't accidentally breaking any major functionalities in our secret rotation project. Just getting this jotted down for further breakdown or discussion.

I'm seeing the following individual items:

- [ ] Create `Azure.Sdk.BuildTools.SecretRotation.IntegrationTestServer` project
- This project should implement the class in `tools/pipeline-witness/Azure.Sdk.Tools.PipelineWitness/Configuration/PostConfigureKeyVaultSettings.cs`
- Should provide an API Controller that will _return_ an appconfiguration value -> `/Test/GetAppConfigurationValue`
- This will return a SHA256 of the appconfiguration value.
- [ ] Add tests.yml to solution root
- Create new ARM template with the following:
- Keyvault
- Add one secret to keyvault
- Create new website based on the afore-mentioned IntegrationTestServer project
- We should re-use `New-TestResources.ps1` to stand up the above ARM resources
- [ ] Additional test steps
- Hit `/Test/GetAppConfigurationValue`. Store value away.
- Use the SecretRotation tool to rotate the secret we retrieved the value for
- Hit `/Test/GetAppConfigurationValue`, compare the SHAs and ensure they are different.

Contributor guide

Open the contributing guide

Research direction

Start with tools/pipeline-witness/Azure.Sdk.Tools.PipelineWitness/Configuration/PostConfigureKeyVaultSettings.cs and review New-TestResources.ps1. Then trace the proposed tests.yml flow: create the IntegrationTestServer project, provision the Key Vault and website, call /Test/GetAppConfigurationValue before and after SecretRotation, and compare the SHA256 values. Done means the integration test demonstrates that rotation changes the returned hash.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, powershell
Domain
api, cloud, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.