Skip to content

migrate micro_focus_itsma#607

Open
haggit-eliyahu wants to merge 3 commits intomainfrom
migrate-micro_focus_itsma-integration
Open

migrate micro_focus_itsma#607
haggit-eliyahu wants to merge 3 commits intomainfrom
migrate-micro_focus_itsma-integration

Conversation

@haggit-eliyahu
Copy link
Contributor

No description provided.

@haggit-eliyahu haggit-eliyahu requested a review from a team as a code owner March 10, 2026 13:55
@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

1 similar comment
@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 adds a new integration for Micro Focus ITSMA, allowing users to interact with the ITSMA platform to manage incidents. It includes actions for creating, updating, and checking the connection to ITSMA, enhancing the platform's ability to integrate with external service management tools.

Highlights

  • New Integration: This pull request introduces a new integration for Micro Focus ITSMA, enabling users to manage incidents and their statuses.
  • Core Functionality: The integration provides actions to create, update, and ping incidents, along with updating their external status.
  • Configuration: The integration requires configuration parameters such as API Root, Username, Password, Tenant ID, and External System to connect to Micro Focus ITSMA.

🧠 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.

Activity
  • New integration added for Micro Focus ITSMA.
  • Includes actions to create, update, and ping incidents.
  • Adds functionality to update the external status of incidents.
  • Requires configuration parameters for connecting to Micro Focus ITSMA.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 is a good start on migrating the Micro Focus ITSMA integration. However, there are several critical issues that need to be addressed. A NameError bug in UpdateIncident.py will cause the action to fail. The core MicroFocusITSMAManager has incorrect session initialization logic, a potential security vulnerability in error logging, and doesn't follow the style guide regarding type hints and docstrings. Furthermore, this pull request is missing meaningful unit tests for the new logic, which is a mandatory requirement of the repository's contribution guidelines. Please add comprehensive tests for the actions and the manager class to ensure correctness and prevent future regressions.

Note: Security Review is unavailable for this PR.

Comment on lines +57 to +61
updated_params = [
param
for param, value in siemplify.parameters.items()
if value and key is not "Incident ID"
]
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

There is a NameError in this list comprehension because key is not defined. It seems you intended to use param. Also, using is not for string comparison is not reliable and should be replaced with !=.

Suggested change
updated_params = [
param
for param, value in siemplify.parameters.items()
if value and key is not "Incident ID"
]
updated_params = [
param
for param, value in siemplify.parameters.items()
if value and param != "Incident ID"
]

Comment on lines +117 to +120
self.session.headers = copy.deepcopy(HEADERS)
self.session.headers["Cookie"] = self.session.headers["Cookie"].format(
self.get_token()
)
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The session initialization logic is incorrect. The call to self.get_token() is made after self.session.headers has been populated from HEADERS. This causes the login request to be sent with an unformatted Cookie header (LWSSO_COOKIE_KEY={0}), which is likely to fail.

You should acquire the token before setting the session headers that depend on it. The correct order should be:

  1. Create the session.
  2. Call get_token() to get the token.
  3. Set the session headers, including the Cookie header formatted with the token.


except requests.HTTPError as err:
raise MicroFocusITSMAManagerError(
f"Status Code: {http_response.status_code}, Content: {http_response.content}, Error: {err}"
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Including http_response.content directly in the exception message can lead to leaking sensitive information in logs, which is against the repository's security policy (Style Guide lines 23-24, 60-61). The response body could contain PII or other sensitive data. Consider logging only status code, headers, and the error message, or redacting sensitive fields from the content before logging.

Suggested change
f"Status Code: {http_response.status_code}, Content: {http_response.content}, Error: {err}"
f"Status Code: {http_response.status_code}, Error: {err}"
References
  1. Never allow Personally Identifiable Information (PII) or secrets to persist in logs, metadata, or telemetry. (link)


self.validate_response(response)

return response.content
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The get_token method returns response.content, which is a bytes object. When this is used to format the cookie string in __init__, it will be converted to a string like b'your_token', which is likely not a valid token format for the server. You should probably return response.text to get the decoded string content.

Suggested change
return response.content
return response.text



@output_handler
def main():
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The main function is missing a return type annotation, which is required by the style guide (line 80). Please add -> None. This applies to the main function in other actions as well (Ping.py, UpdateIncident.py, UpdateIncidentExternalStatus.py).

Suggested change
def main():
def main() -> None:
References
  1. All function parameters and return types must be annotated. (link)

)

if result_value:
output_message = f'An incident with id "{incident_id}" external status was change to {status}'
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There is a typo in the output message. "change" should be "changed".

Suggested change
output_message = f'An incident with id "{incident_id}" external status was change to {status}'
output_message = f'An incident with id "{incident_id}" external status was changed to {status}'

pass


class MicroFocusITSMAManager:
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This class and its methods are missing type annotations and docstrings, which violates the repository style guide.

  • All function parameters and return types must be annotated (Style Guide line 80).
  • All public functions should have a Google-style docstring (Style Guide line 88), and types should not be repeated in the docstring (Style Guide line 91).

For example, __init__ should be:

def __init__(
    self,
    api_root: str,
    username: str,
    password: str,
    tenant_id: str,
    external_system: str,
    external_id: str = "20123",
    verify_ssl: bool = False,
) -> None:
    """Initializes the MicroFocusITSMAManager.

    Args:
        api_root: The API root URL.
        username: The username for authentication.
        password: The password for authentication.
        tenant_id: The tenant ID.
        external_system: The external system name.
        external_id: The external ID.
        verify_ssl: Whether to verify SSL certificates.
    """
    ...

Please apply this to all methods in the class.

References
  1. All function parameters and return types must be annotated. (link)
  2. Docstrings should follow Google Style, using triple double quotes. Types should not be repeated in the Args/Returns sections as they are inferred from type hints. (link)

)

# Setup payload.
paylaod = copy.deepcopy(CREATE_INCIDENT_PAYLOAD)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There is a typo: paylaod should be payload. This typo is present in create_incident, update_incident, and update_external_incident_status methods.

Suggested change
paylaod = copy.deepcopy(CREATE_INCIDENT_PAYLOAD)
payload = copy.deepcopy(CREATE_INCIDENT_PAYLOAD)

- description: ' Added integration support for the Playbook Simulator feature, allowing
you to build, test and edit your workflow logic in a pre-production environment.'
integration_version: 2.0
item_name: MicroFocusTSMA
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There's a typo in item_name. It should be MicroFocusITSMA (with an 'I'). This typo also appears on lines 29 and 39.

    item_name: MicroFocusITSMA

@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

2 similar comments
@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

@haggit-eliyahu haggit-eliyahu force-pushed the migrate-micro_focus_itsma-integration branch from 35a6514 to 8590c69 Compare March 18, 2026 15:25
@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

3 similar comments
@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

1 similar comment
@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

@haggit-eliyahu haggit-eliyahu force-pushed the migrate-micro_focus_itsma-integration branch from dbc362f to a252750 Compare March 22, 2026 15:04
@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

4 similar comments
@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

@haggit-eliyahu haggit-eliyahu force-pushed the migrate-micro_focus_itsma-integration branch from 714ae84 to 6789fd0 Compare March 22, 2026 15:41
@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

1 similar comment
@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

1 similar comment
@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

micro_focus_itsma

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants