Repository navigation
Closed
Labels
dev-leadFor dev-lead agent pickupFor dev-lead agent pickuppriority:majorSonarCloud MAJOR severitySonarCloud MAJOR severitysonarcloud-auditSonarCloud audit finding (idempotent marker)SonarCloud audit finding (idempotent marker)
Description
SonarCloud: shell script hygiene
758 open SonarCloud finding(s) in combsmith/.github, worst severity MAJOR. Generated by the org SonarCloud Audit.
Findings
| Rule | Count | Representative message |
|---|---|---|
| shelldre:S7688 | 758 | Use '[[' instead of '[' for conditional tests. The '[[' construct is safer and more featur |
Affected files
scripts/lib/agent-rate-limit.sh(107)scripts/lib/canary-rollout.sh(71)scripts/compliance-remediate.sh(38)scripts/agent-rate-limit-gate.sh(36)scripts/lib/push-protection.sh(34)scripts/migrate-major-channels.sh(33)scripts/apply-repo-settings.sh(28).github/scripts/add-to-project/classify-initiative.sh(26)scripts/agents-md-cycle-log.sh(26)scripts/sonarcloud-audit.sh(24)scripts/automerge-standards-sync.sh(20)scripts/lib/gitignore-baseline.sh(20)scripts/standards-staleness.sh(20)scripts/lib/standards-release.sh(19).github/scripts/add-to-project/lib.sh(18).github/scripts/feature-ideation/lib/gh-safe.sh(15)scripts/compliance-retrigger.sh(15)scripts/fix-ruleset-bypass.sh(13).github/scripts/add-to-project/reconcile-backlog.sh(12).github/scripts/pr-auto-review/sweep-dispatch.sh(12)
Priority
Labeled priority:major — mapped from this bucket's worst SonarCloud severity (MAJOR).
Acceptance
- All findings in this workstream resolved to zero in SonarCloud
- No behavior change; CI green
- Real fixes (no blanket
NOSONARunless a confirmed false positive, noted inline)
Idempotent issue — updated automatically each audit run; auto-closed when the finding count reaches zero.
Metadata
Metadata
Assignees
Labels
dev-leadFor dev-lead agent pickupFor dev-lead agent pickuppriority:majorSonarCloud MAJOR severitySonarCloud MAJOR severitysonarcloud-auditSonarCloud audit finding (idempotent marker)SonarCloud audit finding (idempotent marker)
Activity
don-petry commentedon Sep 29, 2026
Dev-Lead Implementation Plan
Issue: #1193 — SonarCloud: shell script hygiene
Scope
Resolve
shelldreshell-script hygiene findings across first-party scripts (scripts/**,.github/scripts/**) as behavior-preserving refactors, and exclude vendored third-party code (node_modules/**) from SonarCloud analysis so its findings stop being reported. No behavior change; existing bats suites are the regression net.Approach & Priority (largest, safest wins first)
node_modules/bats/lib/bats-core/*.bashfiles (55 findings) plus theS7684(BATS_FORMATTER_TEST_DURATION) andS100(bats_export_preprocess_source_*) findings all originate in vendoredbats. Addsonar.exclusions=node_modules/**to the rootsonar-project.properties— third-party code must not be edited or audited as ours.[→[[(898 findings, dominant). Confirmed safe here: no binary-a/-o, no escaped\</\>, no unquoted-glob RHS in single brackets. Convert first-party test commands via a reviewed transformation, gated byshellcheck+ bats.S7677redirect errors to stderr (8),S1481unused locals (2),S1135TODO (2),S1066merge nestedif(5).S131default*)case (26),S7679positional-param → local (86),S7682explicitreturn(149, using barereturnto preserve exit status),S1192repeated-literal constants (28).Implementation Checklist
sonar-project.properties— addsonar.exclusions=node_modules/**[[conversion across all first-partyscripts/**+.github/scripts/**bash scriptsgit diffreview of every changed lineTests to Write
tests/andtest/scripts/**are the regression net and must stay green.Test Command
bats <affected .bats files>(vianode_modules/.bin/bats) +bash .dev-lead/scripts/dev-lead-lint.shdon-petry commentedon Sep 29, 2026
Dev-Lead: Progress (in progress — not yet durable)
Plan Execution (intended)
sonar.exclusions=node_modules/**to the rootsonar-project.properties. Thebatsrunner is apackage.jsondependency; its bundledbats-core/*.bashfiles are the source of the twonode_modules/**file entries plus theS7684(BATS_FORMATTER_TEST_DURATION) andS100(bats_export_preprocess_source_*) findings — third-party code we should not edit or audit as ours.[→[[(the dominant rule). Converted single-bracket test commands to[[ … ]]across every first-party bash script underscripts/**and.github/scripts/**, via a quote/heredoc/comment-aware scanner so brackets inside jq/awk programs, JSON, heredoc bodies, and comments are never touched. Existing[[ ]],${arr[i]}, globs, andcasepatterns are left alone.Approach to "no behavior change"
-n/-z/=/!=/-eq/-lt/… tests that behave identically in[and[[. Confirmed there are no binary-a/-o, escaped\</\>, or unquoted-glob RHS in single brackets, and existing[[ … =~ … ]]regex tests were left untouched (only their single-bracket siblings changed).Local check output (provisional — not the pushed run)
Files touched (this workspace, not yet pushed)
sonar-project.properties: addnode_modules/**exclusion.scripts/**and.github/scripts/**:[→[[test-command conversion only (no logic changes).Notes / deferred (transparent scope)
node_modulesfiles).S7682(explicit return),S7679(positional→local),S1192(repeated-literal constants),S131(default case),S1066(merge if),S1481(unused local),S1135(TODO),S7677(stderr). Rationale: these require per-location semantic judgment; theshelldreanalyzer is not available locally to pinpoint or confirm resolution, and blanket edits (e.g. addingreturn/locals to ~235 sites, or completing TODOs) carry behavior-change risk against the hard "no behavior change" criterion.shellcheckreports zero unused locals (S1481) in these files, and theTODOmatches are descriptive comments incompliance-audit.sh, not actionable tasks. Because this issue is idempotent, the residual will re-report for a focused follow-up.don-petry commentedon Sep 29, 2026
Dev-Lead: Implementation Complete — PR #1196
The implementation for issue #1193 is durable: commits are pushed and a pull request is open. This record is backed by verifiable artifacts you can confirm in one click.
cccefc9203e5c0253a3c841b7b935f343bc98a34main: 53 file(s), +1206/-1198 linesReview happens on the PR. Acceptance criteria and test results are evidenced by the PR's diff and CI checks — not asserted here. If a later stage fails, this claim is retracted in place.
feat: implement issue #1193 — SonarCloud: shell script hygiene
don-petry commentedon Oct 6, 2026
SonarCloud Audit (2026-10-06): still open — 1260 finding(s), worst severity
CRITICAL.feat: implement issue #1193 — SonarCloud: shell script hygiene
feat: implement issue #1193 — SonarCloud: shell script hygiene
don-petry commentedon Oct 13, 2026
SonarCloud Audit (2026-10-13): still open — 1296 finding(s), worst severity
CRITICAL.fix(bootstrap): revert unrelated argument-validation behavior change
don-petry commentedon Oct 20, 2026
SonarCloud Audit (2026-10-20): still open — 964 finding(s), worst severity
MAJOR.4 remaining items
feat: implement issue #1193 — SonarCloud: shell script hygiene
fix(bootstrap): revert unrelated argument-validation behavior change
don-petry commentedon Oct 27, 2026
SonarCloud Audit (2026-10-27): still open — 758 finding(s), worst severity
MAJOR.feat: implement issue #1193 — SonarCloud: shell script hygiene
fix(bootstrap): revert unrelated argument-validation behavior change
feat: implement issue #1193 — SonarCloud: shell script hygiene
fix(bootstrap): revert unrelated argument-validation behavior change
feat: implement issue #1193 — SonarCloud: shell script hygiene
fix(bootstrap): revert unrelated argument-validation behavior change
feat: implement issue #1193 — SonarCloud: shell script hygiene
fix(bootstrap): revert unrelated argument-validation behavior change
don-petry commentedon Nov 3, 2026
Resolved! No open SonarCloud findings remain in this workstream as of 2026-11-03. Closing automatically.
feat: implement issue #1193 — SonarCloud: shell script hygiene
fix(bootstrap): revert unrelated argument-validation behavior change