Skip to content

Fix regressions in bux script logic#2922

Merged
skapur12 merged 1 commit intomainfrom
skapur/fix-bux-script
Jul 29, 2024
Merged

Fix regressions in bux script logic#2922
skapur12 merged 1 commit intomainfrom
skapur/fix-bux-script

Conversation

@skapur12
Copy link
Member

@skapur12 skapur12 commented Jul 25, 2024

This PR fixes 2 regressions in the bux script that Dave and I identified:

  • Previously, when a bux status command was run, it would only print out the git status for BatchExplorer. Now, it also prints out the git status for whatever repository it’s being run in (e.g. the portal or CycleCloud)
  • Also, I forgot to test the script in sub-directories underneath the root directory, so bux operations would previously fail if run in any directory other than the root directory. Now, all bux operations (configure, link, unlink, status) can be performed in any sub-directory under the root directory.

What the output looks like when running the commands in the portal (note the changing directories):

PS C:\Users\sanjanakapur\Batch-UX-Portal> node_modules/.bin/bux configure
? Path to Batch Explorer (use /mnt/c/... for WSL, e.g., CycleCloud): C:\Users\sanjanakapur\BatchExplorer
Configuration saved to C:\Users\sanjanakapur\.config\batch\bux.json
PS C:\Users\sanjanakapur\Batch-UX-Portal> cd src
PS C:\Users\sanjanakapur\Batch-UX-Portal\src> ../node_modules/.bin/bux status
Batch Explorer (main)
  - Path: C:\Users\sanjanakapur\BatchExplorer
  - Staged changes:
      M  util/bux/util.ts

Current repository (skapur/bux-support-portal)
  - Path: C:\Users\sanjanakapur\Batch-UX-Portal
  - Unstaged changes:
      M .vscode/settings.json

Link is active
PS C:\Users\sanjanakapur\Batch-UX-Portal\src> cd src
PS C:\Users\sanjanakapur\Batch-UX-Portal\src\src> ../../node_modules/.bin/bux unlink
Unlinking @azure/[email protected]
Unlinking @azure/[email protected]
Unlinking @batch/[email protected]
Unlinking @batch/[email protected]
Unlinking @batch/[email protected]
Running `npm install` to restore packages...
PS C:\Users\sanjanakapur\Batch-UX-Portal\src\src> cd .. 
PS C:\Users\sanjanakapur\Batch-UX-Portal\src> ../node_modules/.bin/bux status
Batch Explorer (main)
  - Path: C:\Users\sanjanakapur\BatchExplorer
  - Staged changes:
      M  util/bux/util.ts

Current repository (skapur/bux-support-portal)
  - Unstaged changes:
      M .vscode/settings.json

Link is inactive
PS C:\Users\sanjanakapur\Batch-UX-Portal\src> cd ..
PS C:\Users\sanjanakapur\Batch-UX-Portal> node_modules/.bin/bux link
Linking @azure/[email protected]
Linking @azure/[email protected]
Linking @batch/[email protected]
Linking @batch/[email protected]
Linking @batch/[email protected]
PS C:\Users\sanjanakapur\Batch-UX-Portal> node_modules/.bin/bux status
Batch Explorer (skapur/fix-bux-script)
  - Path: C:\Users\sanjanakapur\BatchExplorer

Current repository (skapur/bux-support-portal)
  - Path: C:\Users\sanjanakapur\Batch-UX-Portal
  - Unstaged changes:
      M .vscode/settings.json

Link is active
PS C:\Users\sanjanakapur\Batch-UX-Portal>

What the output looks like when running the commands in CycleCloud (note the changing directories):

skapur@LAPTOP-T9HUH5SN:~/cc/cyclecloud$ node_modules/.bin/bux configure
? Path to Batch Explorer (use /mnt/c/... for WSL, e.g., CycleCloud): /mnt/c/Users/sanjanakapur/BatchExplorer
Configuration saved to /home/skapur/.config/batch/bux.json
skapur@LAPTOP-T9HUH5SN:~/cc/cyclecloud$ cd cli
skapur@LAPTOP-T9HUH5SN:~/cc/cyclecloud/cli$ ../node_modules/.bin/bux status
Batch Explorer (main)
  - Path: /mnt/c/Users/sanjanakapur/BatchExplorer
  - Staged changes:
      M  util/bux/util.ts

Current repository (skapur/bux-support-cc)
  - Path: /home/skapur/cc/cyclecloud
  - Staged changes:
      ?? package-lock.json
      ?? package.json
  - Unstaged changes:
      M .gitignore

Link is inactive
skapur@LAPTOP-T9HUH5SN:~/cc/cyclecloud/cli$ cd cyclecloud
skapur@LAPTOP-T9HUH5SN:~/cc/cyclecloud/cli/cyclecloud$ ../../node_modules/.bin/bux link
Linking @azure/[email protected]
Linking @azure/[email protected]
skapur@LAPTOP-T9HUH5SN:~/cc/cyclecloud/cli/cyclecloud$ cd ..
skapur@LAPTOP-T9HUH5SN:~/cc/cyclecloud/cli$ ../node_modules/.bin/bux status
Batch Explorer (main)
  - Path: /mnt/c/Users/sanjanakapur/BatchExplorer
  - Staged changes:
      M  util/bux/util.ts

Current repository (skapur/bux-support-cc)
  - Path: /home/skapur/cc/cyclecloud
  - Staged changes:
      ?? package-lock.json
      ?? package.json
  - Unstaged changes:
      M .gitignore

Link is active
skapur@LAPTOP-T9HUH5SN:~/cc/cyclecloud/cli$ cd ..
skapur@LAPTOP-T9HUH5SN:~/cc/cyclecloud$ node_modules/.bin/bux unlink
Unlinking @azure/[email protected]
Unlinking @azure/[email protected]
Running `npm install` to restore packages...
lerna notice cli v8.1.2
lerna info Bootstrapping 2 packages
lerna info Symlinking packages and binaries
lerna info lifecycle @cyclecloud/[email protected]~postinstall: @cyclecloud/[email protected]

> @cyclecloud/[email protected] postinstall /home/skapur/cc/cyclecloud/gui/pico
> patch-package

patch-package 8.0.0
Applying patches...
[email protected] ✔
lerna success Bootstrapped 2 packages
skapur@LAPTOP-T9HUH5SN:~/cc/cyclecloud$ node_modules/.bin/bux status
Batch Explorer (main)
  - Path: /mnt/c/Users/sanjanakapur/BatchExplorer
  - Staged changes:
      M  util/bux/util.ts

Current repository (skapur/bux-support-cc)
  - Path: /home/skapur/cc/cyclecloud
  - Staged changes:
      ?? package-lock.json
      ?? package.json
  - Unstaged changes:
      M .gitignore

Link is inactive
skapur@LAPTOP-T9HUH5SN:~/cc/cyclecloud$ 

@codecov
Copy link

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.62%. Comparing base (644d334) to head (af0445d).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2922   +/-   ##
=======================================
  Coverage   67.62%   67.62%           
=======================================
  Files        1269     1269           
  Lines       34418    34418           
  Branches     6325     6324    -1     
=======================================
  Hits        23276    23276           
  Misses      10970    10970           
  Partials      172      172           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 644d334...af0445d. Read the comment docs.

@skapur12 skapur12 merged commit cb5b5d6 into main Jul 29, 2024
@skapur12 skapur12 deleted the skapur/fix-bux-script branch July 29, 2024 19:14
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.

2 participants