Skip to content

refactor(functions): use string arrays instead of Sets in kit install helpers - #11008

Merged
inlined merged 1 commit into
mainfrom
refactor_set_to_array
Aug 31, 2026
Merged

refactor(functions): use string arrays instead of Sets in kit install helpers#11008
inlined merged 1 commit into
mainfrom
refactor_set_to_array

Conversation

@inlined

@inlined inlined commented Aug 31, 2026

Copy link
Copy Markdown
Member

Description

Refactors function kit installation helper APIs (extractExistingFunctionsInfo, promptKitInstanceId, promptKitId, generateUniqueId, and ExistingFunctionsInfo) to use standard string[] arrays instead of Set<string> per codebase conventions (using intrinsic arrays in module APIs).

Extracted from #11007 to reduce PR size and isolate refactoring.

Scenarios Tested

  • Unit tests in src/functions/kits/install.spec.ts (npm run mocha:fast -- src/functions/kits/install.spec.ts).
  • Verified unique ID generation and suffix collision avoidance with string arrays.
  • Verified existing kit, codebase, and instance ID validation and prompt collisions.

Sample Commands

N/A (Internal refactoring)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the tracking of existing kit IDs, codebase names, and instance IDs from Set to string arrays in both the implementation and test files. The review feedback points out that the uniqueness checks using .includes when populating these arrays are redundant because the source data is already validated and guaranteed to be unique, suggesting a simplification to avoid unnecessary lookups.

Comment thread src/functions/kits/install.ts Outdated
… helpers

### Description
Refactors function kit installation helper APIs (`extractExistingFunctionsInfo`, `promptKitInstanceId`, `promptKitId`, `generateUniqueId`, and `ExistingFunctionsInfo`) to use standard `string[]` arrays instead of `Set<string>` per codebase conventions (using intrinsic arrays in module APIs).

### Scenarios Tested
- Unit tests in `src/functions/kits/install.spec.ts` (`npm run mocha:fast -- src/functions/kits/install.spec.ts`).
- Verified unique ID generation and suffix collision avoidance with string arrays.
- Verified existing kit, codebase, and instance ID validation and prompt collisions.

### Sample Commands
N/A (Internal refactoring)
@inlined
inlined force-pushed the refactor_set_to_array branch from c9046b3 to cf9170e Compare August 31, 2026 22:33
Comment thread src/functions/kits/install.spec.ts
Comment thread src/functions/kits/install.ts
@inlined
inlined merged commit 6df7db4 into main Aug 31, 2026
51 checks passed
@inlined
inlined deleted the refactor_set_to_array branch August 31, 2026 23:08
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.

3 participants