fluxninja / aperture

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

Revise Caching API #2969

Closed tanveergill closed 11 months ago

tanveergill commented 11 months ago

Description of change

Checklist

Summary by CodeRabbit

coderabbitai[bot] commented 11 months ago

Walkthrough

The updates involve significant changes to caching mechanisms, including renaming fields, introducing new RPC methods, and simplifying label matching logic. The changes affect protocol buffers, SDKs, CLI tools, and internal caching operations, enhancing cache lookup, upsert, and delete functionalities. The modifications streamline interactions with result and state caches, reflecting a broader shift towards more efficient and robust cache management within the system.

Changes

Files Change Summary
api/aperture/.../check.proto Renamed cache_key to result_cache_key, added state_cache_keys, and introduced new cache-related messages and RPC method CacheLookup.
api/aperture/.../label_matcher.proto, .../spec.md, .../selector.go Simplified label matching logic by removing K8sLabelMatcherRequirement and match_expressions, adding match_labels map field.
pkg/.../check_response_labels.go, .../cache.go, .../engine.go, .../iface/cache.go, .../iface/engine.go, .../service/check/check.go Updated to use ResultCache, added handling for new cache keys, and introduced concurrent cache operations.
sdks/aperture-.../sdk/..., sdks/aperture-js/..., .../docs/..., .../example/..., .../proto/..., .../sdk/index.ts Updated SDKs to reflect new caching mechanisms and API changes, renaming classes and methods accordingly.
api/aperture/cmd/v1/cmd.proto, cmd/aperture-controller/..., cmd/aperturectl/cmd/..., pkg/agent-functions/..., pkg/cmd/controller.go, pkg/etcd/transport/server.go, sdks/aperture-csharp/... Changes to command-line tools, controller implementations, and C# SDK to support new caching RPC methods and operations.
cmd/aperturectl/cmd/resultcache/..., cmd/aperturectl/cmd/statecache/..., cmd/aperturectl/cmd/utils/flowcontrol.go Introduced new commands within aperturectl for result and state cache operations, including get, set, and delete.
docs/content/reference/aperture-cli/aperturectl/... Added documentation for new aperturectl commands related to result and state cache management.
pkg/policies/flowcontrol/cache.go, pkg/policies/flowcontrol/engine.go Refactored cache operations and updated method signatures to include cache type parameters and handle new gRPC request and response objects.

"In the burrow of the code, changes abound,
Caches evolve, with new logic found.
Keys renamed, and methods anew,
A rabbit hops through, leaving footprints in the dew. 🐰🌱"


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - If you reply to a *review comment* from CodeRabbit, the bot will automatically respond. - To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment - Note: Review comments are made on code diffs or files, not on the PR overview. - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### 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. Note: For conversation with the bot, please use the review comments on code diffs or files. ### 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`