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

feat: add seed command to generate test users #2132

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

Conversation

kangmingtay
Copy link
Member

What kind of change does this PR introduce?

  • Adds a supabase seed auth command that generates sql examples to add test
    users and saves them in a seed.example.sql file

What is the current behavior?

Please link any relevant issues here.

What is the new behavior?

Feel free to include screenshots if it includes visual changes.

Additional context

Add any other context or screenshots.

@kangmingtay kangmingtay requested a review from a team as a code owner April 8, 2024 08:11
@coveralls
Copy link

coveralls commented Apr 8, 2024

Pull Request Test Coverage Report for Build 8597529949

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 133 of 164 (81.1%) changed or added relevant lines in 4 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.7%) to 58.569%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/db/dump/dump.go 1 2 50.0%
cmd/seed.go 4 12 33.33%
internal/seed/seed.go 127 149 85.23%
Files with Coverage Reduction New Missed Lines %
internal/gen/keys/keys.go 5 11.76%
Totals Coverage Status
Change from base Build 8574460707: 0.7%
Covered Lines: 6555
Relevant Lines: 11192

💛 - Coveralls

seedCmd = &cobra.Command{
GroupID: groupLocalDev,
Use: "seed",
Short: "Generate seed data",
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we move this under supabase gen seed instead since it generates a seed file?

If we continue using supabase seed, my expectation would be to actually seed the local / remote database.

},
},
container.HostConfig{
PortBindings: nat.PortMap{"9999/tcp": []nat.PortBinding{{HostPort: "54325"}}},
Copy link
Contributor

Choose a reason for hiding this comment

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

This port is currently reserved as smtp port for inbucket.

}

// use awk to remove unnecessary sections from the dump
awkCmd := exec.Command("awk", `
Copy link
Contributor

Choose a reason for hiding this comment

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

We can't expect awk to always be installed on user's system, ie. windows?

We can either process the docker output in go or make a shell script that runs inside gotrue container.

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.

None yet

3 participants