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

[Canvas] Extract and inject references for by-value embeddables #115124

Merged

Conversation

cqliu1
Copy link
Contributor

@cqliu1 cqliu1 commented Oct 15, 2021

Summary

Blocked by #113194.

This uses the Embeddable Persistable State Service to extract/inject references for by-value embeddables in the embeddable function.

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@cqliu1 cqliu1 added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:medium Medium Level of Effort Feature:Canvas labels Oct 15, 2021
@cqliu1 cqliu1 force-pushed the canvas/by-value-embeddables branch from 2030a15 to afea023 Compare October 15, 2021 17:33
@cqliu1 cqliu1 force-pushed the canvas/by-value-references branch from e4ae94d to cfd82be Compare October 15, 2021 17:35
@cqliu1 cqliu1 force-pushed the canvas/by-value-embeddables branch from afea023 to 6b2bc48 Compare October 15, 2021 19:47
@cqliu1 cqliu1 force-pushed the canvas/by-value-references branch from cfd82be to fc41b40 Compare October 15, 2021 19:48
@cqliu1 cqliu1 force-pushed the canvas/by-value-references branch 2 times, most recently from 320e58c to 98a4faf Compare October 15, 2021 22:55
@cqliu1 cqliu1 force-pushed the canvas/by-value-embeddables branch from 6b2bc48 to 196b94d Compare October 18, 2021 17:08
@cqliu1 cqliu1 force-pushed the canvas/by-value-references branch from 98a4faf to bd12f1f Compare October 19, 2021 16:00
@cqliu1 cqliu1 force-pushed the canvas/by-value-embeddables branch from 7557017 to f8dbcaf Compare October 19, 2021 16:00
@cqliu1 cqliu1 force-pushed the canvas/by-value-references branch from bd12f1f to 2e57111 Compare October 19, 2021 21:56
@cqliu1 cqliu1 force-pushed the canvas/by-value-embeddables branch from f8dbcaf to 34831c5 Compare October 19, 2021 22:18
@cqliu1 cqliu1 force-pushed the canvas/by-value-references branch from 2e57111 to c9dfc60 Compare October 19, 2021 22:20
@kibanamachine
Copy link
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

History

  • 💔 Build #162982 failed 2e57111cd4d17dc8252859c5537b02232e0f23fd
  • 💔 Build #162994 failed c9dfc609722f3cd5e0f1205092e967fc2887c48f
  • 💔 Build #162801 failed bd12f1f62a0ab49e620dae6f1653007ad38a7358
  • 💔 Build #161687 failed 2e53041435fd2d09f3531a53061271477ca0da51
  • 💔 Build #161723 failed 98a4faf9444d6df001a2fa0abd41b8aeb488f3c8

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

@kibanamachine
Copy link
Contributor

kibanamachine commented Oct 19, 2021

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / jest / Jest Tests.x-pack/plugins/canvas/storybook.Storyshots components/WorkpadHeader/EditorMenu default

Link to Jenkins

Standard Out

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


Stack Trace

Error: expect(received).toMatchSnapshot()

Snapshot name: `Storyshots components/WorkpadHeader/EditorMenu default 1`

- Snapshot
+ Received

@@ -27,11 +27,11 @@
            size="m"
          />
          <span
            className="euiButton__text"
          >
-           All types
+           Select type
          </span>
        </span>
      </button>
    </div>
  </div>
    at test (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/canvas/storybook/storyshots.test.tsx:112:22)

Kibana Pipeline / jest / Jest Tests.x-pack/plugins/canvas/storybook.Storyshots components/WorkpadHeader/EditorMenu dark mode

Link to Jenkins

Standard Out

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


Stack Trace

Error: expect(received).toMatchSnapshot()

Snapshot name: `Storyshots components/WorkpadHeader/EditorMenu dark mode 1`

- Snapshot
+ Received

@@ -27,11 +27,11 @@
            size="m"
          />
          <span
            className="euiButton__text"
          >
-           All types
+           Select type
          </span>
        </span>
      </button>
    </div>
  </div>
    at test (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/canvas/storybook/storyshots.test.tsx:112:22)

Kibana Pipeline / general / X-Pack API Integration Tests.x-pack/test/api_integration/apis/security_solution/tls·ts.apis SecuritySolution Endpoints Tls Test with Packetbeat Tls Overview Test Ensure data is returned for FlowTarget.Destination

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 2 times on tracked branches: https://github.com/elastic/kibana/issues/108640

