docs: stabilize integrations reference rendering#2694
Conversation
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.
|
Please address Copilot feedback |
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
eb5ef18 to
e82e431
Compare
|
I have addressed the Copilot feedback by introducing a |
|
I have also addressed the remaining feedback: |
|
I have also addressed the latest feedback by adding |
| 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 = [render_code_span(c) for tag in tags if (c := str(tag).replace("|", "").strip())] |
| "foo": {"name": "Foo", "description": "", "tags": ["foo|bar"], "verified": False, "repository": ""}, | ||
| }) | ||
| table = render_community_extensions_table(path=f) | ||
| # pipe stripped from tag value | ||
| assert "`foobar`" in table |
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback and fix test & lint errors
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