Skip to content

Commit

Permalink
chore: add non-releasing packages to release-please config so their l…
Browse files Browse the repository at this point in the history
…ocal deps get bumped (open-telemetry#1928)

* chore: add unreleasing packages to release-please config so their local deps get bumped

This is option 1 from open-telemetry#1917.

Refs: open-telemetry#1917

* drop commented out debug output
  • Loading branch information
trentm authored Feb 13, 2024
1 parent 39c34df commit cf034c8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 20 deletions.
7 changes: 7 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"packages/opentelemetry-redis-common": {},
"packages/opentelemetry-sql-common": {},
"packages/opentelemetry-test-utils": {},
"packages/opentelemetry-sampler-aws-xray": { "skip-github-release": true },
"plugins/node/instrumentation-amqplib": {},
"plugins/node/instrumentation-cucumber": {},
"plugins/node/instrumentation-dataloader": {},
Expand All @@ -32,26 +33,32 @@
"plugins/node/opentelemetry-instrumentation-aws-lambda": {},
"plugins/node/opentelemetry-instrumentation-aws-sdk": {},
"plugins/node/opentelemetry-instrumentation-bunyan": {},
"plugins/node/opentelemetry-instrumentation-bunyan/examples": { "skip-github-release": true },
"plugins/node/opentelemetry-instrumentation-cassandra": {},
"plugins/node/opentelemetry-instrumentation-connect": {},
"plugins/node/opentelemetry-instrumentation-dns": {},
"plugins/node/opentelemetry-instrumentation-express": {},
"plugins/node/opentelemetry-instrumentation-express/examples": { "skip-github-release": true },
"plugins/node/opentelemetry-instrumentation-fastify": {},
"plugins/node/opentelemetry-instrumentation-generic-pool": {},
"plugins/node/opentelemetry-instrumentation-graphql": {},
"plugins/node/opentelemetry-instrumentation-hapi": {},
"plugins/node/opentelemetry-instrumentation-ioredis": {},
"plugins/node/opentelemetry-instrumentation-knex": {},
"plugins/node/opentelemetry-instrumentation-koa": {},
"plugins/node/opentelemetry-instrumentation-koa/examples": { "skip-github-release": true },
"plugins/node/opentelemetry-instrumentation-memcached": {},
"plugins/node/opentelemetry-instrumentation-mongodb": {},
"plugins/node/opentelemetry-instrumentation-mongodb/examples": { "skip-github-release": true },
"plugins/node/opentelemetry-instrumentation-mysql": {},
"plugins/node/opentelemetry-instrumentation-mysql/examples": { "skip-github-release": true },
"plugins/node/opentelemetry-instrumentation-mysql2": {},
"plugins/node/opentelemetry-instrumentation-nestjs-core": {},
"plugins/node/opentelemetry-instrumentation-net": {},
"plugins/node/opentelemetry-instrumentation-pg": {},
"plugins/node/opentelemetry-instrumentation-pino": {},
"plugins/node/opentelemetry-instrumentation-redis": {},
"plugins/node/opentelemetry-instrumentation-redis/examples": { "skip-github-release": true },
"plugins/node/opentelemetry-instrumentation-redis-4": {},
"plugins/node/opentelemetry-instrumentation-restify": {},
"plugins/node/opentelemetry-instrumentation-router": {},
Expand Down
49 changes: 29 additions & 20 deletions scripts/check-release-please.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,44 @@ const getProcessOutput = (cmd, args) => {
return result.stdout.toString('utf8');
}

const lernaList = JSON.parse(
getProcessOutput('npx', ['lerna', 'list', '--json'])
);
const lernaList = JSON
.parse(getProcessOutput('npx', ['lerna', 'list', '--json', '-a']))
.map((pkgInfo) => {
pkgInfo.relativeLocation = path.relative(PROJECT_ROOT, pkgInfo.location);
return pkgInfo;
});
const manifest = readJson('.release-please-manifest.json');
const config = readJson('release-please-config.json');

const lernaPackages = new Set(
lernaList.map((pkg) => {
return path.relative(PROJECT_ROOT, pkg.location);
})
lernaList.map((pkgInfo) => pkgInfo.relativeLocation)
);
const manifestPackages = new Set(Object.keys(manifest));
const configPackages = new Set(Object.keys(config.packages));

console.log('lerna packages', lernaPackages);
console.log('manifest packages', manifestPackages);
console.log('config packages', configPackages);

lernaPackages.forEach((relativeLocation) => {
logErrorIf(
!manifestPackages.has(relativeLocation),
`Could not find ${relativeLocation} in .release-please-manifest.json. If you are adding a new package. Add following
"${relativeLocation}": "0.0.1",`);

logErrorIf(
!configPackages.has(relativeLocation),
`Could not find ${relativeLocation} in release-please-config.json. If you are adding a new package. Add following to "packages" object
"${relativeLocation}": {},`);
lernaList.forEach((pkgInfo) => {
const relativeLocation = pkgInfo.relativeLocation
if (pkgInfo.private) {
// Should be in config, with `skip-github-release` option.
const configEntry = config.packages[relativeLocation]
if (!configEntry) {
errors.push(`Could not find "${relativeLocation}" entry in release-please-config.json. If you are adding a new package. Add following to "packages" object:
"${relativeLocation}": { "skip-github-release": true },`);
} else if (configEntry['skip-github-release'] !== true) {
errors.push(`The "${relativeLocation}" entry in release-please-config.json should have the '"skip-github-release": true' option`);
}
} else {
// Should be in manifest and config.
logErrorIf(
!manifestPackages.has(relativeLocation),
`Could not find "${relativeLocation}" entry in .release-please-manifest.json. If you are adding a new package. Add following
"${relativeLocation}": "0.0.1",`);

logErrorIf(
!configPackages.has(relativeLocation),
`Could not find "${relativeLocation}" entry in release-please-config.json. If you are adding a new package. Add following to "packages" object
"${relativeLocation}": {},`);
}
});

manifestPackages.forEach((relativeLocation) => {
Expand Down

0 comments on commit cf034c8

Please sign in to comment.