Skip to content

S223 : fix deps#29

Merged
eschultink merged 3 commits into
mainfrom
s223-fix-deps
Apr 27, 2026
Merged

S223 : fix deps#29
eschultink merged 3 commits into
mainfrom
s223-fix-deps

Conversation

@eschultink
Copy link
Copy Markdown
Member

Fixes

  • upgrade a bunch of the deps to fix dependabot alerts
  • modernize test fw

Change implications

  • No infrastructure changes required.

@eschultink eschultink requested review from Copilot and davidfq April 21, 2026 21:49
@eschultink eschultink self-assigned this Apr 21, 2026
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Copy link
Copy Markdown

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

Updates dependencies and modernizes the test setup to address Dependabot alerts and move off Mocha/Should.

Changes:

  • Upgrade runtime dependencies (notably @google-cloud/datastore) and refresh the lockfile.
  • Replace Mocha/Should tests with Vitest and add Vitest configuration + scripts.
  • Update Node engine requirement and bump GitHub Actions workflow action versions.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vitest.config.cjs Adds Vitest config (Node environment, .test.mjs include glob).
test/datastore-backup.test.mjs Replaces Mocha test with Vitest for datastoreRestoreCommand.
test/datastore-backup.js Removes legacy Mocha/Should test.
test/cmd.test.mjs Replaces Mocha tests with Vitest for CLI helper functions.
test/cmd.js Removes legacy Mocha/Should tests.
package.json Switches test scripts to Vitest, updates deps, adds Node engine + overrides.
package-lock.json Lockfile refresh for upgraded deps and Vitest/Vite toolchain.
lib/cmd.js Ensures colors side-effects are loaded for msg.red usage.
AGENTS.md Updates documentation to reflect Vitest test framework.
.github/workflows/test.yml Updates action versions used in CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
"type": "Apache-2.0",
"url": "https://opensource.org/licenses/apache2.0.php"
"engines": {
"node": ">=20"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

engines.node is broader than what the updated test/tooling stack supports. The lockfile pulls in vite@8 (via Vitest) which requires Node ^20.19.0 || >=22.12.0, so values like Node 20.0–20.18, 21.x, and 23.x would satisfy >=20 but fail installs/runs. Tighten the engine range to match the actual minimum/supported Node versions (or adjust dependency versions accordingly).

Suggested change
"node": ">=20"
"node": "^20.19.0 || >=22.12.0"

Copilot uses AI. Check for mistakes.
Comment thread test/cmd.test.mjs
).toBe('project_backups_daily');
});

it('generates bucket id from project-id, if program does not specificy prefix', () => {
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

Typo in test description: "specificy" -> "specify".

Suggested change
it('generates bucket id from project-id, if program does not specificy prefix', () => {
it('generates bucket id from project-id, if program does not specify prefix', () => {

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +15
it('produces expected command', () => {
const cmd = datastoreRestoreCommand(
['EntityA', 'EntityB'],
'gae-project',
'gae-project_backup',
'2020-01-01T00:00:00Z',
{},
);
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The new test only covers the default options = {} case. In lib/datastore-backup.js, the options.account branch currently concatenates --account without a leading space (and the status command path looks malformed as well), which would generate invalid gcloud commands when an account is provided. Add a test case that passes an account option and asserts the expected spacing/format so this doesn’t regress (and fix the underlying command builder to satisfy the test).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@davidfq davidfq left a comment

Choose a reason for hiding this comment

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

OK;
one improvement: consolidate everything to ES6 modules:

  • vitest.config.mjs instead of vitest.config.cjs
  • /lib.cmd.js and /lib/datastore-backup.js exported as named modules so we don't need the createRequire function

Comment thread AGENTS.md
@eschultink eschultink enabled auto-merge April 22, 2026 22:55
@eschultink eschultink disabled auto-merge April 22, 2026 22:59
@eschultink eschultink enabled auto-merge April 22, 2026 23:03
@eschultink eschultink merged commit 3ad9c05 into main Apr 27, 2026
11 checks passed
@eschultink eschultink deleted the s223-fix-deps branch April 27, 2026 16:25
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