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

Guided Remediation Docs #827

Merged
merged 17 commits into from
Mar 5, 2024
Merged

Guided Remediation Docs #827

merged 17 commits into from
Mar 5, 2024

Conversation

michaelkedar
Copy link
Member

@michaelkedar michaelkedar commented Feb 27, 2024

Link: https://michaelkedar.github.io/osv-scanner/experimental/guided-remediation/

Doc page for guided remediation. Will appreciate feedback if things aren't clear or if something's missing.

#352

@codecov-commenter
Copy link

codecov-commenter commented Feb 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 59.82%. Comparing base (b28c1c8) to head (96e6a65).
Report is 11 commits behind head on main.

Files Patch % Lines
cmd/osv-scanner/fix/state-choose-strategy.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #827      +/-   ##
==========================================
+ Coverage   59.78%   59.82%   +0.04%     
==========================================
  Files         136      139       +3     
  Lines       11268    11466     +198     
==========================================
+ Hits         6737     6860     +123     
- Misses       4102     4160      +58     
- Partials      429      446      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@michaelkedar
Copy link
Member Author

michaelkedar commented Feb 27, 2024

I can't see a way to make the subpages expanded by default when not on the parent page :/
image

EDIT: Found a css workaround :)
image

Copy link
Collaborator

@oliverchang oliverchang left a comment

Choose a reason for hiding this comment

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

nice! some initial comments.

{: .note }
This feature is experimental and may change in future updates.

## Basic Usage: Interactive Mode
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thinking more, we should start with the CLI usage, and then transition to the interactive mode as an alternative for power users.

Starting with a heavyweight interactive mode might scare off readers.

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved non-interactive to be 'basic usage', with some forward links to the sections describing in-place/relock strategies.

docs/guided-remediation.md Show resolved Hide resolved
docs/guided-remediation.md Outdated Show resolved Hide resolved

{: .note }

> The `package-lock.json` file is regenerated by first deleting the existing `package-lock.json` & `node_modules/` directory, then running `npm install --package-lock-only`. To recreate `node_modules/`, you'll need to run `npm ci` separately
Copy link
Collaborator

Choose a reason for hiding this comment

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

This bit feels a bit confusing to me. The first sentence does not make it clear that node_modules/ will be NOT be recreated along with package-lock.json. We should clarify that.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've changed it to be more explicit, but I'm not sure if I've made it any less confusing.

docs/guided-remediation.md Outdated Show resolved Hide resolved

A vulnerability is only considered if it satisfies all the conditions set by these flags.

### Dependency Upgrade Options
Copy link
Contributor

Choose a reason for hiding this comment

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

do we still consider to refactor this part of flags to only one flag?

Copy link
Member Author

Choose a reason for hiding this comment

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

I would like to, but I need to implement it first 🙂

Copy link
Collaborator

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

Thanks! Added some comments

docs/guided-remediation.md Outdated Show resolved Hide resolved
docs/guided-remediation.md Show resolved Hide resolved
docs/guided-remediation.md Outdated Show resolved Hide resolved
docs/guided-remediation.md Outdated Show resolved Hide resolved
docs/guided-remediation.md Outdated Show resolved Hide resolved
@michaelkedar michaelkedar marked this pull request as ready for review March 4, 2024 22:58
Copy link
Collaborator

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

LGTM!

docs/guided-remediation.md Outdated Show resolved Hide resolved
docs/guided-remediation.md Outdated Show resolved Hide resolved
- Non-registry dependencies (local paths, URLs, Git, etc.) are not evaluated.
- `peerDependencies` are not properly considered during dependency resolution (treated as if using `--legacy-peer-deps`).
- `overrides` are ignored during dependency resolution.
- The `node_modules/` in workspaces are not deleted when relocking, which may impact the resulting dependency graph.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, should we add a section specifically to call out workspaces and how we handle that?

Copy link
Member Author

Choose a reason for hiding this comment

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

Expanded upon the workspaces in its own sub-sub-sub-heading :)


Guided remediation aims to help developers with fixing with the high number of known vulnerabilities in dependencies typically reported by vulnerability scanners by providing a small number of actionable steps.

The `osv-scanner fix` subcommand leverages [deps.dev](https://deps.dev) to provide automated and guided remediation of vulnerabilities in your project's dependencies by suggesting upgrades to dependencies.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This now feels a bit repetitive. How about folding this into the previous paragraph, and moving the deps.dev mention to the resolution point below?

Guided remediation (`osv-scanner fix`) aims to help developers with ....
...

...
- Resolution and analysis of the entire transitive graph (leveraging deps.dev)...

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@michaelkedar michaelkedar merged commit 5fc5037 into google:main Mar 5, 2024
11 checks passed
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