Skip to content

feat: add version parameter to install scripts - #323

Merged
zeroshade merged 11 commits into
mainfrom
feat/windows-install-version-param
Feb 25, 2026
Merged

zeroshade merged 11 commits into
mainfrom
feat/windows-install-version-param

Conversation

@zeroshade

@zeroshade zeroshade commented Feb 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds version parameter support to both Windows and Unix install scripts, allowing users to install specific versions of dbc instead of always defaulting to 'latest'.

Changes

Windows PowerShell Script (scripts/install.ps1)

  • Added -Version parameter to specify version (e.g., 0.2.0, v0.2.0, or latest)
  • Automatic normalization strips 'v'/'V' prefix from version strings
  • Defaults to 'latest' for backward compatibility
  • Updated script help documentation

Bash Script (scripts/install.sh)

  • Added --version parameter to specify version (long form only to avoid conflict with -v verbose flag)
  • Automatic normalization strips 'v'/'V' prefix from version strings
  • Version format validation (semantic version or 'latest')
  • Rejects empty/invalid versions with helpful error messages
  • Defaults to 'latest' for backward compatibility
  • Updated help documentation with examples
  • POSIX shell compliant

Documentation

  • Added version parameter examples to docs/getting_started/installation.md
  • Added version parameter examples to README.md
  • Shows download-then-run approach for Windows version-specific installs

Usage Examples

Windows:

# Default (latest)
.\install.ps1

# Specific version
.\install.ps1 -Version "0.2.0"

# With v prefix
.\install.ps1 -Version "v0.2.0"

Linux/macOS:

# Default (latest)
./install.sh

# Specific version
./install.sh --version 0.2.0

# With v prefix
./install.sh --version v0.2.0

Testing

  • ✅ Backward compatibility maintained (defaults to 'latest')
  • ✅ Version normalization works across all formats
  • ✅ Windows script help displays correctly
  • ✅ Bash script version validation works
  • ✅ POSIX shell compliance verified
  • ✅ Documentation examples are accurate

Commits

  • feat: add -Version parameter to Windows install script
  • docs: add examples for version parameter in Windows install
  • feat: add APP_VERSION environment variable support
  • refactor: remove APP_VERSION env var, keep only -Version param
  • feat: add --version parameter to bash install script
  • fix: improve version parameter validation and quoting
  • fix: correct empty version string validation logic

Allow users to specify which version to install via -Version parameter.
Accepts semantic versions with or without 'v' prefix, or 'latest'.
Defaults to 'latest' for backward compatibility.
Check APP_VERSION environment variable as fallback before defaulting
to 'latest'. Priority: -Version parameter > APP_VERSION env var > 'latest'.
Simplify version handling by accepting only the -Version parameter.
Removed APP_VERSION environment variable fallback for clarity.
Allow users to specify which version to install via --version parameter.
Accepts semantic versions with or without 'v' prefix, or 'latest'.
Defaults to 'latest' for backward compatibility.
- Add version format validation (semantic version or 'latest')
- Fix variable quoting in test conditions
- Reject empty version strings with helpful error
- Combine version processing into single block
Replace contradictory nested conditions with single check that properly
rejects both missing and empty version arguments.

@amoeba amoeba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea makes sense but I'm not sure what the rationale is. And I'm not sure we want to advertise that users install non-latest versions of dbc ever.

@zeroshade

Copy link
Copy Markdown
Member Author

It's needed for consistency with a github action. Users need to be able to pin installing a specific version, even from these scripts. (this functionality would already be available via uv/pip install etc. which could pin a specific version of the CLI to install)

@amoeba amoeba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, I think it'd be better to not mention this in the README or docs. Also left one note.

Comment thread scripts/install.sh Resolved
Co-authored-by: Bryce Mecum <[email protected]>
@zeroshade

Copy link
Copy Markdown
Member Author

@amoeba i've removed the changes to the docs as requested.

Comment thread scripts/install.sh Resolved
@amoeba

amoeba commented Feb 23, 2026

Copy link
Copy Markdown
Member

I think it's minor since this isn't exposed to users now but I get this error which could confuse people if they use the setup-dbc action:

$ sh scripts/install.sh --version 0.1.1
Downloading dbc (0.1.1) for aarch64-apple-darwin
Error: dbc is not available for your platform. Please create an issue at https://github.com/columnar-tech/dbc/issues or contact [email protected] for assistance.

Co-authored-by: Bryce Mecum <[email protected]>
@zeroshade

Copy link
Copy Markdown
Member Author

ah, change the error to specify there's no matching version for the platform instead?

@zeroshade

Copy link
Copy Markdown
Member Author

Have any suggested wording to use instead @amoeba ?

@amoeba

amoeba commented Feb 24, 2026

Copy link
Copy Markdown
Member

Yeah, error saying the version requested isn't a valid version to request. I can imagine someone putting the wrong version in their action and erroring about platforms might sense them off on wild goose chase.

I think it's hard for us to have separate error detection for version and also platform. At least without changing things on the AWS side. So could we just update the existing error to say,

Error: dbc {version} is either not available or not available for your platform. Double-check the version you've requested. Please file an issue at https://github.com/columnar-tech/dbc/issues or contact [email protected] for assistance.

@zeroshade

Copy link
Copy Markdown
Member Author

@amoeba updated the error message string

@zeroshade
zeroshade requested a review from amoeba February 24, 2026 16:27

@amoeba amoeba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@zeroshade
zeroshade merged commit 6cd6e28 into main Feb 25, 2026
4 checks passed
@zeroshade
zeroshade deleted the feat/windows-install-version-param branch February 25, 2026 16:37
zeroshade added a commit that referenced this pull request Apr 17, 2026
## Summary

Adds version parameter support to both Windows and Unix install scripts,
allowing users to install specific versions of dbc instead of always
defaulting to 'latest'.

## Changes

### Windows PowerShell Script (`scripts/install.ps1`)
- Added `-Version` parameter to specify version (e.g., `0.2.0`,
`v0.2.0`, or `latest`)
- Automatic normalization strips 'v'/'V' prefix from version strings
- Defaults to `'latest'` for backward compatibility
- Updated script help documentation

### Bash Script (`scripts/install.sh`)
- Added `--version` parameter to specify version (long form only to
avoid conflict with `-v` verbose flag)
- Automatic normalization strips 'v'/'V' prefix from version strings
- Version format validation (semantic version or 'latest')
- Rejects empty/invalid versions with helpful error messages
- Defaults to `'latest'` for backward compatibility
- Updated help documentation with examples
- POSIX shell compliant

### Documentation
- Added version parameter examples to
`docs/getting_started/installation.md`
- Added version parameter examples to `README.md`
- Shows download-then-run approach for Windows version-specific installs

## Usage Examples

**Windows:**
```powershell
# Default (latest)
.\install.ps1

# Specific version
.\install.ps1 -Version "0.2.0"

# With v prefix
.\install.ps1 -Version "v0.2.0"
```

**Linux/macOS:**
```bash
# Default (latest)
./install.sh

# Specific version
./install.sh --version 0.2.0

# With v prefix
./install.sh --version v0.2.0
```

## Testing

- ✅ Backward compatibility maintained (defaults to 'latest')
- ✅ Version normalization works across all formats
- ✅ Windows script help displays correctly
- ✅ Bash script version validation works
- ✅ POSIX shell compliance verified
- ✅ Documentation examples are accurate

## Commits

- feat: add -Version parameter to Windows install script
- docs: add examples for version parameter in Windows install
- feat: add APP_VERSION environment variable support
- refactor: remove APP_VERSION env var, keep only -Version param
- feat: add --version parameter to bash install script
- fix: improve version parameter validation and quoting
- fix: correct empty version string validation logic

---------

Co-authored-by: Bryce Mecum <[email protected]>

This branch was previously deployed

1 inactive deployment
snapshot — a10faf4e Deployed Feb 24, 2026 by zeroshade via snapshot #625
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