fix(patch): cherry-pick 69f93f8 to release/v0.8.0-preview.1-pr-10629 to patch version v0.8.0-preview.1 and create version 0.8.0-preview.2#10642
Conversation
Summary of ChangesHello @gemini-cli-robot, 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 enhancement to the Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request enhances the extensions new command by making the template argument optional. When no template is provided, it now creates a new directory with a basic gemini-extension.json manifest. The implementation looks good, with a logical refactoring to separate directory creation from template copying. I've added one comment regarding an incomplete test case for the new functionality, which should be addressed to ensure the changes are fully verified.
| it('should create directory when no template is provided', async () => { | ||
| mockedFs.access.mockRejectedValue(new Error('ENOENT')); | ||
| mockedFs.mkdir.mockResolvedValue(undefined); | ||
|
|
||
| const parser = yargs([]).command(newCommand).fail(false); | ||
|
|
||
| await parser.parseAsync('new /some/path'); | ||
|
|
||
| expect(mockedFs.mkdir).toHaveBeenCalledWith('/some/path', { | ||
| recursive: true, | ||
| }); | ||
| expect(mockedFs.cp).not.toHaveBeenCalled(); | ||
| }); |
There was a problem hiding this comment.
The test case for creating an extension without a template is incomplete. It verifies directory creation but misses the crucial step of checking if the gemini-extension.json manifest file is created. This is a core part of the new functionality and should be covered by tests to prevent future regressions.
it('should create directory and manifest when no template is provided', async () => {
mockedFs.access.mockRejectedValue(new Error('ENOENT'));
mockedFs.mkdir.mockResolvedValue(undefined);
mockedFs.writeFile.mockResolvedValue(undefined);
const parser = yargs([]).command(newCommand).fail(false);
await parser.parseAsync('new /some/path');
expect(mockedFs.mkdir).toHaveBeenCalledWith('/some/path', {
recursive: true,
});
expect(mockedFs.writeFile).toHaveBeenCalledWith(
path.join('/some/path', 'gemini-extension.json'),
JSON.stringify({ name: 'path', version: '1.0.0' }, null, 2)
);
expect(mockedFs.cp).not.toHaveBeenCalled();
});|
Size Change: +555 B (0%) Total Size: 17.5 MB ℹ️ View Unchanged
|
This PR automatically cherry-picks commit 69f93f8 to patch version v0.8.0-preview.1 in the preview release to create version 0.8.0-preview.2.