Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add non-releasing packages to release-please config so their local deps get bumped #1928

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading