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

[Tech Debt] Use consts for routes #160521

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

CoenWarmer
Copy link
Contributor

Resolves #158146

Summary

This consolidates the route configuration of the Observability app.

Changes:

  • Moves /config/paths.ts to /routes/paths.ts so they are closer together;
  • Renames /routes/index.tsx to /routes/routes.tsx;
  • reuses same consts for route path names everywhere (Locators, plugin.ts, etc)

@CoenWarmer CoenWarmer requested a review from a team as a code owner June 26, 2023 13:53
@CoenWarmer CoenWarmer added the backport:skip This commit does not require backporting label Jun 26, 2023
@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@CoenWarmer CoenWarmer added release_note:skip Skip the PR/issue when compiling release notes and removed backport:skip This commit does not require backporting labels Jun 26, 2023
@CoenWarmer CoenWarmer force-pushed the chore/refactor-route-consts branch 2 times, most recently from fa96b3d to 65066e2 Compare June 26, 2023 14:20
@CoenWarmer CoenWarmer force-pushed the chore/refactor-route-consts branch from 65066e2 to ec563a8 Compare June 26, 2023 14:46
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
observability 519 518 -1

Async chunks

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

id before after diff
observability 1.0MB 1.0MB -2.2KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
observability 70.4KB 71.4KB +1.0KB
Unknown metric groups

API count

id before after diff
observability 527 526 -1

ESLint disabled line counts

id before after diff
enterpriseSearch 14 16 +2
securitySolution 416 420 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 15 17 +2
securitySolution 497 501 +4
total +6

History

  • 💔 Build #138127 failed 65066e24dce3e82344531e0825d10bea79a59bdb
  • 💔 Build #138113 failed fa96b3d57ec98b9fbbf79139e7d96f6126a8a28a

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

Copy link
Member

@maryam-saeidi maryam-saeidi left a comment

Choose a reason for hiding this comment

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

Overall LGTM!

Added one question

features={{ alerts: { sync: false, isExperimental: false } }}
owner={[observabilityFeatureId]}
permissions={permissions}
ruleDetailsNavigation={{
href: (ruleId) => prepend(paths.observability.ruleDetails(ruleId)),
href: (ruleId) => prepend(paths.observability.ruleDetails(ruleId || '')),
Copy link
Member

@maryam-saeidi maryam-saeidi Jun 27, 2023

Choose a reason for hiding this comment

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

Question: What will happen in case of not having a ruleId? Will we show an error on the page?

I wonder why we didn't need to have this before.

Copy link
Contributor Author

@CoenWarmer CoenWarmer Jun 27, 2023

Choose a reason for hiding this comment

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

Previously, in /config/paths.ts, we had:

   ...
   ruleDetails: (ruleId?: string | null) =>
      ruleId ? `${RULES_PAGE_LINK}/${encodeURI(ruleId)}` : RULES_PAGE_LINK,
   ...

This has now made more strict as well as consistent with the other details pages (Alert, SLO):

    ruleDetails: (ruleId: string) => `${OBSERVABILITY_BASE_PATH}${RULES_PATH}/${encodeURI(ruleId)}`,

Copy link
Member

Choose a reason for hiding this comment

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

What will show in this case for rule details if there is no ruleId?

@CoenWarmer CoenWarmer requested a review from maryam-saeidi June 27, 2023 13:21
@CoenWarmer CoenWarmer merged commit 5c397fb into elastic:main Jun 27, 2023
@kibanamachine kibanamachine added v8.10.0 backport:skip This commit does not require backporting labels Jun 27, 2023
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 v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consolidate route configuration
5 participants