Update db_upgrade_scripts with dynamic db changes#1758
Update db_upgrade_scripts with dynamic db changes#1758abhishek8shankar wants to merge 2 commits into
Conversation
Signed-off-by: abhishek8shankar <abhishek.shankarcs@gmail.com>
|
Warning Review limit reached
More reviews will be available in 40 minutes and 44 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. 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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthrough
ChangesDB Upgrade Script Variable Passing
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
db_upgrade_scripts/mosip_ida/upgrade.sh (1)
29-29: ⚡ Quick winQuote
psqlvariable expansions to avoid argument splitting.Line 29 and Line 39 currently use unquoted expansions (
$MOSIP_DB_NAME,$DB_UNAME, script path). Quote them sopsqlreceives stable arguments even with unexpected characters.Proposed patch
- PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 -v db_name=$MOSIP_DB_NAME -v ida_user=$DB_UNAME --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -a -b -f $UPGRADE_SCRIPT_FILE + PGPASSWORD="$SU_USER_PWD" psql -v ON_ERROR_STOP=1 -v "db_name=$MOSIP_DB_NAME" -v "ida_user=$DB_UNAME" --username="$SU_USER" --host="$DB_SERVERIP" --port="$DB_PORT" --dbname="$DEFAULT_DB_NAME" -a -b -f "$UPGRADE_SCRIPT_FILE" @@ - PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 -v db_name=$MOSIP_DB_NAME -v ida_user=$DB_UNAME --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -a -b -f $REVOKE_SCRIPT_FILE + PGPASSWORD="$SU_USER_PWD" psql -v ON_ERROR_STOP=1 -v "db_name=$MOSIP_DB_NAME" -v "ida_user=$DB_UNAME" --username="$SU_USER" --host="$DB_SERVERIP" --port="$DB_PORT" --dbname="$DEFAULT_DB_NAME" -a -b -f "$REVOKE_SCRIPT_FILE"Also applies to: 39-39
🤖 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 `@db_upgrade_scripts/mosip_ida/upgrade.sh` at line 29, The psql command on line 29 has unquoted variable expansions for $MOSIP_DB_NAME, $DB_UNAME, and $UPGRADE_SCRIPT_FILE which can cause argument splitting if these variables contain spaces or special characters. Quote each variable expansion in the psql command by wrapping them with double quotes, so that -v db_name=$MOSIP_DB_NAME becomes -v db_name="$MOSIP_DB_NAME", -v ida_user=$DB_UNAME becomes -v ida_user="$DB_UNAME", and -f $UPGRADE_SCRIPT_FILE becomes -f "$UPGRADE_SCRIPT_FILE". Apply the same quoting fix to line 39 which has the same pattern.Source: Linters/SAST tools
🤖 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 `@db_upgrade_scripts/mosip_ida/upgrade.sh`:
- Line 29: The psql command on line 29 has unquoted variable expansions for
$MOSIP_DB_NAME, $DB_UNAME, and $UPGRADE_SCRIPT_FILE which can cause argument
splitting if these variables contain spaces or special characters. Quote each
variable expansion in the psql command by wrapping them with double quotes, so
that -v db_name=$MOSIP_DB_NAME becomes -v db_name="$MOSIP_DB_NAME", -v
ida_user=$DB_UNAME becomes -v ida_user="$DB_UNAME", and -f $UPGRADE_SCRIPT_FILE
becomes -f "$UPGRADE_SCRIPT_FILE". Apply the same quoting fix to line 39 which
has the same pattern.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4b627b8d-2bc1-4d55-b021-f7063ac7d60e
📒 Files selected for processing (2)
db_upgrade_scripts/mosip_ida/upgrade.propertiesdb_upgrade_scripts/mosip_ida/upgrade.sh
Signed-off-by: abhishek8shankar <abhishek.shankarcs@gmail.com>
Summary by CodeRabbit