Description:
The action.yml currently contains significant amounts of complex logic embedded directly within bash run steps. This approach makes the action difficult to test, maintain, and debug. Refactoring this logic into a dedicated TypeScript package will improve code quality, enable proper unit testing, and enhance reusability.
Specific areas for refactoring:
- Input Validation Logic: The
Validate Inputs step contains extensive conditional logic for validating authentication methods and input combinations. This should be moved into a TypeScript module.
- Gemini CLI Installation Logic: The
Install Gemini CLI step handles different installation methods based on the gemini_cli_version. This logic, including npm and git operations, should be encapsulated in a TypeScript function.
- Gemini CLI Execution and Output Handling: The
Run Gemini CLI step manages the execution of the Gemini CLI, captures its stdout/stderr, and handles error conditions. The output parsing and error reporting could be made more robust and testable in a TypeScript module.
- Telemetry Upload Logic: The
Upload Telemetry to Google Cloud step involves Docker commands, file manipulation, and a polling mechanism. This complex sequence should be refactored into a dedicated TypeScript module for better testability and maintainability.
Acceptance Criteria:
- All identified complex bash logic is replaced with calls to functions within a new TypeScript package.
- The
action.yml remains focused on orchestrating steps rather than implementing detailed logic.
- A clear project structure for the TypeScript package is established (e.g.,
src/, dist/, package.json).
Description:
The
action.ymlcurrently contains significant amounts of complex logic embedded directly withinbashrunsteps. This approach makes the action difficult to test, maintain, and debug. Refactoring this logic into a dedicated TypeScript package will improve code quality, enable proper unit testing, and enhance reusability.Specific areas for refactoring:
Validate Inputsstep contains extensive conditional logic for validating authentication methods and input combinations. This should be moved into a TypeScript module.Install Gemini CLIstep handles different installation methods based on thegemini_cli_version. This logic, including npm and git operations, should be encapsulated in a TypeScript function.Run Gemini CLIstep manages the execution of the Gemini CLI, captures its stdout/stderr, and handles error conditions. The output parsing and error reporting could be made more robust and testable in a TypeScript module.Upload Telemetry to Google Cloudstep involves Docker commands, file manipulation, and a polling mechanism. This complex sequence should be refactored into a dedicated TypeScript module for better testability and maintainability.Acceptance Criteria:
action.ymlremains focused on orchestrating steps rather than implementing detailed logic.src/,dist/,package.json).