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

[Security Solution][Detections] Fix truncated values in columns for rules table #115825

Merged
merged 14 commits into from
Oct 29, 2021

Conversation

vitaliidm
Copy link
Contributor

@vitaliidm vitaliidm commented Oct 20, 2021

Ticket 113607

Summary

This PR fixes issue where column text was truncated, and no tooltip displayed to see full text.

In PR table behaviour is restored to the behaviour as in 7.15 version(wrapping fields, rather than truncating)

UI Before

Screenshot 2021-10-21 at 09 53 07

UI After

Screenshot 2021-10-21 at 10 24 33

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Risk Probability Severity Mitigation/Notes
Single word breaking in couple of lines in marginal to breakpoint resolutions Low Low

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / X-Pack API Integration Tests.x-pack/test/api_integration/apis/security_solution/overview_network·ts.apis SecuritySolution Endpoints Overview Network With packetbeat Make sure that we get OverviewNetwork data

Link to Jenkins

Standard Out

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

[00:00:00]     │
[00:00:00]       └-: apis
[00:00:00]         └-> "before all" hook in "apis"
[00:07:48]         └-: SecuritySolution Endpoints
[00:07:48]           └-> "before all" hook in "SecuritySolution Endpoints"
[00:08:31]           └-: Overview Network
[00:08:31]             └-> "before all" hook in "Overview Network"
[00:08:34]             └-: With packetbeat
[00:08:34]               └-> "before all" hook for "Make sure that we get OverviewNetwork data"
[00:08:34]               └-> "before all" hook for "Make sure that we get OverviewNetwork data"
[00:08:34]                 │ info [x-pack/test/functional/es_archives/packetbeat/overview] Loading "mappings.json"
[00:08:34]                 │ info [x-pack/test/functional/es_archives/packetbeat/overview] Loading "data.json.gz"
[00:08:34]                 │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [packetbeat-8.0.0-2019.02.19-000001] creating index, cause [api], templates [], shards [1]/[1]
[00:08:34]                 │ info [x-pack/test/functional/es_archives/packetbeat/overview] Created index "packetbeat-8.0.0-2019.02.19-000001"
[00:08:34]                 │ debg [x-pack/test/functional/es_archives/packetbeat/overview] "packetbeat-8.0.0-2019.02.19-000001" settings {"index":{"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":["tags","message","agent.version","agent.name","agent.type","agent.id","agent.ephemeral_id","client.address","client.mac","client.domain","client.geo.continent_name","client.geo.country_name","client.geo.region_name","client.geo.city_name","client.geo.country_iso_code","client.geo.region_iso_code","client.geo.name","cloud.provider","cloud.availability_zone","cloud.region","cloud.instance.id","cloud.instance.name","cloud.machine.type","cloud.account.id","container.runtime","container.id","container.image.name","container.image.tag","container.name","destination.address","destination.mac","destination.domain","destination.geo.continent_name","destination.geo.country_name","destination.geo.region_name","destination.geo.city_name","destination.geo.country_iso_code","destination.geo.region_iso_code","destination.geo.name","ecs.version","error.id","error.message","error.code","event.id","event.kind","event.category","event.action","event.outcome","event.type","event.module","event.dataset","event.hash","event.timezone","file.path","file.target_path","file.extension","file.type","file.device","file.inode","file.uid","file.owner","file.gid","file.group","file.mode","group.id","group.name","host.hostname","host.name","host.id","host.mac","host.type","host.architecture","host.os.platform","host.os.name","host.os.full","host.os.family","host.os.version","host.os.kernel","host.geo.continent_name","host.geo.country_name","host.geo.region_name","host.geo.city_name","host.geo.country_iso_code","host.geo.region_iso_code","host.geo.name","http.request.method","http.request.body.content","http.request.referrer","http.response.body.content","http.version","log.level","network.name","network.type","network.iana_number","network.transport","network.application","network.protocol","network.direction","network.community_id","observer.mac","observer.hostname","observer.vendor","observer.version","observer.serial_number","observer.type","observer.os.platform","observer.os.name","observer.os.full","observer.os.family","observer.os.version","observer.os.kernel","observer.geo.continent_name","observer.geo.country_name","observer.geo.region_name","observer.geo.city_name","observer.geo.country_iso_code","observer.geo.region_iso_code","observer.geo.name","organization.name","organization.id","os.platform","os.name","os.full","os.family","os.version","os.kernel","process.name","process.args","process.executable","process.title","process.working_directory","server.address","server.mac","server.domain","server.geo.continent_name","server.geo.country_name","server.geo.region_name","server.geo.city_name","server.geo.country_iso_code","server.geo.region_iso_code","server.geo.name","service.id","service.name","service.type","service.state","service.version","service.ephemeral_id","source.address","source.mac","source.domain","source.geo.continent_name","source.geo.country_name","source.geo.region_name","source.geo.city_name","source.geo.country_iso_code","source.geo.region_iso_code","source.geo.name","url.original","url.full","url.scheme","url.domain","url.path","url.query","url.fragment","url.username","url.password","user.id","user.name","user.full_name","user.email","user.hash","user.group.id","user.group.name","user_agent.original","user_agent.name","user_agent.version","user_agent.device.name","user_agent.os.platform","user_agent.os.name","user_agent.os.full","user_agent.os.family","user_agent.os.version","user_agent.os.kernel","agent.hostname","error.type","cloud.project.id","kubernetes.pod.name","kubernetes.pod.uid","kubernetes.namespace","kubernetes.node.name","kubernetes.container.name","kubernetes.container.image","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.op_code","dns.response_code","dns.question.name","dns.question.type","dns.question.class","dns.question.registered_domain","dns.answers.name","dns.answers.type","dns.answers.class","dns.answers.data","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:08:34]                 │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [packetbeat-overview-flow] creating index, cause [auto(bulk api)], templates [], shards [1]/[1]
[00:08:34]                 │ info [o.e.c.m.MetadataMappingService] [node-01] [packetbeat-overview-flow/gHH61yeiQKalSk__ZOVnBw] create_mapping
[00:08:34]                 │ info [o.e.c.m.MetadataMappingService] [node-01] [packetbeat-overview-flow/gHH61yeiQKalSk__ZOVnBw] update_mapping [_doc]
[00:08:34]                 │ info [o.e.c.m.MetadataMappingService] [node-01] [packetbeat-overview-flow/gHH61yeiQKalSk__ZOVnBw] update_mapping [_doc]
[00:08:34]                 │ info [o.e.c.m.MetadataMappingService] [node-01] [packetbeat-overview-flow/gHH61yeiQKalSk__ZOVnBw] update_mapping [_doc]
[00:08:34]                 │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [packetbeat-overview-flow-1] creating index, cause [auto(bulk api)], templates [], shards [1]/[1]
[00:08:35]                 │ info [o.e.c.m.MetadataMappingService] [node-01] [packetbeat-overview-flow-1/uImcyN4dQqW22YIxWKovRw] create_mapping
[00:08:35]                 │ info [o.e.c.m.MetadataMappingService] [node-01] [packetbeat-overview-flow-1/uImcyN4dQqW22YIxWKovRw] update_mapping [_doc]
[00:08:35]                 │ info [o.e.c.m.MetadataMappingService] [node-01] [packetbeat-overview-flow-1/uImcyN4dQqW22YIxWKovRw] update_mapping [_doc]
[00:08:35]                 │ info [o.e.c.m.MetadataMappingService] [node-01] [packetbeat-overview-flow-1/uImcyN4dQqW22YIxWKovRw] update_mapping [_doc]
[00:08:35]                 │ info [o.e.c.m.MetadataMappingService] [node-01] [packetbeat-overview-flow-1/uImcyN4dQqW22YIxWKovRw] update_mapping [_doc]
[00:08:35]                 │ info [o.e.c.m.MetadataMappingService] [node-01] [packetbeat-overview-flow-1/uImcyN4dQqW22YIxWKovRw] update_mapping [_doc]
[00:08:35]                 │ info [x-pack/test/functional/es_archives/packetbeat/overview] Indexed 332 docs into "packetbeat-overview-flow"
[00:08:35]                 │ info [x-pack/test/functional/es_archives/packetbeat/overview] Indexed 336 docs into "packetbeat-overview-flow-1"
[00:08:35]               └-> Make sure that we get OverviewNetwork data
[00:08:35]                 └-> "before each" hook: global before each for "Make sure that we get OverviewNetwork data"
[00:08:35]                 └- ✖ fail: apis SecuritySolution Endpoints Overview Network With packetbeat Make sure that we get OverviewNetwork data
[00:08:35]                 │       Error: expected { auditbeatSocket: null,
[00:08:35]                 │   filebeatCisco: null,
[00:08:35]                 │   filebeatNetflow: null,
[00:08:35]                 │   filebeatPanw: null,
[00:08:35]                 │   filebeatSuricata: null,
[00:08:35]                 │   filebeatZeek: null,
[00:08:35]                 │   packetbeatDNS: null,
[00:08:35]                 │   packetbeatFlow: null,
[00:08:35]                 │   packetbeatTLS: null } to sort of equal { auditbeatSocket: 0,
[00:08:35]                 │   filebeatCisco: 0,
[00:08:35]                 │   filebeatNetflow: 0,
[00:08:35]                 │   filebeatPanw: 0,
[00:08:35]                 │   filebeatSuricata: 0,
[00:08:35]                 │   filebeatZeek: 0,
[00:08:35]                 │   packetbeatDNS: 44,
[00:08:35]                 │   packetbeatFlow: 588,
[00:08:35]                 │   packetbeatTLS: 0 }
[00:08:35]                 │       + expected - actual
[00:08:35]                 │ 
[00:08:35]                 │        {
[00:08:35]                 │       -  "auditbeatSocket": [null]
[00:08:35]                 │       -  "filebeatCisco": [null]
[00:08:35]                 │       -  "filebeatNetflow": [null]
[00:08:35]                 │       -  "filebeatPanw": [null]
[00:08:35]                 │       -  "filebeatSuricata": [null]
[00:08:35]                 │       -  "filebeatZeek": [null]
[00:08:35]                 │       -  "packetbeatDNS": [null]
[00:08:35]                 │       -  "packetbeatFlow": [null]
[00:08:35]                 │       -  "packetbeatTLS": [null]
[00:08:35]                 │       +  "auditbeatSocket": 0
[00:08:35]                 │       +  "filebeatCisco": 0
[00:08:35]                 │       +  "filebeatNetflow": 0
[00:08:35]                 │       +  "filebeatPanw": 0
[00:08:35]                 │       +  "filebeatSuricata": 0
[00:08:35]                 │       +  "filebeatZeek": 0
[00:08:35]                 │       +  "packetbeatDNS": 44
[00:08:35]                 │       +  "packetbeatFlow": 588
[00:08:35]                 │       +  "packetbeatTLS": 0
[00:08:35]                 │        }
[00:08:35]                 │       
[00:08:35]                 │       at Assertion.assert (/dev/shm/workspace/parallel/4/kibana/node_modules/@kbn/expect/expect.js:100:11)
[00:08:35]                 │       at Assertion.eql (/dev/shm/workspace/parallel/4/kibana/node_modules/@kbn/expect/expect.js:244:8)
[00:08:35]                 │       at Context.<anonymous> (test/api_integration/apis/security_solution/overview_network.ts:97:36)
[00:08:35]                 │       at runMicrotasks (<anonymous>)
[00:08:35]                 │       at processTicksAndRejections (node:internal/process/task_queues:96:5)
[00:08:35]                 │       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:08:35]                 │ 
[00:08:35]                 │ 

Stack Trace

Error: expected { auditbeatSocket: null,
  filebeatCisco: null,
  filebeatNetflow: null,
  filebeatPanw: null,
  filebeatSuricata: null,
  filebeatZeek: null,
  packetbeatDNS: null,
  packetbeatFlow: null,
  packetbeatTLS: null } to sort of equal { auditbeatSocket: 0,
  filebeatCisco: 0,
  filebeatNetflow: 0,
  filebeatPanw: 0,
  filebeatSuricata: 0,
  filebeatZeek: 0,
  packetbeatDNS: 44,
  packetbeatFlow: 588,
  packetbeatTLS: 0 }
    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/overview_network.ts:97:36)
    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' +
    '  "auditbeatSocket": [null]\n' +
    '  "filebeatCisco": [null]\n' +
    '  "filebeatNetflow": [null]\n' +
    '  "filebeatPanw": [null]\n' +
    '  "filebeatSuricata": [null]\n' +
    '  "filebeatZeek": [null]\n' +
    '  "packetbeatDNS": [null]\n' +
    '  "packetbeatFlow": [null]\n' +
    '  "packetbeatTLS": [null]\n' +
    '}',
  expected: '{\n' +
    '  "auditbeatSocket": 0\n' +
    '  "filebeatCisco": 0\n' +
    '  "filebeatNetflow": 0\n' +
    '  "filebeatPanw": 0\n' +
    '  "filebeatSuricata": 0\n' +
    '  "filebeatZeek": 0\n' +
    '  "packetbeatDNS": 44\n' +
    '  "packetbeatFlow": 588\n' +
    '  "packetbeatTLS": 0\n' +
    '}',
  showDiff: true
}

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
securitySolution 4.6MB 4.6MB -224.0B

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

