Skip to content

Conversation

@troian
Copy link
Member

@troian troian commented Nov 21, 2025

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Signed-off-by: Artur Troian <troian@users.noreply.github.com>
@troian troian requested a review from a team as a code owner November 21, 2025 15:41
@coderabbitai
Copy link

coderabbitai bot commented Nov 21, 2025

Walkthrough

The script/upgrades.sh file is modified to change how validator configuration is sourced in the prepare_state function. For Akash version v1.0.0-rc0 and later, the create-validator command now accepts a file path rather than an in-memory JSON string. For earlier versions, the validator.json file is read into a variable for consistent field extraction and transaction building.

Changes

Cohort / File(s) Summary
Validator configuration sourcing
script/upgrades.sh
Modified prepare_state function to pass validator configuration as file path for rc versions and as file-derived variable for non-rc versions; adjusted data sourcing from direct strings to file-based input while maintaining existing control flow.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify that both version paths (rc and non-rc) correctly source and parse the validator.json file
  • Ensure the file path approach for rc versions properly handles file I/O and error cases
  • Confirm the variable assignment for non-rc paths maintains compatibility with existing jq extractions (moniker, etc.)

Poem

🐰 A hop through the validator's dance,
Where files now lead the way, by chance,
No strings attached, just paths so clean,
The rc version's best we've seen,
Consistent values, both old and new,
Configuration flows for version true! 🎩

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: switching from using validator.json content to using a file path after v1.0.0, which aligns with the actual code modifications.
Description check ✅ Passed The description contains the repository's standard template with a placeholder 'Closes: #XXXX' and uncompleted checklist items, but the overall structure is related to documenting the PR changes.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch testnetify

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
script/upgrades.sh (1)

548-567: Semver comparison logic verified as correct; fix missing variable declaration.

Verification of semver_funcs.sh confirms the foundational functions order_nat() and order_string() return -1, 0, or 1 via echo, which are used in the comparison chain. The version check on line 551—[[ $($semver compare "$akashversion" v1.0.0-rc0) -ge 0 ]]—is semantically correct and properly identifies version >= v1.0.0-rc0.

The actual issue is a variable scoping inconsistency: valjson is declared local on line 545, but valjsonfile on line 548 is not. Declare valjsonfile as local:

local valjsonfile="$valdir/validator.json"
🧹 Nitpick comments (1)
script/upgrades.sh (1)

544-548: Declare valjsonfile as local for consistency.

Line 548 assigns valjsonfile without a local declaration, while line 544 declares valjson as local. Both variables are loop-scoped and should be consistently declared as local to avoid potential pollution of outer scopes.

  local valdir
  local valjson
+ local valjsonfile
  
  valdir=$validators_dir/.akash${cnt}
  
- valjsonfile="$valdir/validator.json"
+ valjsonfile="$valdir/validator.json"
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f619d32 and 30efce7.

📒 Files selected for processing (1)
  • script/upgrades.sh (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: network-upgrade
  • GitHub Check: release-dry-run
  • GitHub Check: lint-go
  • GitHub Check: build-macos
  • GitHub Check: sims
  • GitHub Check: tests
  • GitHub Check: coverage
  • GitHub Check: build-bins
🔇 Additional comments (1)
script/upgrades.sh (1)

548-567: Approve version-conditional validator configuration sourcing.

The logic correctly implements the PR objective: for Akash v1.0.0-rc0 and later, the command uses the validator.json file path as a positional argument; for earlier versions, it maintains backward compatibility by reading the file and passing individual field values as flags. File path quoting (line 552) and field extraction (lines 558–566) are properly implemented.

@troian troian merged commit 9e1d6cf into main Nov 21, 2025
18 checks passed
@troian troian deleted the testnetify branch November 21, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants