Skip to content

GH#4077: Simplify concurrency validation in batch.sh#4119

Merged
alex-solovyev merged 1 commit intomainfrom
bugfix/batch-concurrency-validation
Mar 11, 2026
Merged

GH#4077: Simplify concurrency validation in batch.sh#4119
alex-solovyev merged 1 commit intomainfrom
bugfix/batch-concurrency-validation

Conversation

@alex-solovyev
Copy link
Copy Markdown
Collaborator

Summary

  • Simplifies --concurrency positive integer validation in batch.sh from a two-part check (^[0-9]+$ + -eq 0) to a single regex ^[1-9][0-9]*$ that inherently excludes zero
  • Addresses unactioned review feedback from PR GH#3716: Fix CRITICAL security issues from PR #1359 review #4062 (Gemini code review, medium severity)
  • More concise, readable, and robust against injection when parsing numeric data from untrusted sources

Changes

File: .agents/scripts/supervisor-archived/batch.sh:249

Before:

if ! [[ "$2" =~ ^[0-9]+$ ]] || [[ "$2" -eq 0 ]]; then

After:

if ! [[ "$2" =~ ^[1-9][0-9]*$ ]]; then

Verification

  • ShellCheck: zero violations
  • Behaviour unchanged: rejects 0, negative numbers, non-numeric input; accepts 1, 2, 10, etc.

Closes #4077

Replace two-part positive integer check (^[0-9]+$ then -eq 0) with
single regex ^[1-9][0-9]*$ that inherently excludes zero. More concise,
readable, and robust against injection per PR #4062 review feedback.

Closes #4077
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 11, 2026

Warning

Rate limit exceeded

@alex-solovyev has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 24 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f2f52e2a-6de8-4277-ac67-f4dd29e9d86f

📥 Commits

Reviewing files that changed from the base of the PR and between 58e370a and d5cf95e.

📒 Files selected for processing (1)
  • .agents/scripts/supervisor-archived/batch.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/batch-concurrency-validation

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 and usage tips.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the validation logic for the --concurrency flag within the batch.sh script. The primary goal is to enhance the clarity and security of input validation by replacing a multi-part conditional check with a single, more efficient regular expression. This change addresses previous review feedback and ensures that only positive integer values are accepted for the concurrency parameter.

Highlights

  • Concurrency Validation: Simplified the --concurrency positive integer validation in batch.sh from a two-part check to a single regular expression ^[1-9][0-9]*$ that inherently excludes zero.
  • Code Robustness: Improved the robustness against injection when parsing numeric data from untrusted sources, making the validation more concise and readable.
Changelog
  • .agents/scripts/supervisor-archived/batch.sh
    • Updated the validation logic for the --concurrency argument to use a more efficient regular expression.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 396 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Wed Mar 11 03:05:06 UTC 2026: Code review monitoring started
Wed Mar 11 03:05:06 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 396

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 396
  • VULNERABILITIES: 0

Generated on: Wed Mar 11 03:05:09 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link
Copy Markdown

@alex-solovyev alex-solovyev merged commit 85686c5 into main Mar 11, 2026
19 checks passed
@alex-solovyev alex-solovyev deleted the bugfix/batch-concurrency-validation branch March 11, 2026 03:09
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

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 the validation for the --concurrency argument in batch.sh. The change replaces a two-part check with a single regular expression ^[1-9][0-9]*$ to validate that the input is a positive integer. The new implementation is functionally equivalent to the previous one but is more concise. The change has been reviewed and no issues were found.

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.

quality-debt: .agents/scripts/supervisor-archived/batch.sh — PR #4062 review feedback (medium)

1 participant