Skip to content

Commit b492506

Browse files
committed
Attempt to fix registry-scanner for changes in dirs in opentelemetry-js-contrib.git
Refs: open-telemetry/opentelemetry-js-contrib#2928
1 parent 6c5b363 commit b492506

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

scripts/registry-scanner/index.mjs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ if (process.argv.length < 3) {
5252
`USAGE: ${path.basename(process.argv[0])} ${path.basename(
5353
process.argv[1],
5454
)} <list>
55-
<list> is a comma separated list of the following options:
55+
<list> is a comma separated list of the following options:
5656
- collector
5757
- python
5858
- ruby
@@ -63,7 +63,7 @@ if (process.argv.length < 3) {
6363
- php
6464
- go
6565
Use 'all' if you want to run all of them (except go).
66-
66+
6767
Example: ${path.basename(process.argv[0])} ${path.basename(
6868
process.argv[1],
6969
)} python,ruby,erlang`,
@@ -80,12 +80,21 @@ const scanners = {
8080
);
8181
},
8282
js: () => {
83-
scanByLanguage('instrumentation', 'js', 'plugins/node');
8483
scanByLanguage(
85-
'resource-detector',
84+
'instrumentation',
8685
'js',
87-
'detectors/node',
86+
'packages',
87+
'md',
88+
'opentelemetry-js-contrib',
89+
(pkg) => pkg.name.startsWith('instrumentation-'),
90+
);
91+
scanByLanguage(
8892
'resource-detector',
93+
'js',
94+
'packages',
95+
'md',
96+
'opentelemetry-js-contrib',
97+
(pkg) => pkg.name.startsWith('resource-detector-'),
8998
);
9099
},
91100
java: () => {
@@ -305,13 +314,14 @@ async function scanByLanguage(
305314
x
306315
.split(/[_-]/)
307316
.filter(
317+
// TODO: This filter doesn't handle skipping registryType='resource-detector'.
308318
(y) =>
309319
!['opentelemetry', registryType].includes(y) &&
310320
!y.match(/^[0-9]+.[0-9]+$/),
311321
)
312322
.join(''),
313323
) {
314-
// https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/
324+
// https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/
315325
const found = await scanForNew(path, repo, filter, keyMapper);
316326
const existing = await scanForExisting(`${registryType}-${language}`);
317327
createFilesFromScanResult(existing, found, {

0 commit comments

Comments
 (0)