elastic / integrations

Elastic Integrations
https://www.elastic.co/integrations
Other
28 stars 444 forks source link

carbon_black_cloud: fix timestamp type when using cursor value #11221

Closed efd6 closed 1 month ago

efd6 commented 1 month ago

Proposed commit message

When using the cursor value, the start expression in the range macro is a string since state.cursor.last_backend_update_timestamp is a string. This results in a comparison of range.start (string) with range.end (timestamp) which is not a valid type match for the \< operator. So we end up with a "no such overload". If the value is optional.none, we use delayed (timestamp) which is the correct type. Ensure that the expression is always a timestamp by doing a conversion on the resulting value, noting that a timestamp(timestamp(x)) is valid if timestamp(x) is.

Checklist

Author's Checklist

How to test this PR locally

Related issues

Screenshots

elastic-vault-github-plugin-prod[bot] commented 1 month ago

:rocket: Benchmarks report

Package carbon_black_cloud :+1:(3) :green_heart:(2) :broken_heart:(1)

Expand to view Data stream | Previous EPS | New EPS | Diff (%) | Result ----------- | ------------ | ------- | -------- | ------ `asset_vulnerability_summary` | 14492.75 | 10869.57 | -3623.18 (-25%) | :broken_heart:

To see the full report comment with /test benchmark fullreport

elasticmachine commented 1 month ago

:green_heart: Build Succeeded

History

cc @efd6

elastic-sonarqube[bot] commented 1 month ago

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube

elasticmachine commented 1 month ago

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

elastic-vault-github-plugin-prod[bot] commented 1 month ago

Package carbon_black_cloud - 2.5.3 containing this change is available at https://epr.elastic.co/search?package=carbon_black_cloud