Skip to content

Commit

Permalink
fix: isolated peer upgrades break upgrade workflows (#629)
Browse files Browse the repository at this point in the history
As for example seen in: cdk8s-team/cdk8s-hasura#407

The workflow upgrades the peer dependency:

```
cdk8s-plus-27: ^2.7.61 -> ^2.7.66
```

But leaves the devDependency unchanged:

```
cdk8s-plus-27: 2.7.61
```

And then the install fails because its requirements are not satisfied.

Instead, don't upgrade peer dependencies automtically. If we need to do a peerDependency upgrade, we will do it by hand.

Fixes #
  • Loading branch information
rix0rrr authored Nov 23, 2023
1 parent b351b0f commit 53c1fe6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/projects/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ export function buildNodeProjectDefaultOptions(options: Cdk8sTeamNodeProjectOpti
const depsUpgradeOptions: UpgradeDependenciesOptions = {
taskName: 'upgrade-runtime-dependencies',
pullRequestTitle: 'upgrade runtime dependencies',
// only include peer and runtime because we will created a non release trigerring PR for the rest
types: [DependencyType.PEER, DependencyType.RUNTIME, DependencyType.OPTIONAL],
// only include plain dependency because we will created a non release triggering PR for the rest
// NOTE: we explicitly do NOT upgrade PEER dependencies. We want the widest range of compatibility possible,
// and by bumping peer dependencies we force the customer to also unnecessarily upgrade, which they may not want
// to do. Never mind that peerDependencies are usually also devDependencies, so it doesn't make sense to upgrade
// them without also upgrading devDependencies.
types: [DependencyType.RUNTIME, DependencyType.OPTIONAL],
workflowOptions: {
schedule: UpgradeDependenciesSchedule.expressions([UPGRADE_RUNTIME_DEPENDENCIES_SCHEDULE]),
},
Expand Down

0 comments on commit 53c1fe6

Please sign in to comment.