Skip to content
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

[Actionable Observability] update alerts table rule details link to point to o11y rule detail page #132479

Merged
merged 10 commits into from
May 19, 2022

Conversation

mgiota
Copy link
Contributor

@mgiota mgiota commented May 18, 2022

Fixes #132389

@mgiota mgiota requested a review from a team as a code owner May 18, 2022 21:00
@mgiota mgiota changed the title update alerts table rule details link to point to o11y rule detail page [Actionable Observability] update alerts table rule details link to point to o11y rule detail page May 18, 2022
@mgiota mgiota self-assigned this May 18, 2022
@mgiota mgiota added Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" v8.3.0 release_note:skip Skip the PR/issue when compiling release notes labels May 18, 2022
@mgiota mgiota force-pushed the 132389_rule_details_o11y_link branch from 27935b9 to 400c613 Compare May 18, 2022 21:28
@@ -223,7 +223,9 @@ export default ({ getService }: FtrProviderContext) => {
const actionsButton = await observability.alerts.common.getActionsButtonByIndex(0);
await actionsButton.click();
await observability.alerts.common.viewRuleDetailsButtonClick();
expect(await find.existsByCssSelector('[title="Rules and Connectors"]')).to.eql(true);
expect(await find.existsByCssSelector('[data-test-subj="ruleDetailPageTitle"]')).to.eql(
Copy link
Contributor Author

@mgiota mgiota May 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fkanout Currently there's a problem with current test which keeps failing because as you can see in the screenshot rule is undefined (you can even see it in the breadcrumb) and rule details page can not be loaded.
Here's where rule is undefined https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability/public/pages/rule_details/index.tsx#L201. Stack Management Rule details page is getting the rule as param https://github.com/elastic/kibana/blob/main/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details.tsx#L76 and I guess that's why the old rule detail page loads in the tests without issues. This refactoring is out of scope of this issue. How do you suggest we proceed with this failing test?

Screenshot 2022-05-19 at 08 43 03

Copy link
Contributor Author

@mgiota mgiota May 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively I could assert in my test if the page title contains Rules - Alerts - Observability, or even check the rendered breadcrumb if it contains Observability. What do you think? All we want to check with this test, is that it goes to the new Obsservability rule detail page and not the old Rules and Connectors page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just pushed a fix that checks if Observability is in the breadcrumb 1f94a1f#diff-5a75bdfd91813e385e6c322eed601a2fd55d34f4a56b7669b0bb193014df1648R226

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgiota, I think this ok for the purpose of this test and in the scope of this PR.

@mgiota mgiota requested a review from fkanout May 19, 2022 07:00
Copy link
Contributor

@fkanout fkanout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tested, and it worked as expected. Thank you for spotting the need for these changes!
One suggestion about using the URL var instead of the hardcoded one

@@ -8,6 +8,7 @@
export const paths = {
observability: {
alerts: '/app/observability/alerts',
ruleDetails: (ruleId: string) => `/app/observability/alerts/rules/${encodeURI(ruleId)}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep great suggestion! I'll change it

const linkToRule = ruleId && prepend ? prepend(paths.management.ruleDetails(ruleId)) : null;

const linkToRule =
ruleId && prepend ? prepend(`/app/observability/alerts/rules/${ruleId}`) : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@mgiota mgiota May 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fkanout I'll move your variables in the paths file, which is a common place in observability plugin and refactor accordingly

@mgiota mgiota force-pushed the 132389_rule_details_o11y_link branch from 6952f3c to b4e82ef Compare May 19, 2022 13:27
@mgiota
Copy link
Contributor Author

mgiota commented May 19, 2022

I moved the variables in the common paths file and I refactored following places to make use of it in following places:

  • rule details link in alerts table
  • rule details link in alerts flyout
  • rules details link in rules page
  • rules link and alerts link in rule details page

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #2 / lens app - group 1 lens query context keeps time range and pinned filters after refreshing directly after saving

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observability 452.0KB 452.1KB +192.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @mgiota

@mgiota mgiota merged commit 483cc45 into elastic:main May 19, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label May 19, 2022
@mgiota mgiota deleted the 132389_rule_details_o11y_link branch September 29, 2023 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Actionable Observability] Rule details link in Alerts table should link to the new o11y rule details page
4 participants