8000 Tags · go-nv/goenv · GitHub
[go: up one dir, main page]

Skip to content {"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}

Tags

Tags

2.2.48

Toggle 2.2.48's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Update APP_VERSION to 2.2.48 (#612)

Co-authored-by: goenv-bot <goenv-bot@users.noreply.github.com>

2.2.47

Toggle 2.2.47's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Update APP_VERSION to 2.2.47 (#610)

Co-authored-by: goenv-bot <goenv-bot@users.noreply.github.com>

3.2.2

Toggle 3.2.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix(tools): ensure tool management functions correctly across multipl… (

#608)

* fix(tools): ensure tool management functions correctly across multiple directories and isolate test environments

* fix(tools): refactor updateTool to use toolspkg.InstallTools for better binary management

3.2.1

Toggle 3.2.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat(cache): add --current flag to cache clean command for scoped cle… (

#606)

* feat(cache): add --current flag to cache clean command for scoped cleaning
test(cache): add end-to-end tests for architecture-suffixed cache cleaning
fix(cache): update cache directory structure to reflect new layout

* refactor: replace hardcoded paths with config methods for improved maintainability

* fix(cache): ensure custom GOCACHE_DIR is considered in cache status and clean commands

2.2.46

Toggle 2.2.46's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Update APP_VERSION to 2.2.46 (#604)

Co-authored-by: goenv-bot <goenv-bot@users.noreply.github.com>

3.2.0

Toggle 3.2.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix(update): request elevation instead of failing on unwritable insta…

…ll dirs (#601)

* fix(update): request elevation instead of failing on unwritable install dirs

`goenv update` aborted with "cannot update binary" whenever the install
directory was not user-writable, leaving the user to re-run the whole
thing under sudo.

The permission check was also asking the wrong question. It opened the
binary O_WRONLY, but replacement is a rename in the parent directory, so
directory write access is what decides it. That made the check both too
strict (a read-only binary in a writable directory is replaceable) and
wrong on Linux, where opening the running executable for writing returns
ETXTBSY. canReplaceBinary now probes the directory with a real file,
which also covers read-only mounts and ACLs.

When the directory is not writable, only the install step is escalated:

- The download, checksum verification and archive extraction all run as
  the invoking user, staged in a 0700 temp directory. An unverified
  release is never executed with elevated privileges, and root only
  reads a file this process created in a directory it owns.
- Unix runs `install -m 0755` to a temporary name in the destination
  directory followed by `mv -f`, so an interrupted install cannot leave
  a truncated executable on PATH. Stdin is inherited for the password
  prompt.
- Windows launches the existing update batch script through
  `Start-Process -Verb RunAs`, since a non-elevated process has no sudo
  to exec into. The script and staged binary stay in the private temp
  directory.

Escalation is never implicit: it requires both a TTY and an explicit
confirmation, so a scripted or CI invocation gets the manual
instructions rather than an unattended write to a system directory.
--no-elevate opts out entirely.

Package-manager installs are refused rather than escalated. Overwriting
a Homebrew keg leaves `brew list --versions goenv` describing a version
that is no longer installed and the next `brew upgrade` silently reverts
the update, so Homebrew, Nix, Scoop, Chocolatey and asdf paths are
detected and answered with the right upgrade command.

* test(update): fix the elevation tests on Windows

Three failures on the Windows runner, only one of which was about
permission semantics.

TestCanReplaceBinary/read-only_directory: os.Chmod on Windows only
toggles FILE_ATTRIBUTE_READONLY, which says nothing about creating
entries inside a directory, so the unwritable case cannot be staged
there. Skip that subtest only — the other three exercise
canReplaceBinary just as well on Windows, and the function is
platform-agnostic by design: it probes with a real file, so an
ACL-protected directory fails it for real.

TestElevationInstructions: not a permissions problem. filepath.Dir
cleans to the host separator, so "/usr/local/bin/goenv" became
"\usr\local\bin" and the assertion missed. Skipping it would have
dropped coverage of the Windows branch, which is the branch that
matters on Windows, so assert against the expected text per platform
instead.

TestUpdateCommand_WritePermissionError: a duplicate of
TestCanReplaceBinary introduced when the file-mode check was replaced.
Removed rather than skipped.

3.1.7

Toggle 3.1.7's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix(update): stop burning GitHub API quota on every update check (#599)

* fix(update): stop burning GitHub API quota on every update check

The ETag cache was write-only: the release payload itself was never
stored, so a 304 response became a hard error and every check had to
spend a rate limit unit on a full request. Unauthenticated users get
60 requests/hour per IP, so `goenv update` failed with "GitHub API
rate limit exceeded".

- Cache the release list next to its ETag and serve it on 304, so
  repeat checks are conditional requests that don't count against the
  rate limit.
- Fall back to the cached list when the API is rate limited or
  unreachable instead of failing outright.
- Add a last-resort lookup via releases.atom, which is served by
  github.com rather than the REST API and so has no API rate limit.
  Tags are filtered by the running binary's major version to keep the
  assetless v2 line out of the result (issue #582).
- Drop per_page from 50 to 10; still well past any run of assetless v2
  releases, with a much smaller payload.
- Point the rate limit error at GITHUB_TOKEN.

Extracts fetchReleases/rateLimitReset/retryDelay/cacheReleases so the
retry and rate limit paths are testable.

* chore(deps): tidy modules and ignore local issue cache

3.1.6

Toggle 3.1.6's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
chore: update v3 GitHub Actions to use latest versions of actions (#596)

* chore: update GitHub Actions to use latest versions of actions

* fix: ensure cleanup recommendations align with installation markers and add regression tests

* fix: improve GOROOT advice for better user guidance and VS Code integration

* fix: improve VS Code integration by deprecating environment variable mode and enhancing prompts

- Deprecated the use of environment variables in VS Code settings, which the Go extension ignores.
- Updated prompts in `goenv use` and `goenv local` to prevent silent overwrites of `.vscode/settings.json` when stdin is non-interactive.
- Added tests to ensure that the deprecated flags are correctly marked and that settings are not modified without explicit consent.
- Enhanced documentation to clarify the new workflow for VS Code integration and the implications of the deprecation.

* feat: add 'fix-extension' command for VS Code integration and implement e2e tests

2.2.45

Toggle 2.2.45's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Update APP_VERSION to 2.2.45 (#598)

Co-authored-by: goenv-bot <goenv-bot@users.noreply.github.com>

3.1.5

Toggle 3.1.5's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat: refactor buil
5292
d process to output binaries to bin/ directory (#594)

* feat: refactor build process to output binaries to bin/ directory

- Updated the build function to create binaries in the bin/ directory instead of the repository root.
- Added builtBinaryPath function to determine the output path for the binary.
- Implemented sameFile function to check if two paths refer to the same file.
- Modified install function to copy the binary from the new output path.

fix: update swap script to locate goenv binary in bin/ directory

- Adjusted the path for the goenv binary to point to the bin/ directory.
- Added fallback to check for legacy binary location in the repository root.

test: add end-to-end tests for goenv functionality

- Created e2e tests to validate the behavior of the goenv binary in an isolated environment.
- Implemented helper functions for managing test environments and executing commands.
- Added tests for various user journeys, including version selection and installation.

test: add release selection tests for install.sh

- Implemented tests to ensure the installer selects the correct release based on available binaries.
- Added a fixture server to serve mock GitHub releases data for testing.
- Verified that unsupported platforms do not select any releases.

* fix(cache): ensure shared module cache is visible and reclaimable (Fixes #578)

* fix: prevent infinite loops from in-process subcommand dispatch in install and local commands

* feat: enhance GitHub Actions workflow and add workflow linting

- Added support for both master and main branches in the workflow triggers.
- Introduced a new job for linting workflow files using actionlint to ensure proper formatting and catch errors early.

fix: improve goenv shim handling and migration logic

- Updated the logic to remove stale v2 goenv shims, ensuring only valid shims are retained.
- Enhanced detection of goenv shims to avoid mistakenly classifying binaries as shims.
- Added tests to verify that generated shims carry the correct markers and that unrelated scripts are ignored.

refactor: streamline PowerShell installation script

- Cleaned up the PowerShell installation script for better readability and maintainability.
- Ensured that the installation process handles errors gracefully and provides clear output to the user.

test: improve end-to-end tests for goenv

- Added tests to verify the behavior of the doctor command in detecting and fixing recursive goenv shims.
- Enhanced the test environment setup to allow network access when necessary, ensuring tests can reach external resources when required.

* Refactor goenv shim handling and improve Windows support

- Introduced goenvShimNamesFor function to handle platform-specific shim names.
- Updated Windows shim generation to use a consistent extension defined in shims.
- Added comprehensive tests for Windows shim generation and behavior.
- Enhanced error handling for API responses in release selection tests.
- Improved diagnostics in end-to-end tests to aid in troubleshooting.
- Updated GitHub release fixtures to match the actual API response structure.

* fix: accept legacy --print flag in goenv latest command for compatibility

* fix: handle GitHub API rate limits in install scripts and tests

* fix: improve error handling in install script and add checksum verification tests

* fix: update binary extraction to stage in destination directory for atomic renaming
0