fix: dataconnect_build MCP tool returns error even with no compiler error - #10941
Open
chkuang-g wants to merge 1 commit into
Open
fix: dataconnect_build MCP tool returns error even with no compiler error#10941chkuang-g wants to merge 1 commit into
dataconnect_build MCP tool returns error even with no compiler error#10941chkuang-g wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the compilation error handling in src/mcp/tools/dataconnect/compile.ts by adding a .filter(Boolean) call to filter out falsy values. The reviewer pointed out that the .flat() call is redundant because compileErrors returns a single string, meaning Promise.all already resolves to a flat array, and suggested removing it to simplify the code.
Member
|
/joe-review |
joehan
reviewed
Aug 15, 2026
joehan
left a comment
Member
There was a problem hiding this comment.
⚠️ Disclaimer: This draft review was generated by an experimental AI review agent. Please verify all findings before acting on them.
Code Review Summary: firebase/firebase-tools PR #10941
🟢 Strengths & LGTM Aspects
- The fix correctly addresses the bug where
compileErrorsreturning an empty string""(indicating no errors) was treated as an error because[""]has length > 0. Adding.filter(Boolean)effectively removes these empty strings. - The change is minimal and targeted.
🔴 Overview of Findings & Blocking Items
- Testing Discipline: The PR lacks unit tests for this tool. I have verified that the tool can be easily tested by stubbing
pickServicesandcompileErrors. I suggest adding a spec file to prevent future regressions. - CHANGELOG.md: A changelog entry should be added since this is a user-facing (or agent-facing) bug fix for the
dataconnect_buildMCP tool.
🟡 Nits
- None.
chkuang-g
force-pushed
the
chkuang/dataconnect-build
branch
from
August 15, 2026 01:29
55ac877 to
d7a0c23
Compare
…d MCP tool ### Description - Fixes a bug where the `dataconnect_build` MCP tool returned compilation errors on successful compile because `compileErrors()` returns `""` when there are no errors, resulting in `[""]` which has a length > 0. Added `.filter(Boolean)` to filter out those empty strings and removed the redundant `.flat()` call. - Updated the tool's description with structured markdown formatting detailing prerequisites, when/how to use, and examples. - Updated `CHANGELOG.md`. ### Scenarios Tested - Added unit tests in `src/mcp/tools/dataconnect/compile.spec.ts` covering successful and failed compilation states. - Verified that all unit tests pass with `mocha`. - Ran `npm run lint:changed-files` and `npm run build` to confirm clean builds.
chkuang-g
force-pushed
the
chkuang/dataconnect-build
branch
from
August 15, 2026 01:32
d7a0c23 to
a7c9a41
Compare
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.
Description
Fixes a bug where the
dataconnect_buildMCP tool returned compilation errors on successful compile becausecompileErrors()returns""when there are no errors, resulting in[""]which has a length > 0. This change adds.filter(Boolean)to filter out those empty strings.Also update tool description with more details.
Scenarios Tested
npm run lint:changed-filesnpm run buildSample Commands
N/A