Repair-TestEnvironment: put back what verification found missing - #46
Merged
Merged
Conversation
…t verification found missing Runs the verifier, maps each failed check to the seed step that owns it through the $script:<Provider>RepairStep map every provider declares in its Initialize.ps1, re-runs those steps alone through the provider's orchestrator with everything else passed to -Skip, and verifies again. The steps every repair needs run alongside: the units and containment on Entra, the OU structure on AD. What the data does not describe is reported and left for teardown; -WhatIf names the steps and runs none. The suite reads each verifier's source and fails a map that does not cover every judged check, so a new check has to say which step puts it back.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #45.
What
Repair-TestEnvironmentruns the verifier against the active provider, works out from the failed checks which seed steps own the missing objects, re-runs those steps alone through the provider's own orchestrator (everything else passed to-Skip), and verifies again. Every seed step is idempotent, so what exists is reused; a name that came back wrong is repaired where the provider's user step updates an existing user.Each provider declares
$script:<Provider>RepairStepin itsInitialize.ps1:Step, check name to seed step, andAlways, the steps every repair needs around it (the units and the containment pass on Entra, the OU structure on AD). Memberships map to the step that applies them: groups on Entra, Okta and AD; users on Authentik, FreeIPA and PingOne.What is there that the data does not describe is reported and left alone; removing an object the module owns stays teardown's job.
-WhatIfnames the steps and runs none.Tests
Tests/Unit/Public/Repair-TestEnvironment.Tests.ps1: nothing runs when every check passes; only the owning steps run, everything else skipped by name;-WhatIfnames and runs none; an unexpected object is reported and left; and a contract that reads each verifier's source and fails a map that does not cover every judged check, with steps the orchestrator knows.Gates
Unit suite 2,715 passed shuffled on 7 (1 skipped) and 2,716 on 5.1, 0 failed. Analyzer clean. MAML rebuilt. Rehearsal passes. Docs page, index, README, about topic, CHANGELOG, Tests/README and a CLAUDE.md paragraph. A live repair on the PingOne sandbox follows in a docs commit.