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

Consolidate react-hooks/exhaustive-deps lint rules for O11y #184865

Merged

Conversation

dgieselaar
Copy link
Member

Use one react-hooks/exhaustive-deps across our Obs plugins, for consistency reasons.

@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 docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@dgieselaar dgieselaar force-pushed the observability-eslint-rules-update branch from 50be82f to 7bdf023 Compare June 5, 2024 18:35
@dgieselaar
Copy link
Member Author

/ci

@dgieselaar dgieselaar force-pushed the observability-eslint-rules-update branch from 7bdf023 to 8ab5a41 Compare June 5, 2024 21:17
@dgieselaar dgieselaar marked this pull request as ready for review June 5, 2024 21:19
@dgieselaar dgieselaar requested review from a team as code owners June 5, 2024 21:19
@dgieselaar
Copy link
Member Author

@elasticmachine merge upstream

@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:Obs AI Assistant Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team labels Jun 6, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@dgieselaar dgieselaar added the release_note:skip Skip the PR/issue when compiling release notes label Jun 6, 2024
Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

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

LGTM. Just a few questions.

}) => {
const model = findInventoryModel('host');
const model = useMemo(() => findInventoryModel('host'), []);
Copy link
Contributor

Choose a reason for hiding this comment

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

could we move this into useAsync instead?

decimals: 1,
subtitle: getSubtitle(options, chart),
subtitle: getSubtitle ? getSubtitle(chart.value) : getSubtitleFromFormula(chart.value),
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 !

Comment on lines 37 to 41
// FIXME: this should be memoized upstream, but Dario
// cannot find a reasonable fix, so he'll just leave
// this in place.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [params.chartType, params.dataset, dataViews, lens]);
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: dgieselaar#56

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks for this!

[apiKeyEncoded, onboardingId, installShipperSetupStatus === FETCH_STATUS.SUCCESS]
// FIXME: Dario could not find a reasonable fix for successfullyInstalledShipperSetup
// eslint-disable-next-line react-hooks/exhaustive-deps
[apiKeyEncoded, onboardingId, successfullyInstalledShipperSetup]
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't it stop complaining if you add successfullyInstalledShipperSetup to the if inside this useFetcher?

Copy link
Member Author

Choose a reason for hiding this comment

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

nah, it will then complain that it's not in the list of dependencies - it's a behavioral change as well which I would like to avoid to some extent.

@@ -24,14 +24,17 @@ export const PolicyLink = ({ name }: { name: string }) => {

const { data } = useFetcher(async () => {
return ilmLocator?.getLocation({ page: 'policy_edit', policyName: name });
// FIXME: Dario thinks there is a better way to do this but
// he's getting tired and maybe the Synthetics folks can fix it
Copy link
Contributor

Choose a reason for hiding this comment

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

😆 !

@kibana-ci
Copy link
Collaborator

kibana-ci commented Jun 6, 2024

💛 Build succeeded, but was flaky

Failed CI Steps

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
infra 1.5MB 1.5MB -510.0B
observabilityAIAssistantApp 152.8KB 152.8KB +20.0B
observabilityOnboarding 198.7KB 198.7KB +8.0B
synthetics 1.0MB 1.0MB +169.0B
total -313.0B

Canvas Sharable Runtime

The Canvas "shareable runtime" is an bundle produced to enable running Canvas workpads outside of Kibana. This bundle is included in third-party webpages that embed canvas and therefor should be as slim as possible.

id before after diff
module count - 5499 +5499
total size - 8.9MB +8.9MB
Unknown metric groups

ESLint disabled line counts

id before after diff
observabilityOnboarding 9 14 +5
observabilityShared 14 15 +1
synthetics 72 84 +12
uptime 37 45 +8
total +26

Total ESLint disabled count

id before after diff
observabilityOnboarding 13 18 +5
observabilityShared 14 15 +1
synthetics 79 91 +12
uptime 41 49 +8
total +26

History

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

Copy link
Contributor

@achyutjhunjhunwala achyutjhunjhunwala left a comment

Choose a reason for hiding this comment

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

LGTM, Though

I tried removing all your comments in the file x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/custom_logs/install_elastic_agent.tsx. and ran

node scripts/type_check.js --project /Users/achyutjhunjhunwala/Workspace/tug_kibana/kibana/x-pack/plugins/observability_solution/observability_onboarding/tsconfig.json

It gave no errors

@dgieselaar
Copy link
Member Author

@achyutjhunjhunwala you're running a type check 😄 this is a lint rule

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

LGTM

@dgieselaar dgieselaar merged commit 5381dd7 into elastic:main Jun 8, 2024
24 checks passed
@kibanamachine kibanamachine added v8.15.0 backport:skip This commit does not require backporting labels Jun 8, 2024
eokoneyo pushed a commit to eokoneyo/kibana that referenced this pull request Jun 13, 2024
…184865)

Use one react-hooks/exhaustive-deps across our Obs plugins, for
consistency reasons.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:review backport:skip This commit does not require backporting ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:Obs AI Assistant Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants