Fix spec-change-impact PR comments rendering as raw markdown#205
Fix spec-change-impact PR comments rendering as raw markdown#205
Conversation
The model wraps its response in ```markdown``` code fences, so GitHub renders the entire comment as a code block. Add a no-fence instruction to the prompt and defensively strip any fence lines before posting.
Sensitive Change Detection (shadow mode)This PR modifies control-plane files:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8413ffd3b5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/ai-labeler.yml">
<violation number="1" location=".github/workflows/ai-labeler.yml:133">
P2: This `sed` pattern strips every bare ` ``` ` line in the file, not just the wrapping fences. If the impact comment ever contains inline code blocks, their closing fences will be removed too, corrupting the rendered markdown.
Restrict the deletion to the first and last lines of the file so internal code blocks are preserved.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
Pull request overview
This PR improves the “Spec Change Impact” GitHub PR comment rendering by discouraging the model from wrapping its output in ``` fences and by sanitizing the model output before posting/updating the PR comment.
Changes:
- Update the spec-impact prompt to explicitly request unfenced/raw markdown output.
- Add a preprocessing step in the workflow to strip certain code-fence lines before creating/updating the GitHub PR comment.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/ai-labeler.yml | Strips fence lines from the model response and posts/updates the “Spec Change Impact” PR comment using the cleaned file. |
| .github/prompts/spec-impact.prompt.yml | Adds instructions to avoid wrapping the response in markdown/code fences. |
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodeQL 2.24.2 supports Kotlin up to 2.3.10 but not 2.3.20 (github/codeql#21484). Pin to 2.3.10 so the org-enforced Analyze (java-kotlin) check passes on open PRs.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
Pull request overview
Fixes Spec Change Impact PR comments rendering as raw code blocks by discouraging code-fence output from the model and cleaning any remaining fences before posting to GitHub.
Changes:
- Add explicit “no code fence” instruction to the spec-impact prompt.
- Strip markdown fence lines from the model response before creating/updating the PR comment.
- Re-enable Kotlin CodeQL analysis and change the Kotlin version (scope beyond the stated PR purpose).
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/prompts/spec-impact.prompt.yml |
Adds explicit instruction to output raw markdown (no fenced block). |
.github/workflows/ai-labeler.yml |
Cleans model output before posting as a PR comment. |
.github/workflows/codeql.yml |
Re-enables java-kotlin in the CodeQL language matrix. |
kotlin/gradle/libs.versions.toml |
Changes Kotlin version used by Gradle plugins/dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Restrict sed to first/last lines so legitimate fenced examples inside the comment body are preserved. Also handle ```md variant and quote paths consistently.
There was a problem hiding this comment.
Pull request overview
This PR fixes “Spec Change Impact” PR comments rendering as raw markdown code blocks by preventing/cleaning unwanted outer code-fence wrappers before posting to GitHub, and restores Kotlin CodeQL analysis by pinning Kotlin to a CodeQL-supported version.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Update the spec-impact prompt to explicitly request unfenced raw markdown output.
- Strip an outer leading/trailing code fence from the model response before creating/updating the PR comment.
- Pin Kotlin to 2.3.10 and re-enable
java-kotlinCodeQL analysis.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
kotlin/gradle/libs.versions.toml |
Pins Kotlin version to 2.3.10 to align with CodeQL support. |
.github/workflows/codeql.yml |
Re-enables java-kotlin in the CodeQL language matrix and builds Kotlin in manual mode. |
.github/workflows/ai-labeler.yml |
Cleans outer code fences before posting/updating the “Spec Change Impact” comment. |
.github/prompts/spec-impact.prompt.yml |
Adds “no code fence” instruction to reduce fenced responses from the model. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f83e54267
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
```markdown ```code fencesjava-kotlinCodeQL analysisFollows up on #196 which fixed shell escaping but not the fencing issue.
Test plan
sed -E '/^```(markdown)?$/d'correctly strips wrapping fences (```markdown ```and bare``` ```) while preserving inline code fences in content```markdown ```fences, matching the diagnosed failure modestartswith("## Spec Change Impact")can't match fenced content — validates the duplication issuespec/files and verify the comment renders with formatted markdown