Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(zetaclient): propagate context across codebase & refactor zetacore client #2428

Merged
merged 38 commits into from
Jul 12, 2024

Conversation

swift1337
Copy link
Contributor

@swift1337 swift1337 commented Jul 3, 2024

Description

This PR revamps the zetaclient codebase mainly by wiring ctx context.Context across the codebase.

  • Add retrier package with exponential backoff out-of-the-box
  • Add bg package for running go routines safely
  • Drastically refactor zetacore client package, separate each QueryClient into a different file
  • Propagate ctx across the codebase
  • Add several panic handlers for goroutines
  • Improve logging with log fields
  • Improve testing suite, switch to mockery for ZetaClient interface

How Has This Been Tested?

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Summary by CodeRabbit

  • New Features

    • Introduced a robust retry mechanism with exponential backoff for handling retryable errors.
    • Added new background task management utilities for improved task handling and error management.
  • Refactor

    • Enhanced context handling across various functions to improve control over execution flow and pass context-specific information seamlessly.
  • Tests

    • Added comprehensive test cases for new background task management utilities, including logging and panic recovery scenarios.

Copy link
Contributor

coderabbitai bot commented Jul 3, 2024

Warning

Rate limit exceeded

@swift1337 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 13 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 5ff1728 and 7e96f9d.

Walkthrough

The recent changes introduce context handling across various functions for better control over execution flow and context-specific information tracking. This includes modifications in the observer, signer, and retry packages, along with new background task management utilities in the bg package. The changes aim to enhance the robustness, testability, and logging capabilities of the system.

Changes

File(s) / Path(s) Change Summary
observer/inbound_test.go, observer/outbound.go Introduced context parameters to function calls for improved control and context-specific info.
signer/signer.go, signer/outbound_data_test.go Renamed imports, added context parameters, and restructured function signatures.
pkg/retry/retry.go Added a generic retry mechanism with exponential backoff and retryable error handling functions.
pkg/bg/bg.go, pkg/bg/bg_test.go Introduced background task handling primitives, including configuration options and error logging.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Observer
    participant Signer
    participant Retry
    participant BackgroundTask

    Client->>Observer: ObserveInbound(ctx, tx, receipt)
    Observer->>Signer: Sign(ctx, data, txData)
    Signer->>Retry: DoWithBackoff(Sign, backoff)
    Retry-->>Signer: Signed Transaction
    Signer->>Observer: Return Signed Transaction
    Observer->>Client: Return Observed Data

    Client->>BackgroundTask: Work(ctx, taskFunc)
    BackgroundTask->>Logger: Log Task Start
    BackgroundTask->>Client: Execute Task
    BackgroundTask->>Logger: Log Task End
Loading

Poem

🐇
In the realm of code so bright,
Context guides with newfound light.
Functions wrapped in a careful embrace,
Errors retry with exponential grace.
Background tasks now dance with flair,
Robust and swift, beyond compare.
🐰


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@swift1337 swift1337 self-assigned this Jul 3, 2024
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Just add a first look, will look more in the created files, etc.. later

zetaclient/chains/evm/observer/inbound.go Outdated Show resolved Hide resolved
swift1337 added 3 commits July 5, 2024 18:15
# Conflicts:
#	zetaclient/chains/base/signer.go
#	zetaclient/chains/evm/signer/outbound_data.go
#	zetaclient/chains/evm/signer/outbound_data_test.go
#	zetaclient/chains/evm/signer/signer.go
#	zetaclient/chains/evm/signer/signer_test.go
#	zetaclient/orchestrator/orchestrator.go
#	zetaclient/zetacore/client.go
#	zetaclient/zetacore/client_query_test.go
#	zetaclient/zetacore/query.go
#	zetaclient/zetacore/tx.go
#	zetaclient/zetacore/tx_test.go
@github-actions github-actions bot added the nosec label Jul 5, 2024
@swift1337 swift1337 marked this pull request as ready for review July 5, 2024 16:58
@swift1337 swift1337 added zetaclient Issues related to ZetaClient refactor E2E E2E tests related and removed nosec labels Jul 11, 2024
Copy link
Contributor

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

