fix: reduce release bundle to only necessary files#11
Conversation
Include only runtime-required files in release archive: - dist/ (compiled JavaScript) - commands/ (CLI commands) - node_modules/ (dependencies) - gemini-extension.json (extension config) - deep-research-GEMINI.md (documentation) - package.json (package metadata)
WalkthroughReworks the release GitHub Actions workflow to stage artifacts into Changes
Sequence Diagram(s)(No sequence diagram generated.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-12-22T02:36:16.011ZApplied to files:
🔇 Additional comments (5)
Comment |
- Keep version sync for package.json and gemini-extension.json in repo - Create release-specific gemini-extension.json with node dist/index.js - Remove package.json from bundle (not needed at runtime) - Use tar --transform to rename release config in archive
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/release.yml (1)
51-57: Consider using production-only dependencies to reduce bundle size.Including the entire
node_modulesdirectory can significantly increase the bundle size, potentially defeating the purpose of this PR (reducing release bundle size). Development dependencies are not needed at runtime.🔎 Proposed optimization
Add a step before creating the release archive to prune development dependencies:
+ - name: Prepare production dependencies + run: | + # Create a clean production node_modules + rm -rf node_modules + npm ci --production + - name: Create release archive run: | mkdir -p releaseThis ensures only production dependencies are included in the release bundle, reducing its size.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/release.yml
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: allenhutchison/gemini-cli-deep-research PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-22T02:36:16.011Z
Learning: Applies to gemini-extension.json : Define extension metadata and MCP server configuration in `gemini-extension.json`
Learnt from: CR
Repo: allenhutchison/gemini-cli-deep-research PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-22T02:36:16.011Z
Learning: The project is structured as a Gemini CLI extension using the Model Context Protocol (MCP) with logic residing in `src/` and commands in `commands/`
📚 Learning: 2025-12-22T02:36:16.011Z
Learnt from: CR
Repo: allenhutchison/gemini-cli-deep-research PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-22T02:36:16.011Z
Learning: Applies to gemini-extension.json : Define extension metadata and MCP server configuration in `gemini-extension.json`
Applied to files:
.github/workflows/release.yml
Validate that mcpServers["gemini-deep-research"] exists before modifying and verify the output is valid JSON before including in archive.
- Add release/gemini-extension.json with node command (version controlled) - Simplify workflow by removing dynamic JSON generation - Update both dev and release configs during version bump
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/release.ymlrelease/gemini-extension.json
✅ Files skipped from review due to trivial changes (1)
- release/gemini-extension.json
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: allenhutchison/gemini-cli-deep-research PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-22T02:36:16.011Z
Learning: Applies to gemini-extension.json : Define extension metadata and MCP server configuration in `gemini-extension.json`
Learnt from: CR
Repo: allenhutchison/gemini-cli-deep-research PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-22T02:36:16.011Z
Learning: The project is structured as a Gemini CLI extension using the Model Context Protocol (MCP) with logic residing in `src/` and commands in `commands/`
📚 Learning: 2025-12-22T02:36:16.011Z
Learnt from: CR
Repo: allenhutchison/gemini-cli-deep-research PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-22T02:36:16.011Z
Learning: Applies to gemini-extension.json : Define extension metadata and MCP server configuration in `gemini-extension.json`
Applied to files:
.github/workflows/release.yml
- Check target files exist before processing - Capture jq exit code and fail on error - Validate output is well-formed JSON before replacing - Clean up temp files on failure - Provide clear error messages for each failure mode
- Validate required directories exist (dist, commands, node_modules) - Validate required files exist (release/gemini-extension.json, deep-research-GEMINI.md) - Collect all errors and report them together - Fail fast with clear error messages before attempting tar
- Create staging directory with only required files - Run npm ci --omit=dev to install production dependencies only - Create archive from staging directory (excludes devDependencies) - Add release/staging/ and release/*.tar.gz to .gitignore
Summary
Files included in release
dist/commands/node_modules/gemini-extension.jsonnode dist/index.js)deep-research-GEMINI.mdChanges from development config
The release
gemini-extension.jsonusesnode dist/index.jsinstead ofnpm start, eliminating the need forpackage.jsonin the bundle.Test plan
Summary by CodeRabbit
Chores
New Features
✏️ Tip: You can customize this high-level summary in your review settings.