Skip to content

Conversation

@gnishant-gupta
Copy link
Contributor

@gnishant-gupta gnishant-gupta commented Dec 23, 2025

Integration: GitSync - 1P Migration

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:

  • I have read and followed the project's contributing.md guide.
  • My code follows the project's coding style guidelines.
  • I have performed a self-review of my own code.
  • My changes do not introduce any new warnings.
  • My changes pass all existing tests.
  • I have added new tests where appropriate to cover my changes. (If applicable)
  • I have updated the documentation where necessary (e.g., README, API docs). (If applicable)

Open-Source Specific Checks:

  • My changes do not introduce any Personally Identifiable Information (PII) or sensitive customer data.
  • My changes do not expose any internal-only code examples, configurations, or URLs.
  • All code examples, comments, and messages are generic and suitable for a public repository.
  • I understand that any internal context or sensitive details related to this work are handled separately in internal systems (Buganizer for Google team members).

For Google Team Members and Reviewers Only:

  • I have included the Buganizer ID in the PR title or description (e.g., "Internal Buganizer ID: 123456789" or "Related Buganizer: go/buganizer/123456789").
  • I have ensured that all internal discussions and PII related to this work remain in Buganizer.
  • I have tagged the PR with one or more labels that reflect the pull request purpose.

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.

@gnishant-gupta gnishant-gupta self-assigned this Dec 23, 2025
@gnishant-gupta gnishant-gupta requested a review from a team as a code owner December 23, 2025 10:01
@gnishant-gupta gnishant-gupta added the Dependencies Pull requests that update a dependency file label Dec 23, 2025
@gnishant-gupta gnishant-gupta requested a review from a team as a code owner December 23, 2025 10:01
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gnishant-gupta, 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 significantly refactors the GitSync integration to align with a new first-party (1P) API client for Chronicle SOAR. The changes involve migrating existing API calls to a standardized 'TIPCommon' module, enhancing data model handling for various SOAR entities, and updating core dependencies. This modernization effort aims to improve the robustness, maintainability, and future compatibility of GitSync with the evolving SOAR platform.

Highlights

  • API Client Migration: GitSync has been updated to utilize a new first-party (1P) API client, centralizing API interactions through the 'TIPCommon.rest.soar_api' module.
  • Standardized API Calls: Numerous API calls across GitSync's core and job modules have been refactored to pass a 'chronicle_soar' object, ensuring consistent and standardized communication with the SOAR platform.
  • Improved Data Handling: The pull and push jobs now incorporate 'TIPCommon' data models and 'platform_supports_1p_api' utility, enabling proper conversion and handling of various SOAR entities (e.g., environments, case tags, networks) for both legacy and 1P API contexts.
  • Dependency Updates: Key dependencies, including 'GitSync' itself, 'integration-testing', and 'tipcommon', have been updated to their latest versions, and 'setuptools' has been added as a new dependency.
  • Simplified Git Error Handling: The custom error handling logic for Git push operations, including 'PUSH_FAILURE_INDICATORS' and '_raise_on_push_errors', has been removed from 'GitManager.py', streamlining the process.

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

@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

git_sync

Validation Name Details
⚠️ Integration Version Bump The release note's version must match the new version of the project.toml and be consistent in all the newly added notes.

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 migrates the GitSync integration to use first-party (1P) APIs from TIPCommon, which is a significant and positive refactoring for maintainability. The changes are extensive, touching many files to update API calls. My review has found several critical issues related to incorrect API usage and undefined attributes that will cause runtime errors. I've also noted some areas where error handling has been degraded and inconsistencies in the implementation. It's crucial to address the critical issues before merging.

Comment on lines 77 to 85
gitsync.api.add_dynamic_env_param(
id_validator(dynParam, "name", "id", current_parameters),
siemplify,
id=dynParam.get("id", 0),
name=dynParam.get("name", ""),
value=current_parameters.get("value", ""),
type=current_parameters.get("type", ""),
default_value=current_parameters.get("defaultValue", ""),
optional_json=current_parameters,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The call to gitsync.api.add_dynamic_env_param is incorrect. The method add_dynamic_env_param in SiemplifyApiClient was not updated to use the new 1P API and still expects a single dictionary argument param. The current call passes siemplify as the first argument, followed by keyword arguments, which will result in a TypeError.

The method in SiemplifyApiClient is:

def add_dynamic_env_param(self, param):
    res = self.session.post("settings/AddOrUpdateDynamicParameters", json=param)
    self.validate_response(res)
    return res.content

You should either update add_dynamic_env_param to use the new 1P API or construct the param dictionary as it was done previously. The previous logic was: gitsync.api.add_dynamic_env_param(id_validator(dynParam, "name", "id", current_parameters)).

Comment on lines +555 to 561
install_integration(
chronicle_soar=self._siemplify,
integration_identifier=integration_name,
integration_name="",
version=store_integration["version"],
is_certified=store_integration["isCertified"],
)
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 install_integration function is called with integration_name="". This seems suspicious. While integration_identifier is provided, passing an empty string for integration_name might have unintended consequences or could be a bug. Please verify if this is the intended usage of the new API.

Comment on lines +219 to +224
current_cause= id_validator(
cause,
("rootCause", "forCloseReason"),
"rootCause",
"id",
current_causes,
),
)
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 uniqueness check for case close reasons in id_validator has been reduced from checking both rootCause and forCloseReason to just rootCause. This could lead to incorrect updates if rootCause is not unique on its own. It's safer to check for uniqueness on both fields as it was before.

The previous check was: id_validator(cause, ("rootCause", "forCloseReason"), "id", current_causes).

Comment on lines +47 to +50
import_simulated_case(
chronicle_soar=siemplify,
case_data=case
)
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 code directly calls import_simulated_case from TIPCommon.rest.soar_api. While this works, it's inconsistent with the pattern used elsewhere in this PR, where API calls are wrapped in gitsync.api (SiemplifyApiClient). For better maintainability and consistency, consider using the wrapper method gitsync.api.import_simulated_case(siemplify, case).

            gitsync.api.import_simulated_case(siemplify, case)

@gnishant-gupta gnishant-gupta requested review from TalShafir1 and removed request for adarshtwy December 23, 2025 10:11
@TalShafir1 TalShafir1 marked this pull request as draft December 23, 2025 13:55
@TalShafir1 TalShafir1 marked this pull request as ready for review December 23, 2025 13:55
@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

git_sync

Validation Name Details
⚠️ Integration Version Bump The project.toml Version must be incremented by exactly 1.0.

@github-actions
Copy link

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

git_sync

Validation Name Details
⚠️ Integration Version Bump The project.toml Version must be incremented by exactly 1.0.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant