azuredevops_team - Fix create/update never reaching Synched when … - #1599
Open
Maikel Dollé (itmagix) wants to merge 1 commit into
Open
azuredevops_team - Fix create/update never reaching Synched when …#1599Maikel Dollé (itmagix) wants to merge 1 commit into
azuredevops_team - Fix create/update never reaching Synched when …#1599Maikel Dollé (itmagix) wants to merge 1 commit into
Conversation
…the service normalizes values Addresses microsoft#1582 The convergence loop in waitForTeamStateChange() could never report `Synched` when Azure DevOps normalizes team name/description on storage (e.g. trims surrounding whitespace), when the identity security namespace of a new team contains additional ACEs, or when team membership contains members not present in the configuration - the checks used exact string equality and count-only comparisons. A nil dashboard list dereferenced a nil pointer, and the 30 minute wait timeout was hardcoded, ignoring the resource `timeouts` configuration. - compare trimmed name/description values and tolerate omitted response fields instead of hanging or panicking - converge on "all configured members/administrators are present" (set intersection, matching the standalone azuredevops_team_members resource) and log a warning when counts drift - nil-guard the dashboard check (previously a potential provider panic) - honor the resource `timeouts` create/update configuration instead of the hardcoded 30 minutes - skip identities without a subject descriptor when converting members Adds unit tests covering the convergence loop against normalized values, omitted response fields, extra ACL ACEs, extra members, a nil dashboard list, and a configured member that never appears.
Author
|
@microsoft-github-policy-service agree |
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.
All Submissions:
Description
While migrating a few hundred teams to a new organization I ran into #1582: team creation hangs for 30 minutes and then fails with
timeout while waiting for state to become 'Synched' (last state: 'Waiting'), even though the team and its members were created fine in Azure DevOps. Nothing lands in state, so the next run or an import picks the teams up immediately.The convergence loop in
waitForTeamStateChange()has five conditions that all have to hold, and several of them can never become true under normal service behavior:if dashboards == nil && len(*dashboards) == 0, which dereferences a nil pointer. It could only ever crash or pass.timeoutsconfiguration.Because the loop does not log which condition is stuck, every one of these quirks produces the same silent 30 minute timeout. The same symptom came up in #1464, where the actual cause turned out to be an unrelated regression in
GetAccessControlList()(fixed by the revert in #1466).This PR changes the loop to:
azuredevops_team_membersresource already uses) and log a warning when the counts differtimeoutsconfiguration instead of the hardcoded 30 minutesgetSubjectDescriptors()No documentation changes are needed. There is no schema change, the documented
timeoutsblock simply works now.Does this introduce a breaking change?
Config compatible. Two behavior changes worth calling out: the default create/update wait is now the documented 10 minute resource default instead of a hardcoded 30 minutes, and the loop converges on set intersection instead of exact counts, logging a warning when the team state differs from the configuration.
Test Result
go build,go vetand the full core package test suite pass. The patched provider has also been verified in a production pipeline while migrating teams between organizations: teams and members are created and the loop converges in seconds instead of hanging for 30 minutes.Related Issue(s)
Addresses #1582. The same symptom came up in #1464, caused by an unrelated regression and fixed by the revert in PR #1466.
Other information
The triggers for the original hang are all realistic service side behaviors: normalized name and description (confirmed in the #1582 thread), extra ACEs on the team identity namespace, and memberships the identity service does not persist. Each one used to produce the same 30 minute timeout with no indication of which condition was stuck. The loop now logs the drifted condition, which should make reports like #1582 much easier to diagnose.