Skip to content

feat(ci): add public content safeguards#1577

Merged
HanShaoshuai-k merged 1 commit into
mainfrom
feat/public-leak-detection-cli
Jun 25, 2026
Merged

feat(ci): add public content safeguards#1577
HanShaoshuai-k merged 1 commit into
mainfrom
feat/public-leak-detection-cli

Conversation

@HanShaoshuai-k

@HanShaoshuai-k HanShaoshuai-k commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add public-content safeguards to the CLI quality gate and CI workflow.

This change introduces deterministic scanning for public-content leakage across PR metadata, changed files, branch metadata, and published comments. Findings are wired into CI results, facts artifacts, PR summaries, and semantic review inputs with redaction applied before evidence is persisted or surfaced.

Changes

  • Add public-content collection and scanning for changed files, PR metadata, branch metadata, and comments.
  • Add deterministic CI gating and facts artifact output for public-content findings.
  • Add comment audit workflow for issue comments, PR reviews, and PR review comments.
  • Extend semantic review facts, scope, waiver, and publishing behavior for public-content findings.
  • Harden CI result handling and summary publishing around deterministic failures.
  • Add focused tests for scanning, redaction, CI workflow behavior, artifact verification, and PR diagnostics.

Validation

  • make quality-gate
  • make script-test
  • go test ./internal/qualitygate/...

Private sandbox E2E validation was also run for the new public-content boundaries, including credential variant rejection, benign token-field pass cases, and placeholder pass cases.

Summary by CodeRabbit

  • New Features
    • Added a dedicated CI “script test” stage and required it for E2E and final results gating.
    • Introduced public-content metadata support in the quality gate and added a new comment audit workflow.
    • Expanded public-content leakage handling in semantic review, including new evidence mapping and prompt/summary updates.
  • Bug Fixes
    • Improved CI publishing to skip cleanly when a pull request is no longer open.
    • Strengthened stale/ambiguity handling for PR binding to make review publishing more reliable.
  • Tests
    • Added extensive unit/integration coverage for public-content scanning, comment audits, and semantic-review/public-content evidence.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 392a371e-25aa-47f2-9fab-69074b18d9c7

📥 Commits

Reviewing files that changed from the base of the PR and between b5b71d9 and 50db467.

📒 Files selected for processing (47)
  • .github/workflows/ci.yml
  • .github/workflows/comment-audit.yml
  • .github/workflows/semantic-review.yml
  • Makefile
  • internal/qualitygate/cmd/comment-audit/main.go
  • internal/qualitygate/cmd/comment-audit/main_test.go
  • internal/qualitygate/cmd/quality-gate/main.go
  • internal/qualitygate/cmd/quality-gate/main_test.go
  • internal/qualitygate/cmd/semantic-review/main.go
  • internal/qualitygate/cmd/semantic-review/main_test.go
  • internal/qualitygate/config/semantic/policy.json
  • internal/qualitygate/facts/schema.go
  • internal/qualitygate/facts/schema_test.go
  • internal/qualitygate/publiccontent/collect.go
  • internal/qualitygate/publiccontent/collect_test.go
  • internal/qualitygate/publiccontent/comment_audit.go
  • internal/qualitygate/publiccontent/comment_audit_test.go
  • internal/qualitygate/publiccontent/metadata.go
  • internal/qualitygate/publiccontent/metadata_test.go
  • internal/qualitygate/publiccontent/rules.go
  • internal/qualitygate/publiccontent/scan.go
  • internal/qualitygate/publiccontent/scan_test.go
  • internal/qualitygate/publiccontent/types.go
  • internal/qualitygate/rules/dryrun.go
  • internal/qualitygate/rules/dryrun_test.go
  • internal/qualitygate/rules/run.go
  • internal/qualitygate/rules/run_test.go
  • internal/qualitygate/semantic/client.go
  • internal/qualitygate/semantic/gatekeeper.go
  • internal/qualitygate/semantic/gatekeeper_test.go
  • internal/qualitygate/semantic/prompt.go
  • internal/qualitygate/semantic/prompt_contract_test.go
  • internal/qualitygate/semantic/schema.go
  • internal/qualitygate/semantic/scope.go
  • internal/qualitygate/semantic/scope_test.go
  • internal/qualitygate/semantic/view.go
  • internal/qualitygate/semantic/view_test.go
  • internal/qualitygate/semantic/waiver.go
  • internal/qualitygate/semantic/waiver_test.go
  • scripts/ci-quality-summary-publish.js
  • scripts/ci-quality-summary-publish.test.js
  • scripts/ci-workflow.test.sh
  • scripts/semantic-review-publish.js
  • scripts/semantic-review-publish.test.js
  • scripts/semantic-review-verify-artifact.js
  • scripts/semantic-review-verify-artifact.test.js
  • scripts/semantic-review-workflow.test.sh
