Skip to content

refactor: reorganize bundle CLI commands - #4663

Merged
mnriem merged 1 commit into
github:mainfrom
mnriem:mnriem-chore/bundle-cli-refactor
Sep 22, 2026
Merged

mnriem merged 1 commit into
github:mainfrom
mnriem:mnriem-chore/bundle-cli-refactor

Conversation

@mnriem

@mnriem mnriem commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Description

Refactor the specify bundle hierarchy to follow design/cli.md:

  • move each real bundle command into a dedicated command_<name>.py module
  • retain catalog/ as the only nested package because it is a genuine CLI namespace
  • flatten bundle domain APIs into specify_cli/bundles/ while preserving the public BundlerError import compatibility boundary
  • move command-focused tests into the mirrored tests/specify_cli/bundles/ hierarchy while retaining genuine contracts in their existing suites
  • remove the obsolete grouped command module and nested implementation packages

The rebase preserves upstream additions including bundle add, first-party catalog fallback behavior, and offline bundled-workflow installation. User-visible help is byte-identical to upstream/main.

Testing

  • Tested the complete specify bundle help surface locally and confirmed byte-identical output against upstream/main (36,645 bytes)
  • Ran the complete repository suite: 8,357 passed, 16 skipped, 53 warnings (8,373 collected; upstream collects 8,372)
  • Ran focused bundle and relevant cross-domain tests: 385 passed
  • Ran uvx ruff@0.15.0 check src tests
  • Ran git diff --check
  • Built the wheel and verified every new command module is packaged and obsolete bundle modules are absent
  • Verified command registration/order, compatibility imports, and no stale private import paths

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (fill in the disclosure below)

AI disclosure: GitHub Copilot, powered by GPT-5.6 Sol, operated autonomously for repository analysis, code and test refactoring, rebase conflict resolution, validation, and PR drafting on behalf of @mnriem. The code and PR description are fully AI-drafted; validation evidence was produced by local automated commands.

Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 21, 2026 23:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

馃煝 Approval recommended

The structural refactor preserves registration and compatibility while retaining comprehensive command and domain regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Reorganizes the bundle CLI to match the repository鈥檚 command architecture while preserving behavior and the legacy BundlerError import.

Changes:

  • Splits bundle and catalog handlers into dedicated command modules.
  • Flattens bundle domain services under specify_cli.bundles.
  • Mirrors command tests and preserves regression and compatibility coverage.