Outside diff range, codebase verification and nitpick comments (12)
zetaclient/zetacore/constant.go (3)

6-7: Add context to constant comment.

The comment for DefaultBaseGasPrice could be more descriptive to explain its usage context.

- // DefaultBaseGasPrice is the default base gas price
+ // DefaultBaseGasPrice is the default base gas price used for transactions on the ZetaChain network

15-15: Fix grammatical error in comment.

The comment for PostVoteInboundGasLimit contains a grammatical error.

- // PostVoteInboundGasLimit is the gas limit for voting on observed inbound tx (for zetachain itself)
+ // PostVoteInboundGasLimit is the gas limit for voting on observed inbound transactions (for ZetaChain itself)

39-39: Fix grammatical error in comment.

The comment for PostVoteOutboundGasLimit contains a grammatical error.

- // PostVoteOutboundGasLimit is the gas limit for voting on observed outbound tx (for zetachain itself)
+ // PostVoteOutboundGasLimit is the gas limit for voting on observed outbound transactions (for ZetaChain itself)
zetaclient/zetacore/broadcast.go (1)

168-196: Improve error logging.

Consider adding more context to the error logs to make it easier to diagnose issues.

- evt.Msg(m)
+ evt.Str("error_type", "nonce too low").Msg(m)
- evt.Msg("Broadcast replacement")
+ evt.Str("error_type", "replacement transaction underpriced").Msg("Broadcast replacement")
- evt.Msg("Broadcast duplicates")
+ evt.Str("error_type", "already known").Msg("Broadcast duplicates")
- evt.Msg("Broadcast error. Retrying...")
+ evt.Str("error_type", "general broadcast error").Msg("Broadcast error. Retrying...")
zetaclient/chains/bitcoin/observer/observer.go (5)

6-6: Remove unnecessary blank line.

The blank line after the import statement is unnecessary and can be removed for better readability.

-	"context"
+	"context"

Line range hint 221-277: Handle context cancellation and deadlines.

Consider handling context cancellation and deadlines in the WatchRPCStatus function.

// Example of handling context cancellation
select {
case <-ctx.Done():
	return ctx.Err()
case <-ticker.C:
	if !ob.GetChainParams().IsSupported {
		continue
	}

	// existing code...
}
Tools
GitHub Check: codecov/patch

[warning] 196-196: zetaclient/chains/bitcoin/observer/observer.go#L196
Added line #L196 was not covered by tests


[warning] 200-200: zetaclient/chains/bitcoin/observer/observer.go#L200
Added line #L200 was not covered by tests


[warning] 203-203: zetaclient/chains/bitcoin/observer/observer.go#L203
Added line #L203 was not covered by tests


343-347: Improve variable declaration readability.

The variable declarations can be improved for better readability.

- var (
- 	err              error
- 	feeRateEstimated uint64
- )
+ var err error
+ var feeRateEstimated uint64

Line range hint 433-454: Handle context cancellation and deadlines.

Consider handling context cancellation and deadlines in the WatchUTXOs function.

// Example of handling context cancellation
select {
case <-ctx.Done():
	return ctx.Err()
case <-ticker.C():
	if !ob.GetChainParams().IsSupported {
		continue
	}

	// existing code...
}

Line range hint 673-696: Handle context cancellation and deadlines.

Consider handling context cancellation and deadlines in the postBlockHeader function.

select {
case <-ctx.Done():
	return ctx.Err()
default:
	// existing code...
}
zetaclient/chains/bitcoin/observer/outbound.go (3)

35-35: Ensure proper context cancellation and timeout handling.

While the context is being passed correctly, consider adding context cancellation and timeout handling to avoid potential issues with long-running operations.

ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()

61-64: Log context errors with appropriate severity.

Logging at Info level for an error may not be appropriate. Consider using Error or Warn level to log context-related errors.

- ob.logger.Outbound.Info().
+ ob.logger.Outbound.Error().

