Skip to content

Conversation

@caozhuozi
Copy link
Contributor

Description

This change align the json schema with the change introcuded in #85, which should also fixes the ci failure.

Related Issue

Motivation and Context

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.

Summary of Changes

Hello @caozhuozi, 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 new "datasetsURL" field to the configuration JSON schema, aligning it with recent changes and addressing potential CI failures. The update ensures that dataset URLs are correctly validated as an array of strings, enhancing the robustness of configuration parsing.

Highlights

  • JSON Schema Update: The config-schema.json file has been updated to include a new "datasetsURL" property within the "descriptor" object. This property is defined as an array of strings.
  • Test Case Addition: A new test case has been added to config_test.go to validate the "datasetsURL" property. This test specifically checks for an expected failure when "datasetsURL" is not provided as an array, ensuring schema compliance.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 updates the JSON schema to include datasetsURL and adds a corresponding test case. The changes are correct and align with the goal of the PR. I've provided a few suggestions to improve validation by adding a format specifier for the URL, enhance test coverage with a success case, and improve code style consistency in the new test.

Comment on lines +76 to +78
"items": {
"type": "string"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To improve validation, it's a good practice to specify the format for URL strings. Consider adding "format": "uri" to the string item definition. This will ensure that the values in the datasetsURL array are valid URIs. You might consider applying this to docURL and sourceURL as well in a separate change to improve consistency across all URL fields.

            "items": {
              "type": "string",
              "format": "uri"
            }

Comment on lines +208 to 226
config: `
{
"descriptor": {
"name": "xyz-3-8B-Instruct",
"version": "3.1",
"sourceURL": "https://github.com/xyz/xyz3",
"datasetsURL": "https://example.com/dataset"
},
"config": {
"paramSize": "8b"
},
"modelfs": {
"type": "layers",
"diffIds": [
"sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
]
}
}
`,
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 JSON in this test case has inconsistent indentation. For better readability and to maintain a consistent style across the codebase, please format the JSON string with a standard 2-space indentation.

Suggested change
config: `
{
"descriptor": {
"name": "xyz-3-8B-Instruct",
"version": "3.1",
"sourceURL": "https://github.com/xyz/xyz3",
"datasetsURL": "https://example.com/dataset"
},
"config": {
"paramSize": "8b"
},
"modelfs": {
"type": "layers",
"diffIds": [
"sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
]
}
}
`,
config: `
{
"descriptor": {
"name": "xyz-3-8B-Instruct",
"version": "3.1",
"sourceURL": "https://github.com/xyz/xyz3",
"datasetsURL": "https://example.com/dataset"
},
"config": {
"paramSize": "8b"
},
"modelfs": {
"type": "layers",
"diffIds": [
"sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
]
}
}
`,

}
`,
fail: true,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While this negative test case is great for ensuring type safety, it would be beneficial to also add a positive test case to verify that a valid datasetsURL (an array of strings) passes validation. This would make the tests for this new field more comprehensive.

You could add a test case like this after the current one:

		// expected success: datasetsURL is an array
		{
			config: `
{
  "descriptor": {
    "name": "xyz-3-8B-Instruct",
    "version": "3.1",
    "sourceURL": "https://github.com/xyz/xyz3",
    "datasetsURL": [
      "https://example.com/dataset1",
      "https://example.com/dataset2"
    ]
  },
  "config": {
    "paramSize": "8b"
  },
  "modelfs": {
    "type": "layers",
    "diffIds": [
      "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
    ]
  }
}
`,
			fail: false,
		},

@bergwolf bergwolf added the bug Something isn't working label Sep 18, 2025
Copy link
Member

@bergwolf bergwolf left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

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

lgtm

@chlins chlins merged commit 65f455f into modelpack:main Sep 19, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants