Separate Lambda Labs credential logic into credential.go #23
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.
Separate Lambda Labs credential logic into credential.go
Summary
This PR refactors the Lambda Labs client by extracting credential-related logic from
client.gointo a new dedicatedcredential.gofile. This separation improves code organization by cleanly separating credential concerns from client implementation concerns.Key Changes:
internal/lambdalabs/v1/credential.gowithLambdaLabsCredentialstruct and all its methodsinternal/lambdalabs/v1/client.goto remove credential code and unused importsCloudProviderIDandDefaultRegionto credential.go where they're usedclient_test.goto match actual constant valueThe refactoring maintains all existing functionality while improving code organization. Since all files remain in the same Go package, no import changes are required for referencing files.
Review & Testing Checklist for Human
NewLambdaLabsCredential()andMakeClient()still work correctlyDiagram
%%{ init : { "theme" : "default" }}%% graph TB subgraph "internal/lambdalabs/v1/" credential["credential.go<br/>LambdaLabsCredential<br/>CloudProviderID constant"]:::major-edit client["client.go<br/>LambdaLabsClient<br/>(credential code removed)"]:::major-edit client_test["client_test.go<br/>(test expectation fixed)"]:::minor-edit capabilities["capabilities.go<br/>(references credential)"]:::context credential_test["credential_test.go<br/>(tests credential)"]:::context end client -.-> credential capabilities -.-> credential credential_test -.-> credential client_test -.-> client subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
Link to Devin run: https://app.devin.ai/sessions/f72f1dfd7c6a499bbbe8307484b2622f
Requested by: @theFong