VED-1260 Mock PDS lambda rate limiting in ref env#1427
Open
amarauzoma wants to merge 48 commits intomasterfrom
Open
VED-1260 Mock PDS lambda rate limiting in ref env#1427amarauzoma wants to merge 48 commits intomasterfrom
amarauzoma wants to merge 48 commits intomasterfrom
Conversation
- Added a new Lambda function to simulate PDS responses for patient lookups. - Implemented rate limiting with configurable average and spike thresholds. - Updated existing MNS publisher to utilize the new PDS base URL environment variable. - Enhanced tests to cover scenarios with the mock PDS service, including rate limit handling. - Created performance testing scripts to validate MNS behavior under load with the mock PDS. - Updated infrastructure to route PDS calls in the ref environment to the mock endpoint.
- Streamlined the initialization of MockPdsService by consolidating parameters. - Replaced multiple response methods with a unified error handling approach. - Enhanced readability by reducing redundant code in the patient lookup logic. - Updated tests to utilize helper functions for event creation and decision mocking.
- Deleted the performance testing plan document for MNS integration with mocked PDS. - This document outlined objectives, delivery approaches, and existing architecture for implementing a mocked PDS service.
…mock-PDS-in-Ref Made-with: Cursor # Conflicts: # tests/perf_tests/Makefile
- Removed the global service retrieval function and directly initialized the MockPdsService with a Redis client and rate limiter. - Updated the lambda_handler to use the initialized service directly, improving performance and readability. - Adjusted unit tests to accommodate the new service initialization approach, ensuring proper mocking and error handling.
… tests - Updated sonar-project.properties to include coverage report for mock_pds. - Added new unit tests for Mock PDS service to improve test coverage and handle edge cases. - Introduced a new test file for rate limiting functionality in the Mock PDS service. - Updated the quality-checks workflow to run tests for the new mock_pds service.
- Introduced a new Mock PDS Lambda function to simulate PDS responses. - Created an ECR repository for the Mock PDS service with appropriate policies. - Updated deployment workflows to include mock_pds in build flags and image overrides. - Enhanced infrastructure configuration to support the new Mock PDS service, including image URI handling and environment variable setup.
… server for rate limit testing
…ved clarity and maintainability
…ient lookup functionality - Add pyproject.toml for dependency management using Poetry - Create lambda_handler.py to handle incoming requests and integrate with MockPdsService - Implement MockPdsService to manage patient lookup and rate limiting logic - Introduce FixedWindowRateLimiter for controlling request rates using Redis - Add unit tests for MockPdsService and rate limiter functionality - Update performance test setup to target deployed mock PDS Lambda instead of local server - Remove local mock server implementation and related references from performance tests
…y poetry installation
- Introduced a new mock PDS service with a rate limiter for handling patient lookup requests. - Implemented a Lambda function as the entry point for the service. - Added a rate limiter using Redis to manage request limits. - Created unit tests for the mock PDS service and rate limiter to ensure functionality. - Updated Locust load testing configuration to include the new mock PDS service. - Added a `pyproject.toml` file for dependency management using Poetry.
…yload and updating tests
…ly-binary options
- Removed `expected_commit_id` and `require_matching_commit_id` inputs from the workflow. - Updated environment variables to use `github.sha` directly for `SOURCE_COMMIT_ID`. - Simplified commit hash validation logic in the API availability check. Update infrastructure variables for development environment - Changed `mns_environment` from "int" to "dev" in `variables.tfvars`. Clean up unused variables in infrastructure - Removed unused `PDS_BASE_URL` variable from `id_sync_lambda.tf` and `mns_publisher.tf`. - Removed `pds_base_url` variable from `variables.tf` in the `mns_publisher` module. Refactor PDS service client logic - Updated `get_pds_service` to use a single environment variable for PDS environment. - Simplified the initialization of `PdsService` to remove base URL handling. - Adjusted error handling in `pds_get_patient_details` to return patient details directly. Update tests to reflect changes in PDS service - Removed tests related to base URL overrides and unnecessary configurations in `test_pds_details.py` and `test_pds_service.py`. Update package dependencies - Upgraded `@redocly/cli`, `@redocly/openapi-core`, and `@redocly/respect-core` to version 2.30.4. - Updated `styled-components` to version 6.4.1. Refactor performance tests - Removed baseline, spike, and ramp profiles from `Makefile` and `README.md`. - Simplified Locust load testing setup in `locustfile.py` and removed unused profile files.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Uh oh!
There was an error while loading. Please reload this page.