fluxninja / aperture

Rate limiting, caching, and request prioritization for modern workloads
https://docs.fluxninja.com
Apache License 2.0
622 stars 24 forks source link

Fix crash with disabled object storage #3078

Closed hdkshingala closed 8 months ago

hdkshingala commented 8 months ago

Description of change

Fixes: #3077

Checklist

Summary by CodeRabbit

coderabbitai[bot] commented 8 months ago

Walkthrough

The changes involve a simplification of the dependency injection setup for the objectstorage module in an agent application. The fx.Annotate annotation and fx.As declaration have been removed, and the Provide function now directly returns an interface type. This suggests a shift towards a more interface-oriented design, which may have been done to address issues with agent crashes when object storage is disabled.

Changes

File Path Change Summary
cmd/aperture-agent/agent.go Removed fx.Annotate for objectstorage.Provide and fx.As for objectstorage.ObjectStorageIface.
pkg/.../objectstorage/provide.go Changed Provide function return type from (*ObjectStorage, error) to (ObjectStorageIface, error).

Assessment against linked issues

Objective Addressed Explanation
Prevent agents from crashing when object storage is disabled (#3077)

Poem

As the rabbit hops through the field, Code refactored, the crashes healed. No more errors when storage is nil, Smooth runs the agent, calm and still. 🐇💻


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - You can directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `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 gather interesting statistics about this repository and render them in a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai generate unit tests for the src/utils.ts file.` ### 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](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - 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](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback.