chore(scripts): remove useless cat in version detection#479
chore(scripts): remove useless cat in version detection#479Olexandr88 wants to merge 1 commit intoinitia-labs:mainfrom
Conversation
|
Warning Rate limit exceeded
⌛ 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)
📝 WalkthroughWalkthroughThe script Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/protoc-swagger-gen.sh`:
- Around line 16-19: Reintroduce the missing IBC_RATE_LIMITING_VERSION variable
so the clone command that uses it (the clone on Line 25) has a valid ref; add a
line that mirrors the other version lookups, e.g. define
IBC_RATE_LIMITING_VERSION by grepping go.mod for the IBC rate-limiting module
and extracting the version (use the same sed pattern used by
COSMOS_SDK_VERSION/IBC_VERSION/OPINIT_VERSION/CONNECT_VERSION), matching the
module path used in the clone (refer to the IBC_RATE_LIMITING_URL and optional
IBC_RATE_LIMITING_V tokens) so the variable contains the branch/tag string the
clone expects.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
scripts/protoc-swagger-gen.sh
9df6690 to
31fee1f
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
scripts/protoc-swagger-gen.sh (1)
16-19:⚠️ Potential issue | 🔴 Critical
IBC_RATE_LIMITING_VERSIONis still absent — Line 25 will break at runtime.The
cat → grepsimplification for the four other versions is correct. However, the removal of theIBC_RATE_LIMITING_VERSIONextraction leaves the variable undefined. Becauseset -uis not in effect the script won't exit immediately, but the variable expands to an empty string, making the clone on Line 25:git clone -b modules/rate-limiting/ https://github.com/cosmos/ibc-apps ibc-rate-limitingThat branch ref is invalid and the
git clonewill fail with "Remote branch not found".🛠️ Proposed fix — restore the definition with the cleaner grep form
COSMOS_SDK_VERSION=$(grep "$COSMOS_URL v" ./go.mod | sed -n -e "s/^.* //p") IBC_VERSION=$(grep "$IBC_URL/$IBC_V v" ./go.mod | sed -n -e "s/^.* //p") +IBC_RATE_LIMITING_VERSION=$(grep "$IBC_RATE_LIMITING_URL/$IBC_V v" ./go.mod | sed -n -e "s/^.* //p") OPINIT_VERSION=$(grep "$OPINIT_URL v" ./go.mod | sed -n -e "s/^.* //p") CONNECT_VERSION=$(grep "$CONNECT_URL/$CONNECT_V v" ./go.mod | sed -n -e "s/^.* //p")Run the following to confirm the variable is nowhere else in the script:
#!/bin/bash grep -n "IBC_RATE_LIMITING_VERSION" scripts/protoc-swagger-gen.sh🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/protoc-swagger-gen.sh` around lines 16 - 19, The script removed the IBC_RATE_LIMITING_VERSION variable which causes the git clone on the rate-limiting branch to fail; restore IBC_RATE_LIMITING_VERSION using the same grep/sed pattern as the other version vars (e.g., mirror the COSMOS_SDK_VERSION/IBC_VERSION lines) so the variable is populated before the git clone; update the variable name IBC_RATE_LIMITING_VERSION in the top extraction block where COSMOS_SDK_VERSION, IBC_VERSION, OPINIT_VERSION, and CONNECT_VERSION are defined to match the previous behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@scripts/protoc-swagger-gen.sh`:
- Around line 16-19: The script removed the IBC_RATE_LIMITING_VERSION variable
which causes the git clone on the rate-limiting branch to fail; restore
IBC_RATE_LIMITING_VERSION using the same grep/sed pattern as the other version
vars (e.g., mirror the COSMOS_SDK_VERSION/IBC_VERSION lines) so the variable is
populated before the git clone; update the variable name
IBC_RATE_LIMITING_VERSION in the top extraction block where COSMOS_SDK_VERSION,
IBC_VERSION, OPINIT_VERSION, and CONNECT_VERSION are defined to match the
previous behavior.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
scripts/protoc-swagger-gen.sh
Signed-off-by: Olexandr88 <radole1203@gmail.com>
31fee1f to
d25198d
Compare
Replace unnecessary cat usage with direct grep when parsing versions from go.mod