157-157: Consider adding context cancellation or timeout handling.

To avoid potential issues with long-running operations, consider adding context cancellation or timeout handling.

ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 454a56b and bcb19ae.

Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
Files selected for processing (8)
  • changelog.md (1 hunks)
  • e2e/README.md (1 hunks)
  • go.mod (1 hunks)
  • zetaclient/chains/bitcoin/observer/observer.go (14 hunks)
  • zetaclient/chains/bitcoin/observer/outbound.go (20 hunks)
  • zetaclient/chains/bitcoin/rpc/rpc_live_test.go (1 hunks)
  • zetaclient/zetacore/broadcast.go (5 hunks)
  • zetaclient/zetacore/constant.go (2 hunks)
Files skipped from review due to trivial changes (2)
  • e2e/README.md
  • zetaclient/chains/bitcoin/rpc/rpc_live_test.go
Files skipped from review as they are similar to previous changes (1)
  • go.mod
Additional context used
Path-based instructions (4)
zetaclient/zetacore/constant.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

zetaclient/zetacore/broadcast.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

zetaclient/chains/bitcoin/observer/observer.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

zetaclient/chains/bitcoin/observer/outbound.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

GitHub Check: codecov/patch
zetaclient/chains/bitcoin/observer/observer.go

[warning] 196-196: zetaclient/chains/bitcoin/observer/observer.go#L196
Added line #L196 was not covered by tests


[warning] 200-200: zetaclient/chains/bitcoin/observer/observer.go#L200
Added line #L200 was not covered by tests


[warning] 203-203: zetaclient/chains/bitcoin/observer/observer.go#L203
Added line #L203 was not covered by tests

Additional comments not posted (10)
zetaclient/zetacore/broadcast.go (3)

36-38: Handle context cancellation and deadlines.

Consider handling context cancellation and deadlines for the GetBlockHeight function call.


41-43: Handle context cancellation and deadlines.

Consider handling context cancellation and deadlines for the GetBaseGasPrice function call.


56-57: Potential data race on c.blockHeight.

Ensure that c.blockHeight is protected by the mutex during read operations to avoid data races.

zetaclient/chains/bitcoin/observer/outbound.go (6)

126-130: Context propagation is well-implemented.

The function correctly propagates the context and handles the necessary checks and logging.


260-260: Context propagation is well-implemented.

The function correctly propagates the context and handles the necessary checks and logging.


346-346: Context propagation is well-implemented.

The function correctly propagates the context and handles the necessary checks and logging.


378-378: Context propagation is well-implemented.

The function correctly propagates the context and handles the necessary checks and logging.


433-433: Context propagation is well-implemented.

The function correctly propagates the context and handles the necessary checks and logging.


516-516: Context propagation is well-implemented.

The function correctly propagates the context and handles the necessary checks and logging.

changelog.md (1)

61-61: LGTM!

The changelog entry clearly logs the feature update for propagating context across the codebase and refactoring the zetacore client.

zetaclient/chains/bitcoin/observer/outbound.go Outdated Show resolved Hide resolved
zetaclient/zetacore/constant.go Show resolved Hide resolved
zetaclient/zetacore/broadcast.go Show resolved Hide resolved
@swift1337 swift1337 force-pushed the feat/zetaclient-ctx branch from 605036f to d36876d Compare July 11, 2024 18:16
pkg/retry/retry.go Show resolved Hide resolved
pkg/bg/bg.go Show resolved Hide resolved
e2e/README.md Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/observer/outbound.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/observer/outbound.go Outdated Show resolved Hide resolved
@lumtis lumtis added UPGRADE_LIGHT_TESTS Run make start-upgrade-test-light ADMIN_TESTS Run make start-admin-tests labels Jul 12, 2024
Copy link
Contributor

@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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bcb19ae and d36876d.

Files selected for processing (1)
  • zetaclient/chains/bitcoin/observer/outbound.go (20 hunks)
Files skipped from review as they are similar to previous changes (1)
  • zetaclient/chains/bitcoin/observer/outbound.go

Copy link
Contributor

@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

Outside diff range, codebase verification and nitpick comments (9)
zetaclient/chains/bitcoin/observer/outbound.go (9)

55-60: Optimize the nested if statements.

The nested if statements can be simplified for better readability and maintainability.

- if !app.IsOutboundObservationEnabled(ob.GetChainParams()) {
-    sampledLogger.Info().
-        Msgf("WatchOutbound: outbound observation is disabled for chain %d", chainID)
-    continue
- }
+ if !app.IsOutboundObservationEnabled(ob.GetChainParams()) {
+    sampledLogger.Info().Msgf("WatchOutbound: outbound observation is disabled for chain %d", chainID)
+    continue
+ }

Line range hint 166-170: Improve error logging for checkIncludedTx.

Consider adding more context to the error log to make it easier to debug issues related to transaction inclusion.

- ob.logger.Outbound.Error().Err(err).Msgf("IsOutboundProcessed: error verify bitcoin outbound %s outboundID %s", txHash, outboundID)
+ ob.logger.Outbound.Error().Err(err).Msgf("IsOutboundProcessed: error verifying bitcoin outbound transaction %s with outboundID %s", txHash, outboundID)

273-273: Improve error handling for getOutboundIDByNonce.

Consider adding more context to the error log to make it easier to debug issues related to nonce-mark UTXO selection.

- return nil, 0, 0, 0, err
+ return nil, 0, 0, 0, fmt.Errorf("failed to get outbound ID by nonce: %w", err)

361-361: Improve error handling for getOutboundIDByNonce.

Consider adding more context to the error log to make it easier to debug issues related to nonce-mark UTXO selection.

- ob.logger.Chain.Error().Err(err).Msg("refreshPendingNonce: error getting last outbound txid")
+ ob.logger.Chain.Error().Err(err).Msgf("refreshPendingNonce: error getting last outbound txid for nonce %d", nonceLow-1)

385-385: Improve error handling for GetCctxByNonce.

Consider adding more context to the error log to make it easier to debug issues related to CCTX retrieval.

- return "", errors.Wrapf(err, "getOutboundIDByNonce: error getting cctx for nonce %d", nonce)
+ return "", fmt.Errorf("failed to get CCTX by nonce: %w", err)

450-450: Improve error handling for checkTssOutboundResult.

Consider adding more context to the error log to make it easier to debug issues related to TSS outbound result verification.

- ob.logger.Outbound.Error().Err(err).Msgf("checkIncludedTx: error verify bitcoin outbound %s outboundID %s", txHash, outboundID)
+ ob.logger.Outbound.Error().Err(err).Msgf("checkIncludedTx: error verifying bitcoin outbound transaction %s with outboundID %s", txHash, outboundID)

526-526: Improve error handling for checkTSSVin.

Consider adding more context to the error log to make it easier to debug issues related to TSS VIN checks.

- return errors.Wrapf(err, "checkTssOutboundResult: invalid TSS Vin in outbound %s nonce %d", hash, nonce)
+ return fmt.Errorf("invalid TSS Vin in outbound %s nonce %d: %w", hash, nonce, err)

570-570: Improve error handling for getOutboundIDByNonce.

Consider adding more context to the error log to make it easier to debug issues related to nonce-mark UTXO selection.

- return fmt.Errorf("checkTSSVin: error findTxIDByNonce %d", nonce-1)
+ return fmt.Errorf("checkTSSVin: error finding TxID by nonce %d: %w", nonce-1, err)

Line range hint 599-599: Improve error handling for DecodeTSSVout.

Consider adding more context to the error log to make it easier to debug issues related to VOUT decoding.

- return err
+ return fmt.Errorf("failed to decode TSS VOUT: %w", err)
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d36876d and 4bdf50f.

