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

[ML] Server info service refactor #50302

Merged
merged 7 commits into from
Nov 13, 2019

Conversation

jgowdyelastic
Copy link
Member

Removes new_job_defaults.ts in favour of /services/ml_server_info
renames the function loadNewJobDefaults to loadMlServerInfo as more than just new job defaults are being loaded.
new_job_defaults was being deep linked to from other files, so it's best that it's moved to a common location. it also makes sense that the cloud checks to added to this file.

This PR contains the refactoring part from #49861 which were originally dropped to avoid unnecessary churn in #50139

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@jgowdyelastic jgowdyelastic added review non-issue Indicates to automation that a pull request should not appear in the release notes :ml v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.6.0 labels Nov 12, 2019
@jgowdyelastic jgowdyelastic requested a review from a team as a code owner November 12, 2019 13:14
@jgowdyelastic jgowdyelastic self-assigned this Nov 12, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

id="xpack.ml.jobsList.nodeAvailableWarning.noMLNodesAvailableDescription"
defaultMessage="There are no ML nodes available."
/>
<br />
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use div instead of br after inline elements?


describe('ml_server_info', () => {
beforeEach(async done => {
await loadMlServerInfo();
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it makes sense to move jest.mock for mlInfo here

Comment on lines 36 to 39
it('can get could deployment id', async done => {
expect(isCloud()).toBe(true);
expect(cloudDeploymentId()).toBe('85d666f3350c469e8c3242d76a7f459c');
done();
Copy link
Contributor

Choose a reason for hiding this comment

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

there is no async code inside

}

const id = cloudDeploymentId();
Copy link
Contributor

Choose a reason for hiding this comment

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

getCloudDeploymentId? 👀

Copy link
Member Author

@jgowdyelastic jgowdyelastic Nov 12, 2019

Choose a reason for hiding this comment

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

i purposely left this change as every function in this service except loadMlServerInfo is a getter and changing one would mean i'd need to change all and that would be a lot of churn.
Does anyone else have an opinion on this? I don't mind changing all, it'd just touch a lot of files.

Copy link
Member Author

Choose a reason for hiding this comment

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

added getter renaming changes to this PR as all files which use the functions have already been touched for the include path change

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

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

LGTM, in the long run I think I'd prefer getCloudDeploymentId() but maybe it's better to do that rename in a dedicated PR.

@jgowdyelastic
Copy link
Member Author

thinking about it, changing the names of these functions won't touch any additional files because i've already had to update all of the include paths to ml_server_info
so i'll add the renaming to this PR

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

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

LGTM ⚡️

@jgowdyelastic
Copy link
Member Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jgowdyelastic jgowdyelastic merged commit 167dd7f into elastic:master Nov 13, 2019
@jgowdyelastic jgowdyelastic deleted the server-info-refactor branch November 13, 2019 11:05
jgowdyelastic added a commit to jgowdyelastic/kibana that referenced this pull request Nov 13, 2019
* [ML] Server info service refactor

* removing new job defaults

* changes based on review

* renaming all ml server info getter functions

* missed a file
jloleysens added a commit to jloleysens/kibana that referenced this pull request Nov 13, 2019
…ger-ace-theme

* 'master' of github.com:elastic/kibana: (56 commits)
  [ML] Server info service refactor (elastic#50302)
  Remove internal platform types exports (elastic#50427)
  [APM] Document `apm_oss.metricsIndices` and `apm_oss.sourcemap… (elastic#50312)
  [Telemetry] Server side fetcher (elastic#50015)
  [SIEM] Detection engine placeholders (elastic#50220)
  [Uptime] Donut chart loader position centered vertically  (elastic#50219)
  update telemetry banner notice text (elastic#50403)
  Fix aborting when searching without batching (elastic#49966)
  [Telemetry] Remove telemetry splash page and add conditional messaging (elastic#50189)
  Revert chromedriver update (elastic#50324)
  Remove deprecated argument include_type_name from ES calls (elastic#50285)
  [Maps] add settings to maps telemetry (elastic#50161)
  remove visualize loader (elastic#46910)
  Fix misuse of react-router and react-router-dom (elastic#50120)
  Move table-list-view to kibana-react (elastic#50046)
  [ML] Stats bar for data frame analytics (elastic#49464)
  [ML] Make navigation in tests more stable (elastic#50132)
  Migrate authorization subsystem to the new platform.  (elastic#46145)
  Bugfix: Interpreter conversion of string to number should throw on NaN elastic#27788 (elastic#50063)
  Update dependency @elastic/charts to v14 (elastic#49947)
  ...
jgowdyelastic added a commit that referenced this pull request Nov 13, 2019
* [ML] Server info service refactor

* removing new job defaults

* changes based on review

* renaming all ml server info getter functions

* missed a file
chrisronline pushed a commit to chrisronline/kibana that referenced this pull request Nov 14, 2019
* [ML] Server info service refactor

* removing new job defaults

* changes based on review

* renaming all ml server info getter functions

* missed a file
jgowdyelastic added a commit to jgowdyelastic/kibana that referenced this pull request Dec 4, 2019
* [ML] Server info service refactor

* removing new job defaults

* changes based on review

* renaming all ml server info getter functions

* missed a file
jgowdyelastic added a commit that referenced this pull request Dec 4, 2019
* [ML] Server info service refactor

* removing new job defaults

* changes based on review

* renaming all ml server info getter functions

* missed a file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:ml non-issue Indicates to automation that a pull request should not appear in the release notes release_note:skip Skip the PR/issue when compiling release notes review v7.5.1 v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants