-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
Merged
sweatybridge
merged 15 commits into
develop
from
avallete/feat-add-custom-seed-path-to-config
Sep 25, 2024
Merged
feat: add custom seed path to config #2702
sweatybridge
merged 15 commits into
develop
from
avallete/feat-add-custom-seed-path-to-config
Sep 25, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pull Request Test Coverage Report for Build 11027502555Details
💛 - Coveralls |
avallete
commented
Sep 24, 2024
internal/db/push/push_test.go
Outdated
Comment on lines
165
to
166
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.
sweatybridge
approved these changes
Sep 25, 2024
sweatybridge
deleted the
avallete/feat-add-custom-seed-path-to-config
branch
September 25, 2024 06:28
This was referenced Sep 25, 2024
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.