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

refactor(oracle): remove unused code and collapse empty client/cli directory #2050

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Unique-Divine
Copy link
Member

@Unique-Divine Unique-Divine commented Sep 24, 2024

Removes dead code

Collapses oracle/client/cli to oracle/cli

Summary by CodeRabbit

  • Documentation

    • Added comments to the GitHub workflow file for automation clarity.
    • Updated the CHANGELOG to document recent refactors.
  • Chores

    • Added scratch-paper.md to the .gitignore to exclude it from version control.
  • Refactor

    • Removed unused code and collapsed an empty directory in the oracle component.
  • Code Organization

    • Updated import path for the oraclecli package to reflect a more direct structure.
  • Removal

    • Deleted the price.go file, which managed oracle price functionalities.

@Unique-Divine Unique-Divine requested a review from a team as a code owner September 24, 2024 19:43
Copy link
Contributor

coderabbitai bot commented Sep 24, 2024

Walkthrough

The changes encompass updates to several files within the project, including modifications to workflow configurations, version control rules, documentation, and code structure. Key alterations include the addition of comments in the GitHub workflow file, updates to the .gitignore to exclude specific files, documentation of a refactor in the CHANGELOG.md, an import path modification in the root.go file, and the removal of the price.go file, which contained functionality for managing oracle prices.

Changes

Files Change Summary
.github/workflows/gh-issues.yml Added two comment lines at the beginning, including a title and a link to a Notion page.
.gitignore Added scratch-paper.md to the list of ignored files.
CHANGELOG.md Added an entry documenting a refactor in the oracle component, including the removal of unused code and an empty directory, linked to pull request #2050.
cmd/nibid/cmd/root.go Updated import path for oraclecli from client/cli to cli.
x/oracle/integration/action/price.go Deleted file containing functionality for setting and snapshotting oracle prices, removing several methods and types related to this functionality.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Workflow
    participant GitHub
    participant Codebase

    User->>Workflow: Trigger Workflow
    Workflow->>GitHub: Fetch Changes
    GitHub->>Codebase: Retrieve Updated Files
    Codebase->>Workflow: Return File Changes
    Workflow->>User: Notify Completion
Loading

🐰 In the garden where changes bloom,
A workflow whispers, dispelling gloom.
With files anew, and paths refined,
The code hops forward, perfectly aligned.
Let's celebrate with a joyful cheer,
For every change brings progress near! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 72fc6c4 and ddf83cf.

📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • cmd/nibid/cmd/root.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • CHANGELOG.md
  • cmd/nibid/cmd/root.go

Warning

Review ran into problems

🔥 Problems

Error running LanguageTool: LanguageTool error: Unknown error


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

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 UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 81ea61d and 72fc6c4.

Files selected for processing (5)
  • .github/workflows/gh-issues.yml (1 hunks)
  • .gitignore (1 hunks)
  • CHANGELOG.md (1 hunks)
  • cmd/nibid/cmd/root.go (1 hunks)
  • x/oracle/integration/action/price.go (0 hunks)
Files not reviewed due to no reviewable changes (1)
  • x/oracle/integration/action/price.go
Files skipped from review due to trivial changes (2)
  • .github/workflows/gh-issues.yml
  • .gitignore
Additional comments not posted (3)
CHANGELOG.md (3)

153-153: LGTM: Clear and concise changelog entry.

The new entry in the "Unreleased" section accurately describes a refactoring change in the oracle module. It provides enough detail to understand the nature of the change without being overly technical.


Line range hint 1-1166: Overall, the changelog is well-structured and informative.

The CHANGELOG.md file follows best practices:

  1. It adheres to the Keep a Changelog format.
  2. It uses Semantic Versioning.
  3. Changes are categorized into meaningful types (e.g., "Features", "Bug Fixes", "API Breaking").
  4. Each entry provides a brief description and a link to the relevant pull request.

Some minor suggestions for improvement:

  1. Consider adding a brief summary of key changes at the beginning of each version release for quick reference.
  2. Ensure consistency in capitalization and punctuation across entries.
  3. For major releases, consider adding a "Migration Guide" section if there are breaking changes that require user action.

Line range hint 1-1166: The CHANGELOG.md is well-maintained and provides valuable project history.

This changelog effectively documents the project's evolution, making it easier for users and developers to understand changes between versions. The consistent format and detailed entries demonstrate good project maintenance practices.

Keep up the good work in maintaining this changelog. It's an essential tool for communication with your user base and development team.

@@ -31,7 +31,7 @@ import (
"github.com/spf13/cobra"

"github.com/NibiruChain/nibiru/v2/app"
oraclecli "github.com/NibiruChain/nibiru/v2/x/oracle/client/cli"
oraclecli "github.com/NibiruChain/nibiru/v2/x/oracle/cli"
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Import Path Inconsistencies Detected

The import path change from github.com/NibiruChain/nibiru/v2/x/oracle/client/cli to github.com/NibiruChain/nibiru/v2/x/oracle/cli is incomplete. The following files still reference the old import path and need to be updated:

  • x/oracle/module.go
  • x/common/testutil/testnetwork/query.go
  • x/oracle/cli/gen_pricefeeder_delegation_test.go

Please ensure all references are updated to maintain consistency across the codebase.

Analysis chain

LGTM! Verify consistency across the codebase.

The import path change aligns with the PR objective of collapsing the oracle/client/cli directory to oracle/cli. This modification reflects the restructuring of the oracle module's CLI components.

To ensure consistency across the codebase, please run the following script to check for any remaining references to the old import path:

If the first command returns any results, those files need to be updated. The second command should show consistent usage of the new import path across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to the old import path

# Test: Search for the old import path. Expect: No results.
rg --type go "github.com/NibiruChain/nibiru/v2/x/oracle/client/cli"

# Test: Confirm the new import path is used consistently. Expect: Consistent usage across the codebase.
rg --type go "github.com/NibiruChain/nibiru/v2/x/oracle/cli"

Length of output: 777

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ➡️ Pending Review/Merge
Development

Successfully merging this pull request may close these issues.

1 participant