-
Notifications
You must be signed in to change notification settings - Fork 9
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
chore: dev cmd can read directories from project toml #1126
Conversation
Should |
Yes |
50cb168
to
7f39ded
Compare
cmd/ftl/main.go
Outdated
@@ -83,6 +83,9 @@ func main() { | |||
kctx.BindTo(sr, (*cf.Resolver[cf.Secrets])(nil)) | |||
kctx.BindTo(cr, (*cf.Resolver[cf.Configuration])(nil)) | |||
|
|||
config, _ := cr.LoadConfig(ctx) |
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.
This is using the internal state of the ProjectConfigResolver. Instead move this function into the projectconfig
directory as a top-level function, and pass it into ProjectConfigResolver (and Bind())
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.
I've now moved it to load it in separately but I'm unsure about passing it in to the resolver like we'd discussed.
Looking at the implementation, every read/write of config is loaded/written and theres no Config held in memory.
If we pass in Config to the resolvers, that would mean changing implementations so that we keep Config in memory and read from memory instead of from disk. And also seems weird to me that it would accept a Config at initialization, but when calling Set/Unset it would write to a file, which you'd hope is where the initial Config originated.
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.
Makes sense. Centralise the saving logic in the projectconfig package too then?
00a6cea
to
4c23bbf
Compare
e582434
to
21450bc
Compare
return config, nil | ||
} | ||
|
||
func LoadWritableConfig(ctx context.Context, input []string) (Config, error) { |
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.
I think this should have a comment...
Issue: #1125