Skip to content

feat: implement issue #462 — SonarCloud: shell script hygiene - #463

Merged
don-petry merged 1 commit into
mainfrom
dev-lead/issue-462-20260804-1855
Aug 4, 2026
Merged

don-petry merged 1 commit into
mainfrom
dev-lead/issue-462-20260804-1855

Conversation

@don-petry

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

Copy link
Copy Markdown
Contributor

User description

Closes #462

Implemented by dev-lead agent. Please review.


CodeAnt-AI Description

Make ruleset validation tests continue reliably after individual checks

What Changed

  • Ruleset checks now return a successful status after reporting pass or failure, allowing the test script to continue evaluating all configured rules

Impact

✅ Complete ruleset validation results
✅ Fewer shell test interruptions

💡 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.

Summary by CodeRabbit

  • Bug Fixes
    • Improved ruleset validation checks to correctly report successful outcomes when assertions pass.

@don-petry
don-petry requested a review from a team as a code owner August 4, 2026 18:56
@codeant-ai

codeant-ai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 3c816dd Aug 04, 2026 · 18:57 18:58

@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.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Your Qodo trial ends soon. Ask your workspace admin to set up billing to keep reviews running after the trial. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bad62f38-f279-458b-a8e4-7c616e062b20

📥 Commits

Reviewing files that changed from the base of the PR and between 535fd11 and 3c816dd.

📒 Files selected for processing (1)
  • tests/scripts/apply-rulesets.test.sh

📝 Walkthrough

Walkthrough

The _jq_check shell-test helper now explicitly returns status 0 after recording assertion results.

Changes

Shell helper validation

Layer / File(s) Summary
Explicit success return
tests/scripts/apply-rulesets.test.sh
_jq_check explicitly returns status 0 after its conditional assertion handling.

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

Possibly related issues

  • petry-projects/incubator#94 — Both changes add explicit successful returns to shell-script functions for SonarCloud hygiene findings.

Possibly related PRs

Suggested reviewers: donpetry-bot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 shell script hygiene feature and references issue #462.
Linked Issues check ✅ Passed The change adds the required explicit return in the affected function and preserves existing behavior.
Out of Scope Changes check ✅ Passed The single-line change is directly related to resolving the SonarCloud finding in issue #462.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 dev-lead/issue-462-20260804-1855

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 4, 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 adds an explicit return 0 to the end of the _jq_check function in the tests/scripts/apply-rulesets.test.sh script. There are no review comments, and I have no feedback to provide.

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Tests: make _jq_check helper return success for SonarCloud shell hygiene

🧪 Tests 🕐 Less than 10 minutes

Grey Divider

AI Description

• Make the _jq_check helper explicitly return success after performing assertions.
• Prevent helper exit codes from leaking into the test harness and tripping shell hygiene rules.
Diagram

graph TD
  T["apply-rulesets.test.sh"] --> S["apply-rulesets.sh"] --> O("Dry-run output") --> J["jq assertions"]
  S --> G["mock gh (PATH)"]
Loading
High-Level Assessment

Adding an explicit return 0 is the simplest, clearest way to ensure the helper’s exit status can’t accidentally become meaningful later and to satisfy shell hygiene expectations; no alternative approach provides a material benefit for this scope.

Files changed (1) +1 / -0

Tests (1) +1 / -0
apply-rulesets.test.shForce _jq_check to return success after each assertion +1/-0

Force _jq_check to return success after each assertion

• Adds an explicit 'return 0' at the end of the '_jq_check' helper. This makes the helper’s exit code unambiguous and prevents future edits from inadvertently propagating non-zero statuses into the test flow (and related lint/Sonar hygiene checks).

tests/scripts/apply-rulesets.test.sh

@don-petry

Copy link
Copy Markdown
Contributor 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-08-04T19:28:35Z

@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

@don-petry
don-petry enabled auto-merge (squash) August 4, 2026 18:58
@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-04T19:59:40Z.

@don-petry
don-petry disabled auto-merge August 4, 2026 19:57
@don-petry

Copy link
Copy Markdown
Contributor Author

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

PR: #463
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-08-04T20:28:45Z

@don-petry
don-petry enabled auto-merge (squash) August 4, 2026 19:58

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

Summary

One-line test-only change adding an explicit return 0 at the end of the _jq_check helper in tests/scripts/apply-rulesets.test.sh, resolving SonarCloud rule S7682 (explicit return statement). No behavior change: the script uses set -uo pipefail (no -e) and tracks assertion failures via the fail global, which is checked at the end with exit "$fail"; both branches of the function already returned status 0 implicitly. Confirms the triage tier's low-risk assessment.

Linked issue analysis

Closes #462 (SonarCloud: shell script hygiene). The issue reports exactly one MAJOR finding — shelldre:S7682 in tests/scripts/apply-rulesets.test.sh — asking for an explicit return statement at the end of the function. This PR adds that return statement as a real fix (no NOSONAR suppression), with no behavior change and green CI, satisfying all three acceptance criteria. SonarCloud checks on this PR pass.

Findings

No issues found.

  • Test-only, 1 addition / 0 deletions in a single file.
  • The return 0 cannot mask failures: assertion results flow through the fail variable, not the function's return status, and no caller checks _jq_check's return value.
  • No unresolved review threads; the only prior review is a bot comment (gemini-code-assist) with no open threads.
  • Secret scan: gitleaks CI check passed; the run_secret_scanning MCP tool is unavailable in this environment (noted, not blocking).

CI status

All checks green. SUCCESS: Shell Tests, SonarCloud (×3), CodeQL, Analyze (go/js-ts/actions), Go, TypeScript, Secret scan (gitleaks), agent-shield, dependency-audit (govulncheck, pnpm audit), CodeRabbit, Graphite AI Reviews. Remaining entries are SKIPPED/CANCELLED orchestration jobs (dev-lead dispatch/ci-relay, dependabot-automerge, ecosystem-specific audits) with successful counterparts where applicable. mergeStateStatus: BLOCKED reflects only the required-review gate.


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 9e78556 into main Aug 4, 2026
30 of 32 checks passed
@don-petry
don-petry deleted the dev-lead/issue-462-20260804-1855 branch August 4, 2026 20:41
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: shell script hygiene

2 participants