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

Update for Pack: Gatewatcher AionIQ #38289

Open
wants to merge 160 commits into
base: contrib/clement-lyonnet_gcenter103-1-3-0
Choose a base branch
from

Conversation

clement-lyonnet
Copy link

Contributing to Cortex XSOAR Content

Make sure to register your contribution by filling the contribution registration form

The Pull Request will be reviewed only after the contribution registration form is filled.

Status

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Related Issues

None

Description

Update for GCenter103 integration.
Add commands to this integration to interact with the GCenter API.
Updated layouts to display indicators of incidents.

Must have

  • Tests
  • Documentation

…note, playbook sample updated, integration configuration updated
@clement-lyonnet
Copy link
Author

Hi @ilaredo and the documentation team,

Thanks for your indications, I tried to apply the requested changes.

However, I am not able to generate unit tests files using this command:
demisto-sdk generate-unit-tests -i Packs/Gatewatcher-AionIQ/Integrations/GCenter103/GCenter103.py -e Packs/Gatewatcher-AionIQ/Integrations/GCenter103/command_examples.txt --insecure -a

Am I missing something?

@ilaredo
Copy link
Contributor

ilaredo commented Feb 12, 2025

What is the failure reason?

@clement-lyonnet
Copy link
Author

2025-02-12 10:56:18.209 | INFO |
Running code parser and testing generator. @ generate_unit_tests.py:360 (function)
2025-02-12 10:56:18.210 | DEBUG | Starting parsing input code into ast. @ generate_unit_tests.py:361 (function)
2025-02-12 10:56:18.456 | DEBUG | Finished parsing code into ast. @ generate_unit_tests.py:363 (function)
2025-02-12 10:56:20.503 | INFO | Running solver for test generating. @ generate_unit_tests.py:366 (function)
2025-02-12 10:56:20.506 | DEBUG | Obtaining client class ast. @ generate_unit_tests.py:221 (function)
2025-02-12 10:56:20.506 | INFO | An error occurred: ("'NoneType' object has no attribute 'name'",) @ generate_unit_tests.py:348 (function)

@ilaredo
Copy link
Contributor

ilaredo commented Feb 12, 2025

can you add the latest logs file? it should be at ./Users/username/.demisto-sdk/logs
I hope this issue is quick to fix but always it is possible to write it manually:)

@clement-lyonnet
Copy link
Author

I think this is the one you asked

demisto_sdk_debug.log

@ilaredo
Copy link
Contributor

ilaredo commented Feb 13, 2025

Hi @clement-lyonnet,
I wanted to inform you that the issue is not a quick fix and will require some time to resolve. If you are able to, please consider writing the code for the unit test yourself. Alternatively, if you prefer not to, then please await the resolution of the issue.

Thank you for your understanding.

@ilaredo ilaredo added the ready-for-instance-test In contribution PRs, this label will cause a trigger of a build with a modified pack from the PR. label Feb 19, 2025
@content-bot
Copy link
Collaborator

For the Reviewer: Trigger build request has been accepted for this contribution PR.

@content-bot
Copy link
Collaborator

For the Reviewer: Successfully created a pipeline in GitLab with url: https://gitlab.xdr.pan.local/xdr/cortex-content/content/-/pipelines/2492823

@content-bot content-bot removed the ready-for-instance-test In contribution PRs, this label will cause a trigger of a build with a modified pack from the PR. label Feb 19, 2025
@ilaredo ilaredo added the ready-for-instance-test In contribution PRs, this label will cause a trigger of a build with a modified pack from the PR. label Feb 20, 2025
@content-bot
Copy link
Collaborator

For the Reviewer: Trigger build request has been accepted for this contribution PR.

@content-bot
Copy link
Collaborator

For the Reviewer: Successfully created a pipeline in GitLab with url: https://gitlab.xdr.pan.local/xdr/cortex-content/content/-/pipelines/2531224

@content-bot content-bot removed the ready-for-instance-test In contribution PRs, this label will cause a trigger of a build with a modified pack from the PR. label Feb 20, 2025
@ilaredo
Copy link
Contributor

ilaredo commented Feb 24, 2025

Hi @clement-lyonnet,
I haven't heard from you for a while. How is the unit test writing going on? do you need help?

@clement-lyonnet
Copy link
Author

clement-lyonnet commented Feb 24, 2025

Hi @ilaredo, I have tried to push unit tests, it passes pytest command locally and here on the PR.
However, in the PR pipeline it displays the following message: Unit-tests for 'Packs/Gatewatcher-AionIQ/Integrations/GCenter103/GCenter103.py' must reach a coverage of at least 69.39 percent (currently: 63.29 percent).
Let me know if I have to modify things :)

@ilaredo
Copy link
Contributor

ilaredo commented Feb 24, 2025

To improve your code quality, you should increase the number of unit tests. The threshold for code coverage is set at 69.39%, which means that almost 70% of your code should be covered by unit tests. Therefore, make sure to test all functions and parts of the code that have not been tested yet.
Please see here about unit testing.
How to write unit test
Good example for unit tests: Proofpoint TAP v2 integration
And also, dont forget to remove all your # noqa: F405 from your code which will make you cover all these commands with unit tests

@ilaredo
Copy link
Contributor

ilaredo commented Feb 27, 2025

Hi @clement-lyonnet ,
Have you reached the coverage threshold?
Also, I see that the pre-commit is still failing. Please let me know about the progress of this PR and if you need any help. I'll take a look at it!

@ilaredo ilaredo added the ready-for-instance-test In contribution PRs, this label will cause a trigger of a build with a modified pack from the PR. label Mar 4, 2025
@content-bot
Copy link
Collaborator

For the Reviewer: Trigger build request has been accepted for this contribution PR.

@content-bot
Copy link
Collaborator

For the Reviewer: Successfully created a pipeline in GitLab with url: https://gitlab.xdr.pan.local/xdr/cortex-content/content/-/pipelines/2637509

@content-bot content-bot removed the ready-for-instance-test In contribution PRs, this label will cause a trigger of a build with a modified pack from the PR. label Mar 4, 2025
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ clement-lyonnet
❌ amshamah419
You have signed the CLA already but the status is still pending? Let us recheck it.

@clement-lyonnet
Copy link
Author

Hi @ilaredo, sorry for the response delay. We are currently under functionnal tests after discovering an unexpected behavior. In addition, we are working with the unit tests. We will update the PR as soon as possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution Form Filled Whether contribution form filled or not. Contribution Thank you! Contributions are always welcome! docs-approved External PR Partner Support Level Indicates that the contribution is for Partner supported pack Partner Partner-Approved pending-contributor The PR is pending the response of its creator Security Approved If a contribution has been approved for merge by the security team, then this will allow a merge Security Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants