-
Notifications
You must be signed in to change notification settings - Fork 15
Replace partial name lookup with regex-based service queries #1294
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,8 +8,8 @@ let sortedHostNames: string[]; | |
| pmmTest.beforeEach(async ({ api, grafanaHelper, page, queryAnalytics }) => { | ||
| await grafanaHelper.authorize(); | ||
|
|
||
| const service1 = await api.inventoryApi.getServiceDetailsByPartialName('rs101'); | ||
| const service2 = await api.inventoryApi.getServiceDetailsByPartialName('rs102'); | ||
| const service1 = await api.inventoryApi.getServiceDetailsByRegex('^rs101_'); | ||
| const service2 = await api.inventoryApi.getServiceDetailsByRegex('^rs102_'); | ||
|
Comment on lines
+11
to
+12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 The service name is always The env var added to the post-client-upgrade step is the change that does something — |
||
|
|
||
| sortedHostNames = [service1.service_name, service2.service_name].sort(); | ||
|
|
||
|
|
||
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.
🟡 Switching to
getServiceDetailsByRegexdrops the "service is not present" error, because that path's guard is broken:getAllServiceDetailsByRegex(e2e_tests/api/inventory.api.ts:14) checksif (!service)on the result of.filter(), and an empty array is truthy — so it never throws andgetServiceDetailsByRegexreturnsundefined.getServiceDetailsByPartialNameused.find()and did throwService with name rs101 is not present. After this change, an environment where the mongo services never registered fails withTypeError: Cannot read properties of undefined (reading 'service_id')on the next line instead — exactly the failure mode this PR is trying to diagnose in the post-client-upgrade step, now with a worse message. Same for the other seven call sites in this PR.Fix the guard in
inventory.api.ts(if (!service.length) throw ...) as part of this PR, since the diff is what makes the RTA tests depend on it.