Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Custom Config File Support #3092

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

StoneTapeStudios
Copy link

@StoneTapeStudios StoneTapeStudios commented Jan 31, 2025

Add Custom Config File Support

Introduces a new --config-file flag to the Supabase CLI, enabling users to specify alternative configuration files. This enhancement allows running multiple parallel local development environments with different configurations (#2139).

Example Usage

supabase start --config-file=supabase/config.test.toml

Benefits

  • Supports multiple local database instances with different configurations
  • Simplifies management of different environment setups (e.g., testing, staging)
  • Maintains backwards compatibility with default config path

@StoneTapeStudios StoneTapeStudios requested a review from a team as a code owner January 31, 2025 16:00
@coveralls
Copy link

coveralls commented Jan 31, 2025

Pull Request Test Coverage Report for Build 13083225214

Details

  • 0 of 6 (0.0%) changed or added relevant lines in 1 file are covered.
  • 7 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.05%) to 58.128%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/utils/flags/config_path.go 0 6 0.0%
Files with Coverage Reduction New Missed Lines %
internal/storage/rm/rm.go 2 89.53%
internal/gen/keys/keys.go 5 12.9%
Totals Coverage Status
Change from base Build 13077628442: -0.05%
Covered Lines: 7609
Relevant Lines: 13090

💛 - Coveralls

Copy link
Contributor

@sweatybridge sweatybridge left a comment

Choose a reason for hiding this comment

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

Generally agree to add this functionality. However, the current implementation doesn't handle changing workdir based on the given config path.

StoneTapeStudios and others added 2 commits February 10, 2025 12:55
Adds support for setting the working directory based on the provided config file path:
- Handles both absolute and relative config paths
- Normalizes paths across platforms
- Maintains Windows compatibility by handling drive letters
- Preserves existing behavior when no config file is specified

This addresses the feedback about workdir handling in the CLI by ensuring the
working directory is properly set based on the config file location.

Tests added:
- Relative config paths
- Absolute config paths
- Non-existent config paths
- Malformed config files
feat(cli): handle workdir based on config file path
@StoneTapeStudios
Copy link
Author

Generally agree to add this functionality. However, the current implementation doesn't handle changing workdir based on the given config path.

Thanks for the feedback! I think I have addressed the issues with my latest changes.

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.

3 participants