Skip to content

Comments

msgpack by gemini - just a test#117

Open
doomedraven wants to merge 4 commits intokevoreilly:capemonfrom
doomedraven:msgpack_by_gemini
Open

msgpack by gemini - just a test#117
doomedraven wants to merge 4 commits intokevoreilly:capemonfrom
doomedraven:msgpack_by_gemini

Conversation

@doomedraven
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @doomedraven, 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 introduces a significant change to the project's logging infrastructure by migrating from BSON to MessagePack. This modernization effort aims to improve the efficiency and performance of log data serialization. The changes span across project configuration files and the core logging implementation, ensuring a seamless transition to the new binary format.

Highlights

  • Logging Serialization Migration: The core logging mechanism has been migrated from BSON (Binary JSON) to MessagePack (mpack), a more efficient binary serialization format. This involves replacing all BSON-related function calls and data structures with their mpack equivalents.
  • Project Configuration Updates: The capemon.vcxproj and capemon.vcxproj.filters files have been updated to remove BSON library dependencies and include paths, and to incorporate the new mpack.c and mpack.h files into the build process.
  • Refactored Log Generation Logic: The log.c file has undergone significant refactoring. Functions responsible for serializing various data types (integers, pointers, strings, variants, buffers, argument lists) have been rewritten to use the mpack_writer_t API. The main loq function, which generates log entries, has been completely adapted to the new MessagePack format.
  • Adjusted Log Deduplication: The log deduplication logic within the loq function has been updated to accommodate MessagePack's variable-length encoding. The lastlog_t structure now uses an offset (repeat_offset) instead of a direct pointer to manage the repetition count, ensuring safe in-place updates for frequently occurring log messages.

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

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 replaces the BSON logging library with MessagePack (mpack). The changes are extensive, touching project files and the core logging logic. While the migration is a good step towards a more modern and potentially more efficient serialization format, I've found several critical and high-severity issues that need to be addressed. These include memory management bugs that could lead to double-frees, incorrect path string handling, and a broken macro that will likely cause a crash. There are also some minor style issues that affect code readability.

char *data;
size_t size;

mpack_writer_init_growable(&w, &data, &size);
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 line and several others in the file have inconsistent indentation, which makes the code harder to read. Please ensure all code blocks follow a consistent indentation style.

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.

1 participant