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

ref: Provide better missing project id error message #1634

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

kamilogorek
Copy link
Member

Fixes #878
Depends on #1633

@kamilogorek kamilogorek requested a review from a team as a code owner November 3, 2023 09:49
@coveralls
Copy link

Pull Request Test Coverage Report for Build 6743635690

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 58.634%

Files with Coverage Reduction New Missed Lines %
internal/gen/keys/keys.go 5 12.31%
Totals Coverage Status
Change from base Build 6742225044: -0.03%
Covered Lines: 5674
Relevant Lines: 9677

💛 - Coveralls

@kamilogorek kamilogorek enabled auto-merge November 3, 2023 10:02
@sweatybridge sweatybridge changed the base branch from main to pid-env November 4, 2023 07:05
@@ -180,7 +180,7 @@ var (
CustomRolesPath = filepath.Join(SupabaseDirPath, "roles.sql")

ErrNotLinked = errors.New("Cannot find project ref. Have you run " + Aqua("supabase link") + "?")
ErrInvalidRef = errors.New("Invalid project ref format. Must be like `abcdefghijklmnopqrst`.")
ErrInvalidRef = errors.New("Missing or invalid project ID. Use " + Aqua("--project-ref") + "or" + Aqua("SUPABASE_PROJECT_ID") + "env variable to set it. Project ID can be found on project settings page.")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better to create a new error for missing ref. We can update AssertProjectRefIsValid method to check for empty string.

@kamilogorek kamilogorek merged commit 4e9cd47 into pid-env Nov 6, 2023
8 checks passed
@kamilogorek kamilogorek deleted the project-ref-message branch November 6, 2023 04:04
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.

Supabase link should have better UX when --project-ref isn't provided
3 participants