-
Notifications
You must be signed in to change notification settings - Fork 217
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 custom seed path to config #2702
feat: add custom seed path to config #2702
Conversation
Pull Request Test Coverage Report for Build 11027502555Details
💛 - Coveralls |
internal/db/push/push_test.go
Outdated
fsys := &fstest.OpenErrorFs{DenyPath: utils.DefaultSeedDataPath} | ||
_, _ = fsys.Create(utils.DefaultSeedDataPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new files searching behavior we need to ensure the file actually exist on the filesystem. Otherwise, the "Glob" filter will just not return anything, the seeds will be skipped and the file will never be attempted to open.
This broke my seeding ability on Windows. No matter if I use the default |
Hey thanks for reporting, this is already handled and should be fixed by #2735 in the next upcoming release sorry about that. Our testing pipeline for windows is still flawky we want to improve it that's in our roadmap. Meanwhile, you should be able to test this fix by using the Please use github issues to report such cases as it has a much better discoverability for the team than comments on closed PR 👍 |
What kind of change does this PR introduce?
Feature enhancement: Improved seed data handling and configuration
What is the current behavior?
Currently, the system uses a single, fixed seed file path (
utils.SeedDataPath
) for database seeding. This limits flexibility in organizing and applying seed data.What is the new behavior?
config.toml
for specifying multiple seed file paths using glob patterns:Implements a new function
GetSeedFiles
that:Updates various parts of the codebase to use the new seeding mechanism:
SeedDatabase
function to use the newGetSeedFiles
functionChange the logging to display the seed file paths being used
Additional context
This change allows for more flexible organization of seed data, enabling users to split seed data across multiple files and use patterns to include them. It maintains backwards compatibility by defaulting to the previous behavior if no custom configuration is provided.
I'm just wondering about how this should work with supabase "branch deployments" and so on. Locally we'll always find the seeds files at the right location. I wonder how the branching approach work with that. From my understanding it does "clone" the user repository so it should work the same as locally but I might need some help to get that behavior tested.