@vaultcompass/conductor 0.16.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@
5
5
  // given. A repository whose only manifests are a pyproject.toml, a Dockerfile
6
6
  // and a workflow gets a green vulnerabilities gate that looked at none of
7
7
  // them, and "treated as clean" on its own reads as a statement about the code.
8
+ import { OSV_LOCKFILE_ECOSYSTEMS } from './products.js';
8
9
  const EXACT_NAMES = new Set([
9
10
  'pyproject.toml',
10
11
  'Pipfile',
@@ -46,7 +47,28 @@ function isManifest(file) {
46
47
  (file.startsWith('.github/workflows/') && /\.ya?ml$/.test(base)));
47
48
  }
48
49
  /**
49
- * Tracked manifest-like files that were not handed to `product`, sorted, as
50
+ * A package.json no JavaScript lockfile the gate was handed could have resolved:
51
+ * none sits in its directory or an ancestor. Under one it is what that lockfile
52
+ * resolved, a workspace member under a root lockfile included, and naming it
53
+ * would put a note on every such run. Any other ecosystem's lockfile says
54
+ * nothing about it.
55
+ */
56
+ function isUnresolvedPackageJson(file, handed) {
57
+ if (file.slice(file.lastIndexOf('/') + 1) !== 'package.json') {
58
+ return false;
59
+ }
60
+ const directory = file.includes('/') ? file.slice(0, file.lastIndexOf('/')) : '';
61
+ return ![...handed].some((lockfile) => {
62
+ const base = lockfile.slice(lockfile.lastIndexOf('/') + 1);
63
+ if (OSV_LOCKFILE_ECOSYSTEMS[base] !== 'javascript') {
64
+ return false;
65
+ }
66
+ const lockDirectory = lockfile.includes('/') ? lockfile.slice(0, lockfile.lastIndexOf('/')) : '';
67
+ return lockDirectory === '' || directory === lockDirectory || directory.startsWith(`${lockDirectory}/`);
68
+ });
69
+ }
70
+ /**
71
+ * Tracked dependency files that were not handed to `product`, sorted, as
50
72
  * one sentence fragment, or null when there are none.
51
73
  *
52
74
  * `handed` are the repository-relative paths the gate was actually handed,
@@ -62,12 +84,12 @@ export function unreadManifestsNote(tracked, handed, product) {
62
84
  const unread = tracked
63
85
  .filter((file) => !file.split('/').some((segment) => SKIPPED_DIRS.has(segment)))
64
86
  .filter((file) => !handed.has(file))
65
- .filter(isManifest)
87
+ .filter((file) => isManifest(file) || isUnresolvedPackageJson(file, handed))
66
88
  .sort();
67
89
  if (unread.length === 0) {
68
90
  return null;
69
91
  }
70
92
  const listed = unread.slice(0, MAX_LISTED).join(', ');
71
93
  const more = unread.length > MAX_LISTED ? `, and ${unread.length - MAX_LISTED} more` : '';
72
- return `Tracked manifests not handed to ${product}: ${listed}${more}.`;
94
+ return `Tracked dependency files not handed to ${product}: ${listed}${more}.`;
73
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaultcompass/conductor",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "type": "module",
5
5
  "description": "Umbrella installer and combined report over the independently installable guardrail gates.",
6
6
  "keywords": [