Commit 20957bc
committed
refactor(manifest/bazel): walker takes injected prune policy; reuse IGNORED_DIRS
`findWorkspaceRoots` no longer hardcodes the directory-prune set —
callers pass `ignoreDirNames: ReadonlySet<string>` and
`ignoreDirPrefixes: readonly string[]` via options. Neither defaults
to anything; absent means no pruning. This keeps the walker decoupled
from any particular ignore policy and avoids duplicating the
codebase-wide `IGNORED_DIRS` list.
`src/utils/glob.mts` exports `IGNORED_DIRS` so the orchestrator can
compose it with Bazel-specific extras. The orchestrator's composed
set: `IGNORED_DIRS` plus `.hg`, `.idea`, `.pnpm-store`,
`.socket-auto-manifest`, `.svn`, `.vscode`; prefixes `bazel-` and
`dist`.
Also tighten `MAX_WALK_DEPTH` from 16 → 8. Deepest workspace marker
observed across the surveyed OSS corpus is 9 (bazel-self test
fixtures); deepest in realistic application code is 7 (checkmk's
thirdparty layout). The cap gives one level of headroom over the
realistic max while still guarding against pathological symlink loops
that slipped past any prefix prune the caller supplied.
Walker test rewritten against the new injected API: covers the
no-prune-by-default case (`node_modules/MODULE.bazel` surfaces unless
the caller ignores `node_modules`), injected name and prefix prunes,
and the bazel-* symlink case under the prefix injection.1 parent fa3d3de commit 20957bc
4 files changed
Lines changed: 111 additions & 57 deletions
File tree
- src
- commands/manifest/bazel
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
45 | 33 | | |
46 | 34 | | |
47 | 35 | | |
48 | 36 | | |
49 | 37 | | |
50 | 38 | | |
51 | 39 | | |
52 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
| |||
98 | 105 | | |
99 | 106 | | |
100 | 107 | | |
101 | | - | |
| 108 | + | |
102 | 109 | | |
103 | 110 | | |
104 | 111 | | |
105 | | - | |
| 112 | + | |
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
| |||
Lines changed: 50 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
20 | 36 | | |
21 | 37 | | |
22 | 38 | | |
| |||
31 | 47 | | |
32 | 48 | | |
33 | 49 | | |
34 | | - | |
| 50 | + | |
35 | 51 | | |
36 | 52 | | |
37 | 53 | | |
38 | 54 | | |
39 | | - | |
| 55 | + | |
40 | 56 | | |
41 | 57 | | |
42 | | - | |
| 58 | + | |
43 | 59 | | |
44 | 60 | | |
45 | 61 | | |
46 | 62 | | |
47 | 63 | | |
48 | 64 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
55 | 69 | | |
56 | 70 | | |
57 | 71 | | |
58 | 72 | | |
59 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
60 | 83 | | |
61 | 84 | | |
62 | | - | |
| 85 | + | |
63 | 86 | | |
64 | | - | |
65 | 87 | | |
66 | 88 | | |
67 | 89 | | |
68 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
69 | 94 | | |
70 | 95 | | |
71 | 96 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 97 | + | |
76 | 98 | | |
77 | 99 | | |
78 | 100 | | |
| |||
83 | 105 | | |
84 | 106 | | |
85 | 107 | | |
86 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
87 | 112 | | |
88 | 113 | | |
89 | 114 | | |
90 | 115 | | |
91 | 116 | | |
92 | 117 | | |
93 | | - | |
| 118 | + | |
94 | 119 | | |
95 | 120 | | |
96 | 121 | | |
97 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
98 | 126 | | |
99 | 127 | | |
100 | 128 | | |
101 | 129 | | |
102 | 130 | | |
103 | 131 | | |
104 | 132 | | |
105 | | - | |
| 133 | + | |
106 | 134 | | |
107 | 135 | | |
108 | 136 | | |
109 | 137 | | |
110 | 138 | | |
111 | | - | |
112 | 139 | | |
113 | 140 | | |
114 | 141 | | |
115 | 142 | | |
116 | 143 | | |
117 | 144 | | |
118 | 145 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 146 | + | |
122 | 147 | | |
123 | 148 | | |
124 | 149 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
104 | 121 | | |
105 | 122 | | |
106 | 123 | | |
| |||
396 | 413 | | |
397 | 414 | | |
398 | 415 | | |
399 | | - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
400 | 422 | | |
401 | 423 | | |
402 | 424 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
0 commit comments