Skip to content

Code quality: Rename credentialId to clusterId in ClustersClient methods #567

Closed

Description

Problem

Two methods in ClustersClient.ts use credentialId as a parameter name for what is semantically a clusterId — the stable cluster identifier used for cache lookups:

  • exists(credentialId: string) — line 431
  • deleteClient(credentialId: string) — line 445

This is inconsistent with:

  1. The Cluster ID Architecture documented in copilot-instructions.md which marks clusterId as the correct stable key for CredentialCache and ClustersClient
  2. Other ClustersClient methods: getClient(clusterId), getExistingClient(clusterId)
  3. All methods in CredentialCache.ts which consistently use clusterId

Investigation

  • CredentialCache.ts: All 10+ methods use clusterId consistently ✅
  • ClustersClient.ts: 2 of 4 methods use credentialId ❌, 2 use clusterId ✅

The inconsistency appears to be a naming oversight — functionally, both parameters are used as keys into the same _clients Map which is keyed by clusterId.

Recommendation

Rename the parameter from credentialId to clusterId in both methods. This is a purely cosmetic rename with no functional impact but improves code clarity and alignment with the documented architecture.

Context

Identified during PR #508 review (Finding M10).

Activity

  1. added a commit that references this issue on Apr 11, 2026
    dac30ef
  2. added a commit that references this issue on Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issue

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions