Skip to content

[KLC-1663] Fix build workflow#15

Merged
RomuloSiebra merged 4 commits intomainfrom
KLC-1663-fix-build-workflow
Jul 25, 2025
Merged

[KLC-1663] Fix build workflow#15
RomuloSiebra merged 4 commits intomainfrom
KLC-1663-fix-build-workflow

Conversation

@RomuloSiebra
Copy link
Copy Markdown

@RomuloSiebra RomuloSiebra commented Jul 17, 2025

Overview

Some workflows weren't working properly, in the case of the build workflow it was because of issues with dependency, golang version and mismatching interfaces in the code for slowTests and the executor. This PR fixes the build workflow by addressing these issues

Changes

  • Fixed SlowTests and executor interface compability with Klever Blockchain proxy
  • Update build workflow to accept repository variables
  • Add golang package cache to build workflow

Summary by CodeRabbit

  • New Features

    • Introduced a custom GitHub Action for setting up Go development environments with support for private modules and caching.
  • Chores

    • Updated CI workflow to use the new Go setup action, streamlining environment setup and dependency management.
  • Refactor

    • Replaced mock proxy clients with real proxy clients in blockchain modules and integration tests.
    • Updated transaction data types and method signatures in integration test interfaces and handlers to use new models.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 17, 2025

"""

Walkthrough

This update refactors the Go project's integration and CI setup by introducing a custom GitHub Action for Go environment configuration, private module support, and dependency caching. It also transitions Klever blockchain integration tests and framework code from mock proxies and MultiversX data types to real Klever proxy clients and updated transaction data models, resulting in multiple interface and method signature changes.

Changes

File(s) Change Summary
.github/actions/go-setup-action/action.yml Added new composite GitHub Action for Go setup, private module support, Git credentials handling, and caching.
.github/workflows/build.yml Updated CI workflow to use new Go setup action, removed matrix and manual Go setup steps and dependency installs.
executors/kleverBlockchain/module/scCallsModule.go Replaced mock proxy with real Klever proxy client; updated proxy initialization with error handling.
executors/kleverBlockchain/scCallsExecutor.go Modified transaction status check to use new proxy method and updated result type handling.
integrationTests/relayers/slowTests/framework/chainSimulatorWrapper.go Switched from mock to real proxy client; updated field types, method signatures, return types, and error handling.
integrationTests/relayers/slowTests/framework/interface.go Updated interface method signatures and imports to use new proxy and transaction data types from Klever packages.
integrationTests/relayers/slowTests/framework/kcHandler.go Changed imports and method signatures to use new transaction data model from Klever proxy package.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Go Setup Action
    participant Git
    participant Go Toolchain

    GitHub Actions->>Go Setup Action: Run with inputs (go-version, go-private, git-user, git-pass, cache-enabled)
    Go Setup Action->>Go Toolchain: Setup Go version
    alt Git credentials provided
        Go Setup Action->>Git: Configure Git for private modules access
    end
    alt Caching enabled
        Go Setup Action->>Go Toolchain: Restore Go module/vendor cache
        alt Cache miss
            Go Setup Action->>Go Toolchain: Run go mod tidy & go mod download
        end
    end
    Go Setup Action->>Go Toolchain: Install modvendor & generate vendor directory
    Go Setup Action->>Go Toolchain: Verify go.mod and go.sum are tidy (no uncommitted changes)
Loading
sequenceDiagram
    participant Test Framework
    participant Real Klever Proxy
    participant Blockchain

    Test Framework->>Real Klever Proxy: Initialize with configuration
    Test Framework->>Real Klever Proxy: DeploySC / ScCall / SendTx calls
    Real Klever Proxy->>Blockchain: Submit transactions
    Blockchain-->>Real Klever Proxy: Return transaction results
    Real Klever Proxy-->>Test Framework: Return models.TransactionData results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇
In the warren of code, we hop anew,
Go setup's now sleek, with caching in view.
Proxies are real, no more pretend,
Transaction types updated, on tests we depend.
With every commit, our CI runs bright—
The carrot of progress is always in sight!

"""

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch KLC-1663-fix-build-workflow

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@RomuloSiebra RomuloSiebra force-pushed the KLC-1663-fix-build-workflow branch from fea7139 to 87a8840 Compare July 17, 2025 17:54
@RomuloSiebra RomuloSiebra marked this pull request as ready for review July 24, 2025 14:08
Copy link
Copy Markdown

@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: 2

🧹 Nitpick comments (2)
.github/actions/go-setup-action/action.yml (1)

68-76: Improve tidy verification & fix missing EOF newline

  1. The tidy-check will fail if vendor/ changed earlier but was restored from cache. Consider adding git add -A && git diff --cached --exit-code so cached vendor deltas are also caught.

  2. YAML-lint flags a missing trailing newline. Tiny but keeps linters green.

@@
   git status --porcelain
   exit 1
 fi
+
.github/workflows/build.yml (1)

15-15: Update checkout action to v4

actions/checkout@v3 is flagged by action-lint as out-of-date for current runners.

-uses: actions/checkout@v3
+uses: actions/checkout@v4
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6d7df49 and 87a8840.

