Skip to content

generate community extensions index from catalog#2564

Open
DyanGalih wants to merge 9 commits into
github:mainfrom
DyanGalih:003-generate-community-docs
Open

generate community extensions index from catalog#2564
DyanGalih wants to merge 9 commits into
github:mainfrom
DyanGalih:003-generate-community-docs

Conversation

@DyanGalih
Copy link
Copy Markdown
Contributor

What changed

  • Added a generator for docs/community/extensions.md backed by extensions/catalog.community.json.
  • Replaced the hand-maintained community extensions table with a generated index block.
  • Added a regression test that checks the committed page stays in sync with the generator and that --check mode catches drift.

Why

  • The community extensions page was a large manual table and was easy to drift from the catalog source of truth.
  • Moving the page to generated output keeps the community index aligned with the catalog as entries change.
  • This reduces maintainer overhead and makes the published list more trustworthy for contributors and users.

Impact

  • Contributors now update the catalog JSON instead of editing the rendered table by hand.
  • The community extensions page is more consistent and less likely to go stale.
  • CI and local tests can detect drift before it lands.

Validation

  • python scripts/generate_community_extensions_index.py --check
  • pytest tests/test_community_catalog_docs.py -q

Copilot AI review requested due to automatic review settings May 14, 2026 16:43
@DyanGalih DyanGalih changed the title [codex] generate community extensions index from catalog generate community extensions index from catalog May 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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_docs helper module with catalog loading, row iteration, and table/markdown rendering.
  • Adds a CLI script (scripts/generate_community_extensions_index.py) supporting print/--write/--check modes.
  • Regenerates docs/community/extensions.md from 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

  • --check and --write are not declared mutually exclusive, and if both are passed --check silently wins (write is skipped). Use parser.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.

Comment thread src/specify_cli/community_catalog_docs.py Outdated
Comment thread docs/community/extensions.md Outdated
Comment thread docs/community/extensions.md Outdated
Comment thread src/specify_cli/community_catalog_docs.py Outdated
Comment thread src/specify_cli/community_catalog_docs.py Outdated
Comment thread scripts/generate_community_extensions_index.py Outdated
Comment thread tests/test_community_catalog_docs.py Outdated
Comment thread src/specify_cli/community_catalog_docs.py
Comment thread src/specify_cli/community_catalog_docs.py Outdated
Copilot AI review requested due to automatic review settings May 14, 2026 22:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 4 out of 4 changed files in this pull request and generated 9 comments.

Comment thread src/specify_cli/__init__.py
Comment thread src/specify_cli/community_catalog_docs.py
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
Comment thread docs/community/extensions.md Outdated
Comment thread docs/community/extensions.md Outdated
Comment thread tests/test_community_catalog_docs.py
Comment thread src/specify_cli/community_catalog_docs.py Outdated
Copilot AI review requested due to automatic review settings May 14, 2026 23:10
@DyanGalih DyanGalih force-pushed the 003-generate-community-docs branch from ea06181 to 0cb36ea Compare May 14, 2026 23:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 4 out of 4 changed files in this pull request and generated 12 comments.

Comment thread src/specify_cli/__init__.py
Comment thread src/specify_cli/community_catalog_docs.py
Comment thread src/specify_cli/community_catalog_docs.py
Comment thread src/specify_cli/community_catalog_docs.py Outdated
Comment thread tests/test_community_catalog_docs.py Outdated
Comment thread docs/community/extensions.md
Comment thread docs/community/extensions.md Outdated
Comment thread src/specify_cli/community_catalog_docs.py
Comment thread src/specify_cli/community_catalog_docs.py
Comment thread src/specify_cli/__init__.py Outdated
Copilot AI review requested due to automatic review settings May 26, 2026 22:18
@DyanGalih DyanGalih force-pushed the 003-generate-community-docs branch from 7f284f4 to e2ca165 Compare May 26, 2026 22:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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 bool for type: number (since float(True) becomes 1.0) and enforced real strings for type: string have been removed. This will silently accept common YAML authoring mistakes (e.g. default: true for a number, or default: 5 for a string), potentially producing surprising runtime behavior. Consider reinstating: (1) an explicit isinstance(value, bool) rejection in the number branch, and (2) a string branch that requires isinstance(value, str).
"""Workflow engine — loads, validates, and executes workflow YAML definitions.

Comment thread src/specify_cli/workflows/engine.py Outdated
Comment thread src/specify_cli/workflows/engine.py Outdated
Comment thread src/specify_cli/presets.py Outdated
Comment thread src/specify_cli/extensions.py Outdated
Comment thread src/specify_cli/extensions.py Outdated
Comment thread src/specify_cli/__init__.py Outdated
Comment thread scripts/powershell/create-new-feature.ps1 Outdated
Comment thread scripts/powershell/setup-plan.ps1 Outdated
Comment thread pyproject.toml Outdated
Comment thread src/specify_cli/workflows/engine.py Outdated
@DyanGalih DyanGalih force-pushed the 003-generate-community-docs branch from e2ca165 to 8503e48 Compare May 27, 2026 00:13
@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented May 27, 2026

Please resolve conflicts

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 4

Comment thread src/specify_cli/__init__.py Outdated
Comment thread tests/test_community_catalog_docs.py
Comment thread extensions/catalog.community.json Outdated
Comment thread extensions/catalog.community.json
@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented May 27, 2026

Please address Copilot feedback

Copilot AI review requested due to automatic review settings May 28, 2026 16:55
@DyanGalih DyanGalih force-pushed the 003-generate-community-docs branch from b4df9ab to 2990f8b Compare May 28, 2026 16:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 10 out of 10 changed files in this pull request and generated 4 comments.

Comment thread src/specify_cli/__init__.py
Comment thread src/specify_cli/community_catalog_docs.py
Comment thread src/specify_cli/_assets.py Outdated
Comment thread tests/test_utils_assets_imports.py Outdated
@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented May 28, 2026

Rebase needed: Please rebase cleanly on upstream/main. The current branch appears to have incorrect conflict resolutions in extensions/catalog.community.json — several entries were silently downgraded (e.g., agent-governance 1.2.0 → 1.0.0, description changes, tool requirement changes). A clean rebase should pick up the current catalog state from main.

Scope: Please revert or split the following changes into a separate PR — they are unrelated to generating the community extensions index:

  • src/specify_cli/_assets.py — reorders get_speckit_version() priority
  • src/specify_cli/extensions.py — switches to specifier.contains(current, prereleases=True)
  • pyproject.toml — adds pythonpath = ["src"]
  • tests/test_utils_assets_imports.py — adds test_get_speckit_version_prefers_checked_out_pyproject

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.

Copilot AI review requested due to automatic review settings May 28, 2026 17:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Copilot AI review requested due to automatic review settings May 28, 2026 17:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 3 out of 3 changed files in this pull request and generated 3 comments.

Comment on lines +67 to +74
# 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
)
Comment on lines +23 to +24
cleaned = [f"`{c}`" for tag in tags if (c := str(tag).replace("|", "").strip())]
return ", ".join(cleaned) if cleaned else "—"
Comment on lines +78 to +80
f"`{row['id']}`",
_render_cell(row["description"]),
_format_tags(row["tags"]),
@DyanGalih
Copy link
Copy Markdown
Contributor Author

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.

@DyanGalih DyanGalih marked this pull request as ready for review May 28, 2026 17:41
@DyanGalih DyanGalih requested a review from mnriem as a code owner May 28, 2026 17:41
Copilot AI review requested due to automatic review settings May 28, 2026 17:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 4 comments.

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)
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