Skip to content

Relative paths in config file resolve from CWD, not config file location #16

@bobmatnyc

Description

@bobmatnyc

Description

When using relative paths in a configuration file (e.g., path: "../repos/datapipelines"), the paths are resolved relative to the current working directory (CWD) rather than relative to the configuration file's location.

Expected Behavior

Relative paths in the config file should resolve relative to where the config file is located. This is the standard behavior for most tools (e.g., tsconfig.json, pyproject.toml).

Actual Behavior

Paths resolve from CWD, causing "Repository path does not exist" warnings when running from a different directory than expected.

Steps to Reproduce

  1. Create config at /Users/masa/Duetto/repos/gitflow-contractors.yaml with:

    repositories:
      - name: "datapipelines"
        path: "../repos/datapipelines"
  2. Run from /Users/masa/Projects/gitflow-analytics:

    uv run -m gitflow_analytics.cli analyze --config /Users/masa/Duetto/repos/gitflow-contractors.yaml --weeks 4
  3. Observe warning: Repository path does not exist: /Users/masa/Projects/repos/datapipelines

    • Expected path: /Users/masa/Duetto/repos/datapipelines (relative to config file)
    • Actual path: /Users/masa/Projects/repos/datapipelines (relative to CWD)

Suggested Fix

In config/loader.py, resolve relative repository paths using os.path.dirname(config_file_path) as the base, not os.getcwd().

Environment

  • Version: v3.13.13
  • Python: 3.13
  • OS: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions