ci(mcp-diff): build UI artifacts available to baseline checkout#2523
Merged
Conversation
The mcp-server-diff action checks the baseline ref out into a separate working directory and runs install_command there. Without prebuilt UI artifacts, pkg/github/ui_dist/ is empty on the baseline side and UIAssetsAvailable() returns false, producing a false-positive diff that "adds" _meta.ui to MCP Apps tools on every PR. Stash the artifacts to RUNNER_TEMP after the workflow's build-ui step, then restore them from install_command so both the baseline and PR checkouts register identical MCP Apps UI metadata. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes false-positive diffs in the mcp-diff workflow where _meta.ui appears to be “added” on unrelated PRs, by ensuring the baseline checkout sees the same prebuilt UI HTML artifacts as the PR checkout.
Changes:
- Stash
pkg/github/ui_dist/*.htmlinto${RUNNER_TEMP}/ui_distafter the UI build step. - Extend
mcp-server-diff’sinstall_commandto restore those artifacts intopkg/github/ui_distin the baseline checkout. - Apply the same approach to both
mcp-diff(stdio) andmcp-diff-httpjobs.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/mcp-diff.yml | Stashes/restores UI HTML artifacts via RUNNER_TEMP so baseline and PR checkouts have identical embedded UI assets, eliminating UI-related false-positive diffs. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
mcp-diffworkflow has been reporting false-positive diffs that "add"_meta.uimetadata to MCP Apps tools (get_me,issue_write,create_pull_request) on PRs that don't touch the UI at all.Root cause
SamMorrowDrums/mcp-server-diffchecks the baseline ref out into a separate working directory and runsinstall_commandthere. The workflow's./.github/actions/build-uistep only populatespkg/github/ui_dist/in the PR checkout, so on the baseline side:pkg/github/ui_dist/is effectively empty (just.gitkeep/.placeholder.html)UIAssetsAvailable()inpkg/github/ui_embed.goreturnsfalse_meta.uiis never registered on toolsFix
Option D from the investigation: hand the prebuilt artifacts to the baseline checkout via
$RUNNER_TEMP.Build UIstep, copypkg/github/ui_dist/*.htmlto$RUNNER_TEMP/ui_dist/.install_command, copy them back intopkg/github/ui_dist/so both PR and baseline checkouts end up with identical UI assets.Applied to both the
mcp-diff(stdio) andmcp-diff-httpjobs.No double UI build, no Node setup needed in the baseline phase, no upstream action change required.