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

Get trail status #32960

Merged

Conversation

kcelovic
Copy link
Contributor

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

fixes: link to the issue

Description

A few sentences describing the overall goals of the pull request's commits.

Must have

  • Tests
  • Documentation

@CLAassistant
Copy link

CLAassistant commented Feb 15, 2024

CLA assistant check
All committers have signed the CLA.

@content-bot content-bot added Contribution Thank you! Contributions are always welcome! External PR Xsoar Support Level Indicates that the contribution is for XSOAR supported pack labels Feb 15, 2024
@content-bot content-bot changed the base branch from master to contrib/kcelovic_get-trail-status February 15, 2024 20:28
@content-bot
Copy link
Collaborator

Thank you for your contribution. Your generosity and caring are unrivaled! Make sure to register your contribution by filling the Contribution Registration form, so our content wizard @YuvHayun will know the proposed changes are ready to be reviewed.
For your convenience, here is a link to the contributions SLAs document.

@content-bot content-bot requested a review from YuvHayun February 15, 2024 20:28
@content-bot
Copy link
Collaborator

Hi @kcelovic, thanks for contributing to a Cortex XSOAR supported pack. To receive credit for your generous contribution please follow this link.

Copy link
Contributor

@YuvHayun YuvHayun left a comment

Choose a reason for hiding this comment

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

Hey @kcelovic, thx for your contribution!
Looks good in general, please make sure to add tests, sign the CLA, and address my comments.
Let me know if you have any questions.

@YuvHayun YuvHayun added the pending-contributor The PR is pending the response of its creator label Feb 18, 2024
Copy link
Contributor

@YuvHayun YuvHayun left a comment

Choose a reason for hiding this comment

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

The try & except comment is still relevant.
Also, tests are still needed.
Let me know when you're ready for re-review.

@kcelovic
Copy link
Contributor Author

The try & except comment is still relevant. Also, tests are still needed. Let me know when you're ready for re-review.

@YuvHayun what kind of tests are needed? playbook test?

Copy link
Contributor

@YuvHayun YuvHayun left a comment

Choose a reason for hiding this comment

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

Hey @kcelovic, I left some comments.
I'm talking about unit tests in the AWS-CloudTrail_test.py file.
Also, please make sure to update the readme to include the new command.
This can be done easily using the command `demisto-sdk generate-docs AWS-CloudTrail.yml'

@kcelovic kcelovic requested a review from YuvHayun February 27, 2024 05:42
@kcelovic kcelovic requested a review from YuvHayun March 1, 2024 19:35
Comment on lines 427 to 446
'''EXECUTION BLOCK'''
try:
if demisto.command() == 'test-module':
test_function()
if demisto.command() == 'aws-cloudtrail-create-trail':
create_trail(demisto.args())
if demisto.command() == 'aws-cloudtrail-delete-trail':
delete_trail(demisto.args())
if demisto.command() == 'aws-cloudtrail-describe-trails':
describe_trails(demisto.args())
if demisto.command() == 'aws-cloudtrail-update-trail':
update_trail(demisto.args())
if demisto.command() == 'aws-cloudtrail-start-logging':
start_logging(demisto.args())
if demisto.command() == 'aws-cloudtrail-stop-logging':
stop_logging(demisto.args())
if demisto.command() == 'aws-cloudtrail-lookup-events':
lookup_events(demisto.args())
if demisto.command() == 'aws-cloudtrail-get-trail-status':
get_trail_status(demisto.args())
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you remove the main()?
Please revert this change.
Also, the video you send me is not working for some reason.. please attach a new one.
Let's make sure to whole build flow is passing and that the video is attached and I'll move on with the pr.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changes reverted. new video attached.

Screen.Recording.2024-03-05.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@YuvHayun I am unsure why the tests are failing, let me know if additional changes are needed.

@kcelovic kcelovic requested a review from YuvHayun March 5, 2024 22:59
Copy link
Contributor

@YuvHayun YuvHayun left a comment

Choose a reason for hiding this comment

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

Hey @kcelovic, I left some comments about places in the code that I think are failing for you.
Please also add tests to the new command you've added.

Comment on lines 106 to 109
def handle_returning_date_to_string(date_obj: datetime | str | None) -> str:
"""Gets date object to string"""
# if the returning date is a string leave it as is.
if isinstance(date_obj, str):
# if the returning date is a string or None, leave it as is.
if date_obj is None or isinstance(date_obj, str):
Copy link
Contributor

Choose a reason for hiding this comment

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

Something is odd about this logic, if date_obj is None and we return it then the function should support None return (in that case let's also make sure it doesn't break any b/c).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What changes do you recommend here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove the None option from the argument anotation.

Copy link
Contributor

@YuvHayun YuvHayun left a comment

Choose a reason for hiding this comment

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

And the unit tests.

Comment on lines 106 to 109
def handle_returning_date_to_string(date_obj: datetime | str | None) -> str:
"""Gets date object to string"""
# if the returning date is a string leave it as is.
if isinstance(date_obj, str):
# if the returning date is a string or None, leave it as is.
if date_obj is None or isinstance(date_obj, str):
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove the None option from the argument anotation.

@kcelovic kcelovic requested a review from YuvHayun March 8, 2024 22:35
@YuvHayun
Copy link
Contributor

Great job @kcelovic!
Thx for your contribution! merging to internal pr.

@YuvHayun YuvHayun merged commit f3fdb70 into demisto:contrib/kcelovic_get-trail-status Mar 10, 2024
21 of 24 checks passed
@content-bot content-bot mentioned this pull request Mar 10, 2024
5 tasks
Copy link

Thank you for your contribution. Your external PR has been merged and the changes are now included in an internal PR for further review. The internal PR will be merged to the master branch within 3 business days.

YuvHayun added a commit that referenced this pull request Mar 10, 2024
* Get trail status (#32960)

* "contribution update to pack "AWS - CloudTrail""

* made requested changes

* Update Packs/AWS-CloudTrail/ReleaseNotes/1_1_0.md

Co-authored-by: Yuval Hayun <[email protected]>

* Update Packs/AWS-CloudTrail/Integrations/AWS-CloudTrail/AWS-CloudTrail.yml

Co-authored-by: Yuval Hayun <[email protected]>

* Update Packs/AWS-CloudTrail/Integrations/AWS-CloudTrail/AWS-CloudTrail.yml

Co-authored-by: Yuval Hayun <[email protected]>

* Update Packs/AWS-CloudTrail/Integrations/AWS-CloudTrail/AWS-CloudTrail.py

Co-authored-by: Yuval Hayun <[email protected]>

* removed try & except under get_trail_status function

* fixed indent

* fixed typo

* fixed typo

* made requested changes

* updated docker version

* updated docker

* fixed typos

* reverted change on package-lock.json

* reverted changes as requested

* revert package-lock.json

* update dockerimage

* Update 1_1_0.md

* Update AWS-CloudTrail.py

* Update AWS-CloudTrail.yml

* Update 1_1_0.md

* Update AWS-CloudTrail.py

* Update AWS-CloudTrail.py

* Update AWS-CloudTrail.py

* Update AWS-CloudTrail.py

* Update Packs/AWS-CloudTrail/Integrations/AWS-CloudTrail/AWS-CloudTrail.py

Co-authored-by: Yuval Hayun <[email protected]>

* Update AWS-CloudTrail_test.py

* Update 1_1_0.md

* Update AWS-CloudTrail.yml

---------

Co-authored-by: xsoar-bot <[email protected]>
Co-authored-by: Yuval Hayun <[email protected]>

* revert package-lcok

* remove docker line

---------

Co-authored-by: kcelovic <[email protected]>
Co-authored-by: xsoar-bot <[email protected]>
Co-authored-by: Yuval Hayun <[email protected]>
Co-authored-by: YuvHayun <[email protected]>
pal-xmco pushed a commit to pal-xmco/content that referenced this pull request Jun 19, 2024
* Get trail status (demisto#32960)

* "contribution update to pack "AWS - CloudTrail""

* made requested changes

* Update Packs/AWS-CloudTrail/ReleaseNotes/1_1_0.md

Co-authored-by: Yuval Hayun <[email protected]>

* Update Packs/AWS-CloudTrail/Integrations/AWS-CloudTrail/AWS-CloudTrail.yml

Co-authored-by: Yuval Hayun <[email protected]>

* Update Packs/AWS-CloudTrail/Integrations/AWS-CloudTrail/AWS-CloudTrail.yml

Co-authored-by: Yuval Hayun <[email protected]>

* Update Packs/AWS-CloudTrail/Integrations/AWS-CloudTrail/AWS-CloudTrail.py

Co-authored-by: Yuval Hayun <[email protected]>

* removed try & except under get_trail_status function

* fixed indent

* fixed typo

* fixed typo

* made requested changes

* updated docker version

* updated docker

* fixed typos

* reverted change on package-lock.json

* reverted changes as requested

* revert package-lock.json

* update dockerimage

* Update 1_1_0.md

* Update AWS-CloudTrail.py

* Update AWS-CloudTrail.yml

* Update 1_1_0.md

* Update AWS-CloudTrail.py

* Update AWS-CloudTrail.py

* Update AWS-CloudTrail.py

* Update AWS-CloudTrail.py

* Update Packs/AWS-CloudTrail/Integrations/AWS-CloudTrail/AWS-CloudTrail.py

Co-authored-by: Yuval Hayun <[email protected]>

* Update AWS-CloudTrail_test.py

* Update 1_1_0.md

* Update AWS-CloudTrail.yml

---------

Co-authored-by: xsoar-bot <[email protected]>
Co-authored-by: Yuval Hayun <[email protected]>

* revert package-lcok

* remove docker line

---------

Co-authored-by: kcelovic <[email protected]>
Co-authored-by: xsoar-bot <[email protected]>
Co-authored-by: Yuval Hayun <[email protected]>
Co-authored-by: YuvHayun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution Thank you! Contributions are always welcome! docs-approved External PR pending-contributor The PR is pending the response of its creator Xsoar Support Level Indicates that the contribution is for XSOAR supported pack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants