fix: update performance tests counter to use camelCase API Key#7870
Open
Sumedh-6504 wants to merge 3 commits into
Open
fix: update performance tests counter to use camelCase API Key#7870Sumedh-6504 wants to merge 3 commits into
Sumedh-6504 wants to merge 3 commits into
Conversation
Signed-off-by: Sumedh-6504 <sumedhrmundewadi@gmail.com>
Contributor
Author
|
@rishiraj38 @KatalKavya96 The reason behind that I could not make a video is this, http://localhost:8000 is restricted from the CORS. So now you can actually review the code change. |
Contributor
|
🚀 Preview deployment: https://layer5.io/pr-preview/pr-7870/
|
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.
Description
This PR fixes #7860
Notes for Reviewers
Description
Fixes the performance test run counters displaying as
0across several pages (Meshery page, Nighthawk page, etc.) due to an API response key mismatch. Additionally resolves an ESLint warning insistent-component.jsthat was blocking the pre-commit checks.Root Cause
https://cloud.layer5.io/api/performance/results/totalreturns{"totalRuns": 160375}. However, the components were expectingresult.total_runs(snake_case) instead ofresult.totalRuns(camelCase). Since the snake_case key was undefined, the counter fell back to the initial state of0.isDarkdeclared but never used insistent-component.js) which blocked the pre-commit hooks due to--max-warnings=0constraints.Changes Made
src/sections/Counters/index.js— Updated key parsing to supporttotalRuns || total_runsand added a.catch()block with error logging.src/sections/Meshery/How-meshery-works/specs/data-card.js— Updated key parsing and added error handling (rendered on/cloud-native-management/meshery).src/sections/Projects/Nighthawk/index.js— Updated key parsing and added error handling (rendered on/projects/nighthawk).src/sections/Meshery/Features-Col/index.js— Updated key parsing and changedconsole.logtoconsole.errorin the catch block for consistency.src/templates/sistent-component.js— Removed the unusedisDarkvariable and its unused import to satisfy ESLint constraints and allow pre-commit hooks to pass successfully.Local Testing & CORS Restriction
Important
The performance test run count will still show
0(or log a CORS warning) onlocalhost:8000. The API endpoint restricts CORS requests to the production origin (layer5.io), meaning the browser blocks network requests originating from localhost. The fix is verified to match the production API payload structure and will render correctly once deployed to the production or preview environment.Screenshots
Signed commits