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

[Maps] convert SavedGisMap to TS #72286

Merged
merged 2 commits into from
Jul 17, 2020
Merged

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Jul 17, 2020

Breaking this out into a really small PR to isolate since some logic in injectReferences is removed. After a lot of github sleuthing, this logic is safe to remove. See inline comment for details.

@nreese nreese added chore [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.10.0 labels Jul 17, 2020
@nreese nreese requested a review from kindsun July 17, 2020 14:49
@nreese nreese requested a review from a team as a code owner July 17, 2020 14:49
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

.map((reference) => {
return reference.id;
});
savedObject.indexPatternIds = _.uniq(indexPatternIds);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

savedObject.indexPatternIds was added when MapEmbeddable was first introduced in https://github.com/elastic/kibana/pull/31473/files#diff-1bb10565f2889677ad2ded8210390726R50. At the time MapEmbeddableFactory used savedObject.indexPatternIds to obtain index patterns used by the map

#35542 changed the way MapEmbeddableFactory obtained indexPatternIds to pulling them from store, acb78a6#diff-e347d1b056afd109215cc604d63d4aefL47. However, that PR failed to clean up setting indexPatternIds on savedMap.

Since savedMap.indexPatternIds is no longer used, it is safe to remove this code

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / kibana-xpack-agent / X-Pack Alerting API Integration Tests.x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/alerts·ts.alerting api integration security and spaces enabled Alerts alerts space_1_all at space1 should schedule task, run alert and schedule actions when appropriate

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]       │
[00:00:00]         └-: alerting api integration security and spaces enabled
[00:00:00]           └-> "before all" hook
[00:00:00]           └-> "before all" hook
[00:00:00]             │ debg creating space
[00:00:01]             │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1594997999951697933] [ilm-history-2-000001] creating index, cause [api], templates [ilm-history], shards [1]/[0]
[00:00:01]             │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xl-1594997999951697933] moving index [ilm-history-2-000001] from [null] to [{"phase":"new","action":"complete","name":"complete"}] in policy [ilm-history-ilm-policy]
[00:00:01]             │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xl-1594997999951697933] current.health="GREEN" message="Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[ilm-history-2-000001][0]]])." previous.health="YELLOW" reason="shards started [[ilm-history-2-000001][0]]"
[00:00:01]             │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xl-1594997999951697933] moving index [ilm-history-2-000001] from [{"phase":"new","action":"complete","name":"complete"}] to [{"phase":"hot","action":"unfollow","name":"wait-for-indexing-complete"}] in policy [ilm-history-ilm-policy]
[00:00:01]             │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xl-1594997999951697933] moving index [ilm-history-2-000001] from [{"phase":"hot","action":"unfollow","name":"wait-for-indexing-complete"}] to [{"phase":"hot","action":"unfollow","name":"wait-for-follow-shard-tasks"}] in policy [ilm-history-ilm-policy]
[00:00:01]             │ debg created space
[00:00:01]             │ debg creating space
[00:00:02]             │ debg created space
[00:00:02]             │ debg creating space
[00:00:03]             │ debg created space
[00:00:03]             │ debg creating user no_kibana_privileges
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-18-tests-xl-1594997999951697933] added user [no_kibana_privileges]
[00:00:03]             │ debg created user no_kibana_privileges
[00:00:03]             │ debg creating role no_kibana_privileges
[00:00:03]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-18-tests-xl-1594997999951697933] added role [no_kibana_privileges]
[00:00:03]             │ debg creating user superuser
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-18-tests-xl-1594997999951697933] added user [superuser]
[00:00:03]             │ debg created user superuser
[00:00:03]             │ debg creating user global_read
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-18-tests-xl-1594997999951697933] added user [global_read]
[00:00:03]             │ debg created user global_read
[00:00:03]             │ debg creating role global_read_role
[00:00:03]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-18-tests-xl-1594997999951697933] added role [global_read_role]
[00:00:03]             │ debg creating user space_1_all
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-18-tests-xl-1594997999951697933] added user [space_1_all]
[00:00:03]             │ debg created user space_1_all
[00:00:03]             │ debg creating role space_1_all_role
[00:00:04]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-18-tests-xl-1594997999951697933] added role [space_1_all_role]
[00:02:55]           └-: Alerts
[00:02:55]             └-> "before all" hook
[00:10:39]             └-: alerts
[00:10:39]               └-> "before all" hook
[00:10:39]               └-> "before all" hook
[00:10:39]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1594997999951697933] [.kibana-alerting-test-data] creating index, cause [api], templates [], shards [1]/[1]
[00:10:39]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1594997999951697933] [.kibana-test-authorization] creating index, cause [api], templates [], shards [1]/[1]
[00:13:08]               └-: space_1_all at space1
[00:13:08]                 └-> "before all" hook
[00:13:08]                 └-> "before all" hook
[00:13:09]                 └-> should schedule task, run alert and schedule actions when appropriate
[00:13:09]                   └-> "before each" hook: global before each
[00:13:11]                   │ debg --- retry.try error: Expected 1 but received 0.
[00:13:11]                   │ debg --- retry.try failed again with the same message...
[00:13:11]                   │ proc [kibana]   log   [15:45:20.612] [info][eventLog][plugins] event logged: {"event":{"provider":"alerting","action":"execute","start":"2020-07-17T15:45:19.740Z","end":"2020-07-17T15:45:20.610Z","duration":870000000,"outcome":"success"},"kibana":{"saved_objects":[{"rel":"primary","type":"alert","id":"89f6d7ca-6979-4e02-9008-196340354ffb","namespace":"space1"}],"server_uuid":"5b2de169-2785-441b-ae8c-186a1936b17d"},"message":"alert executed: test.always-firing:89f6d7ca-6979-4e02-9008-196340354ffb: 'abc'","@timestamp":"2020-07-17T15:45:20.610Z","ecs":{"version":"1.5.0"}}
[00:13:11]                   │ proc [kibana]   log   [15:45:20.613] [info][eventLog][plugins] event logged: {"event":{"provider":"alerting","action":"new-instance"},"kibana":{"alerting":{"instance_id":"1"},"saved_objects":[{"rel":"primary","type":"alert","id":"89f6d7ca-6979-4e02-9008-196340354ffb","namespace":"space1"}],"server_uuid":"5b2de169-2785-441b-ae8c-186a1936b17d"},"message":"test.always-firing:89f6d7ca-6979-4e02-9008-196340354ffb: 'abc' created new instance: '1'","@timestamp":"2020-07-17T15:45:20.610Z","ecs":{"version":"1.5.0"}}
[00:13:12]                   │ debg --- retry.try failed again with the same message...
[00:13:12]                   │ proc [kibana]   log   [15:45:20.826] [info][eventLog][plugins] event logged: {"event":{"provider":"alerting","action":"execute-action"},"kibana":{"alerting":{"instance_id":"1"},"saved_objects":[{"rel":"primary","type":"alert","id":"89f6d7ca-6979-4e02-9008-196340354ffb","namespace":"space1"},{"type":"action","id":"449312ad-d672-46bc-96b0-2326bab2bb91","namespace":"space1"}],"server_uuid":"5b2de169-2785-441b-ae8c-186a1936b17d"},"message":"alert: test.always-firing:89f6d7ca-6979-4e02-9008-196340354ffb: 'abc' instanceId: '1' scheduled actionGroup: 'default' action: test.index-record:449312ad-d672-46bc-96b0-2326bab2bb91","@timestamp":"2020-07-17T15:45:20.824Z","ecs":{"version":"1.5.0"}}
[00:13:12]                   │ debg --- retry.try failed again with the same message...
[00:13:13]                   │ debg --- retry.try failed again with the same message...
[00:13:13]                   │ debg --- retry.try failed again with the same message...
[00:13:14]                   │ debg --- retry.try failed again with the same message...
[00:13:14]                   │ debg --- retry.try failed again with the same message...
[00:13:14]                   │ proc [kibana]   log   [15:45:23.631] [info][eventLog][plugins] event logged: {"event":{"provider":"actions","action":"execute","start":"2020-07-17T15:45:22.745Z","end":"2020-07-17T15:45:23.629Z","duration":884000000,"outcome":"success"},"kibana":{"saved_objects":[{"rel":"primary","type":"action","id":"449312ad-d672-46bc-96b0-2326bab2bb91","namespace":"space1"}],"server_uuid":"5b2de169-2785-441b-ae8c-186a1936b17d"},"message":"action executed: test.index-record:449312ad-d672-46bc-96b0-2326bab2bb91: My action","@timestamp":"2020-07-17T15:45:23.629Z","ecs":{"version":"1.5.0"}}
[00:13:15]                   │ debg --- retry.try error: Expected 0 non-idle tasks but received 1
[00:13:15]                   │ debg --- retry.try failed again with the same message...
[00:13:18]                   └- ✖ fail: alerting api integration security and spaces enabled Alerts alerts space_1_all at space1 should schedule task, run alert and schedule actions when appropriate
[00:13:18]                   │      Error: expected 'undefined' to equal 'number'
[00:13:18]                   │       at Assertion.assert (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:100:11)
[00:13:18]                   │       at Assertion.be.Assertion.equal (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:227:8)
[00:13:18]                   │       at Assertion.be (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:69:22)
[00:13:18]                   │       at validateEventLog (test/alerting_api_integration/security_and_spaces/tests/alerting/alerts.ts:973:32)
[00:13:18]                   │ 
[00:13:18]                   │ 

Stack Trace

Error: expected 'undefined' to equal 'number'
    at Assertion.assert (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:100:11)
    at Assertion.be.Assertion.equal (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:227:8)
    at Assertion.be (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:69:22)
    at validateEventLog (test/alerting_api_integration/security_and_spaces/tests/alerting/alerts.ts:973:32)

Build metrics

async chunks size

id value diff baseline
maps 3.8MB +159.0B 3.8MB

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


getFullPath() {
return getExistingMapPath(this.id);
this.getFullPath = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this function getting created in the constructor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

typescripting. Something about functional method versus prototypemethod.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds related to the fact that it's now an arrow function. Does it need to be? It doesn't look like this PR changes any calls to it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for typescripting purposes, yes. I had to copy what SavedDashboard was doing to get TS to be happy.

@nreese nreese requested a review from kindsun July 17, 2020 20:48
Copy link
Contributor

@kindsun kindsun left a comment

Choose a reason for hiding this comment

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

lgtm! thanks for the conversion

  • code review

@nreese nreese merged commit dc7db09 into elastic:master Jul 17, 2020
nreese added a commit to nreese/kibana that referenced this pull request Jul 17, 2020
* [Maps] convert SavedGisMap to TS

* i18n translate new map title
nreese added a commit that referenced this pull request Jul 18, 2020
* [Maps] convert SavedGisMap to TS

* i18n translate new map title
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jul 20, 2020
* master:
  [Observability] Remove app logos (elastic#72259)
  Fix float percentiles line chart (elastic#71902)
  update chromedriver to 84 (elastic#72228)
  [esArchiver] actually re-delete the .kibana index if we lose recreate race (elastic#72354)
  [Maps] convert SavedGisMap to TS (elastic#72286)
  [DOCS] Removes occurrences of X-Pack Security and Reporting (elastic#72302)
  use WORKSPACE env var for stack_functional_integration tests, fix navigate path (elastic#71908)
  [Monitoring] Fix issue with ES node detail status (elastic#72298)
  [SIEM] Updates consumer in export_rule archive (elastic#72324)
  [kbn/dev-utils] add RunWithCommands utility (elastic#72311)
  [Security Solution][Endpoint][Exceptions] Only write manifest to policy when there are changes (elastic#72000)
  skip flaky suite (elastic#72339)
  [ML] Fix annotations pagination & change labels from letters to numbers (elastic#72204)
  [Lens] Fix switching with layers (elastic#71982)
  [Maps] 7.9 documenation updates (elastic#71893)
  docs: ✏️ add "Explore underlying data" user docs (elastic#70807)
  [Security Solution][Exceptions] - Remove initial add exception item button in builder (elastic#72215)
  Fix indentation level in code exploration doc (elastic#72274)
  register graph usage (elastic#72041)
  [Monitoring] Added a case for Alerting if security/ssl is disabled (elastic#71846)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation release_note:skip Skip the PR/issue when compiling release notes v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants