generate community extensions index from catalog#2564
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR introduces an automated generator for the community extensions reference documentation. The generator reads extensions/catalog.community.json and renders a Markdown table into docs/community/extensions.md between sentinel markers, with a CLI supporting --write and --check modes plus tests verifying drift detection.
Changes:
- Adds a
community_catalog_docshelper module with catalog loading, row iteration, and table/markdown rendering. - Adds a CLI script (
scripts/generate_community_extensions_index.py) supporting print/--write/--checkmodes. - Regenerates
docs/community/extensions.mdfrom the catalog, replacing the manually curated table with generated content between sentinel markers; adds tests for sync, sort, and CLI check mode.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| src/specify_cli/community_catalog_docs.py | Core helpers to load catalog, iterate rows, and render the generated table/index markdown. |
| scripts/generate_community_extensions_index.py | CLI entry point wrapping the helpers with write/check/print modes. |
| docs/community/extensions.md | Replaces the curated table with a generator-driven section delimited by markers; removes Categories/Effect legends. |
| tests/test_community_catalog_docs.py | Adds tests for sync, alphabetical ordering, and CLI --check behavior. |
Comments suppressed due to low confidence (1)
scripts/generate_community_extensions_index.py:1
--checkand--writeare not declared mutually exclusive, and if both are passed--checksilently wins (write is skipped). Useparser.add_mutually_exclusive_group()or validate explicitly to make the contract clear.
#!/usr/bin/env python3
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ea06181 to
0cb36ea
Compare
7f284f4 to
e2ca165
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 36 out of 36 changed files in this pull request and generated 10 comments.
Comments suppressed due to low confidence (1)
src/specify_cli/workflows/engine.py:1
- The explicit guards that rejected
boolfortype: number(sincefloat(True)becomes1.0) and enforced real strings fortype: stringhave been removed. This will silently accept common YAML authoring mistakes (e.g.default: truefor a number, ordefault: 5for a string), potentially producing surprising runtime behavior. Consider reinstating: (1) an explicitisinstance(value, bool)rejection in thenumberbranch, and (2) astringbranch that requiresisinstance(value, str).
"""Workflow engine — loads, validates, and executes workflow YAML definitions.
e2ca165 to
8503e48
Compare
|
Please resolve conflicts |
|
Please address Copilot feedback |
b4df9ab to
2990f8b
Compare
|
Rebase needed: Please rebase cleanly on Scope: Please revert or split the following changes into a separate PR — they are unrelated to generating the community extensions index:
Copilot feedback: Please address the outstanding Copilot review comments that are not yet outdated. Communication: Rather than replying individually to each review comment, please use a single comment per commit describing what changed and which feedback items were addressed. This is easier to follow. AI disclosure: If you are using AI tooling to generate code or review replies, please disclose that. Several replies were posted within a 2-minute window with identical phrasing patterns, which suggests automated generation. |
| # Escape raw field values *before* composing Markdown syntax so that | ||
| # a pipe inside a name or description doesn't break a link target. | ||
| safe_name = _render_cell(row["name"]) | ||
| link = ( | ||
| f"[{safe_name}]({row['repository']})" | ||
| if row["repository"] | ||
| else safe_name | ||
| ) |
| cleaned = [f"`{c}`" for tag in tags if (c := str(tag).replace("|", "").strip())] | ||
| return ", ".join(cleaned) if cleaned else "—" |
| f"`{row['id']}`", | ||
| _render_cell(row["description"]), | ||
| _format_tags(row["tags"]), |
|
Addressed the prerelease/dev build inconsistency so preset and extension compatibility now both accept source checkouts with prerelease versions when the specifier allows them. I also hardened the community catalog Markdown rendering and added regression tests for the new cases. |
| from .community_catalog_docs import render_community_extensions_table | ||
|
|
||
| try: | ||
| typer.echo(render_community_extensions_table()) |
|
|
||
|
|
||
| def _format_inline_code(value: str) -> str: | ||
| text = _render_cell(value) |
| "--markdown", | ||
| help=( | ||
| "Output the full community catalog as a markdown table " | ||
| "(ignores query/tag/author/verified filters)" |
| @@ -573,7 +573,7 @@ def check_compatibility( | |||
|
|
|||
| try: | |||
| specifier = SpecifierSet(required) | |||
What changed
docs/community/extensions.mdbacked byextensions/catalog.community.json.--checkmode catches drift.Why
Impact
Validation
python scripts/generate_community_extensions_index.py --checkpytest tests/test_community_catalog_docs.py -q