[00:00:00]     │
[00:00:00]       └-: apis
[00:00:00]         └-> "before all" hook in "apis"
[00:07:54]         └-: SecuritySolution Endpoints
[00:07:54]           └-> "before all" hook in "SecuritySolution Endpoints"
[00:09:48]           └-: Tls Test with Packetbeat
[00:09:48]             └-> "before all" hook in "Tls Test with Packetbeat"
[00:09:48]             └-: Tls Overview Test
[00:09:48]               └-> "before all" hook for "Ensure data is returned for FlowTarget.Source"
[00:09:48]               └-> "before all" hook for "Ensure data is returned for FlowTarget.Source"
[00:09:48]                 │ info [x-pack/test/functional/es_archives/packetbeat/tls] Loading "mappings.json"
[00:09:48]                 │ info [x-pack/test/functional/es_archives/packetbeat/tls] Loading "data.json.gz"
[00:09:48]                 │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [packetbeat-7.6.0-2020.03.03-000001] creating index, cause [api], templates [], shards [1]/[1]
[00:09:48]                 │ info [x-pack/test/functional/es_archives/packetbeat/tls] Created index "packetbeat-7.6.0-2020.03.03-000001"
[00:09:48]                 │ debg [x-pack/test/functional/es_archives/packetbeat/tls] "packetbeat-7.6.0-2020.03.03-000001" settings {"index":{"lifecycle":{"indexing_complete":"true","name":"packetbeat","rollover_alias":"packetbeat-7.6.0"},"mapping":{"total_fields":{"limit":"10000"}},"number_of_replicas":"1","number_of_shards":"1","query":{"default_field":["message","tags","agent.ephemeral_id","agent.id","agent.name","agent.type","agent.version","as.organization.name","client.address","client.as.organization.name","client.domain","client.geo.city_name","client.geo.continent_name","client.geo.country_iso_code","client.geo.country_name","client.geo.name","client.geo.region_iso_code","client.geo.region_name","client.mac","client.registered_domain","client.top_level_domain","client.user.domain","client.user.email","client.user.full_name","client.user.group.domain","client.user.group.id","client.user.group.name","client.user.hash","client.user.id","client.user.name","cloud.account.id","cloud.availability_zone","cloud.instance.id","cloud.instance.name","cloud.machine.type","cloud.provider","cloud.region","container.id","container.image.name","container.image.tag","container.name","container.runtime","destination.address","destination.as.organization.name","destination.domain","destination.geo.city_name","destination.geo.continent_name","destination.geo.country_iso_code","destination.geo.country_name","destination.geo.name","destination.geo.region_iso_code","destination.geo.region_name","destination.mac","destination.registered_domain","destination.top_level_domain","destination.user.domain","destination.user.email","destination.user.full_name","destination.user.group.domain","destination.user.group.id","destination.user.group.name","destination.user.hash","destination.user.id","destination.user.name","dns.answers.class","dns.answers.data","dns.answers.name","dns.answers.type","dns.header_flags","dns.id","dns.op_code","dns.question.class","dns.question.name","dns.question.registered_domain","dns.question.subdomain","dns.question.top_level_domain","dns.question.type","dns.response_code","dns.type","ecs.version","error.code","error.id","error.message","error.stack_trace","error.type","event.action","event.category","event.code","event.dataset","event.hash","event.id","event.kind","event.module","event.original","event.outcome","event.provider","event.timezone","event.type","file.device","file.directory","file.extension","file.gid","file.group","file.hash.md5","file.hash.sha1","file.hash.sha256","file.hash.sha512","file.inode","file.mode","file.name","file.owner","file.path","file.target_path","file.type","file.uid","geo.city_name","geo.continent_name","geo.country_iso_code","geo.country_name","geo.name","geo.region_iso_code","geo.region_name","group.domain","group.id","group.name","hash.md5","hash.sha1","hash.sha256","hash.sha512","host.architecture","host.geo.city_name","host.geo.continent_name","host.geo.country_iso_code","host.geo.country_name","host.geo.name","host.geo.region_iso_code","host.geo.region_name","host.hostname","host.id","host.mac","host.name","host.os.family","host.os.full","host.os.kernel","host.os.name","host.os.platform","host.os.version","host.type","host.user.domain","host.user.email","host.user.full_name","host.user.group.domain","host.user.group.id","host.user.group.name","host.user.hash","host.user.id","host.user.name","http.request.body.content","http.request.method","http.request.referrer","http.response.body.content","http.version","log.level","log.logger","log.origin.file.name","log.origin.function","log.original","log.syslog.facility.name","log.syslog.severity.name","network.application","network.community_id","network.direction","network.iana_number","network.name","network.protocol","network.transport","network.type","observer.geo.city_name","observer.geo.continent_name","observer.geo.country_iso_code","observer.geo.country_name","observer.geo.name","observer.geo.region_iso_code","observer.geo.region_name","observer.hostname","observer.mac","observer.name","observer.os.family","observer.os.full","observer.os.kernel","observer.os.name","observer.os.platform","observer.os.version","observer.product","observer.serial_number","observer.type","observer.vendor","observer.version","organization.id","organization.name","os.family","os.full","os.kernel","os.name","os.platform","os.version","package.architecture","package.checksum","package.description","package.install_scope","package.license","package.name","package.path","package.version","process.args","text","process.executable","process.hash.md5","process.hash.sha1","process.hash.sha256","process.hash.sha512","process.name","text","text","text","text","text","process.thread.name","process.title","process.working_directory","server.address","server.as.organization.name","server.domain","server.geo.city_name","server.geo.continent_name","server.geo.country_iso_code","server.geo.country_name","server.geo.name","server.geo.region_iso_code","server.geo.region_name","server.mac","server.registered_domain","server.top_level_domain","server.user.domain","server.user.email","server.user.full_name","server.user.group.domain","server.user.group.id","server.user.group.name","server.user.hash","server.user.id","server.user.name","service.ephemeral_id","service.id","service.name","service.node.name","service.state","service.type","service.version","source.address","source.as.organization.name","source.domain","source.geo.city_name","source.geo.continent_name","source.geo.country_iso_code","source.geo.country_name","source.geo.name","source.geo.region_iso_code","source.geo.region_name","source.mac","source.registered_domain","source.top_level_domain","source.user.domain","source.user.email","source.user.full_name","source.user.group.domain","source.user.group.id","source.user.group.name","source.user.hash","source.user.id","source.user.name","threat.framework","threat.tactic.id","threat.tactic.name","threat.tactic.reference","threat.technique.id","threat.technique.name","threat.technique.reference","tracing.trace.id","tracing.transaction.id","url.domain","url.extension","url.fragment","url.full","url.original","url.password","url.path","url.query","url.registered_domain","url.scheme","url.top_level_domain","url.username","user.domain","user.email","user.full_name","user.group.domain","user.group.id","user.group.name","user.hash","user.id","user.name","user_agent.device.name","user_agent.name","text","user_agent.original","user_agent.os.family","user_agent.os.full","user_agent.os.kernel","user_agent.os.name","user_agent.os.platform","user_agent.os.version","user_agent.version","text","agent.hostname","timeseries.instance","cloud.project.id","cloud.image.id","host.os.build","host.os.codename","kubernetes.pod.name","kubernetes.pod.uid","kubernetes.namespace","kubernetes.node.name","kubernetes.replicaset.name","kubernetes.deployment.name","kubernetes.statefulset.name","kubernetes.container.name","kubernetes.container.image","jolokia.agent.version","jolokia.agent.id","jolokia.server.product","jolokia.server.version","jolokia.server.vendor","jolokia.url","type","server.process.name","server.process.args","server.process.executable","server.process.working_directory","server.process.start","client.process.name","client.process.args","client.process.executable","client.process.working_directory","client.process.start","flow.id","status","method","resource","path","query","params","request","response","amqp.reply-text","amqp.exchange","amqp.exchange-type","amqp.consumer-tag","amqp.routing-key","amqp.queue","amqp.content-type","amqp.content-encoding","amqp.delivery-mode","amqp.correlation-id","amqp.reply-to","amqp.expiration","amqp.message-id","amqp.timestamp","amqp.type","amqp.user-id","amqp.app-id","cassandra.request.headers.flags","cassandra.request.headers.stream","cassandra.request.headers.op","cassandra.request.query","cassandra.response.headers.flags","cassandra.response.headers.stream","cassandra.response.headers.op","cassandra.response.result.type","cassandra.response.result.rows.meta.keyspace","cassandra.response.result.rows.meta.table","cassandra.response.result.rows.meta.flags","cassandra.response.result.rows.meta.paging_state","cassandra.response.result.keyspace","cassandra.response.result.schema_change.change","cassandra.response.result.schema_change.keyspace","cassandra.response.result.schema_change.table","cassandra.response.result.schema_change.object","cassandra.response.result.schema_change.target","cassandra.response.result.schema_change.name","cassandra.response.result.schema_change.args","cassandra.response.result.prepared.prepared_id","cassandra.response.result.prepared.req_meta.keyspace","cassandra.response.result.prepared.req_meta.table","cassandra.response.result.prepared.req_meta.flags","cassandra.response.result.prepared.req_meta.paging_state","cassandra.response.result.prepared.resp_meta.keyspace","cassandra.response.result.prepared.resp_meta.table","cassandra.response.result.prepared.resp_meta.flags","cassandra.response.result.prepared.resp_meta.paging_state","cassandra.response.authentication.class","cassandra.response.warnings","cassandra.response.event.type","cassandra.response.event.change","cassandra.response.event.host","cassandra.response.event.schema_change.change","cassandra.response.event.schema_change.keyspace","cassandra.response.event.schema_change.table","cassandra.response.event.schema_change.object","cassandra.response.event.schema_change.target","cassandra.response.event.schema_change.name","cassandra.response.event.schema_change.args","cassandra.response.error.msg","cassandra.response.error.type","cassandra.response.error.details.read_consistency","cassandra.response.error.details.write_type","cassandra.response.error.details.keyspace","cassandra.response.error.details.table","cassandra.response.error.details.stmt_id","cassandra.response.error.details.num_failures","cassandra.response.error.details.function","cassandra.response.error.details.arg_types","dhcpv4.transaction_id","dhcpv4.flags","dhcpv4.client_mac","dhcpv4.server_name","dhcpv4.op_code","dhcpv4.hardware_type","dhcpv4.option.message_type","dhcpv4.option.parameter_request_list","dhcpv4.option.class_identifier","dhcpv4.option.domain_name","dhcpv4.option.hostname","dhcpv4.option.message","dhcpv4.option.boot_file_name","dns.question.etld_plus_one","dns.authorities.name","dns.authorities.type","dns.authorities.class","dns.additionals.name","dns.additionals.type","dns.additionals.class","dns.additionals.data","dns.opt.version","dns.opt.ext_rcode","http.response.status_phrase","icmp.version","icmp.request.message","icmp.response.message","memcache.protocol_type","memcache.request.line","memcache.request.command","memcache.response.command","memcache.request.type","memcache.response.type","memcache.response.error_msg","memcache.request.opcode","memcache.response.opcode","memcache.response.status","memcache.request.raw_args","memcache.request.automove","memcache.response.version","mongodb.error","mongodb.fullCollectionName","mongodb.startingFrom","mongodb.query","mongodb.returnFieldsSelector","mongodb.selector","mongodb.update","mongodb.cursorId","mysql.insert_id","mysql.num_fields","mysql.num_rows","mysql.query","mysql.error_message","nfs.tag","nfs.opcode","nfs.status","rpc.xid","rpc.status","rpc.auth_flavor","rpc.cred.gids","rpc.cred.machinename","pgsql.error_message","pgsql.error_severity","pgsql.num_fields","pgsql.num_rows","redis.return_value","redis.error","thrift.params","thrift.service","thrift.return_value","thrift.exceptions","tls.detailed.version","tls.detailed.resumption_method","tls.detailed.client_hello.version","tls.detailed.client_hello.session_id","tls.detailed.client_hello.supported_compression_methods","tls.detailed.client_hello.extensions.server_name_indication","tls.detailed.client_hello.extensions.application_layer_protocol_negotiation","tls.detailed.client_hello.extensions.session_ticket","tls.detailed.client_hello.extensions.supported_versions","tls.detailed.client_hello.extensions.supported_groups","tls.detailed.client_hello.extensions.signature_algorithms","tls.detailed.client_hello.extensions.ec_points_formats","tls.detailed.client_hello.extensions._unparsed_","tls.detailed.server_hello.version","tls.detailed.server_hello.selected_compression_method","tls.detailed.server_hello.session_id","tls.detailed.server_hello.extensions.application_layer_protocol_negotiation","tls.detailed.server_hello.extensions.session_ticket","tls.detailed.server_hello.extensions.supported_versions","tls.detailed.server_hello.extensions.ec_points_formats","tls.detailed.server_hello.extensions._unparsed_","tls.detailed.client_certificate.serial_number","tls.detailed.client_certificate.public_key_algorithm","tls.detailed.client_certificate.signature_algorithm","tls.detailed.client_certificate.alternative_names","tls.detailed.client_certificate.subject.country","tls.detailed.client_certificate.subject.organization","tls.detailed.client_certificate.subject.organizational_unit","tls.detailed.client_certificate.subject.province","tls.detailed.client_certificate.subject.common_name","tls.detailed.client_certificate.subject.locality","tls.detailed.client_certificate.issuer.country","tls.detailed.client_certificate.issuer.organization","tls.detailed.client_certificate.issuer.organizational_unit","tls.detailed.client_certificate.issuer.province","tls.detailed.client_certificate.issuer.common_name","tls.detailed.client_certificate.issuer.locality","tls.detailed.server_certificate.serial_number","tls.detailed.server_certificate.public_key_algorithm","tls.detailed.server_certificate.signature_algorithm","tls.detailed.server_certificate.alternative_names","tls.detailed.server_certificate.subject.country","tls.detailed.server_certificate.subject.organization","tls.detailed.server_certificate.subject.organizational_unit","tls.detailed.server_certificate.subject.province","tls.detailed.server_certificate.subject.common_name","tls.detailed.server_certificate.subject.locality","tls.detailed.server_certificate.issuer.country","tls.detailed.server_certificate.issuer.organization","tls.detailed.server_certificate.issuer.organizational_unit","tls.detailed.server_certificate.issuer.province","tls.detailed.server_certificate.issuer.common_name","tls.detailed.server_certificate.issuer.locality","tls.detailed.alert_types","fields.*"]},"refresh_interval":"5s"}}
[00:09:48]                 │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [packetbeat-8.0.0-2019.08.29-000010] creating index, cause [api], templates [], shards [1]/[1]
[00:09:48]                 │ info [o.e.c.r.a.AllocationService] [node-01] updating number_of_replicas to [0] for indices [packetbeat-8.0.0-2019.08.29-000010]
[00:09:48]                 │ info [x-pack/test/functional/es_archives/packetbeat/tls] Created index "packetbeat-8.0.0-2019.08.29-000010"
[00:09:48]                 │ debg [x-pack/test/functional/es_archives/packetbeat/tls] "packetbeat-8.0.0-2019.08.29-000010" settings {"index":{"auto_expand_replicas":"0-1","codec":"best_compression","lifecycle":{"name":"packetbeat-8.0.0","rollover_alias":"packetbeat-8.0.0"},"mapping":{"total_fields":{"limit":"10000"}},"number_of_replicas":"1","number_of_shards":"1","query":{"default_field":["message","tags","agent.ephemeral_id","agent.id","agent.name","agent.type","agent.version","as.organization.name","client.address","client.as.organization.name","client.domain","client.geo.city_name","client.geo.continent_name","client.geo.country_iso_code","client.geo.country_name","client.geo.name","client.geo.region_iso_code","client.geo.region_name","client.mac","client.user.domain","client.user.email","client.user.full_name","client.user.group.id","client.user.group.name","client.user.hash","client.user.id","client.user.name","cloud.account.id","cloud.availability_zone","cloud.instance.id","cloud.instance.name","cloud.machine.type","cloud.provider","cloud.region","container.id","container.image.name","container.image.tag","container.name","container.runtime","destination.address","destination.as.organization.name","destination.domain","destination.geo.city_name","destination.geo.continent_name","destination.geo.country_iso_code","destination.geo.country_name","destination.geo.name","destination.geo.region_iso_code","destination.geo.region_name","destination.mac","destination.user.domain","destination.user.email","destination.user.full_name","destination.user.group.id","destination.user.group.name","destination.user.hash","destination.user.id","destination.user.name","dns.answers.class","dns.answers.data","dns.answers.name","dns.answers.type","dns.header_flags","dns.id","dns.op_code","dns.question.class","dns.question.name","dns.question.registered_domain","dns.question.type","dns.response_code","dns.type","ecs.version","error.code","error.id","error.message","event.action","event.category","event.code","event.dataset","event.hash","event.id","event.kind","event.module","event.original","event.outcome","event.provider","event.timezone","event.type","file.device","file.directory","file.extension","file.gid","file.group","file.hash.md5","file.hash.sha1","file.hash.sha256","file.hash.sha512","file.inode","file.mode","file.name","file.owner","file.path","file.target_path","file.type","file.uid","geo.city_name","geo.continent_name","geo.country_iso_code","geo.country_name","geo.name","geo.region_iso_code","geo.region_name","group.id","group.name","hash.md5","hash.sha1","hash.sha256","hash.sha512","host.architecture","host.geo.city_name","host.geo.continent_name","host.geo.country_iso_code","host.geo.country_name","host.geo.name","host.geo.region_iso_code","host.geo.region_name","host.hostname","host.id","host.mac","host.name","host.os.family","host.os.full","host.os.kernel","host.os.name","host.os.platform","host.os.version","host.type","host.user.domain","host.user.email","host.user.full_name","host.user.group.id","host.user.group.name","host.user.hash","host.user.id","host.user.name","http.request.body.content","http.request.method","http.request.referrer","http.response.body.content","http.version","log.level","log.logger","log.original","network.application","network.community_id","network.direction","network.iana_number","network.name","network.protocol","network.transport","network.type","observer.geo.city_name","observer.geo.continent_name","observer.geo.country_iso_code","observer.geo.country_name","observer.geo.name","observer.geo.region_iso_code","observer.geo.region_name","observer.hostname","observer.mac","observer.os.family","observer.os.full","observer.os.kernel","observer.os.name","observer.os.platform","observer.os.version","observer.serial_number","observer.type","observer.vendor","observer.version","organization.id","organization.name","os.family","os.full","os.kernel","os.name","os.platform","os.version","process.args","process.executable","process.hash.md5","process.hash.sha1","process.hash.sha256","process.hash.sha512","process.name","process.thread.name","process.title","process.working_directory","server.address","server.as.organization.name","server.domain","server.geo.city_name","server.geo.continent_name","server.geo.country_iso_code","server.geo.country_name","server.geo.name","server.geo.region_iso_code","server.geo.region_name","server.mac","server.user.domain","server.user.email","server.user.full_name","server.user.group.id","server.user.group.name","server.user.hash","server.user.id","server.user.name","service.ephemeral_id","service.id","service.name","service.state","service.type","service.version","source.address","source.as.organization.name","source.domain","source.geo.city_name","source.geo.continent_name","source.geo.country_iso_code","source.geo.country_name","source.geo.name","source.geo.region_iso_code","source.geo.region_name","source.mac","source.user.domain","source.user.email","source.user.full_name","source.user.group.id","source.user.group.name","source.user.hash","source.user.id","source.user.name","tracing.trace.id","tracing.transaction.id","url.domain","url.fragment","url.full","url.original","url.password","url.path","url.query","url.scheme","url.username","user.domain","user.email","user.full_name","user.group.id","user.group.name","user.hash","user.id","user.name","user_agent.device.name","user_agent.name","user_agent.original","user_agent.os.family","user_agent.os.full","user_agent.os.kernel","user_agent.os.name","user_agent.os.platform","user_agent.os.version","user_agent.version","agent.hostname","error.type","timeseries.instance","cloud.project.id","cloud.image.id","host.os.build","host.os.codename","kubernetes.pod.name","kubernetes.pod.uid","kubernetes.namespace","kubernetes.node.name","kubernetes.replicaset.name","kubernetes.deployment.name","kubernetes.statefulset.name","kubernetes.container.name","kubernetes.container.image","jolokia.agent.version","jolokia.agent.id","jolokia.server.product","jolokia.server.version","jolokia.server.vendor","jolokia.url","type","server.process.name","server.process.args","server.process.executable","server.process.working_directory","server.process.start","client.process.name","client.process.args","client.process.executable","client.process.working_directory","client.process.start","flow.id","status","method","resource","path","query","params","request","response","amqp.reply-text","amqp.exchange","amqp.exchange-type","amqp.consumer-tag","amqp.routing-key","amqp.queue","amqp.content-type","amqp.content-encoding","amqp.delivery-mode","amqp.correlation-id","amqp.reply-to","amqp.expiration","amqp.message-id","amqp.timestamp","amqp.type","amqp.user-id","amqp.app-id","cassandra.request.headers.flags","cassandra.request.headers.stream","cassandra.request.headers.op","cassandra.request.query","cassandra.response.headers.flags","cassandra.response.headers.stream","cassandra.response.headers.op","cassandra.response.result.type","cassandra.response.result.rows.meta.keyspace","cassandra.response.result.rows.meta.table","cassandra.response.result.rows.meta.flags","cassandra.response.result.rows.meta.paging_state","cassandra.response.result.keyspace","cassandra.response.result.schema_change.change","cassandra.response.result.schema_change.keyspace","cassandra.response.result.schema_change.table","cassandra.response.result.schema_change.object","cassandra.response.result.schema_change.target","cassandra.response.result.schema_change.name","cassandra.response.result.schema_change.args","cassandra.response.result.prepared.prepared_id","cassandra.response.result.prepared.req_meta.keyspace","cassandra.response.result.prepared.req_meta.table","cassandra.response.result.prepared.req_meta.flags","cassandra.response.result.prepared.req_meta.paging_state","cassandra.response.result.prepared.resp_meta.keyspace","cassandra.response.result.prepared.resp_meta.table","cassandra.response.result.prepared.resp_meta.flags","cassandra.response.result.prepared.resp_meta.paging_state","cassandra.response.authentication.class","cassandra.response.warnings","cassandra.response.event.type","cassandra.response.event.change","cassandra.response.event.host","cassandra.response.event.schema_change.change","cassandra.response.event.schema_change.keyspace","cassandra.response.event.schema_change.table","cassandra.response.event.schema_change.object","cassandra.response.event.schema_change.target","cassandra.response.event.schema_change.name","cassandra.response.event.schema_change.args","cassandra.response.error.msg","cassandra.response.error.type","cassandra.response.error.details.read_consistency","cassandra.response.error.details.write_type","cassandra.response.error.details.keyspace","cassandra.response.error.details.table","cassandra.response.error.details.stmt_id","cassandra.response.error.details.num_failures","cassandra.response.error.details.function","cassandra.response.error.details.arg_types","dhcpv4.transaction_id","dhcpv4.flags","dhcpv4.client_mac","dhcpv4.server_name","dhcpv4.op_code","dhcpv4.hardware_type","dhcpv4.option.message_type","dhcpv4.option.parameter_request_list","dhcpv4.option.class_identifier","dhcpv4.option.domain_name","dhcpv4.option.hostname","dhcpv4.option.message","dhcpv4.option.boot_file_name","dns.question.etld_plus_one","dns.authorities.name","dns.authorities.type","dns.authorities.class","dns.additionals.name","dns.additionals.type","dns.additionals.class","dns.additionals.data","dns.opt.version","dns.opt.ext_rcode","http.response.status_phrase","icmp.version","icmp.request.message","icmp.response.message","memcache.protocol_type","memcache.request.line","memcache.request.command","memcache.response.command","memcache.request.type","memcache.response.type","memcache.response.error_msg","memcache.request.opcode","memcache.response.opcode","memcache.response.status","memcache.request.raw_args","memcache.request.automove","memcache.response.version","mongodb.error","mongodb.fullCollectionName","mongodb.startingFrom","mongodb.query","mongodb.returnFieldsSelector","mongodb.selector","mongodb.update","mongodb.cursorId","mysql.insert_id","mysql.num_fields","mysql.num_rows","mysql.query","mysql.error_message","nfs.tag","nfs.opcode","nfs.status","rpc.xid","rpc.status","rpc.auth_flavor","rpc.cred.gids","rpc.cred.machinename","pgsql.error_message","pgsql.error_severity","pgsql.num_fields","pgsql.num_rows","redis.return_value","redis.error","thrift.params","thrift.service","thrift.return_value","thrift.exceptions","tls.version","tls.resumption_method","tls.client_hello.version","tls.client_hello.extensions.server_name_indication","tls.client_hello.extensions.application_layer_protocol_negotiation","tls.client_hello.extensions.session_ticket","tls.client_hello.extensions.supported_versions","tls.client_hello.extensions.supported_groups","tls.client_hello.extensions.signature_algorithms","tls.client_hello.extensions.ec_points_formats","tls.client_hello.extensions._unparsed_","tls.server_hello.version","tls.server_hello.selected_cipher","tls.server_hello.selected_compression_method","tls.server_hello.session_id","tls.server_hello.extensions.session_ticket","tls.server_hello.extensions.supported_versions","tls.server_hello.extensions.ec_points_formats","tls.server_hello.extensions._unparsed_","tls.client_certificate.serial_number","tls.client_certificate.public_key_algorithm","tls.client_certificate.signature_algorithm","tls.client_certificate.raw","tls.client_certificate.subject.country","tls.client_certificate.subject.organization","tls.client_certificate.subject.organizational_unit","tls.client_certificate.subject.province","tls.client_certificate.subject.common_name","tls.client_certificate.issuer.country","tls.client_certificate.issuer.organization","tls.client_certificate.issuer.organizational_unit","tls.client_certificate.issuer.province","tls.client_certificate.issuer.common_name","tls.client_certificate.fingerprint.md5","tls.client_certificate.fingerprint.sha1","tls.client_certificate.fingerprint.sha256","tls.server_certificate.serial_number","tls.server_certificate.public_key_algorithm","tls.server_certificate.signature_algorithm","tls.server_certificate.raw","tls.server_certificate.subject.country","tls.server_certificate.subject.organization","tls.server_certificate.subject.organizational_unit","tls.server_certificate.subject.province","tls.server_certificate.subject.common_name","tls.server_certificate.issuer.country","tls.server_certificate.issuer.organization","tls.server_certificate.issuer.organizational_unit","tls.server_certificate.issuer.province","tls.server_certificate.issuer.common_name","tls.server_certificate.fingerprint.md5","tls.server_certificate.fingerprint.sha1","tls.server_certificate.fingerprint.sha256","tls.alert_types","tls.fingerprints.ja3.hash","tls.fingerprints.ja3.str","fields.*"]},"refresh_interval":"5s"}}
[00:09:48]                 │ info [x-pack/test/functional/es_archives/packetbeat/tls] Indexed 5 docs into "packetbeat-7.6.0-2020.03.03-000001"
[00:09:48]               └-> Ensure data is returned for FlowTarget.Source
[00:09:48]                 └-> "before each" hook: global before each for "Ensure data is returned for FlowTarget.Source"
[00:09:48]                 └- ✓ pass  (26ms)
[00:09:48]               └-> Ensure data is returned for FlowTarget.Destination
[00:09:48]                 └-> "before each" hook: global before each for "Ensure data is returned for FlowTarget.Destination"
[00:09:48]                 └- ✖ fail: apis SecuritySolution Endpoints Tls Test with Packetbeat Tls Overview Test Ensure data is returned for FlowTarget.Destination
[00:09:48]                 │       Error: expected { activePage: 0,
[00:09:48]                 │   fakeTotalCount: 0,
[00:09:48]                 │   showMorePagesIndicator: false } to sort of equal { activePage: 0,
[00:09:48]                 │   fakeTotalCount: 3,
[00:09:48]                 │   showMorePagesIndicator: false }
[00:09:48]                 │       + expected - actual
[00:09:48]                 │ 
[00:09:48]                 │        {
[00:09:48]                 │          "activePage": 0
[00:09:48]                 │       -  "fakeTotalCount": 0
[00:09:48]                 │       +  "fakeTotalCount": 3
[00:09:48]                 │          "showMorePagesIndicator": false
[00:09:48]                 │        }
[00:09:48]                 │       
[00:09:48]                 │       at Assertion.assert (/dev/shm/workspace/parallel/4/kibana/node_modules/@kbn/expect/expect.js:100:11)
[00:09:48]                 │       at Assertion.eql (/dev/shm/workspace/parallel/4/kibana/node_modules/@kbn/expect/expect.js:244:8)
[00:09:48]                 │       at Context.<anonymous> (test/api_integration/apis/security_solution/tls.ts:215:33)
[00:09:48]                 │       at runMicrotasks (<anonymous>)
[00:09:48]                 │       at processTicksAndRejections (node:internal/process/task_queues:96:5)
[00:09:48]                 │       at Object.apply (/dev/shm/workspace/parallel/4/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:09:48]                 │ 
[00:09:48]                 │ 

Stack Trace

Error: expected { activePage: 0,
  fakeTotalCount: 0,
  showMorePagesIndicator: false } to sort of equal { activePage: 0,
  fakeTotalCount: 3,
  showMorePagesIndicator: false }
    at Assertion.assert (/dev/shm/workspace/parallel/4/kibana/node_modules/@kbn/expect/expect.js:100:11)
    at Assertion.eql (/dev/shm/workspace/parallel/4/kibana/node_modules/@kbn/expect/expect.js:244:8)
    at Context.<anonymous> (test/api_integration/apis/security_solution/tls.ts:215:33)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.apply (/dev/shm/workspace/parallel/4/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16) {
  actual: '{\n' +
    '  "activePage": 0\n' +
    '  "fakeTotalCount": 0\n' +
    '  "showMorePagesIndicator": false\n' +
    '}',
  expected: '{\n' +
    '  "activePage": 0\n' +
    '  "fakeTotalCount": 3\n' +
    '  "showMorePagesIndicator": false\n' +
    '}',
  showDiff: true
}

History

  • 💔 Build #163010 failed c9dfc609722f3cd5e0f1205092e967fc2887c48f
  • 💔 Build #162994 failed c9dfc609722f3cd5e0f1205092e967fc2887c48f
  • 💔 Build #162801 failed bd12f1f62a0ab49e620dae6f1653007ad38a7358
  • 💔 Build #161687 failed 2e53041435fd2d09f3531a53061271477ca0da51

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

