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

Feature/add systems test for limits #1703

Merged
merged 5 commits into from
Dec 17, 2024

Conversation

emrgnt-cmplxty
Copy link
Contributor

@emrgnt-cmplxty emrgnt-cmplxty commented Dec 17, 2024

Important

Add system test for rate limits, update configurations, and enhance integration tests for rate limiting and user permissions.

  • Rate Limiting:
    • Added rate_limit_dependency to multiple routes in base_router.py, chunks_router.py, collections_router.py, conversations_router.py, documents_router.py, graph_router.py, indices_router.py, logs_router.py, prompts_router.py, retrieval_router.py, system_router.py, and users_router.py.
    • Superusers are exempt from rate limits in base_router.py.
  • Configuration:
    • New configuration file r2r_azure_with_test_limits.toml for testing limits.
    • Updated action.yml to use r2r_azure_with_test_limits configuration.
  • Testing:
    • Added integration tests in test_collections.py, test_collections_users_interaction.py, test_conversations.py, test_documents.py, test_retrieval.py, test_retrieval_advanced.py, and test_users.py to verify rate limiting and user permissions.
    • Introduced pytest-xdist for parallel test execution in pyproject.toml.
  • Miscellaneous:
    • Minor logging changes in chunks.py and retrieval_router.py for debugging purposes.
    • Adjusted user_limits type in database.py to dict[UUID, LimitSettings].

This description was created by Ellipsis for 02bc99c. It will automatically update as commits are pushed.

@emrgnt-cmplxty emrgnt-cmplxty marked this pull request as ready for review December 17, 2024 00:47
@emrgnt-cmplxty emrgnt-cmplxty merged commit 2d6653c into main Dec 17, 2024
1 of 2 checks passed
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 02bc99c in 1 minute and 22 seconds

More details
  • Looked at 2282 lines of code in 30 files
  • Skipped 1 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. py/sdk/v3/users.py:207
  • Draft comment:
    Ensure refresh_token handles cases where self.client._refresh_token is not set, as it currently assumes the token is always present.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. py/sdk/v3/users.py:105
  • Draft comment:
    Set self.client.access_token and self.client._refresh_token to None before making the request in the delete method to ensure tokens are cleared even if the request fails.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment suggests a change in the order of operations for clearing tokens. The current implementation clears tokens after the request, which might be intentional to ensure tokens are only cleared if the request succeeds. The comment does not provide strong evidence that the current implementation is incorrect or that the suggested change is necessary.
    The comment assumes that clearing tokens before the request is a better approach without providing evidence. The current implementation might be intentional to handle token clearance only after a successful request.
    The comment could be suggesting a valid improvement if the intention is to ensure tokens are cleared regardless of request success. However, without evidence or context, it's speculative.
    The comment lacks strong evidence for the suggested change and seems speculative. It should be deleted as it does not clearly indicate a required code change.

Workflow ID: wflow_M8f5GH016VbkBHPf


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

self.client.access_token = None
self.client._refresh_token = None
return response

Copy link
Contributor

Choose a reason for hiding this comment

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

The logout method should return a response even when self.client.access_token is not present. Add a return statement to ensure consistent behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant