-
Notifications
You must be signed in to change notification settings - Fork 98
[dx] automatically detect version for migrations in installer.sh #837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Warning Rate limit exceeded@kvaps has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 56 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. 📒 Files selected for processing (1)
WalkthroughThe change updates the way the Changes
Poem
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 1
🧹 Nitpick comments (1)
scripts/installer.sh (1)
6-6
: Robustly parse numeric prefixes from migration filenames
The current AWK expression ($NF+1
) may misinterpret filenames that include extensions or non-numeric suffixes. To strictly extract and increment only the numeric prefix, split on the underscore or apply a regex. For instance:-| find scripts/migrations -mindepth 1 -maxdepth 1 -type f | sort -V | awk -F/ 'END {print $NF+1}' +| find scripts/migrations -mindepth 1 -maxdepth 1 -type f | sort -V \ + | awk -F/ '{print $NF}' \ + | sed -E 's/^([0-9]+).*/\1/' \ + | awk 'END {print $1 + 1}'This two-step extraction ensures only the leading digits are considered.
🛑 Comments failed to post (1)
scripts/installer.sh (1)
6-6: 🛠️ Refactor suggestion
Ensure fallback when no migration scripts exist
Ifscripts/migrations
is empty, the pipelinefind … | sort -V | awk …
will yield an emptyVERSION
, which may cause the configmap creation or later loops to misbehave. Consider defaulting to version 1 when no migrations are found. For example:+latest=$(find scripts/migrations -mindepth 1 -maxdepth 1 -type f | sort -V | tail -n1) +if [ -z "$latest" ]; then + VERSION=1 +else + # Extract numeric prefix and increment + base=$(basename "$latest") + num=${base%%_*} + VERSION=$((num + 1)) +fi
Signed-off-by: Andrei Kvapil kvapss@gmail.com
Summary by CodeRabbit