-
Notifications
You must be signed in to change notification settings - Fork 585
Pr 3002 #3058
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
base: main
Are you sure you want to change the base?
Pr 3002 #3058
Conversation
This commit updates the Deep Dependency Graph UI logic to use the correct backend API endpoint for fetching data. Resolves [#6606](jaegertracing/jaeger#6606). Part of [#7399](jaegertracing/jaeger#7399). Signed-off-by: Sujal Shah <sujalshah28092004@gmail.com>
Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
@@ -81,7 +81,7 @@ function getJSON(url, options = {}) { | |||
} | |||
|
|||
export const DEFAULT_API_ROOT = prefixUrl('/api/'); | |||
export const ANALYTICS_ROOT = prefixUrl('/analytics/'); | |||
export const DEEP_DEPENDENCIES_ROOT = prefixUrl(getConfig().deepDependencies?.apiEndpoint); |
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.
Use of ? indicates the value might be null, why should it be allowed?
@@ -195,6 +195,8 @@ export type Config = { | |||
|
|||
deepDependencies?: { |
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.
I understand you're just copying preexisting pattern, but I wonder why these need to be optional if our default config will always overwrite them if not defined? It seems not using optional will make the rest of the code simpler.
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.
Pull Request Overview
This PR configures the Deep Dependencies API endpoint to use a new configurable path instead of the hardcoded analytics endpoint. The default endpoint is changed from /analytics/v1/deep-dependencies
to /api/deep-dependencies
to align with backend changes that provide dummy data for this endpoint.
- Adds configurable
apiEndpoint
andmenuLabel
options to thedeepDependencies
configuration - Updates the default configuration to use
/api/deep-dependencies
as the new endpoint - Refactors the API implementation to use the configurable endpoint instead of hardcoded analytics path
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/jaeger-ui/src/types/config.tsx | Adds type definitions for new configurable deep dependencies options |
packages/jaeger-ui/src/constants/default-config.tsx | Sets default values for the new deep dependencies configuration |
packages/jaeger-ui/src/api/jaeger.js | Updates API implementation to use configurable endpoint instead of hardcoded analytics path |
packages/jaeger-ui/src/api/jaeger.test.js | Updates test to reflect the new endpoint constant name |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@@ -81,7 +81,7 @@ function getJSON(url, options = {}) { | |||
} | |||
|
|||
export const DEFAULT_API_ROOT = prefixUrl('/api/'); | |||
export const ANALYTICS_ROOT = prefixUrl('/analytics/'); | |||
export const DEEP_DEPENDENCIES_ROOT = prefixUrl(getConfig().deepDependencies?.apiEndpoint); |
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.
The getConfig().deepDependencies?.apiEndpoint
could be undefined if the configuration is not properly initialized, which would cause prefixUrl(undefined)
to be called. This should have a fallback value or be wrapped in a function to ensure the config is available when accessed.
export const DEEP_DEPENDENCIES_ROOT = prefixUrl(getConfig().deepDependencies?.apiEndpoint); | |
export const DEEP_DEPENDENCIES_ROOT = prefixUrl(getConfig().deepDependencies?.apiEndpoint || '/api/dependencies'); |
Copilot uses AI. Check for mistakes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3058 +/- ##
=======================================
Coverage 98.13% 98.13%
=======================================
Files 257 257
Lines 8004 8004
Branches 2014 2014
=======================================
Hits 7855 7855
Misses 149 149 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Which problem is this PR solving?
Extends #3002
Previously Deep Dependencies view was always using /analytics/v1/deep-dependencies API endpoint to retrieve the data. Now this endpoint is configurable via UI config, but the default is changed to /api/deep-dependencies to match the change in the backend jaegertracing/jaeger#6606 that returns dummy data for said endpoint.
Part of jaegertracing/jaeger#7399.
Description of the changes
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test