Skip to content

fix: allow prerelease spec-kit versions in compatibility checks#2695

Open
DyanGalih wants to merge 34 commits into
github:mainfrom
DyanGalih:fix/spec-kit-ci-prerelease-version-gate
Open

fix: allow prerelease spec-kit versions in compatibility checks#2695
DyanGalih wants to merge 34 commits into
github:mainfrom
DyanGalih:fix/spec-kit-ci-prerelease-version-gate

Conversation

@DyanGalih

Copy link
Copy Markdown
Contributor

Summary

This PR isolates the prerelease compatibility fix from the docs-rendering work.

What changed

  • Allowed prerelease/dev spec-kit builds to satisfy compatible version specifiers for extensions and presets.
  • Added regression coverage for prerelease version compatibility.
  • Kept the fix scoped to the compatibility gate only.

Why

The compatibility checks were rejecting a local prerelease build (0.8.8.dev0) even when the required version range should have accepted it. That blocked otherwise valid extension and preset workflows.

Impact

  • Dev builds can install compatible extensions and presets again.
  • Extension update/install flows no longer fail on prerelease version numbers.
  • The docs-rendering changes from PR generate integrations reference from catalog #2563 stay in a separate branch/PR.

Validation

  • pytest -q
  • python3 -m compileall -q .

Copilot AI review requested due to automatic review settings May 24, 2026 23:03

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates spec-kit compatibility checks to treat prerelease/dev builds as satisfying version constraints, and adds regression tests for the new behavior.

Changes:

  • Allow prerelease versions to satisfy SpecifierSet checks by using specifier.contains(..., prereleases=True).
  • Add test coverage for prerelease compatibility for extensions and version_satisfies().

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/test_extensions.py Adds tests asserting prerelease/dev versions are treated as compatible.
src/specify_cli/presets.py Updates preset compatibility check to include prerelease versions.
src/specify_cli/extensions.py Updates extension compatibility + version_satisfies() to include prerelease versions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_extensions.py Outdated
Comment thread src/specify_cli/extensions.py Outdated
@mnriem

mnriem commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

DyanGalih added 27 commits June 26, 2026 04:20
…-markdown

- Remove standalone scripts/generate_integrations_reference.py
- Strip doc injection machinery from catalog_docs.py; keep only table rendering
- Wire render_integrations_table() into existing --markdown flag of integration search
- Remove old simple markdown table block from integration_search (was Name|ID|Version|Description|Author)
- Simplify tests: drop subprocess/doc-path tests, keep table rendering and metadata tests
- Clean up docs/reference/integrations.md: remove generated markers, update note
…search

- Warn when --markdown is combined with filters (query/--tag/--author) which are
  silently ignored; catch ValueError/FileNotFoundError and surface clean error
  via console instead of raw traceback (r3244821516)
- Add coverage enforcement in list_integrations_for_docs(): raises ValueError
  with actionable message if any registry key is missing from INTEGRATION_DOC_URLS,
  preventing silently incomplete doc tables (r3244821589)
- Rename test to accurately reflect sources: label derives from registry config,
  URL comes from INTEGRATION_DOC_URLS doc map — not solely from registry (r3244821607)
- Simplify test dict construction to idiomatic dict comprehension (r3244821619)
- Rename _get_mocked_cli_runner() to _get_catalog_docs_patches() for clarity
- Use ExitStack context manager for guaranteed patch cleanup
- Add explicit UTF-8 encoding to file reads
- Skip doc sync test gracefully when docs aren't present
- Remove exception chaining from typer.Exit to avoid noisy tracebacks
…cell rendering, fix table parser for escaped pipes
…t_markdown_table for escaped pipes, guard community tests with skip
…r message, validate test rows, prevent double newline
Allow prerelease/dev builds to satisfy extension and preset compatibility
checks when their version number falls within the required specifier range.
Also harden the integrations docs rendering helpers and add regression
coverage for the markdown table parsing and version gating paths.

Tests: pytest -q; python3 -m compileall -q .; black/flake8 unavailable
Reference: branch 002-generate-integrations-docs; source patch /tmp/spec-kit-changes.patch
Keep the prerelease/version compatibility fix on its own branch and remove
the unrelated integrations docs updates that belong with PR 2563.

Tests: full suite passed on the prerelease branch before splitting; docs branch covered by targeted docs tests
Reference: upstream/main; source patch /tmp/spec-kit-changes.patch
@DyanGalih DyanGalih force-pushed the fix/spec-kit-ci-prerelease-version-gate branch from 057259b to 032ef4c Compare June 26, 2026 04:38
@DyanGalih

Copy link
Copy Markdown
Contributor Author

I have addressed the review feedback with the latest push:

  • Centralized Prerelease Policy: Extracted the prerelease compatibility logic into a central version_satisfies helper in src/specify_cli/_utils.py. Updated src/specify_cli/extensions/__init__.py and src/specify_cli/presets/__init__.py to use this new helper.
  • Failing Boundary Tests: Added failing prerelease boundary cases in tests/test_extensions.py to verify that prerelease strings below the lower bound appropriately fail the check.
  • Rebase: The branch has also been rebased against the latest upstream/main to resolve conflicts.

@DyanGalih DyanGalih marked this pull request as ready for review June 26, 2026 04:45
@DyanGalih DyanGalih requested a review from mnriem as a code owner June 26, 2026 04:45
Copilot AI review requested due to automatic review settings June 26, 2026 04:45

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.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comment thread src/specify_cli/extensions/__init__.py Outdated
Comment thread docs/reference/integrations.md
Comment thread src/specify_cli/presets/__init__.py
@DyanGalih

Copy link
Copy Markdown
Contributor Author

I've addressed the additional feedback from the automated review:

  1. Reverted the unintended changes to docs/reference/integrations.md so the docs match the active integration registry.
  2. Added test_check_compatibility_prerelease to tests/test_presets.py to explicitly test that preset validation properly processes prerelease versions at boundaries, ensuring coverage for this new path.
    The branch has been updated.

Copilot AI review requested due to automatic review settings June 26, 2026 04:54

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.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread src/specify_cli/_utils.py
Comment on lines 306 to +308
return rel_path.as_posix()

def version_satisfies(current: str, required: str) -> bool:
Comment on lines 1871 to 1875
return None


def version_satisfies(current: str, required: str) -> bool:
"""Check if current version satisfies required version specifier.

Args:
current: Current version (e.g., "0.1.5")
required: Required version specifier (e.g., ">=0.1.0,<2.0.0")

Returns:
True if version satisfies requirement
"""
try:
current_ver = pkg_version.Version(current)
specifier = SpecifierSet(required)
return current_ver in specifier
except (pkg_version.InvalidVersion, InvalidSpecifier):
return False


@mnriem mnriem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please address Copilot feedback

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.

3 participants