Repository navigation
fix(mcp): forward packaging mode in package and migrate - #158
Open
matthewmoorcroft wants to merge 16 commits into
Open
matthewmoorcroft wants to merge 16 commits into
matthewmoorcroft wants to merge 16 commits into
Conversation
The MCP package command and migrate's package step dropped packaging_mode, group_by and group_spec, so hosted runs always wrote the per-pipeline layout while reporting ok. Forward them to the adapter's --packaging-mode, --group-by and --group-spec flags so MCP gets the CLI's defaults and refusals, and document the parameters in the tool description. Co-authored-by: Isaac <no-reply@databricks.com>
A packaging_mode or group_by of 0 or False was treated as unset, so MCP package fell back to the per-pipeline layout with ok: true while the CLI refuses the same value. Only a missing key, None or "" now counts as unset; anything else is forwarded so argparse refuses it as on the command line. Co-authored-by: Isaac <no-reply@databricks.com>
…single-bundle packaging
…ext requires per-group
A packaging_mode, group_by or group_spec that is set but not a string reached the CLI stringified, so group_spec false became the spec path "False", which a multi-DAG Airflow migration never reads. MCP now refuses such a value before anything runs, in package and migrate. Co-authored-by: Isaac <no-reply@databricks.com>
The recommended Genie migrate call left out packaging_mode, group_by and group_spec, so following it always packaged per-pipeline. Add them, and say the answers re-call must repeat them. Co-authored-by: Isaac <no-reply@databricks.com>
Re-applied from the validation run's review fix c171934 so the branch stays a fast-forward from be231c4. Co-authored-by: Isaac <no-reply@databricks.com>
The answers re-call test pre-seeded a report and made one call, so it could not show that a first call's layout is not remembered. It now makes the first call, then the re-call with and without the packaging keys, and pins that a later interactive=false call starts over. Co-authored-by: Isaac <no-reply@databricks.com>
Only an answers re-call reuses the report. An interactive=false call after needs_input starts over, so it needs the source again and reruns discover and convert; the skill, the needs_input message, the tool description and the docstring now say so. Co-authored-by: Isaac <no-reply@databricks.com>
Resolves one docstring conflict in the MCP tool description: keeps this branch's migrate re-call ending and main's new profile entry. Co-authored-by: Isaac <no-reply@databricks.com>
This branch has not been deployed
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.
Intent
The hosted flowx MCP server's
packagecall ignored the packaging mode:inputs packageasks the agent forpackaging_modeandgroup_spec, butpackage(andmigrate's package step) dropped them and always wrote the per-pipeline layout while returningok: true. This makes MCP honour the same modes the CLI does (from #73).What changed
src/flowx/mcp/server.py:packageandmigrateforwardpackaging_mode,group_byandgroup_specto the CLI's--packaging-mode/--group-by/--group-spec, so defaults and refusals of bad values match the CLI. Agroup_specsent alone impliesper-group+spec, as theinputs packagetext promises.inputs packagetext and the package skill document the parameters and note thatgroup_specmust be a path the server itself can read (on the hosted server usegroup_byinferred or a server-local path).group_spec: false) is now refused before anything runs, inpackageandmigrate, instead of reaching the CLI as the text"False". The migrate skill's recommended call now shows the packaging keys, and the skill, tool description andneeds_inputmessage say amigratere-call must repeat them (they aren't remembered between calls) and thatinteractive=falsebelongs on the first call.How it was tested
tests/unit/test_mcp_package_modes.py: MCPpackagewrites the same files as the CLI from the same converted state for default/per-pipeline, single, per-group (inferred, explicit spec, and spec withoutgroup_by); a badpackaging_mode/group_byis refused through MCP exactly as through the CLI;migrateforwards the flags. The parity and refusal tests fail on the old code.migratere-call tests drive a realneeds_inputfirst call and then the re-call, across single, per-group inferred and agroup_spec.make integrationselection, ruff check, ruff format --check and mypy pass;uv.lockunchanged.Notes
No inline or remote
group_specsupport, and no changes todab_writer.pypackaging logic, Airflow code or other MCP differences.This pull request and its description were written by Isaac.