Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.

plugin: remove dead code#165

Merged
RaghavSood merged 2 commits intomainfrom
chore/dead_code
Aug 31, 2025
Merged

plugin: remove dead code#165
RaghavSood merged 2 commits intomainfrom
chore/dead_code

Conversation

@RaghavSood
Copy link
Contributor

@RaghavSood RaghavSood commented Aug 31, 2025

Removes dead code from past implementations

Summary by CodeRabbit

  • Refactor
    • Removed the API endpoint that returned the policy schema.
  • Chores
    • Simplified server configuration by removing the mode setting from the plugin configuration.

Copilot AI review requested due to automatic review settings August 31, 2025 20:50
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 31, 2025

Walkthrough

Removed the Server.GetPolicySchema HTTP handler and related filesystem-based schema loading; removed the Server.struct field mode; deleted mode: plugin from config-plugin.yaml. No other handlers, config keys, or public signatures were changed.

Changes

Cohort / File(s) Summary of Changes
API: plugin handler
api/plugin.go
Removed func (s *Server) GetPolicySchema(c echo.Context) error which read plugin/{plugin_id}/dcaPluginUiSchema.json and returned it as JSON; removed unused imports (encoding/json, os, filepath).
API: server struct
api/server.go
Removed mode string field from Server struct.
Config: plugin mode
config-plugin.yaml
Deleted mode: plugin entry from server configuration; other plugin config (e.g., type: fees) unchanged.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Client
    participant Server
    participant FS as Filesystem

    Note over Client,FS: Previous flow (before change)
    Client->>Server: GET /plugin/policy-schema (with header plugin_id)
    Server->>FS: Read plugin/{plugin_id}/dcaPluginUiSchema.json
    FS-->>Server: Schema JSON / read error
    Server-->>Client: 200 JSON / error status
    Note right of Server: Handler removed in this PR
Loading
sequenceDiagram
    autonumber
    participant Client
    participant Server

    Note over Client,Server: Current flow (after change)
    Client->>Server: GET /plugin/policy-schema
    Server-->>Client: 404 / route not available (handler removed)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nibble lines where handlers sleep,
Quietly pulled a mode so deep.
Schema path trimmed, imports few—
Hop, hop, the code feels new. 🥕🐇


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a0381fc and 6645a64.

📒 Files selected for processing (1)
  • api/plugin.go (0 hunks)
💤 Files with no reviewable changes (1)
  • api/plugin.go
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/dead_code

🪧 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Removes dead code from past plugin implementations by eliminating unused configuration properties, struct fields, and methods.

  • Removed unused mode configuration property and corresponding struct field
  • Eliminated deprecated GetPolicySchema method that was no longer in use
  • Cleaned up legacy plugin configuration remnants

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
config-plugin.yaml Removes unused mode: plugin configuration property
api/server.go Removes unused mode field from Server struct
api/plugin.go Removes deprecated GetPolicySchema method implementation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@johnnyluo johnnyluo left a comment

Choose a reason for hiding this comment

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

LGTM

@RaghavSood RaghavSood merged commit b2ca206 into main Aug 31, 2025
2 checks passed
@RaghavSood RaghavSood deleted the chore/dead_code branch August 31, 2025 20:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants