Conversation
* Update FDC local toolkit to v3.2.0 * Formatting * Add PR number
* Add a firebase studio export command under an experiment flag. * typescript conversion * Refactored to a folder, cleaned up, tested * Added tests * Cleanup * Lint * Reorganize * Flags and comment fixes * Lint * shrinkwrap
* Firebase Functions can handle an Extensions outage * Add tests for getting the list of active extensions succeeding or failing * Update message
* Fixing bad implementation of isFirebaseMCPP * formats
firebase#9960) * add FIREBASE_TOOLS_*_EMULATOR_VERSION to allow pinning emulator version * add test * fix lint issue * change FIREBASE_TOOLS_*_EMULATOR_VERSION to *_EMULATOR_VERSION * revert .mocharc.yml change * better error message for invalid versions --------- Co-authored-by: Joe Hanley <joehanley@google.com>
This tool is missing from OneMCP server. Add the local wrapper back for now.
firebase#9899) * Update yaml format for appdistribution:testcases:import/export * Update apptesting MCP yaml format to match test-cases-in-code format (firebase#9900) * Keep AiStep type using successCriteria field to match API * Add note to MCP prompt that the final screen assertion is required for the last step * Revert WATA changes
* Fix apptesting:execute The test case was not being converted to use the success_criteria field before including it in the request * Update tests * Add javadoc
* Observe the project (ID) flag * Add AGY workaround - don't check for AGY if we're not going to open it --------- Co-authored-by: Joe Hanley <joehanley@google.com>
Initial refactor for moving secret logic to index.ts (firebase#10010)
Secret upload apphosting (firebase#10017)
* update fdc emulator to 3.2.1 * changelog * fix naming
* Flip resolvers flag. * Update changelog.
* Add support for additional Next.js config file types - Updated CONFIG_FILES to include "next.config.ts" and "next.config.mts". - Modified logic in ɵcodegenFunctionsDirectory to handle new config file types. - Added unit tests for whichNextConfigFile to ensure correct file detection and prioritization. * cleanup pathExists stub usage in Next.js utils tests * update comment * changelog
* GA4 tracking with framework.
* Ask the user which backend they want to use. This is a little crude in that it quits if invalid but it can be re-ran.
…base#10107) * Delte mcp.json if it exists since this will only be confusing to the user. * Test
…10055) * Update the error message for missing path to be friendlier
* Support .yaml and .yml files
* feat: Add dart delegate * feat: add support for hot reloading * fix: wait for build_runner initial build to complete * fix rooting * emulator update * update functions.yaml directory * clean run on emulator * clear project * improve runtime checks * merge fixes * clean * Fixing feedback from Gemini * compile before deploy * remove placeholder runtime * cross compiling * emulator fix * fix rooting * fix emulator detection * skipping compilation in emulator run * clean output * prevent duplicate watches * dart entry point and min dart version enforcing * change entry point to bin/server.dart * update template --------- Co-authored-by: Elliot Hesp <elliot.hesp@gmail.com> Co-authored-by: Darren Ackers <ackers86@hotmail.com>
* Add changelog entry for new apptesting:execute command * Add trailing newline Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…rebase#10128) * If no binary passed to apptesting:execute, use latest App Distribution release * Simplify if condition * Fix formatting
* Update fs emulator to 1.20.4 * remove unrelated change --------- Co-authored-by: Joe Hanley <joehanley@google.com>
Co-authored-by: Kushal Palesha <3357451+kushalpalesha@users.noreply.github.com>
* Add support for setting DataAccessMode in firebase.json * Dont change defaults * Regen schema; * pr fixes
* Initial commit for adding the ability to pass the runtime flag * Add some unit tests and improve wording * Fix unit tests, handle undefined runtimes more explicitly * Use default runtime variable and dedupe test code * Add ABIU fields to backend creation in our CLI (also includes ability to pass the runtime) * Fix formatting/linter errors * Guard this behind an experiment flag * Update backends:list to only show ABIU in the column if the flag is enabled * Make it so ABIU flags only show up if the experiment flag is enabled * Make our logic for runtime more lenient. If it's not defined, assume it is "" * Improve test coverage, make runtime default to "" * Default runtime is "nodejs" * Update runtime to be more risilient to empty string values * Also display the "runtime" field when listing backends * Polish fixes --------- Co-authored-by: Aryan Falahatpisheh <aryanf@google.com>
Co-authored-by: Joe Hanley <joehanley@google.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request delivers a substantial upgrade to the Firebase CLI, focusing on expanding developer capabilities and improving workflow efficiency. Key advancements include the integration of Dart as a supported runtime for Firebase Functions, offering more flexibility for backend development. App Hosting receives significant enhancements with new controls for backend configuration and a streamlined secret management command. The App Testing experience is made more robust with flexible test execution options and better error handling. Furthermore, critical emulator components are updated to their latest versions, and the migration path for Firebase Studio projects to Antigravity is made smoother with automated setup and improved framework detection. These changes collectively aim to provide a more powerful, stable, and user-friendly development environment. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This is a large pull request that includes a critical crash fix, several new features, and numerous improvements. The main fix addresses a crash in the Storage emulator when handling invalid JWTs. Key new features include Dart support for Cloud Functions, a studio:export command for migrating Firebase Studio projects, and direct VPC support for GCFv2. I've identified a couple of areas for improvement related to Node.js best practices, such as using asynchronous file system operations and avoiding deprecated APIs.
| if (fs.existsSync(rootPath) && fs.statSync(rootPath).isFile() && rootPath.endsWith(".zip")) { | ||
| logger.info(`⏳ Unzipping ${rootPath}...`); | ||
| const parsedPath = path.parse(rootPath); | ||
| let extractDirName = parsedPath.name; | ||
| if (!extractDirName || extractDirName === ".") { | ||
| extractDirName = "studio-export"; | ||
| } | ||
| const extractPath = path.join(parsedPath.dir, extractDirName); | ||
| await unzip(rootPath, extractPath); | ||
|
|
||
| // Studio exports usually contain a single top-level directory. | ||
| // E.g., `Export-12345/`. Let's check if we should dive into it | ||
| const extractedItems = fs.readdirSync(extractPath); | ||
| if ( | ||
| extractedItems.length === 1 && | ||
| fs.statSync(path.join(extractPath, extractedItems[0])).isDirectory() | ||
| ) { | ||
| rootPath = path.join(extractPath, extractedItems[0]); | ||
| } else { | ||
| rootPath = extractPath; | ||
| } | ||
| } |
There was a problem hiding this comment.
This async function uses synchronous file system calls (fs.existsSync, fs.statSync, fs.readdirSync), which can block the Node.js event loop. It's a best practice to use their asynchronous counterparts from the fs/promises module to maintain non-blocking I/O, especially since the rest of the function uses await.
if (fs.existsSync(rootPath) && fs.statSync(rootPath).isFile() && rootPath.endsWith(".zip")) {
logger.info(`⏳ Unzipping ${rootPath}...`);
const parsedPath = path.parse(rootPath);
let extractDirName = parsedPath.name;
if (!extractDirName || extractDirName === ".") {
extractDirName = "studio-export";
}
const extractPath = path.join(parsedPath.dir, extractDirName);
await unzip(rootPath, extractPath);
// Studio exports usually contain a single top-level directory.
// E.g., `Export-12345/`. Let's check if we should dive into it
const extractedItems = await fs.promises.readdir(extractPath);
if (extractedItems.length === 1) {
const firstItemPath = path.join(extractPath, extractedItems[0]);
const firstItemStat = await fs.promises.stat(firstItemPath);
if (firstItemStat.isDirectory()) {
rootPath = firstItemPath;
} else {
rootPath = extractPath;
}
} else {
rootPath = extractPath;
}
}| if (!(await promisify(fs.exists)(pubspecYamlPath))) { | ||
| logger.debug("Customer code is not Dart code."); | ||
| return; | ||
| } |
There was a problem hiding this comment.
The fs.exists method is deprecated. It's recommended to use fs.promises.access within a try/catch block to check for file existence in an asynchronous function. This avoids using a deprecated API and aligns better with modern async/await patterns.
try {
await fs.promises.access(pubspecYamlPath);
} catch {
logger.debug("Customer code is not Dart code.");
return;
}
firestore_query_collectionMCP tool (Add backfirestore_query_collectionMCP tool firebase/firebase-tools#10002)--onlyforemulators:exportfirebase/firebase-tools#10057)=== falsewhich is an antipattern. (Add a directive over=== falsewhich is an antipattern. firebase/firebase-tools#10064)firebase init hostingbehavior (Add changelog for newfirebase init hostingbehavior firebase/firebase-tools#10079)apphosting:secrets:setcommand to the apphosting.yaml template (Add theapphosting:secrets:setcommand to the apphosting.yaml template firebase/firebase-tools#10080)