Skip to content
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

Skip fix if cache is successful (not if failure) #62

Merged
merged 2 commits into from
Feb 15, 2024

Conversation

noizwaves
Copy link
Contributor

Problem

Currently, scope doctor run seems to ignore the path cache results and always runs fixes. This can be slow, especially for some fix commands:

❯ scope doctor run
 INFO Check was successful, group: "homebrew", name: "homebrew"
 INFO Check was successful, group: "github-ssh", name: "github-ssh"
 INFO Check was successful, group: "aws-sso", name: "aws-sso"
 INFO Check was successful, group: "node-version", name: "node-version"
Installing from the API is now the default behaviour!
You can save space and time by running:
  brew untap homebrew/core
  brew untap homebrew/cask
Already up-to-date.
Using homebrew/bundle
Using homebrew/cask
Using homebrew/core
Using homebrew/services
Using gusto/gusto
Using imagemagick@6
Using postgresql@14
Using wkhtmltopdf
Using rbenv
Using ghostscript
Using redis
Using nvm
Using gusto/gusto/pdftk
Using chromedriver
Using pkg-config
Using shellcheck
Using shared-mime-info
Using libsodium
Using overmind
Using libvips
Using mupdf
Homebrew Bundle complete! 21 Brewfile dependencies now installed.
 INFO Check initially failed, fix was successful, group: "brewfile", name: "brew-bundle"
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 0.35s.
 INFO Check initially failed, fix was successful, group: "yarn-install", name: "yarn-install"
...

Solution

Remove the negation that maps an unsuccessful file cache result to a successful cache result. Now:

❯ ~/workspace/scope/target/debug/scope doctor run
 INFO Check was successful, group: "homebrew", name: "homebrew"
 INFO Check was successful, group: "github-ssh", name: "github-ssh"
 INFO Check was successful, group: "aws-sso", name: "aws-sso"
 INFO Check was successful, group: "node-version", name: "node-version"
 INFO Check was successful, group: "brewfile", name: "brew-bundle"
 INFO Check was successful, group: "yarn-install", name: "yarn-install"
 INFO Check was successful, group: "redis", name: "redis"
 INFO Check was successful, group: "rbenv", name: "rbenv"
 INFO Check was successful, group: "postgres", name: "postgres"
 INFO Check was successful, group: "ruby-version", name: "ruby-version"
 INFO Check was successful, group: "dev-databases", name: "dev-databases-exist"
 INFO Check was successful, group: "dev-databases", name: "dev-databases-schema"
 INFO Check was successful, group: "dev-databases", name: "dev-databases-migrations"
 INFO Check was successful, group: "bundler", name: "bundler"
 INFO Check was successful, group: "bundle-install", name: "bundle-install"

@noizwaves noizwaves requested a review from ethankhall February 14, 2024 21:52
Copy link
Contributor

@ethankhall ethankhall left a comment

Choose a reason for hiding this comment

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

Thanks!

@noizwaves noizwaves requested a review from ethankhall February 15, 2024 00:25
@ethankhall ethankhall merged commit 40ef4d6 into main Feb 15, 2024
11 checks passed
@ethankhall ethankhall deleted the an--fix-cache-result-handling branch February 15, 2024 02:48
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