Skip to content

Question: Intended precedence order for configuration files in _get_config_paths? #148

Description

@pratik-naik003

Hi team,

While exploring the configuration loading logic in kubeflow_mcp/core/config.py, I noticed that _get_config_paths() searches for config files in the following order:

def _get_config_paths() -> list[Path]:
    return [
        Path.home() / ".kubeflow-mcp.yaml",
        Path.home() / ".kubeflow-mcp.yml",
        Path.home() / ".config" / "kubeflow-mcp" / "config.yaml",
        Path.cwd() / ".kubeflow-mcp.yaml",
    ]

Since _find_config_file() returns the first existing path it encounters, a global configuration in the user's home directory (e.g., ~/.kubeflow-mcp.yaml) will take precedence over a project-local configuration (Path.cwd() / ".kubeflow-mcp.yaml").

My Question:
Is it intentional that the global home configuration overrides the local working directory configuration?

Many developer tools (like git, ruff, etc.) typically prefer project-local configurations over global ones so that developers can override settings on a per-project basis. If the current behavior is a slight oversight and local configs are meant to take precedence, I would be happy to submit a quick PR to reverse the order in the list!

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions