Skip to content

Fix spec-change-impact PR comments rendering as raw markdown#205

Merged
jeremy merged 3 commits intomainfrom
fix-spec-impact-markdown-rendering
Mar 19, 2026
Merged

Fix spec-change-impact PR comments rendering as raw markdown#205
jeremy merged 3 commits intomainfrom
fix-spec-impact-markdown-rendering

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 18, 2026

Summary

  • Add explicit no-fence instruction to the spec-impact prompt so GPT-4o stops wrapping output in ```markdown ``` code fences
  • Defensively strip any remaining fence lines before posting the comment to GitHub
  • Pin Kotlin to 2.3.10 (supported by CodeQL 2.24.2) and re-enable java-kotlin CodeQL analysis

Follows up on #196 which fixed shell escaping but not the fencing issue.

Test plan

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.
Copilot AI review requested due to automatic review settings March 18, 2026 23:21
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 18, 2026

Sensitive Change Detection (shadow mode)

This PR modifies control-plane files:

  • .github/workflows/ai-labeler.yml
  • .github/workflows/codeql.yml

Shadow mode — this check is informational only. When activated, changes to these paths will require approval from a maintainer.

@github-actions github-actions bot added the github-actions Pull requests that update GitHub Actions label Mar 18, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

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.

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 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.
@jeremy jeremy requested a review from Copilot March 18, 2026 23:39
@github-actions github-actions bot added dependencies Pull requests that update a dependency file kotlin labels Mar 18, 2026
@github-advanced-security
Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

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

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.
@jeremy jeremy requested a review from Copilot March 19, 2026 03:54
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 “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-kotlin CodeQL 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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

@jeremy jeremy merged commit 1c33ce4 into main Mar 19, 2026
50 checks passed
@jeremy jeremy deleted the fix-spec-impact-markdown-rendering branch March 19, 2026 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file github-actions Pull requests that update GitHub Actions kotlin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants