Skip to content

fix: prefer .cds marker for project root, add full-stack install smoke test - #512

Merged
SemTiOne merged 3 commits into
mainfrom
fix/project-root-cds-marker
Aug 25, 2026
Merged

fix: prefer .cds marker for project root, add full-stack install smoke test#512
SemTiOne merged 3 commits into
mainfrom
fix/project-root-cds-marker

Conversation

@RonaldHensbergen

Copy link
Copy Markdown
Owner

Problem

Running cds get/cds use/cds up from a plain working directory (e.g. ~/tmp) that happens to sit under an unrelated ancestor directory containing its own .git (like a dotfiles repo at $HOME) caused find_project_root()/resolve_project_root() to walk past the actual working directory and resolve profiles/modules/config against that unrelated repo instead.

Fix

  • find_project_root() and resolve_project_root() in cli/main.py now check for a .cds directory (CDS's own state marker, created by cds get/cds use) at each ancestor level, checked alongside the existing .git/pyproject.toml markers. A .cds-marked working directory is now recognized as the project root immediately, rather than being shadowed by an unrelated ancestor repo further up the tree.
  • Fresh checkouts of the CDS repo itself (no .cds yet) still fall back to .git/pyproject.toml as before — no behavior change for normal development.

CI: full-stack install smoke test

Also closes a gap in release validation: nothing previously exercised the real end-user flow of installing purely from a built wheel (no source checkout) and running cds getcds initcds up against a fresh directory. build-python-package.yml (reused by testpypi.yml and pypi.yml) now does exactly that — installing the wheel, fetching a profile via cds get --local, initializing it, and bringing up the full docker compose stack, confirming every service reports healthy before the package is published. This is the only check that would have caught bugs limited to the packaged/cds get-fetched layout (missing bundled assets, project-root resolution regressions, etc.).

Verified locally end-to-end: built the wheel, installed into a fresh venv, and ran cds get/cds init/cds up from an empty $HOME-based directory — full stack (dagster-daemon, dagster-user-code, dagster-webserver, keydb, postgres, superset, superset-init) came up healthy.

Tests

  • Added regression tests for both the .cds-preferred case and the .git/pyproject.toml fallback.
  • Full suite: 539 tests, OK (skipped=1).
  • make lint: all checks pass.

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

…e test

- find_project_root()/resolve_project_root() now check for a .cds directory
  (CDS's own state marker, created by cds get/cds use) before falling back to
  .git/pyproject.toml when walking up from cwd. This prevents an unrelated
  ancestor repository (e.g. a dotfiles repo at $HOME) from being mistaken for
  the CDS project root when working in a plain directory such as ~/tmp.
- Add regression tests covering both the .cds-preferred case and the existing
  .git/pyproject.toml fallback for fresh repo checkouts.
- Extend build-python-package.yml (reused by testpypi.yml and pypi.yml) with
  a full cds get -> cds init -> cds up smoke test against the built wheel,
  from an empty directory with no source checkout on
  CDS_PROFILE_PATH/CDS_MODULE_PATH. This exercises the real end-user install
  flow before publishing, catching packaging/get-fetched-layout bugs that a
  plain 'pip install .' smoke test would miss.
- Update RELEASE.md and docs/packaging.md to document the new automated
  full-stack check.

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

@SemTiOne SemTiOne left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good work! However, there are some issues (see inline comments below).

Comment thread .github/workflows/build-python-package.yml
Comment thread cli/main.py
Comment thread cli/main.py
Comment thread tests/test_main.py
@SemTiOne
SemTiOne self-requested a review August 25, 2026 07:45

@SemTiOne SemTiOne left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@SemTiOne
SemTiOne merged commit 0555eb7 into main Aug 25, 2026
11 checks passed
@SemTiOne
SemTiOne deleted the fix/project-root-cds-marker branch August 25, 2026 07:46
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