fix(ci): reduce public content false positives - #1582
Conversation
|
Public Content Screenshot seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
📝 WalkthroughWalkthroughThe public content scanner now recognizes more benign placeholder and fixture token patterns, adds new filters for certain code-like credential expressions and schema-like JWT matches, and extends tests to cover the new acceptance and detection cases. ChangesPublic content scanner updates
Sequence Diagram(s)Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/qualitygate/publiccontent/scan.go`:
- Around line 394-396: The schema dotted-identifier exemption in
isSchemaDottedIdentifier is too broad because it only checks for “schema ” and
an underscore, which can incorrectly suppress real secrets. Tighten the logic in
isSchemaDottedIdentifier so it only skips matches that are truly dotted schema
identifiers, and make scanText continue flagging JWT-like tokens on
schema-related lines when they are not identifiers. Add a regression test around
isSchemaDottedIdentifier/scanText that includes a real JWT on a schema line to
confirm it is still detected.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 972979e4-b0a8-462c-8483-842d999578aa
📒 Files selected for processing (3)
internal/qualitygate/publiccontent/rules.gointernal/qualitygate/publiccontent/scan.gointernal/qualitygate/publiccontent/scan_test.go
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1582 +/- ##
==========================================
+ Coverage 74.72% 74.74% +0.02%
==========================================
Files 799 799
Lines 80274 80380 +106
==========================================
+ Hits 59983 60084 +101
- Misses 15846 15849 +3
- Partials 4445 4447 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@9cacaa83e6aceeb025cb9902e84ac52705f2aaeb🧩 Skill updatenpx skills add larksuite/cli#fix/public-content-placeholder-fps -y -g |
Summary
Reduce false positives in the public-content quality gate for documented placeholders, idempotency tokens, and benign source-code expressions. This keeps real credential-shaped values rejected while allowing common public examples used by skills and tests.
Changes
client_tokenvalues, and token-like resource placeholders.lark-cli schema ...dotted identifiers as JWT-like tokens.Test Plan
go test ./internal/qualitygate/publiccontent -count=1go test ./internal/qualitygate/... -count=1QUALITY_GATE_CHANGED_FROM=upstream/main make quality-gateRelated Issues
Summary by CodeRabbit
Bug Fixes
Tests