Add comment-hygiene violations as a comment on the pull request - #1076
Open
jasonleenaylor wants to merge 4 commits into
Open
Add comment-hygiene violations as a comment on the pull request#1076jasonleenaylor wants to merge 4 commits into
jasonleenaylor wants to merge 4 commits into
Conversation
A new CommentHygiene.yml job scans the lines a pull request adds and posts one sticky comment listing them, updated in place on each push and replaced with a clean note once they are fixed. Nothing in it can fail a check. comment-hygiene.ps1 gains -ReportPath to write the scan result as JSON, and Build-CommentHygieneComment.ps1 renders that into the comment body. - CI.yml presets FW_COMMENT_HYGIENE_REPORTED so the new workflow is the only place that annotates, which moves the fetch-depth: 0 requirement out of the build job, and runs the composer smoke test under both engines. - comment-hygiene.ps1 falls back to origin/main when origin/HEAD is unset: git rev-parse wrote to stderr, which 5.1 turns into a terminating error, so the documented fallback was unreachable. - Wording says check rather than gate, and the agent requirement lives in AGENTS.md alone rather than repeated in help text that does not enforce it. - powershell-compat.ps1 walks Build/Agent instead of naming six files, so a new script is covered when it lands. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
NUnit Tests 1 files 1 suites 11m 7s ⏱️ Results for commit 3abeba9. ♻️ This comment has been updated with latest results. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1076 +/- ##
=========================================
+ Coverage 0 38.07% +38.07%
=========================================
Files 0 1499 +1499
Lines 0 350154 +350154
Branches 0 40241 +40241
=========================================
+ Hits 0 133315 +133315
- Misses 0 187559 +187559
- Partials 0 29280 +29280 🚀 New features to boost your workflow:
|
Four deliberate violations in one throwaway script, so the advisory comment on this pull request has something to show. Reverted once the comment has been reviewed. The subject is kept short on purpose: gitlint caps a title at 72 characters, and the revert of this commit inherits it inside Revert "...". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment hygiene (advisory)No comment-style violations in the lines this branch adds since |
This reverts commit 67bd09a. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
jasonleenaylor
marked this pull request as ready for review
August 18, 2026 15:58
jasonleenaylor
enabled auto-merge (squash)
August 18, 2026 15:59
jasonleenaylor
disabled auto-merge
August 18, 2026 16:07
comment-hygiene.ps1 no longer auto-runs from build.ps1 and test.ps1 in CI, so CommentHygiene.yml is the only thing that scans and annotates. With nothing running the scan twice, FW_COMMENT_HYGIENE_REPORTED and its GITHUB_ENV write go with it. build.ps1 and test.ps1 invoke the scan only for -CommentHygiene, and the installer workflows stop scanning on push. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Quick Summary
Comment-hygiene violations now appear in the pull request conversation, not only as
inline annotations on Files changed and in the Actions log. Follow-up to #1061.
A probe commit produced this comment, then was reverted.
CommentHygiene.ymlscans the lines a pull request adds and posts one stickycomment, updated in place on each push and replaced with a clean note once the
violations are fixed. It cannot fail a check.
comment-hygiene.ps1gains-ReportPath, writing the scan result as JSON;Build-CommentHygieneComment.ps1renders that into the comment body.build.ps1andtest.ps1invoke it only for-CommentHygiene, makingCommentHygiene.ymlthe only place that scans andannotates. That retires
FW_COMMENT_HYGIENE_REPORTEDand itsGITHUB_ENVwrite, andmoves the
fetch-depth: 0requirement to the job that diffs. Push builds, includingthe installer workflows, no longer scan.
comment-hygiene.ps1falls back toorigin/mainwhenorigin/HEADis unset.git rev-parsewrote to stderr, which Windows PowerShell 5.1 turns into a terminatingerror under
ErrorActionPreference Stop, making the documented fallback unreachable.powershell-compat.ps1walksBuild/Agentinstead of naming six files.AGENTS.mdrather than repeated in help text that does not enforce it.CI-ready checklist
.github/commit-guidelines.md(subject <= 72 chars, no trailing punctuation; if body present, blank line then <= 80-char lines).build.ps1/test.ps1or MSBuild).Docs/workflows/ai-pr-workflow.mdand ranpr-preflightor the equivalent branch-readiness review before requesting review.Src/**folders touched, correspondingAGENTS.mdfiles are updated or explicitly confirmed still accurate. NoSrc/**changes.Notes for reviewers
A separate workflow, rather than steps in the build job, so the comment lands in about a
minute and still arrives when the build fails or is cancelled.
Report comment hygienetook 53s.
The comment body is passed to the sticky action as a file path, following
Build-RenderArtifactComment.ps1, so there is noGITHUB_ENVdelimiter to collide with(cf. #1073).
Verified on this pull request: Flex CI green on the shallow checkout with both Codecov
uploads passing, and the new smoke test passing under PowerShell 7 and Windows
PowerShell 5.1.
This change is