Skip to content

docs: stabilize integrations reference rendering#2694

Open
DyanGalih wants to merge 5 commits into
github:mainfrom
DyanGalih:pr/2563-docs-fixes
Open

docs: stabilize integrations reference rendering#2694
DyanGalih wants to merge 5 commits into
github:mainfrom
DyanGalih:pr/2563-docs-fixes

Conversation

@DyanGalih

Copy link
Copy Markdown
Contributor

Summary

This PR keeps the integrations docs rendering work from PR #2563 scoped to the PR-2563 branch.

What changed

  • Hardened integrations docs rendering helpers so markdown table output stays stable.
  • Added safer escaping for markdown link text and repository URLs.
  • Improved tests for the integrations reference table and community catalog docs.
  • Kept the integration search --markdown CLI 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

  • More stable generated integrations docs.
  • Better handling of special characters in table rows and links.
  • Cleaner test coverage around the docs rendering paths.

Validation

  • 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

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

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.

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.py for generating the built-in integrations Markdown reference table (with escaping helpers).
  • Adds community_catalog_docs.py to render a community extensions Markdown table from extensions/catalog.community.json.
  • Extends integration search with --markdown output 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.

Comment thread tests/test_catalog_docs.py Outdated
Comment thread src/specify_cli/community_catalog_docs.py Outdated
Comment thread src/specify_cli/community_catalog_docs.py
Comment thread src/specify_cli/community_catalog_docs.py
@mnriem

mnriem commented May 27, 2026

Copy link
Copy Markdown
Collaborator

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
@DyanGalih DyanGalih force-pushed the pr/2563-docs-fixes branch from eb5ef18 to e82e431 Compare June 26, 2026 03:47
@DyanGalih

Copy link
Copy Markdown
Contributor Author

I have addressed the Copilot feedback by introducing a render_code_span helper to safely handle strings containing backticks when generating the markdown tables. This fixes the issues with malformed tables for tags and IDs.

Copilot AI review requested due to automatic review settings June 26, 2026 03:56
@DyanGalih

Copy link
Copy Markdown
Contributor Author

I have also addressed the remaining feedback: CliRunner is now instantiated with mix_stderr=False to fix flaky tests, and ROOT_DIR is globally cached in _assets.py to avoid redundant path traversal. All threads are now resolved.

@DyanGalih DyanGalih marked this pull request as ready for review June 26, 2026 03:57
@DyanGalih DyanGalih requested a review from mnriem as a code owner June 26, 2026 03:57

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/catalog_docs.py
Comment thread src/specify_cli/catalog_docs.py
@DyanGalih

Copy link
Copy Markdown
Contributor Author

I have also addressed the latest feedback by adding zed to the doc URLs map and updating list_integrations_for_docs to fall back to the integration install_url when an override is not present. All review threads are now resolved!

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.

Review details

  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Low

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())]
Comment on lines +114 to +118
"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 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 and fix test & lint errors

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