Skip to content

fix(copyllm): expand table components in markdown endpoint#11040

Merged
mergify[bot] merged 1 commit intomainfrom
devs/jd/fix/copyllm-expand-tables/I0629a1f64245b272d8b390677d8e9ba961fd7465
Apr 14, 2026
Merged

fix(copyllm): expand table components in markdown endpoint#11040
mergify[bot] merged 1 commit intomainfrom
devs/jd/fix/copyllm-expand-tables/I0629a1f64245b272d8b390677d8e9ba961fd7465

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented Apr 14, 2026

The "Copy for LLM" and "View as Markdown" features served raw MDX source,
which included unresolved JSX component tags like
<OptionsTable def="PullRequestRuleModel" /> instead of actual table data.

This adds a processing step that replaces OptionsTable, ActionOptionsTable,
and PullRequestAttributesTable components with markdown tables generated
from the config schema, and strips import statements.

Fixes Mergifyio/mergify#5166

Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]

Copilot AI review requested due to automatic review settings April 14, 2026 07:38
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 14, 2026 07:39 Failure
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 14, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success = build
    • check-success = lint
    • check-success = test
    • any of:
      • check-success = test-broken-links
      • label = ignore-broken-links
    • any of:
      • check-success=Cloudflare Pages
      • -head-repo-full-name~=^Mergifyio/

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by >= 2
    • author = dependabot[bot]
    • author = mergify-ci-bot

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@mergify mergify bot requested a review from a team April 14, 2026 07:41
@jd jd marked this pull request as ready for review April 14, 2026 07:42
Copy link
Copy Markdown

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

This PR fixes the “Copy for LLM” / “View as Markdown” output by post-processing raw MDX source so that schema-driven table components are expanded into real markdown tables (and MDX import lines are removed), producing more usable plain markdown from the .md endpoint.

Changes:

  • Added a schemaToMarkdown utility that expands <OptionsTable />, <ActionOptionsTable />, and <PullRequestAttributesTable /> into markdown tables generated from the config schema.
  • Added Vitest coverage for MDX expansion behaviors (table replacement, import stripping, blank-line normalization).
  • Wired the markdown endpoint (src/pages/[...slug].md.ts) to run the MDX expansion step before returning the response.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/util/schemaToMarkdown.ts Implements MDX-to-markdown transformations and schema-to-table generation.
src/util/schemaToMarkdown.test.ts Adds unit tests validating the expansion and cleanup behaviors.
src/pages/[...slug].md.ts Applies the expansion step to the .md endpoint response.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The "Copy for LLM" and "View as Markdown" features served raw MDX source,
which included unresolved JSX component tags like
`<OptionsTable def="PullRequestRuleModel" />` instead of actual table data.

This adds a processing step that replaces OptionsTable, ActionOptionsTable,
and PullRequestAttributesTable components with markdown tables generated
from the config schema, and strips import statements.

Fixes Mergifyio/mergify#5166

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Change-Id: I0629a1f64245b272d8b390677d8e9ba961fd7465
@jd jd force-pushed the devs/jd/fix/copyllm-expand-tables/I0629a1f64245b272d8b390677d8e9ba961fd7465 branch from ea76be4 to 2f89f06 Compare April 14, 2026 08:12
@mergify mergify bot deployed to Mergify Merge Protections April 14, 2026 08:13 Active
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 14, 2026

Merge Queue Status

This pull request spent 2 minutes 58 seconds in the queue, including 2 minutes 20 seconds running CI.

Required conditions to merge

mergify bot added a commit that referenced this pull request Apr 14, 2026
@mergify mergify bot added the queued label Apr 14, 2026
@mergify mergify bot merged commit 3786b3c into main Apr 14, 2026
9 of 14 checks passed
@mergify mergify bot deleted the devs/jd/fix/copyllm-expand-tables/I0629a1f64245b272d8b390677d8e9ba961fd7465 branch April 14, 2026 10:51
@mergify mergify bot removed the queued label Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Copy for LLM in Mergify Configuration File does not contains table data

4 participants