File Description
tests/鈥媢nit/鈥媡est_bundle_download_url.py Moves source-resolution tests.
tests/鈥媡est_init_dir_cli.py Relocates bundle-specific override tests.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_yamlio.py Updates flattened imports.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_versioning.py Updates flattened imports.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_validator.py Updates validator imports.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_sources.py Consolidates source-resolution regressions.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_security_paths.py Updates security-path imports.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_resolver.py Updates resolver imports.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_references.py Updates reference imports.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_records.py Updates record imports.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_primitives.py Updates primitive-service imports.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_packager.py Updates packager imports.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_offline.py Updates offline catalog tests.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_installer.py Updates installer imports and patches.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_conflict.py Updates conflict imports.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_commands.py Tests shared CLI registration and errors.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_command_validate.py Mirrors validate command coverage.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_command_update.py Mirrors update command coverage.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_command_search.py Mirrors search command coverage.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_command_remove.py Mirrors remove command coverage.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_command_list.py Mirrors list command coverage.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_command_install.py Consolidates install command coverage.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_command_init.py Mirrors init command coverage.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_command_info.py Consolidates info and download coverage.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_command_build.py Mirrors build command coverage.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_command_add.py Covers the add alias and catalog flow.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_catalog_stack.py Updates catalog-stack imports.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_catalog_config.py Updates catalog-config imports.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_bundles.py Verifies error-import compatibility.
tests/鈥媠pecify_cli/鈥媌undles/鈥媡est_adapters.py Updates adapter imports.
tests/鈥媠pecify_cli/鈥媌undles/鈥媓elpers.py Moves shared bundle test helpers.
tests/鈥媠pecify_cli/鈥媌undles/鈥媍onftest.py Adds scoped project fixture.
tests/鈥媠pecify_cli/鈥媌undles/鈥媍atalog/鈥媡est_command_remove.py Mirrors catalog remove coverage.
tests/鈥媠pecify_cli/鈥媌undles/鈥媍atalog/鈥媡est_command_list.py Mirrors catalog list coverage.
tests/鈥媠pecify_cli/鈥媌undles/鈥媍atalog/鈥媡est_command_add.py Mirrors catalog add coverage.
tests/鈥媠pecify_cli/鈥媌undles/鈥媍atalog/鈥媉_init__.py Adds nested test package marker.
tests/鈥媠pecify_cli/鈥媌undles/鈥媉command_helpers.py Shares command-test setup helpers.
tests/鈥媠pecify_cli/鈥媌undles/鈥媉_init__.py Adds bundle test package marker.
tests/鈥媔ntegration/鈥媡est_bundler_init_install.py Moves install initialization tests.
tests/鈥媍ontract/鈥媡est_manifest_schema.py Updates manifest API imports.
tests/鈥媍ontract/鈥媡est_catalog_schema.py Updates catalog API imports.
src/鈥媠pecify_cli/鈥媍ommands/鈥媌undle/鈥媉_init__.py Removes obsolete monolithic CLI module.
src/鈥媠pecify_cli/鈥媌undles/鈥媦amlio.py Flattens package imports.
src/鈥媠pecify_cli/鈥媌undles/鈥媣ersioning.py Flattens package imports.
src/鈥媠pecify_cli/鈥媌undles/鈥媣alidator.py Flattens validator dependencies.
src/鈥媠pecify_cli/鈥媌undles/鈥媠ources.py Extracts manifest source resolution.
src/鈥媠pecify_cli/鈥媌undles/鈥媟esolver.py Flattens resolver dependencies.
src/鈥媠pecify_cli/鈥媌undles/鈥媟eferences.py Flattens reference dependencies.
src/鈥媠pecify_cli/鈥媌undles/鈥媟ecords.py Flattens record dependencies.
src/鈥媠pecify_cli/鈥媌undles/鈥媝roject.py Flattens project helpers.
src/鈥媠pecify_cli/鈥媌undles/鈥媝rimitives.py Flattens primitive integrations.
src/鈥媠pecify_cli/鈥媌undles/鈥媝ackager.py Flattens packager dependencies.
src/鈥媠pecify_cli/鈥媌undles/鈥媘anifest.py Flattens manifest dependencies.
src/鈥媠pecify_cli/鈥媌undles/鈥媔nstaller.py Flattens installer dependencies.
src/鈥媠pecify_cli/鈥媌undles/鈥媍onflict.py Flattens conflict dependencies.
src/鈥媠pecify_cli/鈥媌undles/鈥媍ommand_validate.py Implements validate CLI adapter.
src/鈥媠pecify_cli/鈥媌undles/鈥媍ommand_update.py Implements update CLI adapter.
src/鈥媠pecify_cli/鈥媌undles/鈥媍ommand_search.py Implements search CLI adapter.
src/鈥媠pecify_cli/鈥媌undles/鈥媍ommand_remove.py Implements remove CLI adapter.
src/鈥媠pecify_cli/鈥媌undles/鈥媍ommand_list.py Implements list CLI adapter.
src/鈥媠pecify_cli/鈥媌undles/鈥媍ommand_install.py Implements install CLI adapter.
src/鈥媠pecify_cli/鈥媌undles/鈥媍ommand_init.py Implements init CLI adapter.
src/鈥媠pecify_cli/鈥媌undles/鈥媍ommand_info.py Implements info CLI adapter.
src/鈥媠pecify_cli/鈥媌undles/鈥媍ommand_build.py Implements build CLI adapter.
src/鈥媠pecify_cli/鈥媌undles/鈥媍ommand_add.py Implements add CLI adapter.
src/鈥媠pecify_cli/鈥媌undles/鈥媍atalogs.py Flattens catalog models.
src/鈥媠pecify_cli/鈥媌undles/鈥媍atalog/鈥媍ommand_remove.py Implements catalog remove adapter.
src/鈥媠pecify_cli/鈥媌undles/鈥媍atalog/鈥媍ommand_list.py Implements catalog list adapter.
src/鈥媠pecify_cli/鈥媌undles/鈥媍atalog/鈥媍ommand_add.py Implements catalog add adapter.
src/鈥媠pecify_cli/鈥媌undles/鈥媍atalog/鈥媉_init__.py Registers nested catalog commands.
src/鈥媠pecify_cli/鈥媌undles/鈥媍atalog_stack.py Flattens catalog-stack dependencies.
src/鈥媠pecify_cli/鈥媌undles/鈥媍atalog_config.py Flattens catalog configuration.
src/鈥媠pecify_cli/鈥媌undles/鈥媋dapters.py Flattens external adapters.
src/鈥媠pecify_cli/鈥媌undles/鈥媉commands.py Centralizes group infrastructure and registration.
src/鈥媠pecify_cli/鈥媌undles/鈥媉_init__.py Documents the flattened package API.
src/鈥媠pecify_cli/鈥媌undler/鈥媠ervices/鈥媉_init__.py Removes obsolete nested package.
src/鈥媠pecify_cli/鈥媌undler/鈥媘odels/鈥媉_init__.py Removes obsolete nested package.
src/鈥媠pecify_cli/鈥媌undler/鈥媗ib/鈥媉_init__.py Removes obsolete nested package.
src/鈥媠pecify_cli/鈥媌undler/鈥媍ommands_impl/鈥媉_init__.py Removes obsolete implementation package.
src/鈥媠pecify_cli/鈥媌undler.py Preserves legacy BundlerError import.
src/鈥媠pecify_cli/鈥媉_init__.py Registers the reorganized bundle CLI.

馃挕 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mnriem
mnriem merged commit 175adbc into github:main Sep 22, 2026
15 checks passed
@mnriem
mnriem deleted the mnriem-chore/bundle-cli-refactor branch September 22, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants