Skip to content

Eval inventory json#28030

Closed
ved015 wants to merge 2 commits into
google-gemini:mainfrom
Gsoc26:eval-inventory-json
Closed

Eval inventory json#28030
ved015 wants to merge 2 commits into
google-gemini:mainfrom
Gsoc26:eval-inventory-json

Conversation

@ved015

@ved015 ved015 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds --json output to npm run eval:inventory so the inventory data can be consumed by scripts and CI tooling.

Running npm run eval:inventory -- --json prints the same inventory as a stable JSON object with a version field, summary counts, and the full case/diagnostic lists.

Details

  • Updated scripts/utils/eval-inventory.ts with a formatInventoryJson() function that maps the inventory result to a versioned JSON schema (version: 1), pre-aggregates policy counts, and normalizes optional fields to null.
  • Updated scripts/eval-inventory-cli.ts to accept --json and switch between text and JSON output.
  • Added an eval:inventory:json npm script as a shorthand.
  • Added snapshot-based and structural tests covering the JSON schema shape, summary counts, field mapping, determinism, path portability, and timestamp format.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@gundermanc pls have a look

@ved015 ved015 requested review from a team as code owners June 19, 2026 07:29
@github-actions github-actions Bot added the size/l A large sized PR label Jun 19, 2026
@github-actions

Copy link
Copy Markdown

📊 PR Size: size/L

  • Lines changed: 863
  • Additions: +859
  • Deletions: -4
  • Files changed: 5

@gemini-code-assist

Copy link
Copy Markdown
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 introduces a machine-readable JSON output format for the eval inventory tool. By allowing the inventory data to be consumed programmatically, it facilitates better integration with CI pipelines and external automation tools. The changes include a new CLI entry point, robust JSON formatting logic, and a suite of tests to guarantee schema consistency and output determinism.

Highlights

  • JSON Output Support: Added a --json flag to the eval:inventory command to enable machine-readable output for CI and scripting.
  • New CLI Entry Point: Created scripts/eval-inventory-cli.ts to handle command-line arguments and switch between text and JSON reporting.
  • Inventory Logic: Implemented formatInventoryJson in scripts/utils/eval-inventory.ts to map inventory results to a versioned JSON schema.
  • Test Coverage: Added comprehensive snapshot and structural tests to ensure the JSON schema is stable, deterministic, and correctly maps all fields.
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 the 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 counterproductive. 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.

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 an evaluation inventory CLI tool and its associated utilities. It adds new npm scripts (eval:inventory and eval:inventory:json) to package.json, implements the CLI entry point in scripts/eval-inventory-cli.ts, and provides the core logic for scanning, collecting, and formatting the inventory results in scripts/utils/eval-inventory.ts. Additionally, comprehensive unit tests are added in scripts/tests/eval-inventory.test.ts, and a minor update is made to the test setup mock in scripts/tests/test-setup.ts. There are no review comments, and I have no feedback to provide.

@ved015 ved015 closed this Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l A large sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant