-
Notifications
You must be signed in to change notification settings - Fork 64
feat: support auto update using Github releases #603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests are failing with an assertion error because of the warning possibly because we are trying to use an ESM module
const { Octokit } = require('@octokit/rest'); shouldnt we convert this to dynamic import?
Pull Request Test Coverage Report for Build 19504729128Details
💛 - Coveralls |
…to poc-auto-update-gh
265e947
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a proof of concept for automatic CLI updates using GitHub releases. The implementation adds a custom updater that extends the oclif plugin-update framework to fetch releases directly from GitHub rather than relying on S3 storage.
Key Changes:
- Implements
GitHubUpdaterclass to fetch and install updates from GitHub releases - Adds
updatecommand to check for and install updates - Includes comprehensive test coverage for the updater functionality
Reviewed Changes
Copilot reviewed 24 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/github-updater.js |
New updater class that integrates with GitHub API to fetch releases and manage CLI updates |
src/commands/update.js |
New update command that provides version management and interactive update options |
test/github-updater.test.js |
Comprehensive test suite for GitHub updater functionality |
test/commands/update.test.js |
Test suite for update command |
test/fixtures/github/releases-v4.4.1.json |
Test fixture containing sample GitHub release data |
tsconfig.esm.json |
Added allowJs compiler option to support JavaScript modules |
package.json |
Added dependencies for update functionality (@oclif/plugin-update, @octokit/rest, @oclif/table, semver) |
docs/update.md |
Documentation for the new update command |
README.md |
Added reference to update command documentation |
| Various test files | Removed extraneous blank lines for code consistency |
src/util.js, src/box-command.js, src/commands/files/download.js |
Code formatting improvements and whitespace cleanup |
test/bulk.test.js |
Formatting improvement for array literal |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f317df4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 27 out of 29 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| updater.runUpdate({ | ||
| autoUpdate: flags.autoupdate, | ||
| force: flags.force, | ||
| version: flags.interactive | ||
| ? await this.promptForVersion(updater) | ||
| : flags.version, | ||
| }); |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing await keyword before updater.runUpdate(). The runUpdate method is async and returns a Promise, so it should be awaited to properly handle the update operation and any potential errors.
7c8937c
This pull request introduces a new update mechanism for BoxCLI using GitHub, adds a corresponding command and documentation, and updates several dependencies to their latest versions. The most significant changes are the addition of the
box updatecommand, integration of the GitHub-based updater, and dependency upgrades to improve stability and compatibility.New update functionality:
box updatecommand that allows users to update BoxCLI directly via GitHub, including options for interactive version selection and forced updates. (src/commands/update.js,README.md,docs/update.md) [1] [2] [3]@oclif/plugin-updateand@octokit/restpackages to support the new update workflow. (package.json)Dependency upgrades:
@oclif/core,box-node-sdk,keychain, andgenerate-license-filefor improved compatibility and security. (package.json) [1] [2] [3]Configuration and scripting improvements:
package.json)package.json)Minor code cleanups:
src/box-command.jsandsrc/commands/files/download.jsfor better readability and maintainability. (src/box-command.js,src/commands/files/download.js) [1] [2]These changes collectively enhance the user experience by making CLI updates easier and keeping dependencies up to date.