-
Notifications
You must be signed in to change notification settings - Fork 987
Code to create emulators.yaml uses backend root not project root #8412
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
base: next
Are you sure you want to change the base?
Conversation
NOTE: This PR is part of my chain for debugging cursor glitches, but if approved, I'll probably rebase onto next directly, commit there, and then re-pull it into inlined.inquirer. |
d46c95f
to
f1292ad
Compare
@@ -0,0 +1 @@ | |||
fix: Prompt to create apphosting.emulator.yaml works with backends that are not at the project.root (#8412) |
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.
fix: Prompt to create apphosting.emulator.yaml works with backends that are not at the project.root (#8412) | |
- Fixed an issue where the prompt to create apphosting.emulator.yaml did not work with backends that are not at the project.root (#8412) |
Clean up to match our usual style.
): Promise<Env[] | null> { | ||
// Even if the app is in /project/app, the user might have their apphosting.yaml file in /project/apphosting.yaml. | ||
// Walk up the tree to see if we find other local files so that we can put apphosting.emulator.yaml in the right place. | ||
const basePath = dynamicDispatch.discoverBackendRoot(repoRoot) || repoRoot; | ||
const basePath = dynamicDispatch.discoverBackendRoot(backendRoot) || backendRoot; |
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.
const basePath = dynamicDispatch.discoverBackendRoot(backendRoot) || backendRoot; | |
const basePath = dynamicDispatch.discoverBackendRoot(backendRoot) ?? backendRoot; |
Nit: IIUC, ?? is preferred over || for undefined fallbacks
Quicker fix than I realized.
We may want to re-add some of the previous behavior to detect multiple environments and determine which to use as the base config. I was more focused on making breaking changes before the major release, but that was interesting/useful, esp if people only have apphosting[.environment].yaml and not a generic apphosting.yaml.
That might require more though though as we may want to consolidate backendRoot/apphosting.mybackend.yaml and /apphosting.yaml for mult-backend setups.