@vitaliidm vitaliidm added v8.0.0 release_note:fix Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Feature:Rule Management Security Solution Detection Rule Management area labels Oct 21, 2021
@vitaliidm vitaliidm force-pushed the fix-rule-name-display-on-rules-table branch from c23d519 to d7d9b76 Compare October 21, 2021 13:48
@vitaliidm vitaliidm marked this pull request as ready for review October 21, 2021 17:06
@vitaliidm vitaliidm requested a review from a team as a code owner October 21, 2021 17:06
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

Copy link
Contributor

@xcrzx xcrzx left a comment

Choose a reason for hiding this comment

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

I checked locally, everything looks fine 👍 Thank you for the fix! Added a comment about tests, though.

test.each([
['Rules', rulesColumns],
['Rule Monitoring', ruleMonitoringColumns],
])('table "%s" should not have truncated text options for column items', (_, columns) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need these tests? All they do is check config values. As soon as config values change, we'll need to update the tests as well. So they add some maintenance burden, but it doesn't look like they can catch an actual bug.

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 config value would change and no refactoring done to how certain cells are rendering(name, tags, etc), it will bring the issue again.
So, idea behind those tests was to help preventing the issue to come back and to make dev conscious about config changes(probably some additional comment to the tests might be helpful as well, let me know if it makes sense).

What do you think would be a better option? Remove tests altogether or add different ones?

Copy link
Contributor

Choose a reason for hiding this comment

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

We have a business requirement, which (very simplified) sounds like: "Table content should be visible to users". And a test that verifies that the table config doesn't contain the truncateText value. I think this config value is a detail of the internal implementation of the table component. And the absence of the truncateText config property doesn't mean that the table content is fully visible. The property could be removed or renamed, or the table could start cropping every column, disregarding the config value. In all these cases, the test will still be green.

I think we should design our test in a way that helps us verify business requirements without knowing internal implementation details. And for this particular case, it could be a cypress test that checks table elements visibility or a visual regression test (but we don't have an infrastructure for visual regression testing afaik). But I don't think it's worth adding complicated test cases to cover this requirement, so just removing the current tests would also be acceptable.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have a super strong opinion on this, but @xcrzx 's thoughts make sense to me.

  • For a developer who would jump into these tests it wouldn't be immediately clear why these tests are there and what behaviour/requirements they actually verify. Adding a link to the bug in a comment would help (please do if you decide to keep these tests).
  • The tests seem to check internal implementation details, and there's a chance that some refactoring (in EUI or on our side) would break them.
  • These tests don't 100% guarantee that the 2 tables actually use the values from getColumns and getMonitoringColumns (unless there are tests for that specifically).

it could be a cypress test that checks table elements visibility

This could be an option, but Cypress sounds too heavy imho. I would check if there's a way to deeply render the full table in a unit test and verify that the content in all cells is not truncated. If that's possible.

Still I think it would be a relatively brittle test. UI requirements might change often, we might introduce new components that would render the content differently, etc.

or a visual regression test (but we don't have an infrastructure for visual regression testing afaik)

Imho this would be a preferable type of test in this case. But I haven't heard about visual regression testing for Kibana either.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the meaningful feedback @banderror, @xcrzx.

I've removed tests.

I would check if there's a way to deeply render the full table in a unit test and verify that the content in all cells is not truncated. If that's possible.

I think, it's not. Jsdom doesn't load layout, and truncation happens within CSS. So either cypress or visual regression tests could handle such case.

I agree that these tests did not guarantee desired outcome. Just want to give you a bit of a thought process behind the decision. I basically treated getColumns as a public method of columns module, that exposes contract to third part component: EuiBasicTable. Ideally, only major version of @elastic/eui would've pose threat to break intended functionality. But unfortunately, these tests would've not be able to catch it anyway.

@banderror
Copy link
Contributor

@elasticmachine merge upstream

@banderror banderror added bug Fixes for quality problems that affect the customer experience v7.16.0 labels Oct 26, 2021
Copy link
Contributor

@banderror banderror left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thank you for the fix and congrats with the first PR in Kibana ❤️

Left my 2 cents regarding the tests, but I'm ok with whatever decision you will come to with @xcrzx. If you decide to rework the tests, I'd suggest to do it in a separate PR - so we could merge this one before the next 7.16 BC (build candidate) which is planned for tomorrow (see https://github.com/elastic/dev/issues/1809).

test.each([
['Rules', rulesColumns],
['Rule Monitoring', ruleMonitoringColumns],
])('table "%s" should not have truncated text options for column items', (_, columns) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have a super strong opinion on this, but @xcrzx 's thoughts make sense to me.

  • For a developer who would jump into these tests it wouldn't be immediately clear why these tests are there and what behaviour/requirements they actually verify. Adding a link to the bug in a comment would help (please do if you decide to keep these tests).
  • The tests seem to check internal implementation details, and there's a chance that some refactoring (in EUI or on our side) would break them.
  • These tests don't 100% guarantee that the 2 tables actually use the values from getColumns and getMonitoringColumns (unless there are tests for that specifically).

it could be a cypress test that checks table elements visibility

This could be an option, but Cypress sounds too heavy imho. I would check if there's a way to deeply render the full table in a unit test and verify that the content in all cells is not truncated. If that's possible.

Still I think it would be a relatively brittle test. UI requirements might change often, we might introduce new components that would render the content differently, etc.

or a visual regression test (but we don't have an infrastructure for visual regression testing afaik)

Imho this would be a preferable type of test in this case. But I haven't heard about visual regression testing for Kibana either.

@banderror banderror added the auto-backport Deprecated - use backport:version if exact versions are needed label Oct 26, 2021
@xcrzx
Copy link
Contributor

xcrzx commented Oct 27, 2021

@elasticmachine merge upstream

@vitaliidm
Copy link
Contributor Author

@elasticmachine merge upstream

@vitaliidm
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

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
securitySolution 4.5MB 4.5MB -224.0B

History

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

cc @vitaliidm

@vitaliidm vitaliidm merged commit b481bff into elastic:main Oct 29, 2021
@kibanamachine
Copy link
Contributor

The following labels were identified as gaps in your version labels and will be added automatically:

  • v8.1.0

If any of these should not be on your pull request, please manually remove them.

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Oct 29, 2021
…ules table (elastic#115825)

* Fix truncated rule name on rules table

* remove empty line

* remove truncateText for all rules table columns

* rename unit tests

* refactor unit tests

* fix ts error

* fix ts error

* remove config line

* fix types after kbn bootstrap

* CR: remove unnecesary tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Oct 29, 2021
…ules table (elastic#115825)

* Fix truncated rule name on rules table

* remove empty line

* remove truncateText for all rules table columns

* rename unit tests

* refactor unit tests

* fix ts error

* fix ts error

* remove config line

* fix types after kbn bootstrap

* CR: remove unnecesary tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
8.0
7.16

The backport PRs will be merged automatically after passing CI.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Nov 1, 2021
kibanamachine added a commit that referenced this pull request Nov 1, 2021
…ules table (#115825) (#116795)

* Fix truncated rule name on rules table

* remove empty line

* remove truncateText for all rules table columns

* rename unit tests

* refactor unit tests

* fix ts error

* fix ts error

* remove config line

* fix types after kbn bootstrap

* CR: remove unnecesary tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Vitalii Dmyterko <92328789+vitaliidm@users.noreply.github.com>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Nov 2, 2021
kibanamachine added a commit that referenced this pull request Nov 2, 2021
…ules table (#115825) (#116796)

* Fix truncated rule name on rules table

* remove empty line

* remove truncateText for all rules table columns

* rename unit tests

* refactor unit tests

* fix ts error

* fix ts error

* remove config line

* fix types after kbn bootstrap

* CR: remove unnecesary tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Vitalii Dmyterko <92328789+vitaliidm@users.noreply.github.com>
@vitaliidm vitaliidm deleted the fix-rule-name-display-on-rules-table branch November 2, 2021 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed bug Fixes for quality problems that affect the customer experience Feature:Rule Management Security Solution Detection Rule Management area release_note:fix Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v7.16.0 v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants