Skip to content

Agent skills - adjusted to install genkit...#10587

Open
christhompsongoogle wants to merge 9 commits into
mainfrom
genkitstuff
Open

Agent skills - adjusted to install genkit...#10587
christhompsongoogle wants to merge 9 commits into
mainfrom
genkitstuff

Conversation

@christhompsongoogle
Copy link
Copy Markdown
Contributor

Agent skills - adjusted to install genkit. Added genkit to FBS migrate.ts.

Copy link
Copy Markdown
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 adds support for custom skill packages in installAgentSkills by introducing a skillPackage option, which is then utilized during the Firebase Studio migration process. The feedback identifies a violation of the repository's style guide in the unit tests, where as any is used as a type assertion. It is recommended to dynamically import child_process and provide a fully typed mock object instead.

Comment thread src/agentSkills.spec.ts
Comment on lines +63 to +66
it("should use custom skill package if provided", async () => {
const spawnSyncStub = sandbox.stub(require("child_process"), "spawnSync").returns({
status: 0,
} as any);
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.

medium

The use of as any as a type assertion violates the repository style guide rule: "Never use any or unknown as an escape hatch." (GEMINI.md, line 38).

Instead of using as any, we can dynamically import child_process to get full type safety and provide all the required properties of SpawnSyncReturns<Buffer> to avoid any type casting.

Suggested change
it("should use custom skill package if provided", async () => {
const spawnSyncStub = sandbox.stub(require("child_process"), "spawnSync").returns({
status: 0,
} as any);
it("should use custom skill package if provided", async () => {
const cp = await import("child_process");
const spawnSyncStub = sandbox.stub(cp, "spawnSync").returns({
status: 0,
pid: 0,
output: [],
stdout: Buffer.alloc(0),
stderr: Buffer.alloc(0),
signal: null,
});
References
  1. Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards. (link)

Copy link
Copy Markdown
Member

@joehan joehan left a comment

Choose a reason for hiding this comment

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

LGTM after you fix the failing tests

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.

3 participants