Skip to content

Conversation

@kycheng
Copy link
Collaborator

@kycheng kycheng commented Aug 28, 2025

…s and improve test command execution

@kycheng kycheng requested a review from Copilot August 29, 2025 07:59
Copy link

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 enhances the upgrade command functionality by adding support for custom environment variables in command execution and improving the test command execution logic to handle workspace paths more efficiently.

  • Adds environment variable support to the Command struct and execution logic
  • Improves workspace path handling in the upgrade command for test execution
  • Refactors test subpath logic to be more flexible and maintainable

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/exec/exec.go Adds Env field to Command struct and implements environment variable inheritance with custom variable support
cmd/upgrade_command.go Refactors workspace path construction logic for test command execution to handle optional test subpaths

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

Comment on lines +200 to +202
workspace := uc.config.OperatorConfig.Workspace
if version.TestSubPath != "" {
workspace = fmt.Sprintf("%s/%s", uc.config.OperatorConfig.Workspace, version.TestSubPath)
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

The workspace path construction duplicates uc.config.OperatorConfig.Workspace. Consider using filepath.Join() for cross-platform path handling and store the base workspace in a variable to avoid repetition.

Suggested change
workspace := uc.config.OperatorConfig.Workspace
if version.TestSubPath != "" {
workspace = fmt.Sprintf("%s/%s", uc.config.OperatorConfig.Workspace, version.TestSubPath)
baseWorkspace := uc.config.OperatorConfig.Workspace
workspace := baseWorkspace
if version.TestSubPath != "" {
workspace = filepath.Join(baseWorkspace, version.TestSubPath)

Copilot uses AI. Check for mistakes.
@kycheng kycheng merged commit e58752e into main Aug 29, 2025
2 checks passed
@kycheng kycheng deleted the feat/env branch August 29, 2025 10:30
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