Commit fd590f4
fix: Fix Aqua registry factory and add darwin_all pattern support (#1948)
* index on osterman/aqua-zip-exe-install: 083d3de chore: Upgrade Docusaurus from 3.6.3 to 3.9.2 (#1926)
* fix: Fix Aqua registry factory and add darwin_all pattern support
- Fix nil registry factory by injecting real Aqua registry factory
- Load configured registries from atmos.yaml in NewInstaller()
- Add Asset field to AquaPackage for github_release types
- Support platform-specific asset patterns (e.g., darwin_all)
- Add test for replicated darwin_all override pattern
- Move test fixtures to proper testdata directories
- Clean up unnecessary aqua config files
- Refactor FindTool to reduce complexity and improve logging
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* chore: Remove duplicate test fixture directory
Remove toolchain/installer/atmos/ which was accidentally committed
alongside the proper test fixture at toolchain/installer/testdata/atmos/.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: Add platform overrides support to atmos inline registry
- Add parseOverrides() to parse platform-specific asset/format overrides in
atmos inline registry (goos/goarch matching with custom asset templates)
- Fix toolchain info command to show correct registry name from tool metadata
instead of always showing "aqua-public"
- Add debug/warning logging when loading registries from atmos.yaml to help
diagnose registry configuration issues
- Add comprehensive test fixture with all supported package types
(github_release, http) and formats (tar.gz, zip, pkg, raw)
- Add CLI test cases for toolchain help, info, registry search, and error handling
- Fix lint errors in pkg/template/ast.go and pkg/utils/git_test.go
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: Use WithBinDir in installer tests to prevent directory pollution
Tests were using SetAtmosConfig() but then calling installer.New()
which doesn't read from the config. This caused binaries to be
installed to the current directory (toolchain/installer/atmos/)
instead of temp directories.
Fixed by:
- Using WithBinDir(tempDir) when creating the installer
- Using separate src/bin directories to avoid filename conflicts
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: Add sanitization to toolchain info test snapshots
Add sanitize rules to replace dynamic version numbers and dates with
stable placeholders (X.X.X and YYYY-MM-DD) in toolchain info tests.
This prevents test failures when new tool versions are released.
Affected tests:
- atmos toolchain info shows atmos-inline registry
- atmos toolchain info http type tool
- atmos toolchain info tar.gz format tool
- atmos toolchain info raw format tool
- atmos toolchain info yaml output
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: Restore aqua/ folder and add README
The aqua/ folder was accidentally deleted, causing CI failures with
"gofumpt: command not found" in the autofix workflow. The aqua-installer
action needs aqua.yaml to know which tools to install.
Restored:
- aqua/aqua.yaml - Main Aqua config
- aqua/imports/gofumpt.yaml - gofumpt v0.7.0 definition
- aqua/aqua-checksums.json - Security checksums
Added:
- aqua/README.md - Documentation explaining the folder's purpose
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: Update tests for reserved flag conflicts and toolchain logging
1. Custom command integration tests: Rename `--verbose/-v` flag to
`--detailed/-d` to avoid conflicts with the new global `--verbose`
flag registered on RootCmd.
2. Regenerate CLI snapshots to include new debug logs from toolchain
registry loading:
- "Loading toolchain registries from atmos.yaml"
- "Successfully loaded configured registry from atmos.yaml"
3. Update toolchain info snapshot for CI environment (no versions
installed).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: Revert custom command test changes
The verbose->detailed flag rename is being handled in a separate branch:
osterman/fix-custom-cmd-flag-conflict
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: Remove conflicting custom command tests and fix toolchain snapshots
1. Remove TestCustomCommandIntegration_BooleanFlagDefaults and
TestCustomCommandIntegration_BooleanFlagTemplatePatterns tests that
use --verbose flag which conflicts with global --verbose flag.
(Being handled in osterman/fix-custom-cmd-flag-conflict branch)
2. Add ignore_trailing_whitespace to toolchain info test - lipgloss
table padding varies by platform/terminal width
3. Add platform sanitization (darwin/linux_arm64/amd64 -> linux_amd64)
to toolchain info yaml output test
4. Regenerate toolchain snapshots with proper sanitization
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: Address CodeRabbit review comments for toolchain
- Fix info command to show proper error for non-existent tools instead
of "incorrect usage" by adding SilenceUsage and SilenceErrors flags
- Add missing test case for "atmos toolchain info non-existent tool"
- Regenerate snapshots for correct CI environment (no installed tools)
- Fix comment casing in clean_test.go and setup.go for godot linter
- Update usage.mdx to use {{.Version}} template syntax consistently
- Add notes for example version and upstream path changes in docs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: Regenerate describe_config_imports snapshot with toolchain debug lines
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test: increase toolchain test coverage by 50%
Add comprehensive tests for toolchain packages:
- extract_test.go: Tests for file extraction functions (isGzipMime, isBinaryMime,
isTarGzFile, resolveBinaryName, validatePath, isSafePath, findBinaryInDir,
installExtractedBinary, Unzip, copyFileFallback, copyWithLimit, extractDir)
- download_test.go: Tests for download functions (writeResponseToCache,
buildDownloadError, isHTTP404, downloadAsset cache behavior)
- asset_test.go: Additional tests for template functions (trimPrefix, trimSuffix,
replace, eq, ne, ternary) and edge cases (missing owner/name, default template)
- types_test.go: Tests for wrapper functions (NewInstaller options, registry
factory, builtin aliases)
Coverage improved from ~5% to 55.7% for toolchain/installer package.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: make toolchain tests cross-platform compatible with Windows
- Remove query string filename test case from download_test.go (? is
invalid in Windows filenames and GitHub releases don't use query
strings anyway)
- Use filepath.FromSlash() in TestValidatePath to handle OS-specific
path separators
- Add windows to platform sanitization regex in toolchain.yaml so
Windows-specific asset URLs are normalized in snapshots
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test: improve TestIsBinaryMime and TestRealRegistryFactory assertions
- TestIsBinaryMime: Refactor to actually verify isBinaryMime() behavior
instead of discarding the result. Tests now create real files with
appropriate content (octet-stream, zip, gzip, text) and assert the
function correctly identifies binary vs non-binary MIME types.
- TestRealRegistryFactory_NewAquaRegistry: Set XDG_CACHE_HOME to temp
dir for hermetic testing, avoiding writes to real user cache and
preventing environment-specific test flakiness.
Addresses CodeRabbit review feedback.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: update constant comments to reference identifier names
Update comments for unexported constants to explicitly reference the
constant identifier name in parentheses, maintaining godot linter
compliance while documenting the identifier:
- defaultMkdirPermissions in clean_test.go
- defaultDirPermissions and versionPrefix in setup.go
Addresses CodeRabbit review feedback.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test: fix TestIsGzipMime and replace hand-written mock with mockgen
- TestIsGzipMime: Always call isGzipMime() and assert the result
for all test cases (both true and false), not just when expected=true.
This ensures negative cases (zip, octet-stream) are actually validated.
- Replace hand-written mockToolRegistryForTypes with mockgen-generated
MockToolRegistry. Add //go:generate directives to registry.go and
types.go for generating mocks in both packages.
Addresses CodeRabbit review feedback.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: delegate NewInstallerWithResolver to NewInstaller for registry injection
The deprecated NewInstallerWithResolver was bypassing the realRegistryFactory
injection by calling installer.NewInstallerWithResolver directly. Now it
delegates to NewInstaller with the appropriate options, ensuring callers of
the deprecated function still get the registry factory injection.
Addresses CodeRabbit review feedback.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: pin mockgen to v0.6.0 and fix godot comment lints
- Change mockgen@latest to mockgen@v0.6.0 in go:generate directives
for reproducible builds (matches go.mod version)
- Fix multi-line comment in NewInstaller to have periods on each line
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* add/update tests
* address comments
---------
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: Andriy Knysh <aknysh@users.noreply.github.com>
Co-authored-by: aknysh <andriy.knysh@gmail.com>1 parent 860160f commit fd590f4
File tree
83 files changed
+4708
-484
lines changed- .github/workflows
- aqua
- cmd/toolchain
- pkg
- template
- utils
- tests
- fixtures/scenarios/toolchain-registry
- snapshots
- test-cases
- toolchain
- installer
- testdata/atmos/1.0.0
- registry
- aqua
- testdata
- atmos
- website/docs/cli/commands/toolchain
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
83 files changed
+4708
-484
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
410 | 417 | | |
411 | 418 | | |
412 | 419 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | 20 | | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 13 | | |
24 | 14 | | |
25 | 15 | | |
| |||
228 | 218 | | |
229 | 219 | | |
230 | 220 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | 221 | | |
242 | 222 | | |
243 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments