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

Fix: Reduce cadence and number of api calls for Demo-Reviews #3

Merged
merged 4 commits into from
Jan 6, 2025

Conversation

davelosert
Copy link

This pull request sequentializes the API calls in the analyze function as well as adding caching for the DeploymentStatus in order to avoid hitting Secondary Rate Limits we saw in some of our cleanup-processess.

Improvements to DemoDeployment class:

  • Added a cachedStatus property to cache the deployment status and modified the getCurrentStatus method to use this cache, reducing the number of API calls. [1] [2]

Refactoring in DemoDeploymentReview class:

  • Refactored the loadDemoReviews method to handle demo deployment reviews sequentially, preventing secondary rate limits.

Enhancements to test coverage:

  • Updated DemoDeploymentReview.test.ts to include new test cases for various demo deployment scenarios, such as identifying demos to warn, terminate, and handle multiple deployments. [1] [2] [3]

Utilities for testing:

  • Enhanced the Mocktokit utility to support parameter matching in the paginateCalledWith method, improving the accuracy of mock API calls.

@davelosert davelosert merged commit 49ae0aa into main Jan 6, 2025
@davelosert davelosert deleted the fix-api-utilization branch January 6, 2025 12:37
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