Skip to content

t4078: Simplify --interval validation to single positive integer regex#4118

Merged
alex-solovyev merged 1 commit intomainfrom
bugfix/t4078-cron-interval-validation
Mar 11, 2026
Merged

t4078: Simplify --interval validation to single positive integer regex#4118
alex-solovyev merged 1 commit intomainfrom
bugfix/t4078-cron-interval-validation

Conversation

@alex-solovyev
Copy link
Copy Markdown
Collaborator

Summary

  • Replace two-part --interval validation (^[0-9]+$ + -eq 0 check) with single regex ^[1-9][0-9]*$ for defense-in-depth against injection when parsing numeric data from untrusted sources
  • Consistent with --concurrency validation pattern in the same codebase

Details

File: .agents/scripts/supervisor-archived/cron.sh:38-42

Before: if ! [[ "$2" =~ ^[0-9]+$ ]] || [[ "$2" -eq 0 ]]; then
After: if ! [[ "$2" =~ ^[1-9][0-9]*$ ]]; then

The single regex rejects 0, 00, 007-style inputs, and non-numeric strings in one check. The -eq 0 arithmetic comparison is no longer needed, which also avoids potential issues if the value somehow bypasses the first regex check.

Closes #4078

@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 25 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: a531ec8a-f9df-48c7-aa65-fc9a8dacad5f

📥 Commits

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

📒 Files selected for processing (1)
  • .agents/scripts/supervisor-archived/cron.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/t4078-cron-interval-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 input validation for the --interval command-line argument within the cron.sh script. The change streamlines the validation process by consolidating two separate checks into a single, more robust regular expression. This improves both the security against malformed inputs and the consistency of validation patterns across the codebase.

Highlights

  • --interval validation: Simplified the validation logic for the --interval parameter in cron.sh by replacing a two-part check (regex for digits and an arithmetic comparison for zero) with a single, more robust regular expression.
  • Security and Consistency: Enhanced defense-in-depth against injection by ensuring only positive integers are accepted, rejecting inputs like 0, 00, or non-numeric strings in one check, and aligning this validation pattern with the existing --concurrency validation.
Changelog
  • .agents/scripts/supervisor-archived/cron.sh
    • Simplified the --interval parameter validation to use a single regular expression for positive integers.
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:01:04 UTC 2026: Code review monitoring started
Wed Mar 11 03:01:04 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:01:06 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Replace two-part positive integer check (^[0-9]+$ + -eq 0) with single
regex ^[1-9][0-9]*$ that inherently rejects zero and non-numeric input.

Addresses PR #4062 review feedback for defense-in-depth consistency.
@alex-solovyev alex-solovyev force-pushed the bugfix/t4078-cron-interval-validation branch from 4e286a8 to 9b51745 Compare March 11, 2026 03:04
@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:01 UTC 2026: Code review monitoring started
Wed Mar 11 03:05:01 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:04 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link
Copy Markdown

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 --interval argument in cron.sh. The previous two-step validation, which used a regex and an arithmetic comparison, is replaced by a single regex ^[1-9][0-9]*$. This change enforces that the interval is a positive integer and disallows leading zeros. The review of this change did not identify any issues.

@alex-solovyev alex-solovyev merged commit 9a54cb3 into main Mar 11, 2026
13 checks passed
@alex-solovyev alex-solovyev deleted the bugfix/t4078-cron-interval-validation branch March 11, 2026 03:09
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/cron.sh — PR #4062 review feedback (medium)

1 participant