Files selected for processing (3)
  • zetaclient/chains/bitcoin/observer/outbound.go (20 hunks)
  • zetaclient/chains/evm/observer/outbound.go (10 hunks)
  • zetaclient/zetacore/client_monitor.go (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • zetaclient/chains/evm/observer/outbound.go
  • zetaclient/zetacore/client_monitor.go
Additional context used
Path-based instructions (1)
zetaclient/chains/bitcoin/observer/outbound.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

Additional comments not posted (10)
zetaclient/chains/bitcoin/observer/outbound.go (10)

35-35: Ensure proper context cancellation and timeout handling.

While the context is being passed correctly, consider adding context cancellation and timeout handling to avoid potential issues with long-running operations.

ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()

36-39: Handle potential error from FromContext.

Returning nil may not be appropriate. Consider returning the error or handling it differently to ensure proper error propagation.

- return nil
+ return fmt.Errorf("failed to retrieve context: %w", err)

125-129: Ensure proper context propagation and cancellation.

While the context is being passed correctly, consider adding context cancellation and timeout handling to avoid potential issues with long-running operations.

ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()

226-231: Use a more explicit variable name for log fields.

lf might not be a standard abbreviation for log fields. Use a more explicit variable name for better readability.

- lf := map[string]any{
+ logFields := map[string]any{

259-259: Ensure proper context propagation and cancellation.

While the context is being passed correctly, consider adding context cancellation and timeout handling to avoid potential issues with long-running operations.

ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()

345-345: Ensure proper context propagation and cancellation.

While the context is being passed correctly, consider adding context cancellation and timeout handling to avoid potential issues with long-running operations.

ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()

377-377: Ensure proper context propagation and cancellation.

While the context is being passed correctly, consider adding context cancellation and timeout handling to avoid potential issues with long-running operations.

ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()

432-432: Ensure proper context propagation and cancellation.

While the context is being passed correctly, consider adding context cancellation and timeout handling to avoid potential issues with long-running operations.

ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()

515-515: Ensure proper context propagation and cancellation.

While the context is being passed correctly, consider adding context cancellation and timeout handling to avoid potential issues with long-running operations.

ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()

554-554: Ensure proper context propagation and cancellation.

While the context is being passed correctly, consider adding context cancellation and timeout handling to avoid potential issues with long-running operations.

ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()

@swift1337 swift1337 force-pushed the feat/zetaclient-ctx branch from d7ccb9c to 5ff1728 Compare July 12, 2024 09:46
Copy link
Contributor

@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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4bdf50f and 5ff1728.

Files selected for processing (2)
  • pkg/bg/bg.go (1 hunks)
  • pkg/bg/bg_test.go (1 hunks)
Additional context used
Path-based instructions (2)
pkg/bg/bg.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

pkg/bg/bg_test.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

GitHub Check: codecov/patch
pkg/bg/bg.go

[warning] 53-53: pkg/bg/bg.go#L53
Added line #L53 was not covered by tests

Additional comments not posted (5)
pkg/bg/bg.go (3)

18-20: LGTM!

The WithName function is correctly implemented.


22-24: LGTM!

The WithLogger function is correctly implemented.


51-62: LGTM!

The logError function is correctly implemented and effectively logs errors.

Tools
GitHub Check: codecov/patch

[warning] 53-53: pkg/bg/bg.go#L53
Added line #L53 was not covered by tests

pkg/bg/bg_test.go (2)

14-75: LGTM!

The TestWork function is well-implemented and covers various scenarios effectively.


78-81: LGTM!

The assertChanClosed function is correctly implemented.

pkg/bg/bg.go Show resolved Hide resolved
@swift1337 swift1337 mentioned this pull request Jul 12, 2024
@swift1337 swift1337 added this pull request to the merge queue Jul 12, 2024
Merged via the queue into develop with commit 59d5ba9 Jul 12, 2024
23 of 24 checks passed
@swift1337 swift1337 deleted the feat/zetaclient-ctx branch July 12, 2024 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADMIN_TESTS Run make start-admin-tests breaking:cli E2E E2E tests related nosec refactor UPGRADE_LIGHT_TESTS Run make start-upgrade-test-light zetaclient Issues related to ZetaClient
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants