Skip to content

refactor(version): extract shared operation - #4863

Merged
mnriem merged 1 commit into
github:mainfrom
mnriem:mnriem-version-shared-operation
Oct 6, 2026
Merged

mnriem merged 1 commit into
github:mainfrom
mnriem:mnriem-version-shared-operation

Conversation

@mnriem

@mnriem mnriem commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a typed, transport-neutral _operation_version.py application entry point for CLI version, runtime, system, and feature capability collection
  • keep command_version.py responsible for Typer registration, Rich rendering, CLI JSON serialization, streams, sanitized failures, and exit codes
  • preserve existing version command output, JSON bytes and compatibility behavior, OpenSSL-unavailable handling, feature ordering, and established monkeypatch paths

Validation

  • uv sync --extra test — passed
  • LC_ALL=en_US.UTF-8 .venv/bin/python -m pytest — 9,742 passed, 19 skipped
  • .venv/bin/python -m pytest tests/specify_cli/test_operation_version.py tests/specify_cli/test_command_version.py — 16 passed
  • broader version/import suite — 69 passed, 1 skipped
  • uv run ruff check src/specify_cli/_operation_version.py src/specify_cli/command_version.py tests/specify_cli/test_operation_version.py tests/specify_cli/test_command_version.py — passed
  • uv run ruff format --check src/specify_cli/_operation_version.py src/specify_cli/command_version.py tests/specify_cli/test_operation_version.py tests/specify_cli/test_command_version.py — passed
  • git diff --check — passed
  • pytest collection increased from 9,707 to 9,714 before rebasing onto the merged architecture change; current rebased collection is 9,761

Scope

No MCP adapter, MCP registration, command inventory, access policy, working-directory behavior, or JSON contract changes are included.

AI disclosure

Implemented with GitHub Copilot using GPT-5.6 Sol in autonomous mode; code generation, tests, validation, commit, and pull request drafting.

Move version, runtime, platform, and capability collection into a transport-neutral typed operation while preserving the existing CLI adapter contract and patch points.

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 October 6, 2026 21:55

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 refactor preserves established behavior, compatibility paths, and transport-specific ownership with adequate test coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Extracts version collection into a typed, transport-neutral operation while preserving CLI rendering and compatibility behavior.

Changes:

  • Adds typed runtime, system, and capability collection.
  • Refactors the CLI adapter to consume shared results.
  • Adds operation and adapter coverage.
File Description
src/​specify_cli/​_operation_version.py Implements shared version collection.
src/​specify_cli/​command_version.py Maps shared results to existing CLI output.
tests/​specify_cli/​test_operation_version.py Tests operation contracts and probes.
tests/​specify_cli/​test_command_version.py Tests CLI adapter integration.

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

@mnriem
mnriem merged commit 62b6fcf into github:main Oct 6, 2026
15 checks passed
@mnriem
mnriem deleted the mnriem-version-shared-operation branch October 6, 2026 22:15
@mnriem mnriem mentioned this pull request Oct 6, 2026
1 of 5 tasks
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