Repository navigation
feat: implement issue #638 — SonarCloud: JavaScript/TypeScript code quality - #639
Conversation
This comment has been minimized.
This comment has been minimized.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This comment has been minimized.
This comment has been minimized.
Dev-Lead — waiting on PR blockers (intent: review-changes)PR: #639 |
|
Note @don-petry I reviewed this PR and no code changes were needed, but I can't mark it done yet: required check |
|
QA Lead — test-risk advisoryRisk tier: LOW. MD5 → SHA-256 doesn't change behaviour because no hash is stored: on every run, both the existing file's hash and the new file's hash are recomputed with the same algorithm. Dedup is not used for anything security-sensitive. The updated hex values in What I'd shore up (highest leverage first):
Escalate? no. This PR is safe to merge. The Advisory only — I comment, I do not change code. Ground: BMAD Test Architecture |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-20T21:41:44Z. |
|
No description provided. |
|
No description provided. |
|
The Codex code review encountered a process failure and did not generate findings. This is not a code issue — all CI checks (Node.js Tests, SonarCloud, CodeQL, etc.) are passing. The review can be retried by commenting |
|
To use Codex here, create an environment for this repo. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
|
No description provided. |
|
CodeRabbit review complete with no actionable findings. The change correctly implements SHA-256 hashing to replace MD5, all tests pass, and pre-merge checks are clear. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
|
No description provided. |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: LOW
Reviewed commit: dfce684a59a1d28d42366da23e939428a2abe673
Review mode: triage-approved (single reviewer)
Summary
Changes the attachment-dedup fingerprint from MD5 to SHA-256 in src/gas-utils.js (Node crypto) and src/gmail-to-drive-by-labels/code.gs (Utilities.DigestAlgorithm.SHA_256). This clears SonarCloud rule javascript:S4790. The PR also updates the test mock, the test vectors, and the docs and comments. I agree with the triage verdict that this is low-risk. The hash is used only to compare two files' contents, not for security. No hash value is stored anywhere: both the existing file's hash and the new file's hash are recomputed on every run, so dedup behaves the same after the switch.
Linked issue analysis
Closes #638 (SonarCloud S4790, a weak hash algorithm in src/gas-utils.js). The fix replaces the algorithm instead of adding a NOSONAR suppression, which is what the issue's acceptance criteria ask for. The SonarCloud Quality Gate passed with 0 new issues. The issue is also set to close automatically once the audit counts zero findings, so Closes #638 is the right keyword.
Findings
No blocking findings.
- Test vectors checked: I recomputed the new expected values locally and they match the standard SHA-256 digests of
hello world,abcandtest. - No leftover MD5 users: I searched the PR head and nothing else uses
DigestAlgorithm.MD5ormd5, so takingMD5out of thetest-utils/setup.jsmock breaks no other test. The only remaining mention isgetMd5Checksum()in a proposal doc, which is unrelated. - Non-blocking, existed before this PR (raised by the QA-lead advisory): in
code.gs,getFileHashreturns the raw byte array fromcomputeDigest, and the caller compares two of these withexistingHash === newHash. Two separate arrays are never===, so the deployed duplicate-skip branch probably never fires. This PR does not cause the bug and does not make it worse; it should get its own follow-up issue. The same goes for thecomputeDigestmock, which ignores itsalgorithmargument. - Secret scan: the
run_secret_scanningMCP tool was not available in this run. The gitleaks check passed.
CI status
All checks are green: build-and-test, Node.js Tests, coverage, Playwright UI Tests, CodeQL (actions, javascript-typescript, python), SonarCloud and its Quality Gate, gitleaks, npm audit and AgentShield. The rest were skipped as not applicable. There are no unresolved review threads and no open questions from human reviewers. The Codex review failed to run (a process failure, already noted on the PR), and CodeRabbit reported nothing actionable.
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.
|
pr-review approved on PARTIAL advisory evidence: 2/5 required advisory bots reported before the gate's head-age-timeout fallback proceeded. Recorded for the miss-rate metric (#1596). |



Problem
SonarCloud: JavaScript/TypeScript code quality
From the issue: 1 open SonarCloud finding(s) in
combsmith/google-app-scripts, worst severity CRITICAL. Generated by the org SonarCloud Audit.Risk
Low — 8 file(s) changed; no CI- or runtime-critical paths touched.
Test plan
Tests added/updated:
src/gmail-to-drive-by-labels/tests/gas-utils.test.js. Verification:bash scripts/dev-lead-lint.sh(shellcheck --severity=warning) ran pre-commit; the bats suite runs in CI.Rollback
Revert this PR. No non-revertible side effects (no tags, migrations, or external state).
Monitoring
This PR's CI checks (Lint + bats) are the success/regression signal.
Closes #638
Summary by CodeRabbit
Enhancements
Documentation
Tests