Skip to content

Commit

Permalink
chore: upgrade cloud-assembly-schema major version (#78)
Browse files Browse the repository at this point in the history
Recently the `@aws-cdk/cloud-assembly-schema` changed their versioning
scheme to do a major version bump every time the schema is updated.

This PR updates our dependency upgrade workflow to always update
`@aws-cdk/cloud-assembly-schema` to the newest version

This also adds `skipVersionCheck: true` so that even if we are behind
the latest version it shouldn't show an error.

fixes #74
  • Loading branch information
corymhall authored Aug 26, 2024
1 parent d28e392 commit 407b4fd
Show file tree
Hide file tree
Showing 8 changed files with 734 additions and 1,124 deletions.
31 changes: 28 additions & 3 deletions .projen/tasks.json

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

17 changes: 17 additions & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const project = new GitHubActionTypeScriptProject({
name: 'cdk-diff-action',
projenrcTs: true,
depsUpgradeOptions: {
exclude: ['@aws-cdk/cloud-assembly-schema'],
workflowOptions: {
labels: ['auto-approve'],
schedule: UpgradeDependenciesSchedule.WEEKLY,
Expand Down Expand Up @@ -97,6 +98,22 @@ const project = new GitHubActionTypeScriptProject({


const projenProject = project as unknown as typescript.TypeScriptProject;

// There doesn't seem to be a way to specify --target for individual dependencies so
// adding a separate task to handle always doing a major upgrade to `@aws-cdk/cloud-assembly-schema`
// @see https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/cloud-assembly-schema/README.md#versioning
project.upgradeWorkflow?.postUpgradeTask.prependSpawn(projenProject.addTask('upgrade-cloud-assembly-schema', {
env: {
CI: '0',
},
steps: [
{ exec: 'npx npm-check-updates@16 --upgrade --target=latest --peer --dep=prod --filter=@aws-cdk/cloud-assembly-schema' },
{ exec: 'yarn install --check-files' },
{ exec: 'yarn upgrade @aws-cdk/cloud-assembly-schema' },
{ exec: 'npx projen' },
],
}));

const jestConfig = projenProject.tryFindObjectFile('jest.config.json');
jestConfig?.patch(JsonPatch.remove('/preset'));
jestConfig?.patch(JsonPatch.remove('/globals'));
Expand Down
1,722 changes: 637 additions & 1,085 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/licenses.txt

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

7 changes: 4 additions & 3 deletions package.json

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

3 changes: 2 additions & 1 deletion src/assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export class AssemblyManifestReader {
*/
public static fromFile(fileName: string): AssemblyManifestReader {
try {
const obj = Manifest.loadAssemblyManifest(fileName);
// skipVersionCheck since we should always be able to load newer versions
const obj = Manifest.loadAssemblyManifest(fileName, { skipVersionCheck: true });
return new AssemblyManifestReader(path.dirname(fileName), obj);

} catch (e: any) {
Expand Down
73 changes: 43 additions & 30 deletions yarn.lock

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

0 comments on commit 407b4fd

Please sign in to comment.