Skip to content

Conversation

@vish-cs
Copy link
Contributor

@vish-cs vish-cs commented Feb 2, 2026

Multiple fixes to import tool code: details of changes in Gemini summary.

@gemini-code-assist
Copy link

Summary of Changes

Hello @vish-cs, 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 enhances the data import tools by refactoring the MCF parsing infrastructure, centralizing error handling, and expanding the recognized vocabulary for statistical properties. These changes improve the robustness and flexibility of the parsing process, ensure better error reporting, and update documentation and test data to align with the latest data model requirements, ultimately making the import pipeline more resilient and adaptable to varied data formats.

Highlights

  • MCF Parsing Refactoring: The core MCF parsing logic in GraphUtils.java has been refactored to delegate to McfParser.java, centralizing and streamlining the parsing process for better maintainability and consistency.
  • Error Handling Improvements: McfParser.java now integrates Log4j for logging errors and includes a new logError helper method, making error reporting more consistent and robust, especially when a LogWrapper is not explicitly provided.
  • Flexible MCF File Detection: The FileGroup.java utility now uses .contains(".mcf") instead of .endsWith(".mcf") for identifying MCF files, allowing for more flexible naming conventions (e.g., file.mcf.txt).
  • Expanded StatType Vocabulary: The docs/counters.md documentation and Vocabulary.java now include ratio as a recognized statType suffix, expanding the supported statistical variable types within the system.
  • Test Data Updates: Several test MCF and CSV files (schema.mcf, obs-diff.csv, schema-diff.csv) have been updated to reflect changes in MCF node syntax (from dcid: "..." to Node: dcid:...) and simplified ID representations.
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.

@vish-cs vish-cs requested a review from n-h-diaz February 2, 2026 15:11
Copy link

@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 introduces several fixes and refactorings to the import tool, centralizing MCF parsing logic into McfParser, supporting the ratio statType, and updating test data and schemas. However, it introduces a significant Denial of Service risk by loading entire files into memory and a Log Injection vulnerability due to logging unsanitized file content. These security concerns should be addressed by reverting to a streaming file-reading approach and sanitizing data before logging. Additionally, there's a concern regarding overly broad MCF file type detection in FileGroup.java, which could lead to misidentification.

Copy link
Contributor

@n-h-diaz n-h-diaz left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes!

@vish-cs vish-cs enabled auto-merge (squash) February 3, 2026 04:06
@vish-cs vish-cs merged commit 577a9ac into datacommonsorg:master Feb 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants