Skip to content

feat: implement issue #528 — SonarCloud: test assertion quality (S5906) - #548

Merged
don-petry merged 20 commits into
mainfrom
dev-lead/issue-528-20260818-2041
Oct 9, 2026
Merged

don-petry merged 20 commits into
mainfrom
dev-lead/issue-528-20260818-2041

Conversation

@don-petry

@don-petry don-petry commented Aug 18, 2026 •

Copy link
Copy Markdown
Collaborator

User description

Closes #528

Implemented by dev-lead agent. Please review.

Summary by CodeRabbit

  • Tests
    • Strengthened batch-processing benchmark checks to verify the number of results and confirm each result has the expected thread ID, classification status, and canonical label.

CodeAnt-AI Description

Clarify batch-processing benchmark assertions

What Changed

  • The scalability benchmark now explicitly verifies that the expected number of items was processed
  • The existing under-100ms performance requirement remains unchanged

Impact

✅ Clearer benchmark failures
✅ Preserved batch-processing coverage
✅ SonarCloud-compliant test assertions

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@don-petry
don-petry requested a review from a team as a code owner August 18, 2026 20:44
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@codeant-ai

codeant-ai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Incremental review completed f166e9a Sep 07, 2026 · 14:22 14:22
✅ Incremental review completed 9e5909f Sep 03, 2026 · 08:33 08:34
✅ Incremental review completed 23975b1 Sep 02, 2026 · 00:43 00:43
✅ Incremental review completed 60d3319 Sep 01, 2026 · 20:16 20:16
✅ Reviewed your PR 4256830 Aug 18, 2026 · 20:44 20:46

@codeant-ai

codeant-ai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: petry-projects/google-app-scripts/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 40db3153-123a-4c37-8fe4-09474ec782f7

📥 Commits

Reviewing files that changed from the base of the PR and between e7dab9f and 93b4d71.


📒 Files selected for processing (1)
  • src/gmail-ai-classifier/tests/performance-scalability.test.js

 __________________________________
< The only good bug is a dead bug. >
 ----------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 56985fed-1c23-47d1-9b0b-0f88cf7897bb


📥 Commits

Reviewing files that changed from the base of the PR and between 4bf0961 and 23975b1.


📒 Files selected for processing (1)
  • src/gmail-ai-classifier/tests/performance-scalability.test.js

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.



📝 Walkthrough

Walkthrough

Changes

Test assertion quality

Layer / File(s) Summary
Batch throughput assertion
src/gmail-ai-classifier/tests/performance-scalability.test.js
The test uses expect(processed).toHaveLength(BATCH_SIZE) instead of comparing processed.length directly.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: donpetry-bot


Merge Risk: ⚪ Minimal · up to 9e590

This localized test-only change improves assertion clarity without changing production behavior, and no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The change resolves the S5906 finding in the Gmail AI classifier test, but issue #528 lists four findings across two files. The three findings in calendar-to-sheets remain unaddressed, so the issue ac… Update the three assertions in src/calendar-to-sheets/tests/index.test.js, then verify that all four S5906 findings are resolved to zero and that CI remains green without behavior changes or blanket NOSONAR usage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the SonarCloud S5906 test assertion change and references the linked issue. It is related to the main change.
Out of Scope Changes check ✅ Passed The one-line assertion change is directly related to issue #528 and the stated SonarCloud test assertion objective. No unrelated code changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…

Full details: Linked Issues check

Explanation

The change resolves the S5906 finding in the Gmail AI classifier test, but issue #528 lists four findings across two files. The three findings in calendar-to-sheets remain unaddressed, so the issue acceptance criteria are not fully met.


Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.



  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR



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.

@codeant-ai codeant-ai Bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Aug 18, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates Jest test assertions across multiple test files to use more idiomatic matchers, replacing '.length' checks with 'toHaveLength()' and '.toBe(null)' with 'toBeNull()'. There are no review comments to address, and I have no additional feedback to provide.

@don-petry
don-petry enabled auto-merge (squash) August 18, 2026 20:46
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-08-18T21:46:47Z.

donpetry-bot
donpetry-bot previously approved these changes Aug 18, 2026

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: 425683015c84f8b433ddeba32e61c2613f8913cf
Review mode: triage-approved (single reviewer)

Summary

Test-only PR (2 files, +4/-4) that rewrites four Jest assertions to idiomatic matchers: three in src/calendar-to-sheets/tests/index.test.js (.length toBe(1) → toHaveLength(1); toBe(null) → toBeNull() ×2) and one in src/gmail-ai-classifier/tests/performance-scalability.test.js (.length toBe(BATCH_SIZE) → toHaveLength(BATCH_SIZE)). All replacements are semantically equivalent to the originals — no behavior change. Confirms the triage assessment: low-risk, mechanical, exactly scoped to the linked issue.

Linked issue analysis

Closes #528 (SonarCloud S5906 — test assertion quality). The issue lists exactly 4 findings: 3 in calendar-to-sheets tests, 1 in gmail-ai-classifier performance test. This PR fixes precisely those 4 assertions with real fixes (no NOSONAR suppressions). SonarCloud quality gate on this PR passed with 0 new issues, satisfying the acceptance criteria (findings resolved, no behavior change, CI green).

Findings

  • No security-relevant changes: no auth, secrets, dependencies, workflows, or executable logic touched.
  • Secret scan (MCP): run_secret_scanning tool not available in this run — noted, not blocking; gitleaks CI check passed (SUCCESS).
  • CodeAnt left one advisory inline suggestion about the benchmark only asserting result count — that weakness pre-exists this PR (the assertion was .length-based before and is semantically unchanged); out of scope here and non-blocking.
  • Advisory bots Codex, Qodo, and CodeRabbit were rate/billing-limited; Gemini Code Assist and CodeAnt did review (no blocking feedback). This sweep re-review supersedes the earlier rate-limited hold.
  • No unanswered human-reviewer questions; no human change requests.

CI status

All substantive checks green: build-and-test, Node.js Tests, coverage, Playwright UI Tests, CodeQL (actions/js-ts/python), SonarCloud (quality gate passed, 0 new issues), gitleaks secret scan, dependency audit, AgentShield — all SUCCESS. A few Dev-Lead Agent dispatch/ci-relay runs show CANCELLED, but these are superseded agent-orchestration runs (the final dev-lead dispatch at 20:46:14Z succeeded), not code checks.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved.

dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention.

To resolve manually instead:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

@don-petry
don-petry disabled auto-merge September 1, 2026 20:13
@don-petry
don-petry force-pushed the dev-lead/issue-528-20260818-2041 branch from 4256830 to 60d3319 Compare September 1, 2026 20:16
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-04T20:14:49Z.

@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-04T20:20:14Z.

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: ac7e3f2261a91539159521d3749a8cd031868806
Review mode: triage-approved (single reviewer)

Summary

Test-only, one-line change in src/gmail-ai-classifier/tests/performance-scalability.test.js: expect(processed.length).toBe(BATCH_SIZE) becomes expect(processed).toHaveLength(BATCH_SIZE), which is what SonarCloud rule S5906 recommends. The two assertions check the same thing, so behavior is unchanged, and Jest's failure message is now clearer. No production code changed. I agree with the triage tier's low-risk assessment.

Linked issue analysis

Closes #528 (SonarCloud S5906, 4 findings). This PR fixes the one finding in gmail-ai-classifier/tests/performance-scalability.test.js, and the fix matches SonarCloud's suggested replacement word for word. The other 3 findings, in src/calendar-to-sheets/tests/index.test.js, are no longer present on main: the only remaining .length assertion there is toBeGreaterThan, which S5906 does not flag. They were most likely fixed by #565. The issue is already closed; the audit closes it automatically once the finding count reaches zero. The acceptance criteria are met: the finding is resolved, behavior is unchanged, CI is green, and there is no NOSONAR.

Findings

  • No blocking findings.
  • Non-blocking: one unresolved advisory thread from codeant-ai suggests stronger per-item assertions in the benchmark, such as checking that each result maps to its input thread. That would be a test improvement beyond what #528 asks for (#528 requires a single-rule fix with no behavior change), so it is not needed for this PR. It could be filed as a follow-up.
  • Secret scan: the run_secret_scanning MCP tool is not available in this run. The gitleaks CI check passed, and the diff contains no secrets or credentials.

CI status

All checks pass: build-and-test, Node.js Tests, Playwright UI Tests, coverage, CodeQL (actions/js-ts/python), SonarCloud (Quality Gate passed), gitleaks, AgentShield, dependency-audit (npm), and autofix (finished successfully during this review). Checks that do not apply to this repo were skipped. The BLOCKED merge state is only waiting on a required approving review.


Reviewed automatically by the PR-review agent (single-reviewer mode: opus 5.5 [opus 4.8, opus 4.7]). Reply if you need a human review.

@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@don-petry

Copy link
Copy Markdown
Collaborator Author

The CodeAnt AI comment is a non-actionable operational status notice — a table showing completed review runs. No specific findings are reported, no files or line numbers are referenced, and no code changes are needed. All CI checks pass, and the PR is already approved.

@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — rate-limited (intent: fix-bot-comment)

PR: #548
The retry cron will re-attempt automatically after the rate limit resets, while the bot comment still lacks a disposition.

@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-05T13:42:17Z.

@donpetry-bot

Copy link
Copy Markdown
Contributor

Automated review paused — review engines are unavailable.

Every configured review engine (Claude → Copilot → Gemini) reported a usage/rate limit or was otherwise unavailable, so no review could be generated for this run. This is a single, deduplicated notice: the agent will re-review automatically on its next scheduled run once capacity recovers, and will not post repeat notices in the meantime.

@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — rate-limited (intent: fix-bot-comment)

PR: #548
The retry cron will re-attempt automatically after the rate limit resets, while the bot comment still lacks a disposition.

@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@don-petry

Copy link
Copy Markdown
Collaborator Author

The CodeRabbit code review generated no actionable comments, and all CI checks pass. The rate-limit notice indicates the free OSS review quota was exhausted, but the recent review found no code issues requiring fixes. The pre-merge warning about linked issues is an issue-tracking status check (three findings in calendar-to-sheets were already resolved by #565), not a code-quality finding.

@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@don-petry

Copy link
Copy Markdown
Collaborator Author

This comment is a promotional notice from CodeAnt with no specific code findings. All CI checks pass, and the PR has been approved. No code changes are needed.

@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed. Requested items addressed:

  • src/gmail-ai-classifier/tests/performance-scalability.test.js:124 — applied

@codeant-ai

codeant-ai Bot commented Oct 9, 2026

Copy link
Copy Markdown

CodeAnt PR Risk: Low Risk

  • The PR appears safe to merge; the benchmark now checks each result's thread ID, classification status, and expected label.

Assessed commit: 93b4d7198569

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

View guided diff | Turn on auto-fix | Re-trigger cubic

@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-09T18:12:42Z.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SonarCloud: test assertion quality (S5906)

2 participants