✅ Files skipped from review due to trivial changes (4)
  • .github/workflows/comment-audit.yml
  • internal/qualitygate/publiccontent/metadata_test.go
  • internal/qualitygate/publiccontent/types.go
  • internal/qualitygate/semantic/view_test.go
🚧 Files skipped from review as they are similar to previous changes (41)
  • internal/qualitygate/publiccontent/comment_audit_test.go
  • internal/qualitygate/semantic/schema.go
  • internal/qualitygate/publiccontent/comment_audit.go
  • internal/qualitygate/semantic/client.go
  • internal/qualitygate/semantic/prompt_contract_test.go
  • internal/qualitygate/config/semantic/policy.json
  • internal/qualitygate/semantic/scope_test.go
  • internal/qualitygate/publiccontent/metadata.go
  • internal/qualitygate/cmd/comment-audit/main_test.go
  • internal/qualitygate/semantic/scope.go
  • internal/qualitygate/cmd/quality-gate/main_test.go
  • internal/qualitygate/semantic/prompt.go
  • internal/qualitygate/cmd/comment-audit/main.go
  • internal/qualitygate/facts/schema_test.go
  • internal/qualitygate/semantic/waiver.go
  • Makefile
  • internal/qualitygate/semantic/gatekeeper_test.go
  • internal/qualitygate/cmd/quality-gate/main.go
  • internal/qualitygate/rules/run_test.go
  • scripts/ci-quality-summary-publish.js
  • .github/workflows/semantic-review.yml
  • internal/qualitygate/semantic/waiver_test.go
  • scripts/semantic-review-publish.test.js
  • scripts/ci-quality-summary-publish.test.js
  • internal/qualitygate/semantic/gatekeeper.go
  • scripts/semantic-review-workflow.test.sh
  • internal/qualitygate/facts/schema.go
  • internal/qualitygate/publiccontent/rules.go
  • scripts/semantic-review-verify-artifact.test.js
  • internal/qualitygate/cmd/semantic-review/main.go
  • internal/qualitygate/rules/dryrun_test.go
  • internal/qualitygate/rules/run.go
  • .github/workflows/ci.yml
  • scripts/semantic-review-verify-artifact.js
  • internal/qualitygate/cmd/semantic-review/main_test.go
  • internal/qualitygate/semantic/view.go
  • internal/qualitygate/rules/dryrun.go
  • internal/qualitygate/publiccontent/collect.go
  • internal/qualitygate/publiccontent/scan_test.go
  • internal/qualitygate/publiccontent/scan.go
  • internal/qualitygate/publiccontent/collect_test.go

📝 Walkthrough

Walkthrough

The PR adds public-content scanning and metadata handling, threads those findings into quality-gate and semantic review, adds comment-audit and workflow wiring, and expands dry-run placeholder synthesis and output formatting.

Changes

Public content quality gate and review flow

