Skip to content

feat: transition to ID-based management for ACLs and Node Attributes#16

Merged
jaxxstorm merged 1 commit intomainfrom
resource_ids
Jan 21, 2025
Merged

feat: transition to ID-based management for ACLs and Node Attributes#16
jaxxstorm merged 1 commit intomainfrom
resource_ids

Conversation

@jaxxstorm
Copy link
Copy Markdown
Member

@jaxxstorm jaxxstorm commented Jan 21, 2025

Important

Transition TACL system to ID-based management for ACLs and Node Attributes, updating both backend logic and Terraform provider.

  • Behavior:
    • Transition from index-based to ID-based management for ACLs and Node Attributes in acls.go and nodeattributes.go.
    • Each ACL and Node Attribute now has a stable UUID for identification.
    • Updated HTTP routes to handle CRUD operations by ID.
  • Terraform Provider:
    • Updated acl_resource.go and nodeattr_resource.go to manage resources by stable ID instead of index.
    • Adjusted schema definitions to reflect ID-based management.
    • Enhanced error handling for not found resources using isNotFound().
  • Sync and Helpers:
    • Modified sync.go to push ACLs to Tailscale using ID-based JSON.
    • Added helper functions in helpers.go for ID-based operations and error handling.
  • Misc:
    • Added README.md for project documentation.

This description was created by Ellipsis for 81f62b6. It will automatically update as commits are pushed.

@ellipsis-dev ellipsis-dev bot changed the title ... feat: transition to ID-based management for ACLs and Node Attributes Jan 21, 2025
@jaxxstorm jaxxstorm merged commit d89a2a4 into main Jan 21, 2025
@jaxxstorm jaxxstorm deleted the resource_ids branch January 21, 2025 23:13
Copy link
Copy Markdown

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 81f62b6 in 1 minute and 13 seconds

More details
  • Looked at 2167 lines of code in 7 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. pkg/acl/acls/acls.go:134
  • Draft comment:
    Consider using a consistent error message for missing IDs across functions. For example, use "Missing 'id' field" in both updateACL and deleteACL.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code in pkg/acl/acls/acls.go has inconsistent error messages for missing IDs. In updateACL, the error message is "Missing ACL 'id' in request body", while in deleteACL, it's "Missing 'id' field". These should be consistent for clarity.
2. pkg/acl/nodeattributes/nodeattributes.go:152
  • Draft comment:
    Consider using a consistent error message for missing IDs across functions. For example, use "Missing 'id' field" in both updateNodeAttr and deleteNodeAttr.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code in pkg/acl/nodeattributes/nodeattributes.go has inconsistent error messages for missing IDs. In updateNodeAttr, the error message is "Missing 'id' in request body", while in deleteNodeAttr, it's "Missing 'id' field". These should be consistent for clarity.
3. pkg/sync/sync.go:102
  • Draft comment:
    The comment "also remove any other custom fields if you want" is misleading as no other fields are removed. Consider updating or removing this comment.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In pkg/sync/sync.go, the removeIDFields function has a comment suggesting the removal of other custom fields, but it doesn't actually remove any other fields. This comment might be misleading.
4. terraform/provider/acl_resource.go:137
  • Draft comment:
    Good use of doACLIDRequest for HTTP operations, ensuring consistent request handling across functions.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    In terraform/provider/acl_resource.go, the Create function uses doACLIDRequest for making HTTP requests. This function is defined in the same file and is used consistently across other functions for HTTP operations, which is good for maintainability.
5. terraform/provider/nodeattr_resource.go:148
  • Draft comment:
    Good use of doNodeAttrIDRequest for HTTP operations, ensuring consistent request handling across functions.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    In terraform/provider/nodeattr_resource.go, the Create function uses doNodeAttrIDRequest for making HTTP requests. This function is defined in the same file and is used consistently across other functions for HTTP operations, which is good for maintainability.

Workflow ID: wflow_GoQnwtfLkuhXeR4n


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

1 participant