codeant-ai-for-open-source[bot] commented on code in PR #42430:
URL: https://github.com/apache/superset/pull/42430#discussion_r3699772822
##########
scripts/tag_latest_release.sh:
##########
@@ -163,10 +163,10 @@ do
# Iterate through the components of the version strings
for (( j=0; j<${#THIS_TAG_NAME_ARRAY[@]}; j++ )); do
echo "Comparing ${THIS_TAG_NAME_ARRAY[$j]} to
${LATEST_RELEASE_TAG_ARRAY[$j]}"
- if [[ $((THIS_TAG_NAME_ARRAY[$j])) > $((LATEST_RELEASE_TAG_ARRAY[$j]))
]]; then
+ if [[ $((THIS_TAG_NAME_ARRAY[$j])) -gt
$((LATEST_RELEASE_TAG_ARRAY[$j])) ]]; then
compare_result="greater"
break
- elif [[ $((THIS_TAG_NAME_ARRAY[$j])) <
$((LATEST_RELEASE_TAG_ARRAY[$j])) ]]; then
+ elif [[ $((THIS_TAG_NAME_ARRAY[$j])) -lt
$((LATEST_RELEASE_TAG_ARRAY[$j])) ]]; then
compare_result="lesser"
break
Review Comment:
**Suggestion:** These arithmetic expansions interpret zero-padded components
as octal. A valid tag such as `1.08.0` or `1.0.09` causes Bash to report an
arithmetic syntax error, leaves `compare_result` unset, and can incorrectly
write `SKIP_TAG=true` instead of comparing the release versions. Parse
components explicitly as base-10 values before comparing them. [type error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ Zero-padded releases can be incorrectly rejected as equal.
- ⚠️ Latest-tag updates are skipped for valid release tags.
- ⚠️ GitHub release publishing reports misleading comparison results.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=b18c26aa769a4df59c5183035c7a3279&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=b18c26aa769a4df59c5183035c7a3279&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** scripts/tag_latest_release.sh
**Line:** 166:171
**Comment:**
*Type Error: These arithmetic expansions interpret zero-padded
components as octal. A valid tag such as `1.08.0` or `1.0.09` causes Bash to
report an arithmetic syntax error, leaves `compare_result` unset, and can
incorrectly write `SKIP_TAG=true` instead of comparing the release versions.
Parse components explicitly as base-10 values before comparing them.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42430&comment_hash=99ad66e3373d8f625fd890df9d855591aaaccfcc09b1eac09b7a388d6d34d9dc&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42430&comment_hash=99ad66e3373d8f625fd890df9d855591aaaccfcc09b1eac09b7a388d6d34d9dc&reaction=dislike'>👎</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]