Skip to content

Address PR review comments: fix path parsing safety and improve dependency injection#34

Merged
jcleigh merged 2 commits intofix-consistency-add-testsfrom
copilot/sub-pr-33
Jan 8, 2026
Merged

Address PR review comments: fix path parsing safety and improve dependency injection#34
jcleigh merged 2 commits intofix-consistency-add-testsfrom
copilot/sub-pr-33

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

Addresses two code review findings from previous commits.

Path parsing in internal/doctor/consistency.go

  • Handle branch names containing slashes (e.g., feature/new-ui) by joining all path parts beyond index 3
  • Previous implementation only accessed parts[3], truncating multi-segment branch names

Dependency injection in internal/version/update.go

  • Replace global mutable state with UpdateChecker struct for testability
  • Add constructors: NewUpdateChecker() and NewUpdateCheckerWithURL(url)
  • Maintain backward compatibility via deprecated ReleaseURL global variable
// New approach - dependency injection
checker := NewUpdateCheckerWithURL(customURL)
updateAvailable, version, url, err := checker.CheckForUpdate(ctx)

// Still works - backward compatible
updateAvailable, version, url, err := CheckForUpdate(ctx)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…checker

Co-authored-by: jcleigh <12815554+jcleigh@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 8, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/foundagent/foundagent/releases/latest
    • Triggering command: /tmp/go-build2589942544/b001/version.test /tmp/go-build2589942544/b001/version.test -test.testlogfile=/tmp/go-build2589942544/b001/testlog.txt -test.paniconexit0 -test.timeout=10m0s (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Fix consistency and add tests for repository management CLI Address PR review comments: fix path parsing safety and improve dependency injection Jan 8, 2026
Copilot AI requested a review from jcleigh January 8, 2026 15:27
@jcleigh jcleigh marked this pull request as ready for review January 8, 2026 16:02
@jcleigh jcleigh merged commit 97ded91 into fix-consistency-add-tests Jan 8, 2026
@jcleigh jcleigh deleted the copilot/sub-pr-33 branch January 8, 2026 16:03
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.

2 participants