Code to create emulators.yaml uses backend root not project root#8412
Merged
Code to create emulators.yaml uses backend root not project root#8412
Conversation
Member
Author
|
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. |
mathu97
approved these changes
Apr 8, 2025
annajowang
approved these changes
Apr 8, 2025
d46c95f to
f1292ad
Compare
joehan
approved these changes
Apr 8, 2025
| // 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; |
Member
There was a problem hiding this comment.
Suggested change
| const basePath = dynamicDispatch.discoverBackendRoot(backendRoot) || backendRoot; | |
| const basePath = dynamicDispatch.discoverBackendRoot(backendRoot) ?? backendRoot; |
Nit: IIUC, ?? is preferred over || for undefined fallbacks
Member
Author
There was a problem hiding this comment.
I personally prefer a style where you only use ?? when you know null and/or 0 is a valid value.
Co-authored-by: joehan <joehanley@google.com>
6dbdd66 to
b07c42c
Compare
blidd-google
pushed a commit
that referenced
this pull request
May 12, 2025
* Use backend root, not project root to initilaize apphosting.emulators.yaml * Changelog & lint * Update CHANGELOG.md Co-authored-by: joehan <joehanley@google.com> --------- Co-authored-by: joehan <joehanley@google.com>
This file contains hidden or 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
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.
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.