Skip to content

feat: fix broken e2e scirpt#326

Merged
sczembor merged 9 commits into
masterfrom
stan/update-e2e
Sep 30, 2025
Merged

feat: fix broken e2e scirpt#326
sczembor merged 9 commits into
masterfrom
stan/update-e2e

Conversation

@sczembor
Copy link
Copy Markdown
Contributor

@sczembor sczembor commented Sep 30, 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
  • added appropriate labels to the PR
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • 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

Summary by Sourcery

Fix broken E2E light client deployment by parsing separate SPV and parser package IDs, updating environment and config files, removing obsolete variables, and adding a service teardown script.

New Features:

  • Add stop_services.sh script to stop bitcoind and Docker Compose services for E2E testing.

Bug Fixes:

  • Fix deploy_light_client_alpha.sh to correctly extract and validate SPV_PACKAGE_ID and PARSER_PACKAGE_ID from publish output.

Enhancements:

  • Remove unused INIT_HEADERS, BTC_NETWORK, and START_HEIGHT variables from deploy_light_client_alpha.sh.
  • Update .e2e.env and e2e-bitcoin-spv.yml to use separate SPV_PACKAGE_ID and PARSER_PACKAGE_ID.

Signed-off-by: sczembor <stanislaw.czembor@gmail.com>
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Sep 30, 2025

Reviewer's Guide

Refactor the e2e deployment script to remove deprecated constants, parse separate SPV and parser package IDs from the publish JSON, improve error checks and environment/config updates, and add a new script to stop services.

Flow diagram for updated e2e deployment script logic

flowchart TD
    A["Start deployment script"] --> B["Clone light client repo"]
    B --> C["Publish light client to Sui network"]
    C --> D["Parse publish output JSON"]
    D --> E["Extract SPV_PACKAGE_ID"]
    D --> F["Extract PARSER_PACKAGE_ID"]
    E --> G["Check if both IDs are present"]
    F --> G
    G -->|IDs missing| H["Exit with error"]
    G -->|IDs present| I["Update .e2e.env with SPV_PACKAGE_ID and PARSER_PACKAGE_ID"]
    I --> J["Clone repo locally"]
    J --> K["Update config file with SPV_PACKAGE_ID and Light Client ID"]
    K --> L["Finish"]
Loading

Flow diagram for new stop_services.sh script

flowchart TD
    A["Start stop_services.sh"] --> B["Run make bitcoind-init"]
    B --> C["Change directory to contrib/"]
    C --> D["Stop Docker Compose services"]
    D --> E["Change directory back"]
    E --> F["Finish"]
Loading

File-Level Changes

Change Details Files
Removed obsolete initialization variables
  • Eliminated INIT_HEADERS declaration
  • Dropped BTC_NETWORK and START_HEIGHT settings
e2e/deploy_light_client_alpha.sh
Extract separate SPV and parser package IDs
  • Renamed PUBLISH_OUTPUT to PUBLISH_JSON
  • Used jq filters to derive SPV_PACKAGE_ID
  • Used jq filters to derive PARSER_PACKAGE_ID
  • Removed single PACKAGE_ID extraction
e2e/deploy_light_client_alpha.sh
Enhanced error handling and logging
  • Check both SPV and parser variables in failure condition
  • Updated error message to mention both IDs
  • Echo both SPV and parser package IDs on success
e2e/deploy_light_client_alpha.sh
Updated environment and config substitutions
  • Replaced .e2e.env sed for PACKAGE_ID with SPV_PACKAGE_ID and PARSER_PACKAGE_ID
  • Changed config sed to use SPV_PACKAGE_ID for lc_package_id
e2e/deploy_light_client_alpha.sh
Added stop_services.sh script
  • Created script to reinitialize bitcoind
  • Implemented docker compose down to stop services
e2e/stop_services.sh

Possibly linked issues

  • #0: PR removes outdated initialisation parameters from the light client deployment script, directly matching the issue's goal.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `e2e/stop_services.sh:4` </location>
<code_context>
+#!/bin/bash
+set -e
+
+make bitcoind-init
+cd contrib/
+echo "Starting Docker Compose services..."
</code_context>

<issue_to_address>
**question:** Running 'make bitcoind-init' before stopping services may be unnecessary or confusing.

If this order is intentional, please clarify the workflow or rename the script for accuracy.
</issue_to_address>

### Comment 2
<location> `e2e/stop_services.sh:6-8` </location>
<code_context>
+
+make bitcoind-init
+cd contrib/
+echo "Starting Docker Compose services..."
+docker compose down
+echo "Services started."
+cd ../
\ No newline at end of file
</code_context>

<issue_to_address>
**nitpick:** Echo statements do not match the actual operation being performed.

Update the echo statements to indicate that services are being stopped, not started, for clarity.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread e2e/stop_services.sh Outdated
Comment thread e2e/stop_services.sh Outdated
Signed-off-by: sczembor <stanislaw.czembor@gmail.com>
@sczembor sczembor self-assigned this Sep 30, 2025
Signed-off-by: sczembor <stanislaw.czembor@gmail.com>
Signed-off-by: sczembor <stanislaw.czembor@gmail.com>
Signed-off-by: sczembor <stanislaw.czembor@gmail.com>
Signed-off-by: sczembor <stanislaw.czembor@gmail.com>
Signed-off-by: sczembor <stanislaw.czembor@gmail.com>
Signed-off-by: sczembor <stanislaw.czembor@gmail.com>
Signed-off-by: sczembor <stanislaw.czembor@gmail.com>
@sczembor sczembor merged commit 6239335 into master Sep 30, 2025
15 checks passed
@sczembor sczembor deleted the stan/update-e2e branch September 30, 2025 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants