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

[Ingest Manager] Simplify createInstallation interface #83180

Merged
merged 1 commit into from
Nov 11, 2020

Conversation

jfsiii
Copy link
Contributor

@jfsiii jfsiii commented Nov 11, 2020

Summary

All internal changes. createInstallation has one caller (_installPackage) which doesn't use the return value.

Push the work from the caller into the function. Replace empty/unused return value with something more helpful, if still unused.

-    await createInstallation({
-      savedObjectsClient,
-      pkgName,
-      pkgVersion,
-      internal,
-      removable,
-      installed_kibana: [],
-      installed_es: [],
-      toSaveESIndexPatterns,
-      installSource,
-    });
+    await createInstallation({
+      savedObjectsClient,
+      packageInfo,
+      installSource,
+    });

Added comments next to code for more context

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Nov 11, 2020
@jfsiii jfsiii requested a review from skh November 11, 2020 15:55
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@jfsiii jfsiii requested a review from neptunian November 11, 2020 15:55
@jfsiii jfsiii self-assigned this Nov 11, 2020
@jfsiii jfsiii added release_note:skip Skip the PR/issue when compiling release notes v7.11 v8.0.0 labels Nov 11, 2020
installSource,
});
} else {
if (installedPkg) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Swapped the condition to avoid the double-negative (!!installedPkg)

Comment on lines -386 to +381
return [...installedKibana, ...installedEs];

return created;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I understand the existing code correctly (both reading & running with logging), we always passed empty arrays for the two installed* params. Which makes this [ ...[], ...[] ] or []

Even if they had values, rather than return the caller data they gave, return the result of the function.

The return value isn't used by the one caller so this is safe and unnoticed.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

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

@jfsiii jfsiii merged commit 2d3261f into elastic:master Nov 11, 2020
jfsiii pushed a commit to jfsiii/kibana that referenced this pull request Nov 11, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Nov 12, 2020
…ts-public

* upstream/master: (57 commits)
  Remove unused asciidoc file (elastic#83228)
  [Lens] Remove background from lens embeddable (elastic#83061)
  [Discover] Unskip flaky tests based on discover fixture index pattern (elastic#82991)
  Removing unnecessary trailing slash in CODEOWNERS
  Trying to fix CODEOWNERS again, where was a non-existent team prior (elastic#83236)
  Trying to fix CODEOWERS, missing a starting slash (elastic#83233)
  skip flaky suite (elastic#83231)
  Add enzyme rerender test helper (elastic#83208)
  Move Elasticsearch type definitions out of APM (elastic#83081)
  [ts/checkTsProjects] produce a more useful error message (elastic#83209)
  [kbnClient] retry updating config if necessary (elastic#83205)
  I accidentally removed this line in a recent PR (elastic#83201)
  Don't make the caller do work the function can do (elastic#83180)
  [App Search] Update EngineRouter & EngineNav to use EngineLogic (elastic#83138)
  [Workplace Search] Add routes for Sources (elastic#83125)
  Update logstash pipeline management to use system index APIs (elastic#80405)
  [ML] Replace EuiBasicTable with EuiInMemoryTable (elastic#83057)
  [Metrics UI] Add basic interaction and shell for node details overlay (elastic#82013)
  [App Search] Added the log retention confirmation modal to the Settings page (elastic#83009)
  [docs] Fix create map title in import geospatial page (elastic#83172)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants