Skip to content

Make config path root-relative in start command - #1296

Merged
DZakh merged 7 commits into
mainfrom
claude/awesome-pascal-gpopb6
Jun 10, 2026
Merged

Make config path root-relative in start command#1296
DZakh merged 7 commits into
mainfrom
claude/awesome-pascal-gpopb6

Conversation

@DZakh

@DZakh DZakh commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

Fixes a bug where the config path passed to the start command was absolute, causing double-prefixing when consumers resolved it against the working directory. The config path is now computed relative to the project root.

Changes

  • Add config_relative_to_root() method to ParsedProjectPaths that computes the config path relative to the project root using path normalization and diffing
  • Update build_start_command() to use the new relative path method instead of the absolute config path
  • Add documentation clarifying that ENVIO_CONFIG is root-relative and should be resolved against cwd/--directory
  • Add three test cases covering:
    • Round-trip behavior through directory join
    • Relative paths with default root
    • Absolute paths with explicit root

https://claude.ai/code/session_014kgG3btfXFG5ujc6xzJja8

Summary by CodeRabbit

  • Bug Fixes

    • Fixed config path handling so CLI --config and ENVIO_CONFIG are interpreted and resolved relative to the selected project directory; improved error reporting when resolution fails.
  • Documentation

    • Clarified CLI help: --directory, --config, and ENVIO_CONFIG are documented as paths resolved relative to the chosen directory (defaults to current directory).
  • Tests

    • Added tests validating config path round-tripping and resolution for relative and absolute inputs.

claude added 2 commits June 10, 2026 08:14
The start/dev command handoff exported ENVIO_CONFIG as the directory-joined
config path while also chdir-ing the runtime into the project root. Since
clap joins ENVIO_CONFIG onto --directory on every invocation, the prefix
was applied twice on restarts (e.g. envio/analytics/envio/analytics/config.yaml).
Export the root-relative path instead, matching the convention that
--config is resolved relative to --directory.

https://claude.ai/code/session_014kgG3btfXFG5ujc6xzJja8
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds ParsedProjectPaths::config_relative_to_root(), updates executor to use that root-relative path for ENVIO_CONFIG, updates CLI help to state --config/ENVIO_CONFIG are resolved relative to --directory, and expands an error message when resolving the config path fails.

Changes

ENVIO_CONFIG Path Relativity

Layer / File(s) Summary
Relative config path method and tests
packages/cli/src/project_paths/mod.rs
ParsedProjectPaths::config_relative_to_root() computes the config path relative to the normalized project root using pathdiff::diff_paths. Tests verify round-trip computation and expected relative paths for default and absolute config scenarios.
Executor integration, CLI help, and error message
packages/cli/src/executor/mod.rs, packages/cli/CommandLineHelp.md, packages/cli/src/cli_args/clap_definitions.rs, packages/cli/src/config_parsing/system_config.rs
build_start_command now calls config_relative_to_root() instead of the prior config value when setting ENVIO_CONFIG. CLI help text and clap argument docs clarify that --config/ENVIO_CONFIG are resolved relative to --directory. The system config parsing error message is expanded to include the resolved config path and resolution context.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: making the config path root-relative in the start command, which directly aligns with the primary objective of fixing the double-prefixing bug.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

When the config file can't be read, the error now shows how the path
was built (--config joined onto --directory) instead of only the final
joined path, and the --config help text documents that it's resolved
relative to --directory.

https://claude.ai/code/session_014kgG3btfXFG5ujc6xzJja8
@DZakh
DZakh merged commit 08b70d9 into main Jun 10, 2026
8 checks passed
@DZakh
DZakh deleted the claude/awesome-pascal-gpopb6 branch June 10, 2026 09:36
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