-
Notifications
You must be signed in to change notification settings - Fork 44
[Doppel] Refactor parameter names in DoppelVision actions for consistency #434
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
base: main
Are you sure you want to change the base?
[Doppel] Refactor parameter names in DoppelVision actions for consistency #434
Conversation
Summary of ChangesHello @siddharths1-metron, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the maintainability and clarity of the DoppelVision integration by standardizing parameter names within its various actions. The changes involve a straightforward refactoring of configuration parameter names, replacing underscore-separated names with space-separated ones. This ensures a more consistent naming convention across the integration, making the code easier to read and understand for future development and maintenance. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors parameter names for consistency, which is a good improvement. The changes correctly align the parameter names in the action scripts with the definition.yaml.
However, my review identified several critical issues and style guide violations across the modified files that should be addressed:
- Critical Security Vulnerability: In
Ping.py, the API key is logged in plain text, which is a severe security risk and violates the repository's style guide. - Bugs: The
Ping.pyaction incorrectly uses string values"true"and"false"for the result status, where booleans are expected. - Style Guide Violations:
- None of the
mainfunctions in the modified action files have type annotations or docstrings, which are mandatory. - Actions that produce JSON results are missing the required
_json_example.jsonfiles in aresources/directory. - The integration uses the synchronous
requestslibrary for network calls, while the style guide recommends asynchronous libraries likehttpxoraiohttpfor better performance in I/O-bound operations. - Unit test coverage appears minimal, while the style guide requires comprehensive tests for integrations in this part of the repository.
- None of the
- Inconsistency: Some parameter names in
GetAlert.pyandUpdateAlert.pystill usesnake_case, which is inconsistent with the goal of this PR.
I've added detailed comments in each file. Please address the critical security issue and the bug in Ping.py with the highest priority.
| api_key = siemplify.extract_configuration_param( | ||
| provider_name="DoppelVision", | ||
| param_name="API_Key", | ||
| param_name="API Key", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| api_key = siemplify.extract_configuration_param( | ||
| provider_name="DoppelVision", | ||
| param_name="API_Key", | ||
| param_name="API Key", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| api_key = siemplify.extract_configuration_param( | ||
| provider_name="DoppelVision", | ||
| param_name="API_Key", | ||
| param_name="API Key", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file has a few style guide violations that should be addressed:
- Missing Type Hints & Docstring: The
mainfunction lacks required type annotations and a Google-style docstring (Style Guide lines 80, 90). - Missing JSON Example: This action uses
siemplify.result.add_result_json()(line 43), which requires a correspondingCreateAbuseAlert_json_example.jsonfile in theresources/directory (Style Guide lines 155-158). - Generic Exception: The
except Exceptionblock on line 47 should ideally catch a more specific exception type, such asrequests.RequestExceptionif that's what the manager layer can raise.
References
| api_key = siemplify.extract_configuration_param( | ||
| provider_name="DoppelVision", | ||
| param_name="API_Key", | ||
| param_name="API Key", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file has a few style guide violations that should be addressed:
- Missing Type Hints & Docstring: The
mainfunction lacks required type annotations and a Google-style docstring (Style Guide lines 80, 90). - Missing JSON Example: This action uses
siemplify.result.add_result_json()(line 42), which requires a correspondingCreateAlert_json_example.jsonfile in theresources/directory (Style Guide lines 155-158). - Generic Exception: The
except Exceptionblock on line 47 should ideally catch a more specific exception type.
References
| api_key = siemplify.extract_configuration_param( | ||
| provider_name="DoppelVision", | ||
| param_name="API_Key", | ||
| param_name="API Key", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file has several issues that should be addressed:
- Inconsistent Parameter Name: For consistency with this PR's changes, the
param_nameAlert_IDon line 29 should be updated toAlert ID. - Missing Type Hints & Docstring: The
mainfunction lacks required type annotations and a Google-style docstring (Style Guide lines 80, 90). - Missing JSON Example: The action uses
siemplify.result.add_result_json()(line 51), which requires a correspondingGetAlert_json_example.jsonfile in theresources/directory (Style Guide lines 155-158). - Generic Exception: The
except Exceptionon line 56 is too broad and should be more specific.
References
| api_key = siemplify.extract_configuration_param( | ||
| provider_name="DoppelVision", | ||
| param_name="API_Key", | ||
| param_name="API Key", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file has a few style guide violations that should be addressed:
- Missing Type Hints & Docstring: The
mainfunction lacks required type annotations and a Google-style docstring (Style Guide lines 80, 90). - Missing JSON Example: This action uses
siemplify.result.add_result_json()(line 95), which requires a correspondingGetAlerts_json_example.jsonfile in theresources/directory (Style Guide lines 155-158). - Generic Exception: The
except Exceptionblock on line 101 should ideally catch a more specific exception type.
References
| api_key = siemplify.extract_configuration_param( | ||
| provider_name="DoppelVision", | ||
| param_name="API_Key", | ||
| param_name="API Key", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main function is missing required type annotations and a Google-style docstring, as per the repository style guide (lines 80, 90).
| api_key = siemplify.extract_configuration_param( | ||
| provider_name="DoppelVision", | ||
| param_name="API_Key", | ||
| param_name="API Key", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file has several areas for improvement to align with the project's standards:
- Inconsistent Parameter Names:
param_names forAlert_ID(line 29),Queue_State(line 31), andEntity_State(line 35) still usesnake_case. For consistency with this PR, they should be updated to use spaces (e.g.,Alert ID). - Missing Type Hints & Docstring: The
mainfunction lacks required type annotations and a Google-style docstring (Style Guide lines 80, 90). - Missing JSON Example: The action uses
siemplify.result.add_result_json()(line 64), which requires a correspondingUpdateAlert_json_example.jsonfile in theresources/directory (Style Guide lines 155-158). - Generic Exception: The
except Exceptionon line 69 is too broad. It's better to catch more specific exceptions, likerequests.RequestExceptionfrom the manager.
Refactor parameter names in DoppelVision actions for consistency with definiton.yaml
Description
What problem does this PR solve?
The Doppel integration is not able to fetch API key and other credentials due to mismatch in parameter names.
How does this PR solve the problem?
We have modified to parameter values to be consistent with definition.yaml file.
Checklist:
Please ensure you have completed the following items before submitting your PR.
This helps us review your contribution faster and more efficiently.
General Checks:
Open-Source Specific Checks:
For Google Team Members and Reviewers Only:
Screenshots (If Applicable)
If your changes involve UI or visual elements, please include screenshots or GIFs here.
Ensure any sensitive data is redacted or generalized.
Further Comments / Questions
Any additional comments, questions, or areas where you'd like specific feedback.