Authentik works several objects at a time; FreeIPA sends in batches - #44
Merged
Merged
Conversation
…s its objects in batches Invoke-TestParallel runs a block over many items on a pool of four runspaces that have the module loaded, on both editions. New-AuthentikUser and the teardown's per-type sweep use it; the groups sweep keeps one worker so a group goes before the group it nests under. A worker has the module's functions and none of the session's state, so the block takes its connection through -Parameter, and a contract test refuses a $script: read inside a worker block. Invoke-FreeIPABatch sends users, hosts and DNS records fifty to a request through the realm's JSON-RPC batch method, one answer per command in order, a refused command failing alone and an expected error name ignored. Each row is still decided, confirmed and reported one at a time. Measured on the labs: Authentik seed 8:22 -> 6:18, teardown 7:34 -> 4:36; FreeIPA seed 13:22 -> 11:48, because the realm's own work per user is most of the time. Both cycles verified with every check passing and nothing left after teardown.
fadwen
force-pushed
the
feat/parallel-seeding
branch
from
September 14, 2026 17:36
affd080 to
9cd2193
Compare
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.
Follows #41, #42 and #43, now merged.
What
Authentik.
Core/Invoke-TestParallel.ps1runs a block over many items on a runspace pool whose workers import the module, on Windows PowerShell 5.1 and 7 alike.New-AuthentikUserbuilds every row's request in the main runspace (theShouldProcesscall, progress, group resolution) and creates four at a time; the teardown's per-type sweep confirms each item first and deletes four at a time, except groups, which keep one worker because a group goes before the group it nests under. A worker has the module's functions and none of the session's state: the block takes the connection through-Parameter, and a new contract test refuses any$script:read inside a worker block, as the existing one does forStart-Jobbodies.FreeIPA.
Invoke-FreeIPABatchsends the users, hosts and DNS records fifty to a request through the realm's JSON-RPCbatchmethod, one answer per command in order. A refused command fails alone, an expected error name (EmptyModlist,NotFound,AlreadyInactive) is ignored per command, and a request the realm could not take fails every command in it with the same message. Each row is still decided, confirmed and reported one at a time.Measured on the labs
The FreeIPA gain is small and the changelog says why: the realm's own work per user (private group, memberof) is most of the time, not the round trip. The batching stays because it is the right shape and a faster realm would reward it. Both cycles verified with every check passing after the seed and nothing of the module's after teardown.
Tests
Core/Invoke-TestParallel.Tests.ps1runs real workers with no network: results in input order whatever order workers finish, the block inside the module (a private function in reach), one item's exception failing that item alone, no session state in a worker.Providers/FreeIPA/Invoke-FreeIPABatch.Tests.ps1: wire shape with the API version, chunking, per-command refusal, ignored error names, a failed chunk, an unanswered command.Invoke-TestParallelwith a body that runs the block inline (Pester mocks do not reach a worker); the FreeIPA user, host and DNS suites mockInvoke-FreeIPABatchwith a shim that records each command as its own call, so their assertions stay about the commands.Gates
Unit suite 2,642 passed shuffled on 7 (1 skipped) and 2,643 on 5.1, 0 failed. Analyzer clean. Rehearsal passes. CHANGELOG, provider READMEs (timings), Tests/README and a CLAUDE.md invariant.