Skip to content

feat: implement issue #351 — SonarCloud: shell script hygiene cleanup (×7) - #352

Merged
don-petry merged 3 commits into
mainfrom
dev-lead/issue-351-20260703-2128
Jul 15, 2026
Merged

don-petry merged 3 commits into
mainfrom
dev-lead/issue-351-20260703-2128

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

Closes #351

Implemented by dev-lead agent. Please review.

Copilot AI review requested due to automatic review settings July 3, 2026 21:32
@don-petry
don-petry requested a review from a team as a code owner July 3, 2026 21:32
@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.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 87118928-ad49-4d8b-b3b1-e3b6fc2f75a6

📥 Commits

Reviewing files that changed from the base of the PR and between 6adbf9b and 7b9da4b.

📒 Files selected for processing (3)
  • tools/test-ci-secret-scan.sh
  • tools/test-repo-settings.sh
  • tools/validate-skills.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-351-20260703-2128

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.

@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 refactors several CI and validation shell scripts by introducing a central DONE_MARK constant, localizing variables in the error function, and redirecting warning outputs to standard error. The review feedback correctly identifies a large block of duplicate checks in tools/test-repo-settings.sh that should be removed to clean up the script.

Comment thread tools/test-repo-settings.sh Outdated

Copilot AI 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.

Pull request overview

This PR addresses issue #351 by applying mechanical shell-script hygiene cleanups (per SonarCloud findings) in the repo’s validation/verification scripts, without changing their intended behavior.

Changes:

  • Replaced repeated echo " done." literals with a per-script constant (readonly DONE_MARK=" done.").
  • Updated error() helpers to assign positional parameters to local variables before use.
  • Redirected a “python3/PyYAML unavailable — skipping …” message to stderr in tools/test-repo-settings.sh.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tools/validate-skills.sh Introduces DONE_MARK constant and refactors error() to use a local variable before emitting to stderr.
tools/test-repo-settings.sh Introduces DONE_MARK, refactors error() to use a local variable, and redirects the “PyYAML unavailable” diagnostic to stderr.
tools/test-ci-secret-scan.sh Introduces DONE_MARK and refactors error() to use a local variable before emitting to stderr.

@donpetry-bot

donpetry-bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor
Superseded by automated re-review at 7b9da4b7128652c906c66d2710ffbc797fddec30 — click to expand prior review.

Review — fix requested (cycle 1/3)

The automated review identified the following issues. Please address each one:

Findings to fix

Automated review — NEEDS HUMAN REVIEW

Risk: LOW
Reviewed commit: ca005bf68e765f07b5574caa22ba5a48393c7b8d
Cascade: triage → deep (triage: haiku 4.5 → deep: opus 4.8 + duck: o4-mini → audit: fable 5)

Summary

PR applies purely mechanical, behavior-preserving shell hygiene in three test/validation scripts (DONE_MARK constant, local var in error(), one stderr redirect). All gates are green: CI Validate, CodeQL, SonarCloud quality gate (0 new issues, 0 duplication on new code), gitleaks, AgentShield, and dependency-audit all SUCCESS. Downstream impact is (none). The run_secret_scanning MCP tool is not exposed in this environment; gitleaks CI is green, so no secret risk. I confirmed Gemini's high-priority finding is accurate — test-repo-settings.sh lines 181-253 are a duplicate of Checks 5/7/8 with scrambled numbering — but this duplication is PRE-EXISTING and not introduced by this PR (the diff only swaps the done marker on those lines). It is a maintainability nit with no security or correctness dimension, so I do not escalate to the Tier 3 security auditor; I decline to auto-approve while the substantive reviewer thread is unresolved and recommend removing the dup block (here or as a scoped follow-up to #351).

Findings

  • MAJOR: Duplicate block: lines 181-253 re-run checks already performed earlier — 'Check 4' (181-190) duplicates 'Check 5' (70-79, CodeQL default setup); 'Check 3' (194-201) duplicates 'Check 7' (93-100, secret_scanning_non_provider_patterns); 'Check 6' (203-253) duplicates 'Check 8' (102-152, permissions-scope validation). The scrambled check numbers confirm a stale copy-paste. Pre-existing (NOT introduced by this PR, which only swaps the done marker on these lines). Confusing output and redundant execution; remove the block. Recommend a scoped follow-up rather than blocking this mechanical PR.
  • INFO: Actual PR changes are correct and behavior-preserving: readonly DONE_MARK constant, error() now assigns 'local msg="$1"' before use, and the PyYAML-unavailable diagnostic is redirected to stderr. No auth/secret/crypto logic touched; SonarCloud reports 0 new issues and 0 duplication on new code.

Reviewed by the PR-review cascade (triage: haiku 4.5 → deep: opus 4.8 + duck: o4-mini → audit: fable 5). Reply if you need a human review.

Additional tasks

  1. Resolve all unresolved review thread comments from other reviewers
  2. Ensure all CI checks pass after your changes
  3. Rebase on the target branch if behind
  4. Do NOT modify files unrelated to the findings above

The review cascade will automatically re-review after new commits are pushed.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) July 15, 2026 00:17
@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry disabled auto-merge July 15, 2026 00:18
@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-07-15T00:49:15Z

@don-petry
don-petry enabled auto-merge (squash) July 15, 2026 00:19
@don-petry
don-petry disabled auto-merge July 15, 2026 03:36
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #352
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-07-15T04:07:14Z

@don-petry
don-petry enabled auto-merge (squash) July 15, 2026 03:37

@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: 7b9da4b7128652c906c66d2710ffbc797fddec30
Review mode: triage-approved (single reviewer)

Summary

Triage-approved confirmation review (cycle 1/3). This PR implements issue #351 (SonarCloud shell hygiene ×7) across three test/validation scripts: readonly DONE_MARK constant replacing repeated ' done.' literals (S1192), error() assigning its positional parameter to a local variable (S7679), and the PyYAML-unavailable diagnostic redirected to stderr (S7677). All changes are mechanical and behavior-preserving. Since the prior cascade review (ca005bf), the head now also removes the stale duplicate check block in tools/test-repo-settings.sh (former lines 181-253 duplicating Checks 5/7/8) — the prior review's only MAJOR finding — and the associated Gemini review thread is resolved/outdated. CodeRabbit approved the current head; Copilot reviewed with no comments. All substantive CI checks are green (CI Validate, gitleaks, CodeQL, SonarCloud quality gate: 0 new issues, AgentShield, dependency-audit). The run_secret_scanning MCP tool is not exposed in this environment; gitleaks CI is green and the diff adds no secret-like content.

Linked issue analysis

Closes #351 (SonarCloud: shell script hygiene cleanup ×7). All three rule groups are substantively addressed in the affected files: S7679 local-variable assignment in error() in all three scripts; S1192 DONE_MARK constant in all three scripts; S7677 stderr redirect for the PyYAML-unavailable message in tools/test-repo-settings.sh. SonarCloud quality gate passed with 0 new issues and 0 duplication on new code, consistent with the issue's acceptance criteria (real fixes, no NOSONAR suppressions, behavior unchanged, CI green).

Findings

  • RESOLVED: Prior review's MAJOR finding (duplicate check block at tools/test-repo-settings.sh lines 181-253 re-running Checks 5/7/8 with scrambled numbering) is fixed — the block is removed in the current head, and the Gemini review thread on it is resolved and outdated.
  • INFO: Two CANCELLED entries in the status rollup (dev-lead / dispatch and dev-lead / ci-relay on run 29378624508) are Dev-Lead Agent orchestration jobs superseded by concurrency — a later dev-lead / dispatch run succeeded, and ci-relay was intentionally skipped via [skip ci-relay] in the head commit. These are not code-validation checks and do not gate approval.
  • INFO: run_secret_scanning MCP tool unavailable in this environment; gitleaks CI check is green, so no secret-scanning gap.

CI status

All code-validation checks green at 7b9da4b: CI / Validate SUCCESS, CI / Secret scan (gitleaks) SUCCESS, CodeQL (actions) SUCCESS, SonarCloud quality gate PASSED (0 new issues, 0 security hotspots, 0 duplication on new code), AgentShield SUCCESS, dependency-audit SUCCESS (ecosystem jobs skipped where not applicable), pr-auto-review SUCCESS, CodeRabbit status SUCCESS. Two cancelled Dev-Lead Agent orchestration jobs are concurrency-superseded duplicates, not test failures. mergeable=MERGEABLE; mergeStateStatus=BLOCKED pending this review approval.


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

@don-petry
don-petry merged commit 9006a15 into main Jul 15, 2026
22 of 24 checks passed
@don-petry
don-petry deleted the dev-lead/issue-351-20260703-2128 branch July 15, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SonarCloud: shell script hygiene cleanup (×7)

3 participants