Skip to content

Add cds --version flag and release version-mismatch check - #242

Merged
RonaldHensbergen merged 5 commits into
mainfrom
feature/version-check
Jul 27, 2026
Merged

Add cds --version flag and release version-mismatch check#242
RonaldHensbergen merged 5 commits into
mainfrom
feature/version-check

Conversation

@RonaldHensbergen

Copy link
Copy Markdown
Owner

Summary

  • Add -v/--version to cds (reads the installed package version via importlib.metadata).
  • Bump pyproject.toml version to 0.2.0a0 to match the v0.2.0-alpha GitHub release (it had drifted, causing cds --version to report a stale 0.1.1).
  • Add scripts/check_release_version.py and wire it into .github/workflows/release.yml to fail the release workflow if a pushed tag (e.g. v0.2.0-alpha) doesn't match pyproject.toml's version, preventing this drift from recurring.
  • Add tests/test_release_version_check.py covering matching/mismatched/invalid version cases.

Testing

  • python -m unittest tests.test_release_version_check tests.test_main -v → 37 passed
  • yamllint .github/workflows/release.yml → clean
  • Manually verified cds --version / cds -v output cds 0.2.0a0

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

- cli/main.py: add -v/--version flag reporting the installed
  composable-data-stack package version via importlib.metadata.
- pyproject.toml: bump version to 0.2.0a0 to match the v0.2.0-alpha
  GitHub release, and add packaging to the dev extras.
- scripts/check_release_version.py: new script that compares a pushed
  release tag (e.g. v0.2.0-alpha) against pyproject.toml's version and
  fails with a clear error on mismatch.
- .github/workflows/release.yml: run the new check before generating
  release notes so releases can't be cut with a stale pyproject version.
- tests/test_release_version_check.py: unit tests for the new script,
  including a guard test against the current repo's version/tag state.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@RonaldHensbergen
RonaldHensbergen changed the base branch from packaging/testpypi-cli to main July 26, 2026 21:34
RonaldHensbergen and others added 4 commits July 27, 2026 07:42
- pyproject.toml: 0.2.0a0 -> 0.3.0b1 (PEP 440 form of 0.3.0-beta-1)
- CHANGELOG.md: move Unreleased entries under [0.3.0-beta-1], record
  the new cds --version flag and release version-mismatch check, and
  open a fresh Unreleased section.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
argparse.ArgumentParser previously had no description, so `cds -h`
jumped straight to usage/subcommands with no explanation of what the
tool does. Add a short description mirroring the README/PyPI summary.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tests/test_release_version_check.py imports scripts/check_release_version.py,
which depends on `packaging`. CI's Windows/macOS test legs only run
`pip install .` (dev extras are only installed for the Ubuntu coverage
leg), so the import failed there with ModuleNotFoundError. Move
packaging from the dev extra to the core dependencies so it's always
present.

Verified with a clean venv + `pip install .` (no dev extras): all 132
tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Previously every generated .env value, including non-sensitive
database/user identifiers like CDS_ANALYTICS_DB_NAME and
CDS_DAGSTER_DB_USER, was set to the "change-me" placeholder. Only
values declared under spec.secrets.values are actually sensitive
(passwords, keys); other ${CDS_*} references found in a profile are
typically plain identifiers.

_collect_profile_env_vars now also returns which env vars are true
secrets, and _write_env_file derives a friendly default (e.g.
"analytics", "dagster", "superset") for non-secret *_DB_NAME/*_DB_USER
vars instead of "change-me", falling back to the placeholder for
everything else (passwords, secret keys, and any var it can't infer a
name for).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@RonaldHensbergen
RonaldHensbergen merged commit a2d3500 into main Jul 27, 2026
10 checks passed
@RonaldHensbergen
RonaldHensbergen deleted the feature/version-check branch July 27, 2026 18:28
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.

1 participant