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

build(deps): remove go header dependency #63

Merged
merged 3 commits into from
Feb 21, 2025
Merged

Conversation

tac0turtle
Copy link
Contributor

@tac0turtle tac0turtle commented Feb 20, 2025

closes #27

Summary by CodeRabbit

  • Chores
    • Streamlined build processes and optimized dependency management for enhanced stability.
  • Refactor
    • Improved underlying data handling in core processes to boost consistency and maintainability.
    • Updated method signatures and return types for better compatibility in mock implementations.
    • Transitioned from custom types to more generic byte slices for certain parameters and return values.
    • Removed unnecessary dependencies to simplify the project structure.

Copy link
Contributor

coderabbitai bot commented Feb 20, 2025

Walkthrough

This pull request simplifies the build and type interfaces. The Makefile's mock-gen target now directly invokes @mockery without relying on a prerequisite file. The go.mod file has been cleaned up by removing a toolchain specification and multiple dependencies. Additionally, the mock methods in the executor and the type alias in types.go have been updated to use []byte instead of the custom header.Hash type, with corresponding changes in their signatures and imports.

Changes

File(s) Change Summary
Makefile Updated mock-gen target: Removed the dependency on mocks/mock_Executor.go and simplified the command to directly invoke @mockery.
go.mod Removed the toolchain specification and numerous dependencies (including header, crypto, and related libraries) from the require block.
mocks/…/mock_Executor.go
types/…/types.go
Replaced the usage of header.Hash with []byte: Updated method signatures in MockExecutor (ExecuteTxs and InitChain) and changed the type alias in types.go; removed the unused header package import.

Suggested reviewers

  • tuxcanfly
  • gupadhyaya
  • Manav-Aggarwal

Poem

I hopped through lines of code today,
Simplifying mocks in a clever way,
With hashes now just bytes so light,
My bundle of changes shone so bright,
A rabbit's delight in code's pure play!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f41ada and b04af35.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod (0 hunks)
💤 Files with no reviewable changes (1)
  • go.mod

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>, please review it.
    • 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 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 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 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. (Beta)
  • @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.

CodeRabbit Configuration 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.

@RollkitBot RollkitBot requested review from a team, tzdybal, yarikbratashchuk and gupadhyaya and removed request for a team February 20, 2025 15:29
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

🧹 Nitpick comments (1)
types/types.go (1)

7-7: LGTM, but consider type validation for Hash.

The change from header.Hash to []byte simplifies the type system, but consider adding validation functions to ensure the byte slice meets hash requirements (e.g., length, format).

// Add these helper functions to maintain type safety
func ValidateHash(h Hash) error {
    // Example validation
    if len(h) != 32 { // adjust size based on your hash algorithm
        return fmt.Errorf("invalid hash length: got %d, want 32", len(h))
    }
    return nil
}

func NewHashFromBytes(b []byte) (Hash, error) {
    h := Hash(b)
    if err := ValidateHash(h); err != nil {
        return nil, err
    }
    return h, nil
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1857c85 and f97252b.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (4)
  • Makefile (1 hunks)
  • go.mod (0 hunks)
  • mocks/mock_Executor.go (4 hunks)
  • types/types.go (1 hunks)
💤 Files with no reviewable changes (1)
  • go.mod
🔇 Additional comments (2)
mocks/mock_Executor.go (1)

1-283: LGTM! Auto-generated mock file.

The changes are consistent with the type alias update in types/types.go. Remember to regenerate this file using make mock-gen if the interfaces change.

Makefile (1)

92-94: LGTM! Simplified mock generation.

The removal of prerequisites simplifies the mock generation process. The mockery tool handles file generation automatically, making the explicit prerequisite unnecessary.

@tzdybal tzdybal changed the title dep: remove go header build(deps): remove go header Feb 20, 2025
@tzdybal tzdybal changed the title build(deps): remove go header build(deps): remove go header dependency Feb 20, 2025
tzdybal
tzdybal previously approved these changes Feb 20, 2025
Copy link
Member

@tzdybal tzdybal left a comment

Choose a reason for hiding this comment

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

LGTM; but Makefile could be cleaned more.

@tac0turtle tac0turtle merged commit 6a7ddd0 into main Feb 21, 2025
11 checks passed
@tac0turtle tac0turtle deleted the marko/remove_go_header branch February 21, 2025 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Get rid of go-header dependency
3 participants