Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e3e3bf1
index on osterman/aqua-zip-exe-install: 083d3de44 chore: Upgrade Docu…
osterman Jan 9, 2026
e6e6420
On osterman/aqua-zip-exe-install: WIP: aqua-zip-exe-install changes
osterman Jan 9, 2026
79de13b
fix: Fix Aqua registry factory and add darwin_all pattern support
osterman Jan 9, 2026
93eae6f
chore: Remove duplicate test fixture directory
osterman Jan 9, 2026
39b09bd
feat: Add platform overrides support to atmos inline registry
osterman Jan 10, 2026
a7e1293
fix: Use WithBinDir in installer tests to prevent directory pollution
osterman Jan 10, 2026
17e76fe
fix: Add sanitization to toolchain info test snapshots
osterman Jan 10, 2026
fb6cd83
fix: Restore aqua/ folder and add README
osterman Jan 10, 2026
7c1b725
fix: Update tests for reserved flag conflicts and toolchain logging
osterman Jan 10, 2026
1dd7c7d
chore: Revert custom command test changes
osterman Jan 10, 2026
c9f241d
fix: Remove conflicting custom command tests and fix toolchain snapshots
osterman Jan 10, 2026
b2ff541
fix: Address CodeRabbit review comments for toolchain
osterman Jan 10, 2026
3726396
Merge branch 'main' into osterman/aqua-zip-exe-install
osterman Jan 10, 2026
9a4c03b
Merge remote-tracking branch 'origin/main' into osterman/aqua-zip-exe…
osterman Jan 10, 2026
aa7f889
fix: Regenerate describe_config_imports snapshot with toolchain debug…
osterman Jan 10, 2026
dc9f8e4
test: increase toolchain test coverage by 50%
osterman Jan 10, 2026
10a786e
fix: make toolchain tests cross-platform compatible with Windows
osterman Jan 10, 2026
c91fc66
test: improve TestIsBinaryMime and TestRealRegistryFactory assertions
osterman Jan 11, 2026
f88841e
docs: update constant comments to reference identifier names
osterman Jan 11, 2026
7cae3b4
test: fix TestIsGzipMime and replace hand-written mock with mockgen
osterman Jan 11, 2026
2cdf2b3
fix: delegate NewInstallerWithResolver to NewInstaller for registry i…
osterman Jan 11, 2026
3bba085
fix: pin mockgen to v0.6.0 and fix godot comment lints
osterman Jan 11, 2026
2004e52
Merge branch 'main' into osterman/aqua-zip-exe-install
osterman Jan 13, 2026
5ae9fb1
Merge branch 'main' into osterman/aqua-zip-exe-install
aknysh Jan 13, 2026
5849068
add/update tests
aknysh Jan 13, 2026
306e959
address comments
aknysh Jan 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
go-version-file: go.mod
- run: go mod tidy

# gofumpt
# gofumpt (installed via aqua from aqua/aqua.yaml)
- name: Get changed Go files
id: changed-files
uses: tj-actions/changed-files@e7b157b1c4ad44acfc8d9be14b8cd8f5058636e3 # v45.0.6
Expand Down
68 changes: 68 additions & 0 deletions aqua/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Aqua Package Manager Configuration

