Skip to content

Conversation

@gautambaghel
Copy link
Member

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.

  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.

  • If applicable, I've documented the impact of any changes to security controls.

    Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.

@gautambaghel gautambaghel requested a review from a team as a code owner August 19, 2025 23:29

This comment was marked as outdated.

Copy link
Contributor

@mayank-sisodiya mayank-sisodiya left a comment

Choose a reason for hiding this comment

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

Should we update the packaging of the tools as well for registry & tfe tools?
Example tools/registry/get_latest_provider_version.go & tools/terraform/list_orgs.

@gautambaghel
Copy link
Member Author

gautambaghel commented Aug 20, 2025

@mayank-sisodiya

Should we update the packaging of the tools as well for registry & tfe tools? Example tools/registry/get_latest_provider_version.go & tools/terraform/list_orgs.

Sure!

On second thought, let's address that in a later PR when list becomes longer

This comment was marked as outdated.

@gautambaghel gautambaghel requested a review from Copilot August 20, 2025 08:09
Copy link
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 PR separates the previously combined TFE (Terraform Enterprise/Cloud) and HTTP clients into distinct, independently managed clients. The refactor improves client management by creating separate client types with their own lifecycle management and context retrieval methods.

Key changes:

  • Split the monolithic terraformClients struct into separate TFE and HTTP client management
  • Created dedicated client files (tfe_client.go, registry_client.go, session.go) with independent storage and retrieval
  • Updated all tool handlers to use the appropriate client type based on their functionality

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/utils/utils.go Added utility function for environment variable retrieval
pkg/client/client.go Removed monolithic client structure - replaced by separate client files
pkg/client/tfe_client.go New file implementing TFE client management and context retrieval
pkg/client/registry_client.go New file implementing HTTP client management for registry operations
pkg/client/session.go New file handling session lifecycle for both client types
pkg/client/common.go Added shared utility function for TLS verification parsing
pkg/client/middleware.go Updated to use the new utility function location
pkg/tools/*.go Updated all tool handlers to use appropriate client retrieval methods
pkg/resources/*.go Updated resource handlers to use HTTP client retrieval
pkg/tools/dynamic_tool.go Updated to use direct TFE client retrieval
CHANGELOG.md Added reference to this PR

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@gautambaghel gautambaghel merged commit 7961cc0 into main Aug 20, 2025
32 checks passed
@gautambaghel gautambaghel deleted the fix/clients branch August 20, 2025 17:52
@github-actions
Copy link

Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes.

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