Conversation
* Enable secret resolution during local App Hosting builds * fix build error * Handle env vars (especially secrets) with a Promise.all so it can be parallelized
…al builds (#10337) * Enable secret resolution during local App Hosting builds * fix build error * Handle env vars (especially secrets) with a Promise.all so it can be parallelized * Add a warning so that we do not use build-available secrets unless the user confirms * fix undefined boolean flag behavior * fix tests, address some review comments * fix test mocking
…#10352) * Consolidate the ABIU prompts in the CLI so it matches the UI more closely * Address linter errors
* feat: add SSE mode support for MCP server ### Description Adds support for running the MCP server in SSE (HTTP) mode, in addition to the default Stdio transport. This allows clients to connect over network or via tools that support SSE. ### Scenarios Tested - Started server in SSE mode and verified log output. * fix: add progressToken to McpContext interface to fix build error ### Description Fixes a type error where progressToken was not defined on McpContext. ### Scenarios Tested - Verified build succeeds. * refactor: address PR comments on SSE support ### Description Addresses PR comments by: - Moving inline require calls to top-level imports. - Replacing any types with specific interfaces or unknown. ### Scenarios Tested - Verified build succeeds. * fix: address remaining review comments on SSE support ### Description - Reverts accidental GA4 tracking change in mcpListResources. - Replaces console.error with this.logger calls for better logging. - Changes default server binding from 0.0.0.0 to 127.0.0.1 for security. ### Scenarios Tested - Verified build succeeds. * style: lint and format fixes for SSE support ### Description - Applied auto-formatting fixes from npm run format. ### Scenarios Tested - Verified build succeeds. * feat: add infrastructure for MCP Apps (#10259) * feat: add infrastructure for MCP Apps ### Description Adds support for returning structured content from tools, which is used by MCP Apps to pass complex data to the host. Also updates the resource index. ### Scenarios Tested - Verified build and file changes. * fix: resolve build errors and address review comments on infra ### Description - Removes imports and registry entries for UI resources that are not yet available in this branch (login, update_environment, deploy, init). - Replaces as any in toContent with an intersection type for better type safety. ### Scenarios Tested - Verified build succeeds. * chore: avoid any for sessionId in SSE transport ### Description - Defines a local interface extending SSEServerTransport to avoid using when accessing . ### Scenarios Tested - Build succeeds. - Lint passes for modified lines. * feat: change sse flag to mode flag and fix build errors ### Description - Replaced boolean flag with string flag (defaults to 'stdio'). - Added validation for to accept only 'stdio' or 'sse'. - Fixed build errors by adding to interface and removing missing resource. ### Scenarios Tested - Build succeeds. - Lint passes with no new errors. * feat: add Update Environment MCP App (#10260) * feat: add mcpapps experiment flag and helper ### Description - Adds mcpapps experiment flag to src/experiments.ts. - Adds applyAppMeta helper function to src/mcp/util.ts to conditionally add UI metadata. - Adds unit tests for applyAppMeta in src/mcp/util.spec.ts. ### Scenarios Tested - Unit tests passed. - Build succeeds. * chore: address PR comments on experiments and util ### Description - Fixes applyAppMeta to preserve existing metadata. - Moves mcpapps flag to be grouped with other MCP experiments. - Removes as any in util.spec.ts by importing CallToolResult. ### Scenarios Tested - Build succeeds. - Lint passes for modified files (ignoring pre-existing warnings). - Unit tests for applyAppMeta pass. * feat: add infrastructure for MCP Apps Adds support for returning structured content from tools, which is used by MCP Apps to pass complex data to the host. Also updates the resource index. - Verified build and file changes. * feat: add Update Environment MCP App ### Description Adds the Update Environment MCP App, allowing users to switch projects and directories from the UI. ### Scenarios Tested - Verified build and file changes. * fix: resolve compilation errors in mcp-update-env-app * fix: resolve remaining lint errors in mcp-update-env-app * refactor: extract app MIME type shared constant * added changelog'
* fix: prevent hosting deploy to site in wrong project ### Description Prevent accidental deployments to a hosting site that does not belong to the active project. The CLI now verifies that the site belongs to the project before creating a version. Fixes #10376 ### Scenarios Tested - Verified that error is thrown when site does not belong to project. - Verified that deploy passes when site belongs to project. - Verified that check is skipped for demo projects. ### Sample Commands `firebase deploy --project project-b` (where site in firebase.json belongs to project-a) -> should fail. * chore: remove excessive site validation check and update tests * Comment * chore: remove demo project check and corresponding test * chore: remove unused Constants import in prepare.ts
* test: improve coverage for appdistribution distribution ### Description Add hermetic uploading and mock polling asserts for app distribution workflows. ### Scenarios Tested - Extracting sequential binary structures * test: fix unused imports in distribution tests
There was a problem hiding this comment.
Code Review
This pull request introduces a new test suite for the database initialization feature, covering both the question-asking process and the actuation logic. The reviewer identified several instances where the 'any' type was used as an escape hatch in the test setup, which violates the repository's style guide regarding type safety. I recommend updating these test cases to use the proper 'Setup' interface as suggested.
| import { expect } from "chai"; | ||
| import * as sinon from "sinon"; | ||
| import * as nock from "nock"; | ||
| import { askQuestions, actuate, DEFAULT_RULES } from "./database"; |
There was a problem hiding this comment.
To avoid using any for the setup object in the tests below, you should import the Setup interface from the parent directory.
| import { askQuestions, actuate, DEFAULT_RULES } from "./database"; | |
| import { askQuestions, actuate, DEFAULT_RULES } from "./database"; | |
| import { Setup } from ".."; |
References
- Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards. (link)
| it("should setup defaults when no project ID is present", async () => { | ||
| inputStub.resolves("database.rules.json"); | ||
| configConfirmWriteStub.resolves(true); | ||
| const setup: any = { config: {} }; |
There was a problem hiding this comment.
Avoid using any as an escape hatch for types. Use the Setup interface (or a type assertion to Setup) to maintain type safety and adhere to the repository style guide.
| const setup: any = { config: {} }; | |
| const setup = { config: {} } as Setup; |
References
- Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards. (link)
| .get("/.settings/rules.json") | ||
| .reply(200, mockRules); | ||
|
|
||
| const setup: any = { projectId: "my-project", config: {} }; |
There was a problem hiding this comment.
Avoid using any as an escape hatch for types. Use the Setup interface to maintain type safety.
| const setup: any = { projectId: "my-project", config: {} }; | |
| const setup = { projectId: "my-project", config: {} } as Setup; |
References
- Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards. (link)
| .get("/.settings/rules.json") | ||
| .reply(500); | ||
|
|
||
| const setup: any = { projectId: "my-project", config: {} }; |
There was a problem hiding this comment.
Avoid using any as an escape hatch for types. Use the Setup interface to maintain type safety.
| const setup: any = { projectId: "my-project", config: {} }; | |
| const setup = { projectId: "my-project", config: {} } as Setup; |
References
- Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards. (link)
| const setup: any = { | ||
| config: {}, | ||
| featureInfo: { | ||
| database: { | ||
| rulesFilename: "database.rules.json", | ||
| rules: DEFAULT_RULES, | ||
| writeRules: true, | ||
| }, | ||
| }, | ||
| }; |
There was a problem hiding this comment.
Avoid using any as an escape hatch for types. Use the Setup interface to maintain type safety.
| const setup: any = { | |
| config: {}, | |
| featureInfo: { | |
| database: { | |
| rulesFilename: "database.rules.json", | |
| rules: DEFAULT_RULES, | |
| writeRules: true, | |
| }, | |
| }, | |
| }; | |
| const setup = { | |
| config: {}, | |
| featureInfo: { | |
| database: { | |
| rulesFilename: "database.rules.json", | |
| rules: DEFAULT_RULES, | |
| writeRules: true, | |
| }, | |
| }, | |
| } as Setup; |
References
- Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards. (link)
| const setup: any = { | ||
| config: {}, | ||
| featureInfo: { | ||
| database: { | ||
| rulesFilename: "database.rules.json", | ||
| rules: DEFAULT_RULES, | ||
| writeRules: false, | ||
| }, | ||
| }, | ||
| }; |
There was a problem hiding this comment.
Avoid using any as an escape hatch for types. Use the Setup interface to maintain type safety.
| const setup: any = { | |
| config: {}, | |
| featureInfo: { | |
| database: { | |
| rulesFilename: "database.rules.json", | |
| rules: DEFAULT_RULES, | |
| writeRules: false, | |
| }, | |
| }, | |
| }; | |
| const setup = { | |
| config: {}, | |
| featureInfo: { | |
| database: { | |
| rulesFilename: "database.rules.json", | |
| rules: DEFAULT_RULES, | |
| writeRules: false, | |
| }, | |
| }, | |
| } as Setup; |
References
- Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards. (link)
### Description\nImplement unit tests for init database feature using nock.\n\n### Scenarios Tested\n- Defaults without project ID\n- Downloading rules with project ID\n- Actuate writing rules
5059ce9 to
df25319
Compare
Description\nImplement unit tests for init database feature using nock.\n\n### Scenarios Tested\n- Defaults without project ID\n- Downloading rules with project ID\n- Actuate writing rules