Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

Addresses three structural issues in the security list resource implementation based on code review feedback.

Changes

  • Refactored optimistic locking in update.go: Pass version_id directly from state to toUpdateRequest() instead of copying to plan. The copy was redundant since the subsequent read overwrites it anyway.

  • Fixed id attribute schema: Made id Computed-only per Terraform conventions. Clarified that id is the internal resource identifier while list_id is the user-facing Kibana identifier (optionally user-specified or auto-generated).

  • Removed version from update requests: The version field is server-managed and distinct from _version (version_id) used for optimistic locking. Sending both could cause conflicts.

Example

// Before: Unnecessary copy to plan
plan.VersionID = state.VersionID
updateReq, _ := plan.toUpdateRequest()

// After: Direct pass from state
updateReq, _ := plan.toUpdateRequest(state.VersionID.ValueString())

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: nick-benoit <163016768+nick-benoit@users.noreply.github.com>
Copilot AI changed the title [WIP] Add security list resource Refactor security list resource to address review feedback Nov 25, 2025
Copilot AI requested a review from nick-benoit November 25, 2025 23:47
Copilot finished work on behalf of nick-benoit November 25, 2025 23:47
@nick-benoit nick-benoit force-pushed the add_security_lists branch 2 times, most recently from 1bfcb71 to 358c970 Compare November 26, 2025 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants