Fix pull request comment rendering and disable flags - #322
Merged
lelia merged 2 commits intoSep 2, 2026
Merged
Conversation
Eric Hibbs (flowstate)
approved these changes
Aug 28, 2026
Eric Hibbs (flowstate)
left a comment
Contributor
There was a problem hiding this comment.
LGTM!
oh and we should add a lint:fix via ruff somewhere in our automation, main is carrying around like 75 formatting issues, nothing major
A whitespace-only line closes a CommonMark HTML block. Optional sections that rendered as empty left one behind inside the alerts table, so the indented closing tags after it were rendered as a literal code block reading `</blockquote></details>` instead of markup. - Drop blank lines from generated comment markup and keep indentation below the four spaces that start a code block. - Collapse alert descriptions, suggestions and license findings onto a single line so multi-line API text cannot break the table either. - Replace the comment body with a short confirmation when no alerts are left to report, instead of keeping the caution banner above a table with no rows. The comment marker is preserved so the same comment is updated later. - Apply ignore-all to the pre-2.0.55 Markdown table format. The check was made once per ignore command and an ignore-all comment produces none, so no rows were removed. Bumps to 2.6.8.
Both flags were checked only after testing whether a comment of that type was already on the pull request, so they suppressed the first post and then updated that comment on every later run. --disable-security-issue in particular kept refreshing an existing comment with the full alerts table. The flags now mean the CLI does not manage that comment at all. An existing comment is left untouched rather than rewritten, since a body claiming no alerts would be inaccurate when reporting is merely switched off. Moves the decision into should_write_comment() so it is covered by tests directly; main_code() had no harness for this block. Bumps to 2.7.0 rather than a patch, since these flags change behavior.
lelia
force-pushed
the
lelia/ce-381-python-cli-github-pr-comment-leaves-orphaned-elements-empty
branch
from
September 2, 2026 20:55
ef831c7 to
48d4330
Compare
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.
Summary
Two fixes to the pull request comment the CLI posts:
</blockquote></details>tags as a literal code block, and could leave the "Caution" banner sitting above an alerts table with no rows. A whitespace-only line closes a CommonMark HTML block; optional sections that rendered as empty left one behind inside the table, and because the closing tags after it are indented four or more spaces they were rendered as an indented code block rather than markup. The empty table appeared separately, when a comment's alerts were all resolved by a later commit or ignored by comment.--disable-security-issueand--disable-overviewwere checked only after testing whether a comment of that type already existed, so they suppressed the first post and then updated that comment on every later run.Changes
@SocketSecurity ignore-allnow applies to comments in the pre-2.0.55 Markdown table format. The check was made once per ignore command, and an ignore-all comment produces none, so no rows were removed.Bumps to 2.7.0 rather than a patch, since the disable flags change behavior.
Testing
tests/unit/test_pr_comment_rendering.pycovers both rendering artifacts, the ignore round trips, and the collapsed body.tests/unit/test_socketcli.pycovers the comment write decision, which previously had no harness./markdownAPI to confirm the tags are gone; 423 unit and 87 core tests pass.Fixes CE-381
Fixes CE-427