📒 Files selected for processing (7)
  • .github/actions/go-setup-action/action.yml (1 hunks)
  • .github/workflows/build.yml (1 hunks)
  • executors/kleverBlockchain/module/scCallsModule.go (2 hunks)
  • executors/kleverBlockchain/scCallsExecutor.go (2 hunks)
  • integrationTests/relayers/slowTests/framework/chainSimulatorWrapper.go (7 hunks)
  • integrationTests/relayers/slowTests/framework/interface.go (2 hunks)
  • integrationTests/relayers/slowTests/framework/kcHandler.go (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
executors/kleverBlockchain/module/scCallsModule.go (2)
clients/klever/proxy/proxy.go (2)
  • ArgsProxy (33-43)
  • NewProxy (56-94)
clients/klever/proxy/models/entity.go (1)
  • RestAPIEntityType (4-4)
integrationTests/relayers/slowTests/framework/kcHandler.go (2)
integrationTests/relayers/slowTests/framework/address.go (1)
  • KlvAddress (12-17)
clients/klever/proxy/models/transactions.go (1)
  • TransactionData (57-59)
integrationTests/relayers/slowTests/framework/interface.go (2)
integrationTests/relayers/slowTests/framework/address.go (1)
  • KlvAddress (12-17)
clients/klever/proxy/models/transactions.go (1)
  • TransactionData (57-59)
🪛 YAMLlint (1.37.1)
.github/actions/go-setup-action/action.yml

[error] 76-76: no new line character at the end of file

(new-line-at-end-of-file)

🪛 actionlint (1.7.7)
.github/workflows/build.yml

15-15: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🔇 Additional comments (13)
executors/kleverBlockchain/module/scCallsModule.go (1)

40-53: LGTM! Excellent transition from mock to real proxy client.

The real proxy initialization is well-structured with comprehensive configuration options and proper error handling. The configurable parameters (finality checks, cache expiration, nonce delta) provide good flexibility for different deployment scenarios.

executors/kleverBlockchain/scCallsExecutor.go (2)

415-415: LGTM! Method call updated to match real proxy interface.

The change from ProcessTransactionStatus to GetTransactionInfoWithResults aligns with the transition to the real proxy client and provides more comprehensive transaction information.


424-424: LGTM! Status comparison updated for new transaction data model.

The status comparison now correctly uses the string representation of the transaction status from the new models.TransactionData type, maintaining the same logical behavior as before.

integrationTests/relayers/slowTests/framework/kcHandler.go (3)

11-11: LGTM! Import updated to use Klever-specific proxy models.

The import change from MultiversX SDK to Klever-specific proxy models is consistent with the overall transition to the real Klever proxy client.


481-481: LGTM! Method signature updated to use new transaction data type.

The return type change from *data.TransactionOnNetwork to *models.TransactionData aligns with the new proxy models and maintains compatibility with the framework.


876-876: LGTM! Method parameter type updated consistently.

The parameter type change maintains consistency with the new transaction data models used throughout the framework.

integrationTests/relayers/slowTests/framework/chainSimulatorWrapper.go (4)

57-57: LGTM! Proxy field type updated to use real proxy interface.

The field type change from mock to real proxy interface is consistent with the overall transition.


63-73: LGTM! Real proxy initialization with appropriate configuration.

The proxy initialization uses proper configuration parameters suitable for the chain simulator context, with disabled finality checks and synchronization, which is appropriate for testing scenarios.


113-113: LGTM! Method signatures consistently updated to use new transaction data types.

All method signatures have been properly updated to return *models.TransactionData instead of the old transaction type, maintaining consistency across the framework.

Also applies to: 123-123, 150-150, 195-195, 213-213


156-160: LGTM! Transaction status comparison updated for new data model.

The status comparison logic has been properly updated to work with the new transaction data model while maintaining the same validation behavior.

integrationTests/relayers/slowTests/framework/interface.go (2)

12-13: LGTM! Import paths updated to use Klever-specific packages.

The import changes from MultiversX SDK to Klever-specific proxy packages are consistent with the overall transition to the real Klever proxy client.


32-32: LGTM! Interface method signatures consistently updated.

All interface methods have been properly updated to use the new proxy and transaction data types (proxy.Proxy and *models.TransactionData), ensuring consistent type usage across all implementations.

Also applies to: 34-34, 35-35, 37-37, 44-44

.github/workflows/build.yml (1)

17-24: Ensure repository variables/secrets exist & pass cache toggle explicitly

The composite action relies on:

  • vars.GO_VERSION
  • vars.GO_PRIVATE_REPO
  • secrets.GIT_USER
  • secrets.GIT_PASS

A missing variable causes a silent empty-string which fails the conditional in the action (e.g. private modules won’t resolve). Please double-check they are configured in repo settings or default them in the workflow. Also consider setting cache-enabled: true/false in the with: block for clearer intent.

Copy link
Copy Markdown

@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: 1

♻️ Duplicate comments (1)
.github/actions/go-setup-action/action.yml (1)

36-37: Persisting plaintext credentials in global git config is still unsafe
The token remains on-disk for the rest of the job. Please switch to a per-repo http.extraheader that you unset immediately after go mod download, as suggested previously.

🧹 Nitpick comments (1)
.github/actions/go-setup-action/action.yml (1)

76-76: Missing trailing newline
Add a newline at EOF to silence linters and keep diffs clean.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87a8840 and a29f77d.

📒 Files selected for processing (1)
  • .github/actions/go-setup-action/action.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/actions/go-setup-action/action.yml

[error] 76-76: no new line character at the end of file

(new-line-at-end-of-file)

@RomuloSiebra RomuloSiebra merged commit 9302fc6 into main Jul 25, 2025
2 checks passed
@RomuloSiebra RomuloSiebra deleted the KLC-1663-fix-build-workflow branch July 25, 2025 17: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.

3 participants