Layer / File(s) Summary
Data contracts and metadata
internal/qualitygate/facts/schema.go, internal/qualitygate/facts/schema_test.go, internal/qualitygate/publiccontent/types.go, internal/qualitygate/publiccontent/metadata.go, internal/qualitygate/publiccontent/metadata_test.go
Facts and public-content types gain the new public-content payload, and metadata JSON is loaded into Metadata.
Scanner, rules, and comment audit
internal/qualitygate/publiccontent/rules.go, internal/qualitygate/publiccontent/scan.go, internal/qualitygate/publiccontent/comment_audit.go, internal/qualitygate/publiccontent/scan_test.go, internal/qualitygate/publiccontent/comment_audit_test.go, internal/qualitygate/cmd/comment-audit/*, .github/workflows/comment-audit.yml
Public-content scans detect leaks in text and comment payloads, and the new comment-audit command/workflow reads GitHub event payloads and prints findings.
Changed-line collector
internal/qualitygate/publiccontent/collect.go, internal/qualitygate/publiccontent/collect_test.go
Collect scans changed lines, commit messages, branches, and metadata, and the tests cover filtering, sanitization, and deduplication.
Quality-gate ingestion and CI trigger
internal/qualitygate/rules/run.go, internal/qualitygate/rules/run_test.go, internal/qualitygate/cmd/quality-gate/*, Makefile, .github/workflows/ci.yml, scripts/ci-workflow.test.sh
Run collects public-content findings into diagnostics and facts, the quality-gate CLI accepts --public-content-metadata, and CI provisions script-test and passes metadata through the gate.
Semantic policy and evidence
internal/qualitygate/semantic/client.go, internal/qualitygate/semantic/gatekeeper.go, internal/qualitygate/semantic/gatekeeper_test.go, internal/qualitygate/semantic/schema.go, internal/qualitygate/semantic/scope.go, internal/qualitygate/semantic/scope_test.go, internal/qualitygate/semantic/waiver.go, internal/qualitygate/semantic/waiver_test.go, internal/qualitygate/config/semantic/policy.json
The semantic policy allows public_content_leakage, evidence parsing and reproducibility handle facts.public_content, and waivers and scope validation accept the new fact kind.
Semantic view and command
internal/qualitygate/semantic/view.go, internal/qualitygate/semantic/view_test.go, internal/qualitygate/semantic/prompt.go, internal/qualitygate/semantic/prompt_contract_test.go, internal/qualitygate/cmd/semantic-review/*
Semantic input views surface public-content findings, prompts include the new evidence rules, and the semantic-review command can short-circuit when no reviewable facts are present.
Workflow and publish guards
.github/workflows/semantic-review.yml, scripts/ci-quality-summary-publish.*, scripts/semantic-review-publish.*, scripts/semantic-review-verify-artifact.*, scripts/semantic-review-workflow.test.sh
PR-binding, artifact verification, and publish steps now skip closed or stale pull requests and recognize facts.public_content evidence.

Dry-run placeholder synthesis

Layer / File(s) Summary
Placeholder synthesis and JSON output
internal/qualitygate/rules/dryrun.go, internal/qualitygate/rules/dryrun_test.go
Dry-run placeholder generation adds numeric and URL-specific synthesis, expands token mappings, and forces --format pretty to JSON in dry-run arguments.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~90+ minutes

Possibly related PRs

  • larksuite/cli#1488: Both PRs modify the CI quality-gate and semantic-review workflow path in .github/workflows/ci.yml and .github/workflows/semantic-review.yml.
  • larksuite/cli#1505: Both PRs touch semantic review input/view construction in internal/qualitygate/semantic/view.go and related prompt logic.

Suggested labels

feature

Suggested reviewers

  • liangshuo-1
  • tuxedomm

Poem

I’m a rabbit in the review moonlight,
Sniffing public crumbs that hop in sight.
JSON carrots and dry-run beams align,
Stale PRs nap while the green lights shine.
🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.36% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding public content safeguards to CI.
Description check ✅ Passed The description is mostly complete, covering summary, changes, and validation, though it doesn't follow the template headings exactly.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/public-leak-detection-cli

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.44.0)
scripts/semantic-review-publish.test.js

[
{
"text": "new RegExp(lark-cli-semantic-finding:${findingKey(finding, facts)})",
"range": {
"byteOffset": {
"start": 45395,
"end": 45464
},
"start": {
"line": 1284,
"column": 49
},
"end": {
"line": 1284,
"column": 118
}
},
"file": "scripts/semantic-review-publish.test.js",
"lines": " assert.match(calls.reviewComments[0].body, new RegExp(lark-cli-semantic-finding:${findingKey(finding, facts)}));",
"charCount": {
"leading": 49,
"trailing": 2
},
"language": "JavaScript",
"metaVariables": {
"single": {
"ARG": {
"text": "lark-cli-semantic-finding:${findingKey(finding, facts)}",
"range": {
"byteOffset": {
"start": 45406,
"end": 45463
},
"start": {
"line": 1284,
"column": 60
},
"end": {
"line": 1284,
"column": 117
}
}
}
},

... [truncated 5517 characters] ...

a Restricted Directory ('Path Traversal'). [REFERENCES]\n - https://cwe.mitre.org/data/definitions/22.html",
"message": "Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.",
"labels": [
{
"text": "fs.writeFileSync(decisionPath, JSON.stringify({\n degraded: true,\n block_mode: false,\n blockers: [],\n warnings: [{ message: "review unavailable" }],\n }), "utf8")",
"range": {
"byteOffset": {
"start": 15666,
"end": 15849
},
"start": {
"line": 452,
"column": 4
},
"end": {
"line": 457,
"column": 15
}
},
"style": "primary"
}
]
}
]


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the size/XL Architecture-level or global-impact change label Jun 25, 2026
liangshuo-1
liangshuo-1 previously approved these changes Jun 25, 2026
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@50db4677bed841c7361d159899a40105e72eedfd

🧩 Skill update

npx skills add larksuite/cli#feat/public-leak-detection-cli -y -g

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (4)
internal/qualitygate/rules/dryrun_test.go (1)

308-337: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

FlagDefault (DefValue) consumption is not actually exercised.

defaultPositiveInteger(ctx.FlagDefault, "20") returns the same value whether or not FlagDefault is read here, because the page-size DefValue ("20") equals the hardcoded fallback. The other numeric tests use the params flag (empty default → fallback "1893456000"), so no test proves that a manifest DefValue is preferred over the fallback. Consider setting DefValue to a value distinct from the fallback (e.g. "50") and asserting it propagates, so the new FlagDefault path has real coverage.

💚 Example tweak to assert the DefValue path
-			{Name: "page-size", TakesValue: true, Usage: "page size, 20-100 (default 20)", DefValue: "20"},
+			{Name: "page-size", TakesValue: true, Usage: "page size, 20-100 (default 50)", DefValue: "50"},
-	cliBin, argsPath := fakeDryRunCLI(t, `{"api":[{"method":"GET","url":"/open-apis/vc/v1/bots/events","params":{"meeting_id":"400000000001","page_size":20}}]}`)
+	cliBin, argsPath := fakeDryRunCLI(t, `{"api":[{"method":"GET","url":"/open-apis/vc/v1/bots/events","params":{"meeting_id":"400000000001","page_size":50}}]}`)
-	wantArgs := []string{"vc", "+meeting-events", "--meeting-id", "400000000001", "--page-size", "20", "--dry-run"}
+	wantArgs := []string{"vc", "+meeting-events", "--meeting-id", "400000000001", "--page-size", "50", "--dry-run"}

As per coding guidelines: "Every behavior change needs a test alongside the change."

Source: Coding guidelines

.github/workflows/ci.yml (1)

95-100: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Set persist-credentials: false on the script-test checkout.

make script-test doesn't perform authenticated git operations, so the persisted token (with fetch-depth: 0) is unnecessary surface flagged by zizmor artipacked.

🔒 Proposed change
       - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
         with:
           fetch-depth: 0
+          persist-credentials: false
🤖 Prompt for 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.

In @.github/workflows/ci.yml around lines 95 - 100, The script-test checkout is
persisting Git credentials unnecessarily. Update the actions/checkout step used
before make script-test to set persist-credentials to false, while keeping the
existing fetch-depth behavior, so the workflow no longer carries an unused token
surface.

Source: Linters/SAST tools

.github/workflows/comment-audit.yml (1)

18-21: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Set persist-credentials: false on checkout.

This audit job never performs authenticated git operations, so the persisted GITHUB_TOKEN in the runner git config is unnecessary attack surface (zizmor artipacked). Disable credential persistence.

🔒 Proposed change
       - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
+        with:
+          persist-credentials: false
       - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
🤖 Prompt for 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.

In @.github/workflows/comment-audit.yml around lines 18 - 21, The checkout step
in the workflow should stop persisting the default GitHub token because this
audit job does not need authenticated git access. Update the actions/checkout
usage in the workflow to set persist-credentials to false while leaving the rest
of the job intact, so the runner does not keep unnecessary credentials in its
git config.

Source: Linters/SAST tools

internal/qualitygate/publiccontent/collect.go (1)

333-341: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

CombinedOutput mixes stderr into parsed git output.

Every git call here (including diff/log/show whose stdout is line-parsed for hunks and credential text) uses CombinedOutput, so git diagnostics written to stderr (e.g. warning: LF will be replaced by CRLF, advice hints) get interleaved into the data being scanned. This can break hunk/line parsing or surface spurious scanned text. Prefer capturing stdout via cmd.Output() and keep stderr only for the error message.

♻️ Proposed change
 func gitOutput(ctx context.Context, repo string, args ...string) ([]byte, error) {
 	cmd := exec.CommandContext(ctx, "git", args...)
 	cmd.Dir = repo
-	out, err := cmd.CombinedOutput()
-	if err != nil {
-		return nil, fmt.Errorf("git %s: %w\n%s", strings.Join(args, " "), err, out)
-	}
-	return out, nil
+	var stdout, stderr bytes.Buffer
+	cmd.Stdout = &stdout
+	cmd.Stderr = &stderr
+	if err := cmd.Run(); err != nil {
+		return nil, fmt.Errorf("git %s: %w\n%s", strings.Join(args, " "), err, stderr.Bytes())
+	}
+	return stdout.Bytes(), nil
 }
🤖 Prompt for 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.

In `@internal/qualitygate/publiccontent/collect.go` around lines 333 - 341, The
gitOutput helper currently uses CombinedOutput, which mixes stderr into the
returned git data and can corrupt parsers that consume stdout from git
diff/log/show. Update gitOutput to capture stdout only from exec.CommandContext
via cmd.Output() while still preserving stderr in the returned error path, and
keep the existing context/repo/args handling and formatting in gitOutput.
🤖 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/cmd/comment-audit/main_test.go`:
- Around line 44-48: The unsafe-path validation in commentBody is returning a
generic fmt.Errorf-style wrapper and uses the wrong CLI flag in its error text,
so update commentBody to return the appropriate typed errs.* validation error
with --file metadata and adjust the test in main_test to assert it via
errs.ProblemOf instead of matching an error string substring. Make sure the flag
name in both the production path validation and the test expectation is
consistent, and keep the existing commentBody symbol as the place to fix the
validation/error construction.

In `@internal/qualitygate/publiccontent/collect_test.go`:
- Around line 653-658: The slice literal in the test setup uses inconsistent
indentation, so gofmt will reformat it and cause the pre-PR check to fail.
Update the indentation of the excluded []string literal in collect_test.go to
match gofmt’s standard spacing, keeping the list entries and closing brace
aligned as gofmt would in the test block.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 95-100: The script-test checkout is persisting Git credentials
unnecessarily. Update the actions/checkout step used before make script-test to
set persist-credentials to false, while keeping the existing fetch-depth
behavior, so the workflow no longer carries an unused token surface.

In @.github/workflows/comment-audit.yml:
- Around line 18-21: The checkout step in the workflow should stop persisting
the default GitHub token because this audit job does not need authenticated git
access. Update the actions/checkout usage in the workflow to set
persist-credentials to false while leaving the rest of the job intact, so the
runner does not keep unnecessary credentials in its git config.

In `@internal/qualitygate/publiccontent/collect.go`:
- Around line 333-341: The gitOutput helper currently uses CombinedOutput, which
mixes stderr into the returned git data and can corrupt parsers that consume
stdout from git diff/log/show. Update gitOutput to capture stdout only from
exec.CommandContext via cmd.Output() while still preserving stderr in the
returned error path, and keep the existing context/repo/args handling and
formatting in gitOutput.
🪄 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: 19783f07-946a-486c-9ea7-757464a2d3e5

📥 Commits

Reviewing files that changed from the base of the PR and between af9835c and 5ba6b26.

📒 Files selected for processing (47)
  • .github/workflows/ci.yml
  • .github/workflows/comment-audit.yml
  • .github/workflows/semantic-review.yml
  • Makefile
  • internal/qualitygate/cmd/comment-audit/main.go
  • internal/qualitygate/cmd/comment-audit/main_test.go
  • internal/qualitygate/cmd/quality-gate/main.go
  • internal/qualitygate/cmd/quality-gate/main_test.go
  • internal/qualitygate/cmd/semantic-review/main.go
  • internal/qualitygate/cmd/semantic-review/main_test.go
  • internal/qualitygate/config/semantic/policy.json
  • internal/qualitygate/facts/schema.go
  • internal/qualitygate/facts/schema_test.go
  • internal/qualitygate/publiccontent/collect.go
  • internal/qualitygate/publiccontent/collect_test.go
  • internal/qualitygate/publiccontent/comment_audit.go
  • internal/qualitygate/publiccontent/comment_audit_test.go
  • internal/qualitygate/publiccontent/metadata.go
  • internal/qualitygate/publiccontent/metadata_test.go
  • internal/qualitygate/publiccontent/rules.go
  • internal/qualitygate/publiccontent/scan.go
  • internal/qualitygate/publiccontent/scan_test.go
  • internal/qualitygate/publiccontent/types.go
  • internal/qualitygate/rules/dryrun.go
  • internal/qualitygate/rules/dryrun_test.go
  • internal/qualitygate/rules/run.go
  • internal/qualitygate/rules/run_test.go
  • internal/qualitygate/semantic/client.go
  • internal/qualitygate/semantic/gatekeeper.go
  • internal/qualitygate/semantic/gatekeeper_test.go
  • internal/qualitygate/semantic/prompt.go
  • internal/qualitygate/semantic/prompt_contract_test.go
  • internal/qualitygate/semantic/schema.go
  • internal/qualitygate/semantic/scope.go
  • internal/qualitygate/semantic/scope_test.go
  • internal/qualitygate/semantic/view.go
  • internal/qualitygate/semantic/view_test.go
  • internal/qualitygate/semantic/waiver.go
  • internal/qualitygate/semantic/waiver_test.go
  • scripts/ci-quality-summary-publish.js
  • scripts/ci-quality-summary-publish.test.js
  • scripts/ci-workflow.test.sh
  • scripts/semantic-review-publish.js
  • scripts/semantic-review-publish.test.js
  • scripts/semantic-review-verify-artifact.js
  • scripts/semantic-review-verify-artifact.test.js
  • scripts/semantic-review-workflow.test.sh

Comment thread internal/qualitygate/cmd/comment-audit/main_test.go
Comment thread internal/qualitygate/publiccontent/collect_test.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 @.github/workflows/ci.yml:
- Around line 96-99: Disable credential persistence for the script-test checkout
by updating the actions/checkout step in the CI workflow to include
persist-credentials: false, matching the hardened setup already used in lint;
locate the affected checkout step in the script-test job and add the setting
alongside fetch-depth to prevent credentials from being retained for later
steps.
🪄 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: 93d8266b-c71b-4c8f-aa16-b4dd3479bcb3

📥 Commits

Reviewing files that changed from the base of the PR and between 5ba6b26 and b5b71d9.

📒 Files selected for processing (47)
  • .github/workflows/ci.yml
  • .github/workflows/comment-audit.yml
  • .github/workflows/semantic-review.yml
  • Makefile
  • internal/qualitygate/cmd/comment-audit/main.go
  • internal/qualitygate/cmd/comment-audit/main_test.go
  • internal/qualitygate/cmd/quality-gate/main.go
  • internal/qualitygate/cmd/quality-gate/main_test.go
  • internal/qualitygate/cmd/semantic-review/main.go
  • internal/qualitygate/cmd/semantic-review/main_test.go
  • internal/qualitygate/config/semantic/policy.json
  • internal/qualitygate/facts/schema.go
  • internal/qualitygate/facts/schema_test.go
  • internal/qualitygate/publiccontent/collect.go
  • internal/qualitygate/publiccontent/collect_test.go
  • internal/qualitygate/publiccontent/comment_audit.go
  • internal/qualitygate/publiccontent/comment_audit_test.go
  • internal/qualitygate/publiccontent/metadata.go
  • internal/qualitygate/publiccontent/metadata_test.go
  • internal/qualitygate/publiccontent/rules.go
  • internal/qualitygate/publiccontent/scan.go
  • internal/qualitygate/publiccontent/scan_test.go
  • internal/qualitygate/publiccontent/types.go
  • internal/qualitygate/rules/dryrun.go
  • internal/qualitygate/rules/dryrun_test.go
  • internal/qualitygate/rules/run.go
  • internal/qualitygate/rules/run_test.go
  • internal/qualitygate/semantic/client.go
  • internal/qualitygate/semantic/gatekeeper.go
  • internal/qualitygate/semantic/gatekeeper_test.go
  • internal/qualitygate/semantic/prompt.go
  • internal/qualitygate/semantic/prompt_contract_test.go
  • internal/qualitygate/semantic/schema.go
  • internal/qualitygate/semantic/scope.go
  • internal/qualitygate/semantic/scope_test.go
  • internal/qualitygate/semantic/view.go
  • internal/qualitygate/semantic/view_test.go
  • internal/qualitygate/semantic/waiver.go
  • internal/qualitygate/semantic/waiver_test.go
  • scripts/ci-quality-summary-publish.js
  • scripts/ci-quality-summary-publish.test.js
  • scripts/ci-workflow.test.sh
  • scripts/semantic-review-publish.js
  • scripts/semantic-review-publish.test.js
  • scripts/semantic-review-verify-artifact.js
  • scripts/semantic-review-verify-artifact.test.js
  • scripts/semantic-review-workflow.test.sh
✅ Files skipped from review due to trivial changes (2)
  • internal/qualitygate/semantic/scope_test.go
  • internal/qualitygate/semantic/prompt_contract_test.go
🚧 Files skipped from review as they are similar to previous changes (40)
  • internal/qualitygate/publiccontent/comment_audit_test.go
  • internal/qualitygate/publiccontent/comment_audit.go
  • scripts/ci-quality-summary-publish.js
  • internal/qualitygate/semantic/waiver.go
  • internal/qualitygate/publiccontent/metadata_test.go
  • internal/qualitygate/semantic/schema.go
  • internal/qualitygate/semantic/client.go
  • internal/qualitygate/publiccontent/metadata.go
  • internal/qualitygate/facts/schema.go
  • internal/qualitygate/cmd/quality-gate/main.go
  • internal/qualitygate/semantic/scope.go
  • internal/qualitygate/semantic/prompt.go
  • internal/qualitygate/config/semantic/policy.json
  • internal/qualitygate/cmd/comment-audit/main_test.go
  • .github/workflows/comment-audit.yml
  • Makefile
  • internal/qualitygate/cmd/quality-gate/main_test.go
  • scripts/semantic-review-verify-artifact.test.js
  • internal/qualitygate/semantic/view_test.go
  • internal/qualitygate/semantic/gatekeeper.go
  • internal/qualitygate/facts/schema_test.go
  • internal/qualitygate/semantic/gatekeeper_test.go
  • scripts/ci-quality-summary-publish.test.js
  • internal/qualitygate/rules/run_test.go
  • internal/qualitygate/cmd/semantic-review/main_test.go
  • .github/workflows/semantic-review.yml
  • scripts/semantic-review-verify-artifact.js
  • internal/qualitygate/rules/run.go
  • scripts/semantic-review-publish.test.js
  • internal/qualitygate/cmd/comment-audit/main.go
  • scripts/semantic-review-workflow.test.sh
  • internal/qualitygate/publiccontent/rules.go
  • internal/qualitygate/rules/dryrun.go
  • internal/qualitygate/rules/dryrun_test.go
  • internal/qualitygate/cmd/semantic-review/main.go
  • internal/qualitygate/semantic/view.go
  • internal/qualitygate/publiccontent/collect.go
  • internal/qualitygate/publiccontent/scan.go
  • internal/qualitygate/publiccontent/collect_test.go
  • internal/qualitygate/publiccontent/scan_test.go

Comment thread .github/workflows/ci.yml
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.51634% with 214 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.72%. Comparing base (fe32a6e) to head (50db467).

Files with missing lines Patch % Lines
internal/qualitygate/publiccontent/collect.go 78.53% 28 Missing and 19 partials ⚠️
internal/qualitygate/publiccontent/scan.go 89.20% 26 Missing and 20 partials ⚠️
internal/qualitygate/cmd/comment-audit/main.go 26.53% 34 Missing and 2 partials ⚠️
internal/qualitygate/publiccontent/rules.go 87.75% 22 Missing and 8 partials ⚠️
internal/qualitygate/rules/dryrun.go 76.34% 19 Missing and 3 partials ⚠️
internal/qualitygate/cmd/semantic-review/main.go 52.63% 6 Missing and 3 partials ⚠️
internal/qualitygate/semantic/view.go 83.33% 9 Missing ⚠️
internal/qualitygate/publiccontent/metadata.go 73.91% 3 Missing and 3 partials ⚠️
internal/qualitygate/facts/schema.go 0.00% 3 Missing ⚠️
...nternal/qualitygate/publiccontent/comment_audit.go 50.00% 1 Missing and 1 partial ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1577      +/-   ##
==========================================
+ Coverage   74.59%   74.72%   +0.12%     
==========================================
  Files         793      799       +6     
  Lines       79085    80274    +1189     
==========================================
+ Hits        58997    59983     +986     
- Misses      15702    15846     +144     
- Partials     4386     4445      +59     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@HanShaoshuai-k HanShaoshuai-k force-pushed the feat/public-leak-detection-cli branch from b5b71d9 to 50db467 Compare June 25, 2026 10:43
@HanShaoshuai-k HanShaoshuai-k merged commit cf93ee0 into main Jun 25, 2026
38 checks passed
@HanShaoshuai-k HanShaoshuai-k deleted the feat/public-leak-detection-cli branch June 25, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Architecture-level or global-impact change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants