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

op-batcher: Move config test from op-e2e to unit tests #8463

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

trianglesphere
Copy link
Contributor

Description

Move the batcher config test from op-e2e to unit tests. Two reasons: 1) the test in op-e2e is flaky and 2) the unit test lets us quickly test many more conditions.

Metadata

@trianglesphere trianglesphere requested a review from a team as a code owner December 6, 2023 00:18
Copy link
Contributor

coderabbitai bot commented Dec 6, 2023

Warning

Rate Limit Exceeded

@trianglesphere has exceeded the limit for the number of files or commits that can be reviewed per hour. Please wait 16 minutes and 24 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. 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 dac5877 and 5e25450.

Walkthrough

The code changes involve enhancing the validation logic for CLI flags in the op-batcher component, adding new tests for configuration validation, and refactoring the default configuration setup for the op-service RPC CLI. The op-batcher now includes checks for empty RPC URLs, polling intervals, and batch sizes, along with a new error for unknown batch types. Test functions have been added to ensure these validations work as expected. The op-service RPC CLI now uses a function to set default configuration values.

Changes

File Path Change Summary
op-batcher/batcher/config.go Added validation logic for CLI flags in CLIConfig
op-batcher/batcher/config_test.go Added tests for CLIConfig validation
op-e2e/system_test.go Removed test for incorrect batcher configuration
op-service/rpc/cli.go Added DefaultCLIConfig function for default values

Assessment against linked issues

Objective Addressed Explanation
Check the sanity of op-batcher CLI flags (#7512)
Implement checks for int/duration values for each flag (#7512)
Verify the validity of RPC URL values entered via the CLI (#7512)
Audit other CLI programs for input sanity checks (#7512) The provided changes do not indicate whether other CLI programs have been audited.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

op-batcher/batcher/config.go Outdated Show resolved Hide resolved
op-batcher/batcher/config_test.go Outdated Show resolved Hide resolved
op-batcher/batcher/config_test.go Outdated Show resolved Hide resolved
auto-merge was automatically disabled December 6, 2023 00:44

Merge queue setting changed

@ajsutton ajsutton added this pull request to the merge queue Dec 6, 2023
Merged via the queue into develop with commit 8df680a Dec 6, 2023
58 checks passed
@ajsutton ajsutton deleted the jg/batcher_config_test branch December 6, 2023 01:16
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.

Check the sanity of op-batcher CLI flags
2 participants