Skip to content

chore(uat): [[ ]] tests + stderr errors (Sonar S7688/S7677)#568

Closed
alichherawalla wants to merge 1 commit into
mainfrom
chore/sonar-uat-shell
Closed

chore(uat): [[ ]] tests + stderr errors (Sonar S7688/S7677)#568
alichherawalla wants to merge 1 commit into
mainfrom
chore/sonar-uat-shell

Conversation

@alichherawalla

@alichherawalla alichherawalla commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Fixes SonarCloud shell code smells in scripts/uat.sh.

What

  • S7688 (23 findings): convert every POSIX [ ... ] test conditional to [[ ... ]].
  • S7677 (1 finding, line 37): redirect the error() message to stderr (>&2).

Why safe

This is the production release script and cannot be run in review (it ships a real build). Every converted conditional already had its operands quoted, so [[ ]] (which suppresses word-splitting and globbing) is behavior-neutral here. No string literals like [ERROR]/[INFO]/[WARN] were touched.

Verification

  • bash -n scripts/uat.sh passes (syntax clean).
  • [[ / ]] counts balance (21 each).
  • No remaining bare [ ... ] conditionals.
  • shellcheck was not available in the environment, so static-lint verification is by bash -n + manual review only.

Diff: 22 insertions, 22 deletions.

Summary by CodeRabbit

  • Bug Fixes
    • Improved release script failure reporting by directing error messages to the appropriate output stream.
    • Preserved existing release checks, build safeguards, artifact handling, and release-note generation behavior while improving conditional handling.

Convert all POSIX [ ... ] conditionals in scripts/uat.sh to [[ ... ]]
(S7688) and redirect the error() message to stderr (S7677). All operands
were already quoted, so the change is behavior-neutral for this release
script. Verified with bash -n.
@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 Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

UAT script updates

Layer / File(s) Summary
Validation and release preparation
scripts/uat.sh
Error messages now target stderr, while pre-flight checks, platform version bumps, and release-note selection use [[ ... ]] conditionals.
Build, publishing, and reporting conditionals
scripts/uat.sh
Android and iOS build gates, artifact handling, GitHub release arguments, and final status messages use the updated conditional structure while preserving the existing release flow.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change and verification, but it omits required template sections like Type of Change and Checklist. Add the template sections, especially Type of Change, Checklist, Related Issues, and remove or fill the Screenshots section for non-UI work.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly names the shell-test refactor and stderr error redirect in scripts/uat.sh.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 chore/sonar-uat-shell

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.

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

🧹 Nitpick comments (1)
scripts/uat.sh (1)

177-179: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Reuse variables for APK and AAB paths.

Since APK_SRC and AAB_SRC were already defined for these exact paths earlier in the script, reusing them here reduces duplication and ensures consistency.

♻️ Proposed fix to reuse variables
-  [[ -f android/app/build/outputs/apk/release/app-release.apk ]] && \
-    { cp android/app/build/outputs/apk/release/app-release.apk "$APK_DST"; GH_ARGS+=("$APK_DST"); }
-  [[ -f android/app/build/outputs/bundle/release/app-release.aab ]] && \
+  [[ -f "$APK_SRC" ]] && \
+    { cp "$APK_SRC" "$APK_DST"; GH_ARGS+=("$APK_DST"); }
+  [[ -f "$AAB_SRC" ]] && \
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/uat.sh` around lines 177 - 179, Update the APK and AAB existence
checks and copy operations in the release artifact handling block to reuse the
existing APK_SRC and AAB_SRC variables instead of repeating their literal paths.
Preserve the current destination and GH_ARGS behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@scripts/uat.sh`:
- Around line 177-179: Update the APK and AAB existence checks and copy
operations in the release artifact handling block to reuse the existing APK_SRC
and AAB_SRC variables instead of repeating their literal paths. Preserve the
current destination and GH_ARGS behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 25d39d4c-1022-4878-9eda-9d16c61e6710

📥 Commits

Reviewing files that changed from the base of the PR and between 856bca1 and 429610f.

📒 Files selected for processing (1)
  • scripts/uat.sh

@alichherawalla

Copy link
Copy Markdown
Collaborator Author

Included in release PR #571 via merge commit 2130a63; closing this superseded source PR.

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.

1 participant