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

[platform] Improve CSV mapper behavior to allow correct count and failure tracking (#6844) #6862

Merged
merged 5 commits into from
May 25, 2024

Conversation

richard-julien
Copy link
Member

@richard-julien richard-julien self-assigned this May 1, 2024
@richard-julien richard-julien added the filigran team use to identify PR from the Filigran team label May 1, 2024
@richard-julien richard-julien added this to the Release 6.1.0 milestone May 1, 2024
Copy link

codecov bot commented May 1, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 50 lines in your changes are missing coverage. Please review.

Project coverage is 67.67%. Comparing base (504101c) to head (b17308d).
Report is 3 commits behind head on master.

Files Patch % Lines
...hql/src/connector/importCsv/importCsv-connector.ts 0.00% 28 Missing ⚠️
...latform/opencti-graphql/src/types/stix-common.d.ts 0.00% 18 Missing ⚠️
...-platform/opencti-graphql/src/parser/csv-parser.ts 70.00% 3 Missing ⚠️
...platform/opencti-graphql/src/parser/csv-bundler.ts 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6862      +/-   ##
==========================================
+ Coverage   67.48%   67.67%   +0.19%     
==========================================
  Files         561      561              
  Lines       68734    68741       +7     
  Branches     5774     5990     +216     
==========================================
+ Hits        46384    46522     +138     
+ Misses      22350    22219     -131     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SamuelHassine SamuelHassine removed this from the Release 6.1.0 milestone May 2, 2024
Copy link
Member

@lndrtrbn lndrtrbn left a comment

Choose a reason for hiding this comment

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

I don't know how to test a complex bundle with errors in it to test the use case but locally tested normal csv mappers and import data works correctly

@labo-flg labo-flg self-requested a review May 6, 2024 15:29
if event_type == "bundle":
content = base64.b64decode(data["content"]).decode("utf-8")
update = data["update"] if "update" in data else False
self.api.stix2.import_bundle_from_json(
content, update, types, processing_count
imported_items = self.api.stix2.import_bundle_from_json(
Copy link
Member

Choose a reason for hiding this comment

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

import_bundle_from_json returns a list of elements, not a number, and imported_items is initialized at 0. is it a list or a number ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Its a list, the initialization to 0 must be an empty array. Thanks

@labo-flg
Copy link
Member

I pushed the rebase to master ; conflict in requirements.txt.

@labo-flg
Copy link
Member

I pushed the rebase to master ; conflict in requirements.txt.

CI is red, we probably need to rebase also the corresponding branch in python-client

@richard-julien richard-julien merged commit e58bac2 into master May 25, 2024
5 checks passed
@richard-julien richard-julien deleted the issue/6844 branch May 25, 2024 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
5 participants