Skip to content

Make emulator hub locator path more robust to environment changes #8604

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tammam-g
Copy link
Contributor

@tammam-g tammam-g commented May 15, 2025

Description

Some clients couldn't discover emulator due to tempdir path being different depending the client, by using ~/.cache/firebase we should have more robust path.

Scenarios Tested

Running dataconnect emulator
Running dataconnect MCP and communicating with emulator from previously failing client (RooCode)

Sample Commands

image

Copy link
Contributor

@joehan joehan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this file get cleaned up after you kill the emulator? If not, I'm worried that all subsequent runs will see a running emualtor

@github-project-automation github-project-automation bot moved this to Changes Requested [PR] in [Cloud] Extensions + Functions May 15, 2025
@tammam-g
Copy link
Contributor Author

Does this file get cleaned up after you kill the emulator? If not, I'm worried that all subsequent runs will see a running emualtor

Just tested it and it does cleanup, works same exact way as the previous one worked.

@tammam-g tammam-g requested a review from joehan May 15, 2025 22:35
@tammam-g tammam-g enabled auto-merge (squash) May 15, 2025 22:41
@fredzqm
Copy link
Contributor

fredzqm commented May 15, 2025

Does this file get cleaned up after you kill the emulator? If not, I'm worried that all subsequent runs will see a running emualtor

The EmulatorHubClient is just a HTTP client that tries to reach the emulator.

Not something that consumes a lot of resource, right?

Copy link
Contributor

@fredzqm fredzqm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(offline discussion)

This one looks risky

@tammam-g tammam-g disabled auto-merge May 15, 2025 22:43
@fredzqm
Copy link
Contributor

fredzqm commented May 28, 2025

@joehan @yuchenshi

Can you take a look at this small but risky change?

It sounds like some MCP client sets the $TMPDIR and messed up CLI's resolution algorithm. @tammam-g is trying to move the locator file to a fixed path.

const dir = os.tmpdir();
const filename = `hub-${projectId}.json`;
return path.join(dir, filename);
return path.join(os.homedir(), ".cache", "firebase", `hub-${projectId}.json`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the parent directories do not exist? Can we find some existing code in the rest of the CLI code base that creates the parents and reuse the logic?

Copy link
Contributor

@joehan joehan May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this is why the integration tests are failing btw - the runner does not have this directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy