Skip to content

[AV-129893] Revert: Enhance network peer error handling and state management"#621

Merged
Talina06 merged 1 commit into
mainfrom
revert-580-AV-129893-Enhance-network-peer-error-handling-and-state-management
May 29, 2026
Merged

[AV-129893] Revert: Enhance network peer error handling and state management"#621
Talina06 merged 1 commit into
mainfrom
revert-580-AV-129893-Enhance-network-peer-error-handling-and-state-management

Conversation

@Talina06
Copy link
Copy Markdown
Member

Reverts #580

Copilot AI review requested due to automatic review settings May 29, 2026 03:57
@Talina06 Talina06 requested a review from a team as a code owner May 29, 2026 03:57
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

🚨 PR title "Revert "AV-129893 Enhance network peer error handling and state management"" does not match the required format.

Requirements:
- Must start with [AV-XXXXX] where X is any number of digits
- After the bracket, must start with a Verb (Add, Update, Fix, etc.)
- The Verb must start with an uppercase letter

Expected format: [AV-XXXXX] Verb ...
Example: [AV-98659] Implement Cluster On/Off feature
Valid verbs: Add, Update, Fix, Implement, Remove, Refactor, etc.

@github-actions
Copy link
Copy Markdown

No PR template selections were detected. Please make sure to fill out the PR template properly by selecting the appropriate checkboxes.

@factory-droid
Copy link
Copy Markdown
Contributor

factory-droid Bot commented May 29, 2026

Droid finished @Talina06's task —— View job


Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request reverts PR #580, rolling back recent changes that enhanced network peer error handling and state management in the provider. The revert primarily affects how network peer responses are interpreted (especially around optional status/providerConfig fields) and how the resource behaves during create/read refresh.

Changes:

  • Reverts nil/empty handling for providerConfig and status.reasoning/state when morphing API responses into Terraform state.
  • Reverts “best-effort” provider type inference and related state refresh behavior in the network peer resource.
  • Removes unit tests that covered nil/null providerConfig and nil reasoning scenarios.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
internal/schema/network_peer.go Reverted schema/state morphing logic; reintroduces unsafe dereferences and stricter providerConfig parsing.
internal/schema/network_peer_test.go Removes tests that previously validated nil/null providerConfig and nil reasoning handling.
internal/resources/network_peer.go Reverts resource-level error handling and provider-type inference; introduces issues with provider-type detection and error wrapping.
Comments suppressed due to low confidence (1)

internal/schema/network_peer.go:223

  • Potential nil-pointer dereference: this block checks networkPeer.Status.State != nil but then unconditionally dereferences networkPeer.Status.Reasoning. The API type uses pointers for both fields, so Reasoning can be nil and will panic during state refresh.
	if networkPeer.Status.State != nil {
		state := *networkPeer.Status.State
		reasoning := *networkPeer.Status.Reasoning
		status := PeeringStatus{
			State:     types.StringValue(state),
			Reasoning: types.StringValue(reasoning),
		}

Comment thread internal/schema/network_peer.go
Comment thread internal/schema/network_peer.go
Comment thread internal/resources/network_peer.go
Comment thread internal/resources/network_peer.go
Comment thread internal/resources/network_peer.go
Comment thread internal/resources/network_peer.go
Comment thread internal/schema/network_peer.go
Copy link
Copy Markdown

@saiakhil2012 saiakhil2012 left a comment

Choose a reason for hiding this comment

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

+1

Comment thread internal/schema/network_peer.go
Comment thread internal/schema/network_peer.go
Comment thread internal/schema/network_peer.go
Comment thread internal/resources/network_peer.go
Comment thread internal/resources/network_peer.go
Copy link
Copy Markdown
Contributor

@factory-droid factory-droid Bot left a comment

Choose a reason for hiding this comment

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

Validated the candidate findings against the full diff and reporting gate. I approved 5 comments with concrete trigger paths (nil-pointer panics and failed-state read/create regressions) and rejected 2 items that were non-defect/overstated.

@Talina06 Talina06 changed the title Revert "[AV-129893] Enhance network peer error handling and state management" [AV-129893] Revert: Enhance network peer error handling and state management" May 29, 2026
@Talina06 Talina06 merged commit 1173165 into main May 29, 2026
24 of 27 checks passed
@Talina06 Talina06 deleted the revert-580-AV-129893-Enhance-network-peer-error-handling-and-state-management branch May 29, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants