docs: stabilize integrations reference rendering#2694
Draft
DyanGalih wants to merge 2 commits into
Draft
Conversation
Isolate the integrations docs rendering and test updates from the unrelated prerelease compatibility gate fix so the PR 2563 branch stays focused. Tests: targeted docs tests expected; full suite covered on the separate compatibility branch Reference: upstream/main; source patch /tmp/spec-kit-changes.patch
Keep the CLI path alongside the integrations docs rendering changes so the PR 2563 branch remains testable. Tests: pytest tests/test_catalog_docs.py tests/test_community_catalog_docs.py -q; python3 -m compileall -q src/specify_cli/__init__.py src/specify_cli/catalog_docs.py src/specify_cli/community_catalog_docs.py tests/test_catalog_docs.py tests/test_community_catalog_docs.py Reference: upstream/main; source patch /tmp/spec-kit-changes.patch
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds Markdown table rendering utilities for built-in integrations and community extensions, plus CLI/test coverage to validate escaping and formatting.
Changes:
- Introduces
catalog_docs.pyfor generating the built-in integrations Markdown reference table (with escaping helpers). - Adds
community_catalog_docs.pyto render a community extensions Markdown table fromextensions/catalog.community.json. - Extends
integration searchwith--markdownoutput and adds comprehensive tests for formatting and edge cases.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_community_catalog_docs.py | Adds tests covering community catalog parsing, sorting, and Markdown escaping edge cases. |
| tests/test_catalog_docs.py | Adds tests for integrations Markdown rendering, URL/text escaping, and the new CLI --markdown behavior. |
| src/specify_cli/community_catalog_docs.py | Implements community extensions catalog parsing and Markdown table rendering. |
| src/specify_cli/catalog_docs.py | Implements integrations reference table renderer + escaping helpers and doc URL/label/note maps. |
| src/specify_cli/init.py | Adds --markdown option to integration search to print the built-in integrations table. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from specify_cli import app | ||
|
|
||
|
|
||
| runner = CliRunner() |
Comment on lines
+17
to
+18
| ROOT_DIR = _repo_root() | ||
| COMMUNITY_CATALOG_PATH = ROOT_DIR / "extensions" / "catalog.community.json" |
Comment on lines
+21
to
+27
| def _format_tags(tags: Any) -> str: | ||
| if not isinstance(tags, list) or not tags: | ||
| return "—" | ||
| # Clean first, then filter: a tag of " | " would pass str(tag).strip() but produce | ||
| # an empty backtick span after pipe removal, so filter on the cleaned value. | ||
| cleaned = [f"`{c}`" for tag in tags if (c := str(tag).replace("|", "").strip())] | ||
| return ", ".join(cleaned) if cleaned else "—" |
Comment on lines
+84
to
+92
| table_rows.append( | ||
| [ | ||
| link, | ||
| f"`{render_cell(row['id'])}`", | ||
| render_cell(row["description"]), | ||
| _format_tags(row["tags"]), | ||
| row["verified"], | ||
| ] | ||
| ) |
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.
Summary
This PR keeps the integrations docs rendering work from PR #2563 scoped to the PR-2563 branch.
What changed
integration search --markdownCLI path aligned with the docs rendering tests.Why
The generated integrations reference was sensitive to ordering and markdown characters in labels, notes, and repository values. The tests now cover those edge cases so the docs output stays predictable.
Impact
Validation
pytest tests/test_catalog_docs.py tests/test_community_catalog_docs.py -qpython3 -m compileall -q src/specify_cli/__init__.py src/specify_cli/catalog_docs.py src/specify_cli/community_catalog_docs.py tests/test_catalog_docs.py tests/test_community_catalog_docs.py