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

[backend] use component name in traces and fix warn issue.(#8352)(#8310) #8625

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

aHenryJard
Copy link
Member

Proposed changes

  • Fix the 'warn' level
  • Use component user define name in traces instead of generic component name.

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case (coverage and e2e)
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

@github-actions github-actions bot added the filigran team use to identify PR from the Filigran team label Oct 7, 2024
@aHenryJard aHenryJard marked this pull request as ready for review October 7, 2024 11:57
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 65.97%. Comparing base (263582d) to head (36caeba).
Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
...orm/opencti-graphql/src/manager/playbookManager.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8625      +/-   ##
==========================================
+ Coverage   65.93%   65.97%   +0.03%     
==========================================
  Files         597      597              
  Lines       60694    60720      +26     
  Branches     6201     6229      +28     
==========================================
+ Hits        40021    40057      +36     
+ Misses      20673    20663      -10     

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

@@ -110,7 +110,7 @@ const PLAYBOOK_LOGGER_COMPONENT_SCHEMA: JSONSchemaType<LoggerConfiguration> = {
oneOf: [
{ const: 'debug', title: 'debug' },
{ const: 'info', title: 'info' },
{ const: 'warning', title: 'warning' },
{ const: 'warn', title: 'warn' },
Copy link
Member

Choose a reason for hiding this comment

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

Seems ok but I don't know how to test this part?

Copy link
Member Author

Choose a reason for hiding this comment

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

you need a component
image

if you test on master with 'warning', you will see an error in console log of opencti, when using this fix the bundle is in log with warn level.

Copy link
Member

Choose a reason for hiding this comment

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

tested ok 👌

@@ -157,7 +157,7 @@ export const playbookExecutor = async ({
const durationDiff = end.diff(start);
const duration = moment.duration(durationDiff);
const observation: ObservationFn = {
message: `${nextStep.component.name.trim()} successfully executed in ${duration.humanize()}`,
message: `${nextStep.instance.name.trim()} successfully executed in ${duration.humanize()}`,
Copy link
Member

Choose a reason for hiding this comment

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

locally tested ok 👌

@aHenryJard aHenryJard merged commit 93f1a93 into master Oct 8, 2024
6 checks passed
@aHenryJard aHenryJard deleted the issue/8352-playbook-traces branch October 28, 2024 09:25
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
2 participants