-
Notifications
You must be signed in to change notification settings - Fork 8
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
fix: ftltest config: use ConfigPaths with envar fallback #1543
Conversation
c3cb181
to
e31b468
Compare
if ok { | ||
paths = strings.Split(envValue, ",") | ||
} else { | ||
paths = pc.ConfigPaths(paths) |
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.
Should we confirm that paths
isn't empty and return the same preprocessingErr
error from before?
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.
My intention here is to have the same behavior as main.go
, which allows LoadConfig
to return an empty config after attempting to fall back on the envar, then the gitroot. I think having that parity makes sense?
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.
Ah, I see. I was wondering because I can't think of a reason why someone would use WithProjectFiles
without any paths. From that perspective, I'd find it useful to get the error message during development so that I know the way I'm using WithProjectFiles
isn't actually doing anything. main.go
wouldn't want to error in that case because the project toml isn't required, whereas if someone is explicitly invoking WithProjectFiles
, I'd assume they have some intent to actually use a project toml.
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 it's clear that if you're not passing explicit config files to WithProjectFiles()
that whatever its described behaviour is is in effect. The ftl-project.toml
file is designed to be the "default" for a project, and having it consistent across the CLI and tests is fine.
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.
nice!!
Follow up to #1539 We use `react-codemirror2`, which requires `codemirror` major version `5.*`, even on their [master branch](https://github.com/scniro/react-codemirror2/blob/master/package.json). Since we have no reason to stop using `react-codemirror2`, we just need to stop codemirror from continuing to get updated automatically by renovate. After this PR merges (assuming reviewers think this looks right!), I'll close #1539.
Fixes #1502.
Adds tests to ensure we're correctly falling back to the config in
FTL_CONFIG
and toftl-project.toml
in the gitroot.