@cqliu1 cqliu1 force-pushed the canvas/by-value-embeddables branch from 34831c5 to 6a29232 Compare October 20, 2021 18:58
@cqliu1 cqliu1 force-pushed the canvas/by-value-references branch 2 times, most recently from 3e204cb to 2371a43 Compare October 20, 2021 21:31
@cqliu1 cqliu1 force-pushed the canvas/by-value-embeddables branch from 6a29232 to 8ac6d41 Compare October 20, 2021 22:45
@cqliu1 cqliu1 force-pushed the canvas/by-value-references branch from 2371a43 to ed91534 Compare October 21, 2021 01:41
@cqliu1 cqliu1 marked this pull request as ready for review October 21, 2021 20:22
@cqliu1 cqliu1 requested a review from a team as a code owner October 21, 2021 20:22
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Code review only - Inject and Extract functions are looking pretty good so far!

Left a couple comments / questions, but much of it might just be me misunderstanding how reference extraction / injection works in Canvas.


// extracts references for by-reference embeddables
if (input.savedObjectId) {
const refName = 'embeddable.savedObjectId';
Copy link
Contributor

Choose a reason for hiding this comment

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

These references must get de-duped somewhere in the workpad extract / inject references, but I'm not sure where this happens. Just to make sure: If you look at the workpad in the saved objects explorer, each by reference embeddable has a unique ID?

Copy link
Contributor

Choose a reason for hiding this comment

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

Update: Looks like the de-duping is conducted properly inside the workpad, each reference is prepended with the element ID.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Each reference name includes the unique element ID as a prefix. Here's an example with two elements backed by the same saved object id.

Screen Shot 2021-10-21 at 2 41 40 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks again for double checking this for me!

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

With the one comment addressed, this LGTM!

@cqliu1 cqliu1 force-pushed the canvas/by-value-embeddables branch from c637735 to 780f71c Compare October 25, 2021 07:46
@cqliu1 cqliu1 requested review from a team as code owners October 25, 2021 07:46
@cqliu1 cqliu1 force-pushed the canvas/by-value-references branch from 3fd223f to aeea737 Compare October 25, 2021 07:46
@pgayvallet pgayvallet removed request for a team October 25, 2021 09:37
@pgayvallet
Copy link
Contributor

Don't see any core/telemetry owned changes, removing us from reviews.

state.type[0] = savedObjectReference.type;
} else {
// injects references for by-value embeddables
const { type, ...injectedInput } = embeddablePersistableStateService.inject(
Copy link
Contributor

Choose a reason for hiding this comment

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

@cqliu1 I think this is the source of the issue I mentioned to you. inject expects embeddableStateWithType and this is just giving it state.

Comment on lines 134 to 137
const { type, ...injectedInput } = embeddablePersistableStateService.inject(
input,
references
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const { type, ...injectedInput } = embeddablePersistableStateService.inject(
input,
references
);
const { type, ...injectedInput } = embeddablePersistableStateService.inject(
{...input, type: state.type[0]},
references
);

@cqliu1 cqliu1 removed the request for review from a team October 25, 2021 16:18
@cqliu1 cqliu1 force-pushed the canvas/by-value-embeddables branch from 1834014 to 151ceac Compare October 25, 2021 20:02
@cqliu1 cqliu1 force-pushed the canvas/by-value-references branch from 0104adf to 7125b53 Compare October 25, 2021 20:03
@cqliu1 cqliu1 mentioned this pull request Oct 25, 2021
11 tasks
@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky

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
canvas 1.0MB 1.0MB +476.0B

History

  • 💔 Build #1478 failed 0104adf80d61f4e075734dad61d12b3d2d301ee4
  • 💔 Build #1279 failed aeea73752645aadd9895327088cddb6cee116ce4
  • 💚 Build #1164 succeeded 3fd223f91793671147b552c3387ed527401fdda6
  • 💔 Build #1143 failed bd896ecd3431463407d16fec82a508de508adef6
  • 💔 Build #763 failed ed9153452ae66e65b1faf1666584e7c19f33534b

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

Copy link
Contributor

@crob611 crob611 left a comment

Choose a reason for hiding this comment

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

Looks good now 👍

@cqliu1 cqliu1 merged this pull request into elastic:canvas/by-value-embeddables Oct 26, 2021
cqliu1 added a commit that referenced this pull request Oct 26, 2021
)

* Extract/inject references for by-value embeddables in embeddable function

Fixed server interpreter setup

Register external functions in canvas_plugin_src plugin def

* Fixed ref name in embeddable.inject

* Fixed ts errors

* Fix missing type error
cqliu1 added a commit that referenced this pull request Oct 27, 2021
* [Canvas] Generic embeddable function (#104499)

* Created generic embeddable function

    Fixed telemetry

    Updates expression on input change

    Fixed ts errors

Store embeddable input to expression

Added lib functions

Added comments

Fixed type errors

Fixed ts errors

Clean up

Removed extraneous import

Added context type to embeddable function def

Fix import

Update encode/decode fns

Moved embeddable data url lib file

Added embeddable test

Updated comment

* Fix reference extract/inject in embeddable fn

* Simplify embeddable toExpression

* Moved labsService to flyout.tsx

* Added comment

* [Canvas] Adds Save and Return Workflow (#111411)

* [Canvas] Adds editor menu to Canvas (#113194)

* Merge existing embeddable input with incoming embeddable input (#116026)

* [Canvas] Extract and inject references for by-value embeddables (#115124)

* Extract/inject references for by-value embeddables in embeddable function

Fixed server interpreter setup

Register external functions in canvas_plugin_src plugin def

* Fixed ref name in embeddable.inject

* Fixed ts errors

* Fix missing type error

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
cqliu1 added a commit that referenced this pull request Oct 28, 2021
)

* Extract/inject references for by-value embeddables in embeddable function

Fixed server interpreter setup

Register external functions in canvas_plugin_src plugin def

* Fixed ref name in embeddable.inject

* Fixed ts errors

* Fix missing type error
cqliu1 added a commit that referenced this pull request Oct 28, 2021
)

* Extract/inject references for by-value embeddables in embeddable function

Fixed server interpreter setup

Register external functions in canvas_plugin_src plugin def

* Fixed ref name in embeddable.inject

* Fixed ts errors

* Fix missing type error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Canvas loe:medium Medium Level of Effort Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants