Skip to content

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

Merged
dgieselaar merged 3 commits intoelastic:mainfrom
dgieselaar:observability-eslint-rules-update
Jun 8, 2024
Merged

Consolidate react-hooks/exhaustive-deps lint rules for O11y#184865
dgieselaar merged 3 commits intoelastic:mainfrom
dgieselaar:observability-eslint-rules-update

Conversation

@dgieselaar
Copy link
Copy Markdown
Contributor

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

@ghost
Copy link
Copy Markdown

ghost commented Jun 5, 2024

🤖 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
Copy Markdown
Contributor 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 a review from a team June 5, 2024 21:19
@dgieselaar dgieselaar requested review from a team as code owners June 5, 2024 21:19
@dgieselaar dgieselaar requested a review from a team June 5, 2024 21:19
@dgieselaar dgieselaar requested a review from a team as a code owner June 5, 2024 21:19
@dgieselaar
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:Obs AI Assistant Observability AI Assistant Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. labels Jun 6, 2024
@elasticmachine
Copy link
Copy Markdown
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
Copy Markdown
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.

overview?: boolean;
}) => {
const model = findInventoryModel('host');
const model = useMemo(() => findInventoryModel('host'), []);
Copy link
Copy Markdown
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?

seriesColor,
decimals: 1,
subtitle: getSubtitle(options, chart),
subtitle: getSubtitle ? getSubtitle(chart.value) : getSubtitleFromFormula(chart.value),
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
Contributor 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.

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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
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
@kibanamachine kibanamachine added v8.15.0 backport:skip This PR 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 PR 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 Observability AI Assistant Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. v8.15.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants