Skip to content

Conversation

@congminh1254
Copy link
Member

@congminh1254 congminh1254 commented Oct 31, 2025

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 update command, integration of the GitHub-based updater, and dependency upgrades to improve stability and compatibility.

New update functionality:

  • Added a new box update command 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]
  • Integrated the @oclif/plugin-update and @octokit/rest packages to support the new update workflow. (package.json)

Dependency upgrades:

  • Updated several dependencies to newer versions, including @oclif/core, box-node-sdk, keychain, and generate-license-file for improved compatibility and security. (package.json) [1] [2] [3]

Configuration and scripting improvements:

  • Added GitHub repository information for the update command in the CLI configuration. (package.json)
  • Updated CLI build and documentation scripts to streamline the release process and support the new update mechanism. (package.json)

Minor code cleanups:

  • Various formatting and whitespace cleanups in src/box-command.js and src/commands/files/download.js for 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.

Copy link
Contributor

@Hawra2020 Hawra2020 left a 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?

@coveralls
Copy link

coveralls commented Oct 31, 2025

Pull Request Test Coverage Report for Build 19504729128

Details

  • 142 of 163 (87.12%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 85.591%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/util.js 4 5 80.0%
src/box-command.js 13 15 86.67%
src/github-updater.js 117 121 96.69%
src/commands/update.js 8 22 36.36%
Files with Coverage Reduction New Missed Lines %
src/box-command.js 1 75.71%
Totals Coverage Status
Change from base Build 19503546042: 0.01%
Covered Lines: 4736
Relevant Lines: 5335

💛 - Coveralls

Hawra2020
Hawra2020 previously approved these changes Nov 4, 2025
Percival33
Percival33 previously approved these changes Nov 6, 2025
@congminh1254 congminh1254 dismissed stale reviews from Percival33 and Hawra2020 via 265e947 November 18, 2025 11:42
@congminh1254 congminh1254 requested a review from a team November 18, 2025 11:42
Copy link

Copilot AI left a 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 GitHubUpdater class to fetch and install updates from GitHub releases
  • Adds update command 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.

@congminh1254 congminh1254 changed the title feat: POC auto update CLI feat: support auto update using github releases Nov 18, 2025
@congminh1254 congminh1254 changed the title feat: support auto update using github releases feat: support auto update using Github releases Nov 18, 2025
Hawra2020
Hawra2020 previously approved these changes Nov 19, 2025
Percival33
Percival33 previously approved these changes Nov 19, 2025
@congminh1254 congminh1254 dismissed stale reviews from Percival33 and Hawra2020 via f317df4 November 19, 2025 13:52
Hawra2020
Hawra2020 previously approved these changes Nov 19, 2025
Copy link

Copilot AI left a 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.

Comment on lines +33 to +39
updater.runUpdate({
autoUpdate: flags.autoupdate,
force: flags.force,
version: flags.interactive
? await this.promptForVersion(updater)
: flags.version,
});
Copy link

Copilot AI Nov 19, 2025

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.

Copilot uses AI. Check for mistakes.
KwiatkowskiML
KwiatkowskiML previously approved these changes Nov 19, 2025
@congminh1254 congminh1254 dismissed stale reviews from KwiatkowskiML and Hawra2020 via 7c8937c November 19, 2025 14:27
@congminh1254 congminh1254 merged commit 2460e1b into main Nov 19, 2025
30 checks passed
@congminh1254 congminh1254 deleted the poc-auto-update-gh branch November 19, 2025 14:32
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.

6 participants