chore: simplify postinstall to advise running aidevops update#82
chore: simplify postinstall to advise running aidevops update#82marcusquinn merged 1 commit intomainfrom
Conversation
The npm package only contains the CLI wrapper, not the full agent files. Instead of trying to run setup.sh (which fails without .agent/ folder), show version comparison and advise running 'aidevops update' to: - Clone the repo if not present - Pull latest changes if repo exists - Run setup.sh to deploy agents This makes the install flow clearer: 1. npm install -g aidevops (installs CLI) 2. aidevops update (deploys agents)
WalkthroughThe npm postinstall script is refactored to use a simpler version-checking mechanism. Instead of executing setup.sh, it now reads the installed version from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (3)📓 Common learnings📚 Learning: 2026-01-06T15:57:56.027ZApplied to files:
📚 Learning: 2025-12-22T01:24:53.937ZApplied to files:
🧬 Code graph analysis (1)scripts/npm-postinstall.cjs (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (3)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @marcusquinn, 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 streamlines the post-installation process for 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 simplifies the npm postinstall script to provide clearer guidance to users after installation. The previous approach of running setup.sh was flawed and has been replaced with a script that checks the installed agent version and advises the user to run aidevops update if necessary. This is a significant improvement to the user installation experience. I have one suggestion to make the script more robust against potential file system errors.
| if (fs.existsSync(versionFile)) { | ||
| installedVersion = fs.readFileSync(versionFile, 'utf8').trim(); | ||
| } |
There was a problem hiding this comment.
The script could be more robust by handling potential errors when reading the version file. While fs.existsSync checks for the file, fs.readFileSync could still fail due to permissions or other file system issues. An unhandled exception would print a stack trace, which is not ideal for a post-install script. Wrapping this logic in a try...catch block would gracefully handle such errors and improve the user experience.
try {
if (fs.existsSync(versionFile)) {
installedVersion = fs.readFileSync(versionFile, 'utf8').trim();
}
} catch (error) {
// If reading the version fails, we can't determine the version.
// We'll proceed as if it's not installed and log a warning.
console.warn(`aidevops: Could not read agents version file: ${error.message}`);
}
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Wed Jan 14 02:28:58 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
🤖 Augment PR SummarySummary: Simplifies the npm Changes: Prints CLI version and detected agents version (from Why: The published npm package only includes the CLI wrapper, so running 🤖 Was this summary useful? React with 👍 or 👎 |
| // Check current installed version | ||
| let installedVersion = 'not installed'; | ||
| if (fs.existsSync(versionFile)) { | ||
| installedVersion = fs.readFileSync(versionFile, 'utf8').trim(); |
There was a problem hiding this comment.
fs.readFileSync(versionFile, ...) can still throw even if existsSync returned true (e.g., permission issues/broken symlink), which would fail the entire npm install because this postinstall script isn’t guarded. Consider wrapping version detection in a try/catch and falling back to not installed to keep installs resilient.
🤖 Was this useful? React with 👍 or 👎



Summary
aidevops updateWhy
The npm package only contains the CLI wrapper, not the full
.agent/folder with agents. The previous postinstall tried to runsetup.shwhich would fail silently.New Install Flow
Update Flow
When In Sync
Summary by CodeRabbit
Chores
✏️ Tip: You can customize this high-level summary in your review settings.