feat: Port Arxiv to the Extension Framework#13047
Conversation
Validates ``src/bundles/PORTING.md`` end-to-end by following its recipe
against a clean candidate (``ArXivComponent``: no third-party runtime
deps, no langflow-base extra, no deactivated duplicate). Touchpoints
exercised:
* Bundle skeleton at ``src/bundles/arxiv/`` mirroring duckduckgo.
* In-tree provider directory removed from ``src/lfx/src/lfx/components/``
along with its three references in ``components/__init__.py``.
* Workspace wiring: dep, ``[tool.uv.sources]``, ``[tool.uv.workspace]``
members, lockfile.
* Migration table: bare-name + two import-path forms + legacy_slot
entry.
* Component index regenerated via ``LFX_DEV=1`` (forces dynamic
discovery; without it the script reproduces stale entries).
* Integration test ``test_pilot_arxiv_upgrade.py`` mirroring the
duckduckgo pilot suite; 5 tests pass against the workspace install.
PORTING.md updates fall out of running the recipe live:
* Validate path is ``src/bundles/<bundle>/src/lfx_<bundle>``, not the
bundle root (the manifest lives next to ``__init__.py``).
* Index regen needs ``LFX_DEV=1`` to skip the prebuilt-index fast path.
* Drop the migration-table JSON from the ruff invocation (ruff treats
it as Python and complains about the top-level expression).
``scripts/migrate/port_bundle.py`` is the mechanical helper referenced
from § Automation: stdlib-only, dry-run by default, refuses on invalid
input, and intentionally leaves migration-table edits + integration-test
authoring to a human (release version + bare-name uniqueness require
judgement). Three guard rails verified: invalid bundle name,
existing-target-bundle, missing in-tree provider.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/extension-production-install #13047 +/- ##
=====================================================================
+ Coverage 54.98% 55.03% +0.04%
=====================================================================
Files 2121 2121
Lines 195991 195281 -710
Branches 30886 28051 -2835
=====================================================================
- Hits 107773 107471 -302
+ Misses 86971 86562 -409
- Partials 1247 1248 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
…l' into feat/extension-pilot-arxiv # Conflicts: # pyproject.toml # scripts/migrate/port_bundle.py
…low-ai/langflow into feat/extension-pilot-arxiv
…pilot-arxiv # Conflicts: # pyproject.toml
ogabrielluiz
left a comment
There was a problem hiding this comment.
thanks for the thorough turnaround on this. dogfooded the script against a couple of candidates to verify:
- dry-run on
wikipedia(2 files, 2 classes:WikidataComponent,WikipediaComponent) produces: correct layout actions, 8 migration entries (4 per class), and a structurally completetest_pilot_wikipedia_upgrade.pyscaffold.--display-name "Wikipedia"+--migration-release 1.10.0flow through everything. - templates vs checked-in
arxiv: renderingPACKAGE_INIT_TEMPLATE/COMPONENTS_INIT_TEMPLATE/EXTENSION_JSON_TEMPLATEagainst arxiv's discovered class set produces files that are structurally identical to what's in this PR. only differences are cosmetic (single-vs-double quotes in__all__, an extra docstring line in the package__init__.py, "(s)" plural marker in the description). a third port would land on a working bundle straight out of the script. - marker-based pyproject patching:
# langflow-extensions:bundle-{deps,sources,members}-{start,end}pairs are in place;_insert_before_markerfails loudly if a marker goes missing. survives reordering and version-pin bumps as intended.
on my original validator-false-positive comment (PORTING.md line 297) — that one was a misread on my end. validate._has_build_method already accepts both def build AND Output(method="...") shapes (validate.py:378-397); the original doc footnote made it sound like a false positive when the validator was actually doing the right thing. your rewrite to describe the contract instead of papering over a warning is the better fix.
one leftover suggestion, not a blocker for this PR but worth filing: there's still no automated test that runs port_bundle.py --apply against a fixture and asserts the output matches an expected layout. the third bundle author becomes the first to find any drift between templates and the doc. a single tmp_path-based test that exercises _validate_candidate + _layout_bundle + _render_reexports + _render_migration_entries against a minimal fixture would close that loop. happy to send that as a follow-up if it'd help.
CI is showing Run Frontend Tests / Playwright Tests - Shard 37/70 failing — looks unrelated to this change but worth a re-run / glance.
LGTM otherwise. nice work.
0e51b68
into
feat/extension-production-install
This pull request introduces the second pilot port of a component to the new Extension Bundle system by extracting the arXiv search component into its own standalone bundle,
lfx-arxiv. This follows the documented porting process and ensures that the arXiv component is now shipped, installed, and managed as an independent extension, just like the previously ported DuckDuckGo component. The changes include all necessary workspace wiring, packaging, and documentation updates to support this migration.Porting of arXiv component to standalone Extension Bundle:
lfx-arxivbundle:src/bundles/arxiv/with full bundle layout, includingREADME.md,pyproject.toml, and extension manifest (extension.json). [1] [2] [3] [4]ArXivComponentimplementation from the monorepo (src/lfx/src/lfx/components/arxiv/arxiv.py) to the new bundle location (src/bundles/arxiv/src/lfx_arxiv/components/arxiv/arxiv.py) without modifying its logic.Workspace and dependency wiring:
pyproject.tomlto:lfx-arxivas a regular dependency so it is installed with Langflow.lfx-arxivunder[tool.uv.sources]for workspace management.src/bundles/arxivto the workspace members list.Documentation and process improvements:
src/bundles/PORTING.mdto document the step-by-step process for extracting components into bundles, including best practices, verification steps, and automation tips.These changes ensure the arXiv component is now distributed, loaded, and maintained as a standalone extension, making future component ports easier and more consistent.