-
Notifications
You must be signed in to change notification settings - Fork 72
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
feat: Added ability to load spending plans from environment variable. #3153
Conversation
Signed-off-by: ebadiere <[email protected]>
🚨 Memory Leak Detected 🚨A potential memory leak has been detected in the test titled Details📊 Memory Leak Detection Report 📊 GC Type: MarkSweepCompact Heap Statistics (before vs after executing the test):
Heap Space Statistics (before vs after executing the test):
RecommendationsPlease investigate the memory allocations in this test, focusing on objects that are not being properly deallocated. |
Test Results 20 files - 3 265 suites - 23 33m 6s ⏱️ - 3m 31s For more details on these failures, see this check. Results for commit c48d26f. ± Comparison against base commit 6606c38. This pull request removes 4 and adds 1 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Config suggestion, other than that looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few suggestions:
packages/relay/tests/lib/config/hbarSpendingPlanConfigService.spec.ts
Outdated
Show resolved
Hide resolved
packages/relay/tests/lib/config/hbarSpendingPlanConfigService.spec.ts
Outdated
Show resolved
Hide resolved
packages/relay/tests/lib/config/hbarSpendingPlanConfigService.spec.ts
Outdated
Show resolved
Hide resolved
packages/relay/tests/lib/config/hbarSpendingPlanConfigService.spec.ts
Outdated
Show resolved
Hide resolved
packages/relay/tests/lib/config/hbarSpendingPlanConfigService.spec.ts
Outdated
Show resolved
Hide resolved
packages/relay/tests/lib/config/hbarSpendingPlanConfigService.spec.ts
Outdated
Show resolved
Hide resolved
packages/relay/tests/lib/config/hbarSpendingPlanConfigService.spec.ts
Outdated
Show resolved
Hide resolved
a7b302e
to
b79887a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just a non-blocking clean up suggestion on the logic.
packages/relay/tests/lib/config/hbarSpendingPlanConfigService.spec.ts
Outdated
Show resolved
Hide resolved
packages/relay/tests/lib/config/hbarSpendingPlanConfigService.spec.ts
Outdated
Show resolved
Hide resolved
…tent. Signed-off-by: ebadiere <[email protected]> fix: removed .only Signed-off-by: ebadiere <[email protected]> fix: Cleaned up file and env var evaluation. Signed-off-by: ebadiere <[email protected]> fix: Flaky unit test fix. Signed-off-by: ebadiere <[email protected]> feat: Refactored implementation and updated tests. Signed-off-by: ebadiere <[email protected]>
54b6a01
to
4415cb3
Compare
Signed-off-by: ebadiere <[email protected]>
Signed-off-by: ebadiere <[email protected]>
🚨 Memory Leak Detected 🚨A potential memory leak has been detected in the test titled Details📊 Memory Leak Detection Report 📊 GC Type: MarkSweepCompact Heap Statistics (before vs after executing the test):
Heap Space Statistics (before vs after executing the test):
RecommendationsPlease investigate the memory allocations in this test, focusing on objects that are not being properly deallocated. |
🚨 Memory Leak Detected 🚨A potential memory leak has been detected in the test titled Details📊 Memory Leak Detection Report 📊 GC Type: Scavenge Heap Statistics (before vs after executing the test):
Heap Space Statistics (before vs after executing the test):
GC Type: Scavenge Heap Statistics (before vs after executing the test):
Heap Space Statistics (before vs after executing the test):
GC Type: MarkSweepCompact Heap Statistics (before vs after executing the test):
Heap Space Statistics (before vs after executing the test):
RecommendationsPlease investigate the memory allocations in this test, focusing on objects that are not being properly deallocated. |
🚨 Memory Leak Detected 🚨A potential memory leak has been detected in the test titled Details📊 Memory Leak Detection Report 📊 GC Type: MarkSweepCompact Heap Statistics (before vs after executing the test):
Heap Space Statistics (before vs after executing the test):
RecommendationsPlease investigate the memory allocations in this test, focusing on objects that are not being properly deallocated. |
🚨 Memory Leak Detected 🚨A potential memory leak has been detected in the test titled Details📊 Memory Leak Detection Report 📊 GC Type: MarkSweepCompact Heap Statistics (before vs after executing the test):
Heap Space Statistics (before vs after executing the test):
RecommendationsPlease investigate the memory allocations in this test, focusing on objects that are not being properly deallocated. |
🚨 Memory Leak Detected 🚨A potential memory leak has been detected in the test titled Details📊 Memory Leak Detection Report 📊 GC Type: MarkSweepCompact Heap Statistics (before vs after executing the test):
Heap Space Statistics (before vs after executing the test):
RecommendationsPlease investigate the memory allocations in this test, focusing on objects that are not being properly deallocated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one last thing
packages/relay/tests/lib/config/hbarSpendingPlanConfigService.spec.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Logan Nguyen <[email protected]>
…erent-batches' into 3152-spendingplan-as-env-var Signed-off-by: ebadiere <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* chore: divided hbar limtier tests into different batches Signed-off-by: Logan Nguyen <[email protected]> * fix: fixed acceptance.yml Signed-off-by: Logan Nguyen <[email protected]> --------- Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: ebadiere <[email protected]>
Co-authored-by: Nana Essilfie-Conduah <[email protected]> Signed-off-by: Eric Badiere <[email protected]>
…hgraph/hedera-json-rpc-relay into 3152-spendingplan-as-env-var Signed-off-by: ebadiere <[email protected]>
Signed-off-by: ebadiere <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Quality Gate passedIssues Measures |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3153 +/- ##
==========================================
- Coverage 83.39% 83.35% -0.05%
==========================================
Files 66 66
Lines 4283 4290 +7
Branches 835 837 +2
==========================================
+ Hits 3572 3576 +4
- Misses 471 473 +2
- Partials 240 241 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…#3153) * feat: Added ability to load spening plans from environment variable. Signed-off-by: ebadiere <[email protected]> * feat: Now uses one property for either spending plan file or JSON content. Signed-off-by: ebadiere <[email protected]> fix: removed .only Signed-off-by: ebadiere <[email protected]> fix: Cleaned up file and env var evaluation. Signed-off-by: ebadiere <[email protected]> fix: Flaky unit test fix. Signed-off-by: ebadiere <[email protected]> feat: Refactored implementation and updated tests. Signed-off-by: ebadiere <[email protected]> * fix: Adding updated package-lock.json Signed-off-by: ebadiere <[email protected]> * fix: Updated global variable reference to the new HBAR_SPENDING_PLANS_CONFIG Signed-off-by: ebadiere <[email protected]> fix: Test fix. Signed-off-by: ebadiere <[email protected]> fix: Removed irrelevant test since we now use either env var or file for spending plan. Signed-off-by: ebadiere <[email protected]> fix: Updated HBAR_SPENDING_PLANS_CONFIG from HBAR_SPENDING_PLANS_CONFIG_FILE Signed-off-by: ebadiere <[email protected]> * fix: Clean up. Updated logging and appropriate tests. Signed-off-by: ebadiere <[email protected]> * fix: Replaced the useInMemoryRedisServer with the start and stop redis in the before and after mocha functions. Signed-off-by: ebadiere <[email protected]> * fix: Test fix. Added the envName back to the loggerService test. Signed-off-by: ebadiere <[email protected]> * Update docs/configuration.md Co-authored-by: Victor Yanev <[email protected]> Signed-off-by: Eric Badiere <[email protected]> * fix: Added back file not found tests. Signed-off-by: ebadiere <[email protected]> * fix: Updated file name in `withOverriddenEnvsInMochaTest` with existing file. Signed-off-by: ebadiere <[email protected]> * fix: Clear the spending plan repository in a test as in CI it seems to already be populated. Signed-off-by: ebadiere <[email protected]> fix: Cleanup. Signed-off-by: ebadiere <[email protected]> * fix: Added more time for the HBar Rate Limiter to update expenses in the background. Signed-off-by: ebadiere <[email protected]> * chore: divided hbar limtier tests into different batches Signed-off-by: Logan Nguyen <[email protected]> * fix: Removed the clearing of the spending plans. Signed-off-by: ebadiere <[email protected]> * chore: divided hbar limtier tests into different batches (#3181) * chore: divided hbar limtier tests into different batches Signed-off-by: Logan Nguyen <[email protected]> * fix: fixed acceptance.yml Signed-off-by: Logan Nguyen <[email protected]> --------- Signed-off-by: Logan Nguyen <[email protected]> * Update packages/relay/src/lib/config/hbarSpendingPlanConfigService.ts Co-authored-by: Nana Essilfie-Conduah <[email protected]> Signed-off-by: Eric Badiere <[email protected]> * fix: Restored class comments and corrected HBAR_SPENDING_PLAN_CONFIG. Signed-off-by: ebadiere <[email protected]> * test: fix hbarSpendingPlanConfigService.spec.ts Signed-off-by: Victor Yanev <[email protected]> * test: remove `.only` from `describe` Signed-off-by: Victor Yanev <[email protected]> * test: disconnect redis client after tests with shared cache Signed-off-by: Victor Yanev <[email protected]> --------- Signed-off-by: ebadiere <[email protected]> Signed-off-by: Eric Badiere <[email protected]> Signed-off-by: Logan Nguyen <[email protected]> Signed-off-by: Victor Yanev <[email protected]> Co-authored-by: Victor Yanev <[email protected]> Co-authored-by: Logan Nguyen <[email protected]> Co-authored-by: Nana Essilfie-Conduah <[email protected]> Co-authored-by: Victor Yanev <[email protected]>
#3201) feat: Added ability to load spending plans from environment variable. (#3153) * feat: Added ability to load spening plans from environment variable. * feat: Now uses one property for either spending plan file or JSON content. fix: removed .only fix: Cleaned up file and env var evaluation. fix: Flaky unit test fix. feat: Refactored implementation and updated tests. * fix: Adding updated package-lock.json * fix: Updated global variable reference to the new HBAR_SPENDING_PLANS_CONFIG fix: Test fix. fix: Removed irrelevant test since we now use either env var or file for spending plan. fix: Updated HBAR_SPENDING_PLANS_CONFIG from HBAR_SPENDING_PLANS_CONFIG_FILE * fix: Clean up. Updated logging and appropriate tests. * fix: Replaced the useInMemoryRedisServer with the start and stop redis in the before and after mocha functions. * fix: Test fix. Added the envName back to the loggerService test. * Update docs/configuration.md * fix: Added back file not found tests. * fix: Updated file name in `withOverriddenEnvsInMochaTest` with existing file. * fix: Clear the spending plan repository in a test as in CI it seems to already be populated. fix: Cleanup. * fix: Added more time for the HBar Rate Limiter to update expenses in the background. * chore: divided hbar limtier tests into different batches * fix: Removed the clearing of the spending plans. * chore: divided hbar limtier tests into different batches (#3181) * chore: divided hbar limtier tests into different batches * fix: fixed acceptance.yml --------- * Update packages/relay/src/lib/config/hbarSpendingPlanConfigService.ts * fix: Restored class comments and corrected HBAR_SPENDING_PLAN_CONFIG. * test: fix hbarSpendingPlanConfigService.spec.ts * test: remove `.only` from `describe` * test: disconnect redis client after tests with shared cache --------- Signed-off-by: ebadiere <[email protected]> Signed-off-by: Eric Badiere <[email protected]> Signed-off-by: Logan Nguyen <[email protected]> Signed-off-by: Victor Yanev <[email protected]> Co-authored-by: Victor Yanev <[email protected]> Co-authored-by: Logan Nguyen <[email protected]> Co-authored-by: Nana Essilfie-Conduah <[email protected]> Co-authored-by: Victor Yanev <[email protected]>
This enhancement adds the ability to load HBar Rate Limiter spending plans from an environment variable.
Related issue(s):
Fixes #3152
Checklist