-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit fe64476
Updates the audit implementation to the bulk endpoint (#5501)
**What's the problem this PR addresses?**
The current audit implementation uses the older `/audit/quick` endpoint,
which has various problems. One particular is that its design requires
to submit a nested payload, but since it doesn't make much sense in our
case (because most of Yarn installs are flat), we flatten the package
list. It causes problems when multiple packages with different versions
can be found in the tree.
Fixes #3861
Fixes #4117
Fixes #5408
Closes #5409 (Supercedes it)
---
Edit by @merceyz
Fixes #5450
Fixes #2507
Fixes #3778
Fixes #3945
Closes #5309 (Doesn't have a reproduction so I'm assuming it's the same
as the others)
---
**How did you fix it?**
This change rewrites `yarn npm audit` to use the new endpoint. As part
of the migration a couple of fields are reworked (`Via` is replaced by
`Dependents`, the versions are now part of a tree item rather than
concatenated, we don't get the "recommendation" anymore). The options
remain the same for now.
It's possible that some registries don't support the bulk endpoint.
Given that it's fairly straightforward to implement, that it's been
released for some time now, and that without it we would end up with an
invalid `audit` implementation, I'd tend to let them deal with that.
**Checklist**
<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.
<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.1 parent 116d897 commit fe64476
File tree
62 files changed
+1667
-1569
lines changed- .yarn
- cache
- versions
- packages
- acceptance-tests
- pkg-tests-core
- sources/utils
- pkg-tests-fixtures/packages
- vulnerable-1.0.0
- vulnerable-1.1.0 copy
- vulnerable-1.1.0
- vulnerable-1.1.0
- vulnerable-dep-1.0.0
- vulnerable-dep-1.1.0
- vulnerable-many-1.0.0
- vulnerable-1.1.0
- vulnerable-peer-deps-1.0.0
- vulnerable-1.1.0
- vulnerable-peer-deps-1.1.0
- pkg-tests-specs/sources/commands/npm
- plugin-constraints
- plugin-dlx
- plugin-essentials
- plugin-git
- plugin-init
- plugin-interactive-tools
- plugin-nm
- plugin-npm-cli
- sources
- commands/npm
- tests
- plugin-pack
- plugin-patch
- plugin-pnpm
- plugin-pnp
- plugin-stage
- plugin-version
- plugin-workspace-tools
- yarnpkg-builder
- yarnpkg-cli
- yarnpkg-core
- sources
- yarnpkg-doctor
- yarnpkg-pnpify
- yarnpkg-sdks
- yarnpkg-shell
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
62 files changed
+1667
-1569
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + | ||
16 | + | ||
17 | + | ||
18 | + | ||
19 | + | ||
20 | + | ||
21 | + | ||
22 | + | ||
23 | + | ||
24 | + | ||
25 | + | ||
26 | + | ||
27 | + | ||
28 | + | ||
29 | + | ||
30 | + | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | + | ||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | - | ||
22 | + | ||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | + | ||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
41 | + | ||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
Lines changed: 82 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | + | ||
1 | 2 | | |
3 | + | ||
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
17 | + | ||
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
59 | + | ||
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| |||
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
83 | + | ||
84 | + | ||
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
| |||
108 | 114 | | |
109 | 115 | | |
110 | 116 | | |
117 | + | ||
118 | + | ||
119 | + | ||
120 | + | ||
121 | + | ||
122 | + | ||
123 | + | ||
124 | + | ||
125 | + | ||
126 | + | ||
127 | + | ||
128 | + | ||
129 | + | ||
130 | + | ||
131 | + | ||
132 | + | ||
133 | + | ||
134 | + | ||
135 | + | ||
136 | + | ||
137 | + | ||
138 | + | ||
139 | + | ||
140 | + | ||
141 | + | ||
142 | + | ||
143 | + | ||
144 | + | ||
145 | + | ||
146 | + | ||
147 | + | ||
148 | + | ||
149 | + | ||
150 | + | ||
151 | + | ||
152 | + | ||
111 | 153 | | |
112 | 154 | | |
113 | 155 | | |
| |||
440 | 482 | | |
441 | 483 | | |
442 | 484 | | |
485 | + | ||
443 | 486 | | |
444 | 487 | | |
445 | 488 | | |
| |||
472 | 515 | | |
473 | 516 | | |
474 | 517 | | |
518 | + | ||
519 | + | ||
520 | + | ||
521 | + | ||
522 | + | ||
523 | + | ||
524 | + | ||
525 | + | ||
526 | + | ||
527 | + | ||
528 | + | ||
529 | + | ||
530 | + | ||
531 | + | ||
532 | + | ||
533 | + | ||
534 | + | ||
535 | + | ||
536 | + | ||
537 | + | ||
538 | + | ||
539 | + | ||
540 | + | ||
541 | + | ||
542 | + | ||
543 | + | ||
544 | + | ||
545 | + | ||
546 | + | ||
547 | + | ||
548 | + | ||
549 | + | ||
550 | + | ||
551 | + | ||
552 | + | ||
475 | 553 | | |
476 | 554 | | |
477 | 555 | | |
| |||
508 | 586 | | |
509 | 587 | | |
510 | 588 | | |
589 | + | ||
590 | + | ||
591 | + | ||
592 | + | ||
511 | 593 | | |
512 | 594 | | |
513 | 595 | | |
| |||
0 commit comments