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

docs: add adr-1 proposal for msg server and keeper consistency. #1751

Merged
merged 9 commits into from
Jan 2, 2024

Conversation

jgimeno
Copy link
Contributor

@jgimeno jgimeno commented Dec 28, 2023

Purpose / Abstract

Summary by CodeRabbit

Summary by CodeRabbit

  • Documentation
    • Introduced a proposal for refactoring core components to enhance separation of concerns and testing framework within the Nibiru Chain documentation.
    • Updated the ADR template to include structured sections for documenting architectural decisions.
    • Added an ADR outlining the separation of concerns between MsgServer and Keeper in the Nibiru Chain.
    • Introduced an ADR framework for managing significant software design choices in the documentation.

@jgimeno jgimeno requested a review from a team as a code owner December 28, 2023 22:04
Copy link
Contributor

coderabbitai bot commented Dec 28, 2023

Walkthrough

The proposed changes aim to refactor the MsgServer and Keeper components in the Nibiru Chain to achieve a clear separation of concerns and improve the action-based testing framework. This addresses issues related to role confusion, maintenance challenges, and security implications arising from the current blending of responsibilities. The refactor seeks to simplify action-based tests and outlines the benefits of this separation.

Changes

File Path Change Summary
documentation/adrs/adr-1.md Refactoring of MsgServer and Keeper components
.gitignore Modification to .gitignore file
docs/adr/00-adr-template.md Introduction of ADR template for documenting context
docs/adr/01-adr-msg-server-keeper.md Introduction of ADR proposing separation of concerns
docs/adr/README.md Introduction of ADR framework for managing design choices

🐇✨
In the realm of code, where the data streams flow,
A change was made, with refactor's glow.
MsgServer and Keeper now dance apart,
A rabbit's cheer for the cleaner start. 🎉🥕

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 with CodeRabbit Bot (@coderabbitai)

  • You can directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • You can tag CodeRabbit on specific lines of code or entire files in the PR by tagging @coderabbitai in a comment. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • You can tag @coderabbitai in a PR comment and ask questions about the PR and the codebase. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid.
    • @coderabbitai read the files in the src/scheduler package and generate README in the markdown format.

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.

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.

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.
  • 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

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a8ff7ef and 7ada755.
Files selected for processing (1)
  • documentation/adrs/adr-1.md (1 hunks)
Additional comments: 1
documentation/adrs/adr-1.md (1)
  • 1-45: The document provides a clear and structured explanation of the proposed changes, outlining the issues, analogies, specific cases, and benefits of the refactor. The markdown syntax appears to be correctly used, and the document is well-formatted. It is important to ensure that the document is accessible to all stakeholders and that the language is clear and concise.

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 7ada755 and 051e3f8.
Files selected for processing (1)
  • documentation/adrs/adr-1.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • documentation/adrs/adr-1.md

Copy link
Member

@Unique-Divine Unique-Divine left a comment

Choose a reason for hiding this comment

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

Looks good. Just going to rename the file path and add some text improvements, then merge this.

Copy link
Member

@Unique-Divine Unique-Divine left a comment

Choose a reason for hiding this comment

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

One thing to note here is that x/sudo checks are actually stateful validation, which would still go in the Keeper. They're not a msg validation for the MsgServer.

The ADR should probably propose a format for that or advocate for some convention like the original proposal from Frojdi

@matthiasmatt
Copy link
Contributor

LGTM, just want everyone here to pinky promise that we will never do a binding from msg to keeper ever again. Any binding (like wasm for example) needs to go to msg server and not touch the keeper, otherwise we can lose the msg validation from the msg server.

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 051e3f8 and a5158f9.
Files selected for processing (4)
  • .gitignore (1 hunks)
  • docs/adr/00-adr-template.md (1 hunks)
  • docs/adr/01-adr-msg-server-keeper.md (1 hunks)
  • docs/adr/README.md (1 hunks)
Files skipped from review due to trivial changes (2)
  • docs/adr/00-adr-template.md
  • docs/adr/README.md
Additional comments: 6
.gitignore (1)
  • 14-14: The update to .gitignore to exclude docs/static seems appropriate. Ensure that no necessary files within docs/static are currently being tracked by Git, as they will need to be removed manually.
Verification successful

The script was intended to check if any files within docs/static are currently being tracked by Git. The absence of output suggests that there are no files being tracked in docs/static, or the command did not work as intended.

To ensure accuracy, I will modify the script to list all files in docs/static that are tracked by Git without using the --error-unmatch option, which may have suppressed the output.


The absence of output from the script indicates that there are no files currently being tracked by Git within the docs/static directory. This aligns with the change made to the .gitignore file, which now excludes docs/static from version control.

Based on this information, it can be concluded that the update to .gitignore is consistent with the state of the repository, and no further action is required to remove files from tracking.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# List files in docs/static that are currently tracked by Git
git ls-files --error-unmatch docs/static/* > /dev/null 2>&1 && echo "Some files in docs/static are still being tracked by Git."

Length of output: 46



Script:

#!/bin/bash
# List all files in docs/static that are currently tracked by Git
git ls-files docs/static/*

Length of output: 30

docs/adr/01-adr-msg-server-keeper.md (5)
  • 1-107: The ADR document is well-structured and follows the standard format for architectural decision records, providing clear context and rationale for the proposed changes.

  • 12-13: Verify the existence and status of the referenced GitHub issue to ensure it is relevant to the ADR.

Verification successful

The shell script output confirms the existence and status of the GitHub issue #524 in the NibiruChain/nibiru repository. The issue is closed and was authored by testinginprod, which matches the reference in the ADR document. The issue is labeled as a refactor and is part of the Testnet V1 milestone. The content of the issue also matches the changes proposed in the ADR, specifically the introduction of NewMsgServerImpl and NewQueryServerImpl without embedding the Keeper struct.

Based on this information, the reference to the GitHub issue in the ADR document is accurate and relevant.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the referenced GitHub issue
gh issue view 524 --repo NibiruChain/nibiru

Length of output: 1128

* 37-57: The proposed code changes and best practices for separating `MsgServer` and `Keeper` are technically sound and align with the principles of clean architecture.
  • 71-100: The clarification on the role of the Keeper and MsgServer regarding security and access control is well-articulated and addresses potential concerns effectively.

  • 105-107: The conclusion effectively summarizes the benefits of the proposed architectural changes, highlighting improvements in code clarity, maintainability, and security.

@Unique-Divine Unique-Divine merged commit b986ccf into main Jan 2, 2024
7 checks passed
@Unique-Divine Unique-Divine deleted the doc/adr-1 branch January 2, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants