refactor(node-checker): improve, reuse, delete#100
Conversation
|
""" WalkthroughThe script is refactored to introduce a centralized associative array that maps Ethereum client names to their GitHub API URLs. A new generic function consolidates version-checking logic for all client types, replacing duplicated code in existing functions. Client-specific functions are updated to use this generic function and the new URL mapping. Changes
Sequence Diagram(s)sequenceDiagram
participant Systemd
participant Script
participant Client API
participant GitHub API
Systemd->>Script: Provide client service description
Script->>Script: Extract client name
Script->>Script: Lookup GitHub URL from associative array
Script->>Client API: Query running client version
Script->>GitHub API: Fetch latest release version
Script->>Script: Compare versions
Script->>Script: Print pass/warn/fail result
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
plugins/node-checker/run.sh (1)
697-698: Standardize MEV-Boost version lookup and naming
Use a lowercasetag_urllocal var to align with other functions and add a guard for missing mapping. Optionally, unify the regex withgrep -oEto extract full semantic versions.- TAG_URL=${client_github_url["mev-boost"]} + local tag_url=${client_github_url["mev-boost"]} + if [[ -z "$tag_url" ]]; then + print_check_result "FAIL" "MEV-Boost no GitHub URL mapping found" + ((failed_checks++)) + return + fi - LATEST_VERSION=$(curl -s "$TAG_URL" | jq -r .tag_name | sed 's/.*v\([0-9]*\.[0-9]*\).*/\1/') + LATEST_VERSION=$(curl -s "$tag_url" | jq -r .tag_name | grep -oE 'v?[0-9]+\.[0-9]+\.[0-9]+')
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
plugins/node-checker/run.sh(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: run-lido-csm-staking-node
|
@Jor-Tech can you verify this works well with your setup? 🙏 |
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Looking all good here! 👍 |
Summary by CodeRabbit