This directory contains [Aqua](https://aquaproj.github.io/) configuration for managing CLI tool versions used in CI/CD workflows.

## What is Aqua?

Aqua is a declarative CLI version manager that ensures consistent tool versions across development environments and CI pipelines. It downloads tools from their official sources and verifies checksums for security.

## Files

- **aqua.yaml** - Main configuration file that defines registries and imports
- **aqua-checksums.json** - Checksum verification file for security (auto-generated by `aqua upc`)
- **imports/*.yaml** - Individual tool definitions (one file per tool for clarity)

## Usage

### CI Workflows

The `.github/workflows/autofix.yml` workflow uses Aqua to install tools like `gofumpt`:

```yaml
- uses: aquaproj/aqua-installer@v3
with:
aqua_version: v2.43.0
- run: aqua upc -prune # Update checksums
```

After this step, tools defined in `aqua.yaml` are available on PATH.

### Local Development

Install Aqua locally:

```bash
brew install aquaproj/aqua/aqua
```

Then install tools:

```bash
aqua install
```

## Adding New Tools

1. Create a new file in `imports/` (e.g., `imports/mytool.yaml`):
```yaml
packages:
- name: owner/repo@vX.Y.Z
```

2. Update checksums:
```bash
aqua upc -prune
```

3. Commit both the import file and the updated `aqua-checksums.json`.

## Current Tools

| Tool | Version | Purpose |
|------|---------|---------|
| gofumpt | v0.7.0 | Go code formatter (stricter than gofmt) |

## References

- [Aqua Documentation](https://aquaproj.github.io/)
- [Aqua Standard Registry](https://github.com/aquaproj/aqua-registry)
7 changes: 7 additions & 0 deletions atmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,13 @@ docs:
hide_empty: false
indent_level: 2

toolchain:
registries:
# Default Aqua registry
- name: aqua
type: aqua
priority: 10

version:
check:
enabled: true
Expand Down
10 changes: 6 additions & 4 deletions cmd/toolchain/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ import (
var infoParser *flags.StandardParser

var infoCmd = &cobra.Command{
Use: "info <tool>",
Short: "Show information about a tool",
Long: `Display detailed information about a tool from the registry.`,
Args: cobra.ExactArgs(1),
Use: "info <tool>",
Short: "Show information about a tool",
Long: `Display detailed information about a tool from the registry.`,
Args: cobra.ExactArgs(1),
SilenceUsage: true, // Don't show usage on error.
SilenceErrors: true, // Don't show errors twice.
RunE: func(cmd *cobra.Command, args []string) error {
// Bind flags to Viper for precedence handling.
v := viper.GetViper()
Expand Down
4 changes: 2 additions & 2 deletions pkg/template/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ type FieldRef struct {
}

// String returns the dot-separated path of the field reference.
//
//nolint:lintroller // Simple strings.Join - perf.Track overhead disproportionate.
func (f FieldRef) String() string {
defer perf.Track(nil, "template.FieldRef.String")()

return strings.Join(f.Path, ".")
}

Expand Down
20 changes: 0 additions & 20 deletions pkg/utils/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ import (
)

func TestProcessTagCwd(t *testing.T) {
// Save and restore original working directory.
originalDir, err := os.Getwd()
require.NoError(t, err)
t.Cleanup(func() {
err := os.Chdir(originalDir)
if err != nil {
t.Errorf("failed to restore original directory: %v", err)
}
})

tests := []struct {
name string
input string
Expand Down Expand Up @@ -228,16 +218,6 @@ func TestProcessTagGitRoot_RealGitRepo(t *testing.T) {
// Skip if TEST_GIT_ROOT is already set (test isolation mode).

t.Run("Detects real Git root without TEST_GIT_ROOT override", func(t *testing.T) {
// Save and check if we're in a git repo.
originalDir, err := os.Getwd()
require.NoError(t, err)
t.Cleanup(func() {
err := os.Chdir(originalDir)
if err != nil {
t.Errorf("failed to restore original directory: %v", err)
}
})

// The atmos repo root should be detected.
result, err := ProcessTagGitRoot("!repo-root")
require.NoError(t, err)
Expand Down
65 changes: 65 additions & 0 deletions tests/fixtures/scenarios/toolchain-registry/atmos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Test fixture for toolchain registry configuration.
# Tests inline atmos registry with all supported package types and features.
#
# Supported types:
# - github_release: Asset from GitHub releases (uses owner/repo + asset template)
# - http: Direct URL download (uses full URL template)
#
# Supported formats:
# - tar.gz (default), zip, pkg, raw
#
# Supported features:
# - overrides: Platform-specific (goos/goarch) asset/format overrides
# - files: Extract specific files from archives with renamed destinations
# - replacements: OS/arch string mappings (e.g., amd64 -> x86_64)
# - binary_name: Override the binary name
# - format: Archive format (tar.gz, zip, pkg, raw)
#
# Usage:
# ./build/atmos --chdir tests/fixtures/scenarios/toolchain-registry toolchain install replicatedhq/replicated@v0.124.1
# ./build/atmos --chdir tests/fixtures/scenarios/toolchain-registry toolchain install aws/aws-cli@2.15.0

toolchain:
registries:
- name: custom-tools
type: atmos
priority: 100
tools:
# Type: github_release with platform overrides.
# Tests: asset template, goos override for darwin (uses "all" arch).
replicatedhq/replicated:
type: github_release
asset: "replicated_{{trimV .Version}}_{{.OS}}_{{.Arch}}.tar.gz"
overrides:
- goos: darwin
asset: "replicated_{{trimV .Version}}_{{.OS}}_all.tar.gz"

# Type: http with format, overrides, files, and replacements.
# Tests: Full AWS CLI pattern - zip on Linux, pkg on macOS with nested extraction.
aws/aws-cli:
type: http
url: "https://awscli.amazonaws.com/awscli-exe-{{.OS}}-{{.Arch}}-{{.Version}}.zip"
format: zip
overrides:
- goos: darwin
format: pkg
binary_name: aws

# Type: github_release with tar.gz format (default).
# Tests: Simple tar.gz extraction.
junegunn/fzf:
type: github_release
asset: "fzf-{{.Version}}-{{.OS}}_{{.Arch}}.tar.gz"
format: tar.gz

# Type: http with raw format (no extraction).
# Tests: Direct binary download without archive extraction.
jqlang/jq:
type: http
url: "https://github.com/jqlang/jq/releases/download/jq-{{.Version}}/jq-{{.OS}}-{{.Arch}}"
format: raw
binary_name: jq

- name: aqua
type: aqua
priority: 10

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

106 changes: 106 additions & 0 deletions tests/snapshots/TestCLICommands_atmos_toolchain_--help.stdout.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading