Skip to content

Align TestUtil.findCliPath() lookup order with review feedback#221

Merged
edburns merged 2 commits into
mainfrom
copilot/fix-code-review-comment
May 21, 2026
Merged

Align TestUtil.findCliPath() lookup order with review feedback#221
edburns merged 2 commits into
mainfrom
copilot/fix-code-review-comment

Conversation

Copilot AI commented May 21, 2026

Copy link
Copy Markdown
Contributor

Before the change?

  • findCliPath() prioritized PATH before COPILOT_CLI_PATH, and the method/docs drift noted in review comment r3284484448 required correction.

After the change?

  • Lookup-order alignment
    • findCliPath() now checks COPILOT_CLI_PATH first, then PATH lookup, then parent-directory fallback.
  • Javadoc alignment
    • Updated the “Resolution order” section to exactly match runtime behavior.
  • Resulting code path
    String envPath = System.getenv("COPILOT_CLI_PATH");
    if (envPath != null && !envPath.isEmpty()) {
        return envPath;
    }
    
    String copilotInPath = findCopilotInPath();
    if (copilotInPath != null) {
        return copilotInPath;
    }

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • mvn spotless:apply has been run to format the code
  • mvn clean verify passes locally

Does this introduce a breaking change?

  • Yes
  • No

Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code based on review comment May 21, 2026
Copilot AI requested a review from edburns May 21, 2026 23:04
@edburns edburns marked this pull request as ready for review May 21, 2026 23:41
Copilot AI review requested due to automatic review settings May 21, 2026 23:41

Copilot AI 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.

Pull request overview

Aligns TestUtil.findCliPath() (used by test suites that need a Copilot CLI) with prior review feedback by making the runtime lookup order match the documented “Resolution order”, prioritizing explicit configuration via COPILOT_CLI_PATH.

Changes:

  • Updated findCliPath() to check COPILOT_CLI_PATH first, then PATH lookup, then parent-directory fallback.
  • Updated the Javadoc “Resolution order” list to match the implemented behavior.
Show a summary per file
File Description
src/test/java/com/github/copilot/sdk/TestUtil.java Reorders CLI path resolution to prefer COPILOT_CLI_PATH and updates Javadoc to match.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
@edburns edburns merged commit f3e157f into main May 21, 2026
14 checks passed
@edburns edburns deleted the copilot/fix-code-review-comment branch May 21, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants