Skip to content

Commit 2740e98

Browse files
renovate[bot]renovate-botdevversion
authored
build: update angular shared dev-infra code to 932b9d5 (#25000)
* build: update angular shared dev-infra package Updates the shared dev-infra package. * build: use new release prechecks for validating release before publish Uses the new release precheck feature for validating release output and other inputs. Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Paul Gschwendtner <[email protected]>
1 parent 35d230b commit 2740e98

File tree

8 files changed

+52
-101
lines changed

8 files changed

+52
-101
lines changed

.github/workflows/dev-infra.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
15-
- uses: angular/dev-infra/github-actions/commit-message-based-labels@000ac3f5424551e510250f5a63d3e5917f13af6a
15+
- uses: angular/dev-infra/github-actions/commit-message-based-labels@a2889d30aa4f7ff953f0cdaed212a7a62880644a
1616
with:
1717
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
1818
post_approval_changes:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
22-
- uses: angular/dev-infra/github-actions/post-approval-changes@000ac3f5424551e510250f5a63d3e5917f13af6a
22+
- uses: angular/dev-infra/github-actions/post-approval-changes@a2889d30aa4f7ff953f0cdaed212a7a62880644a
2323
with:
2424
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}

.github/workflows/lock-closed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ jobs:
99
lock_closed:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: angular/dev-infra/github-actions/lock-closed@000ac3f5424551e510250f5a63d3e5917f13af6a
12+
- uses: angular/dev-infra/github-actions/lock-closed@a2889d30aa4f7ff953f0cdaed212a7a62880644a
1313
with:
1414
lock-bot-key: ${{ secrets.LOCK_BOT_PRIVATE_KEY }}

.ng-dev/release.ts

Lines changed: 10 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,8 @@
1-
import {
2-
BuiltPackage,
3-
ReleaseConfig,
4-
ReleaseAction as _ReleaseAction,
5-
FatalReleaseActionError,
6-
} from '@angular/dev-infra-private/ng-dev';
71
import {SemVer} from 'semver';
2+
import {ReleaseConfig} from '@angular/dev-infra-private/ng-dev';
3+
import {assertValidFrameworkPeerDependency} from '../tools/release-checks/check-framework-peer-dependency';
4+
import {assertValidUpdateMigrationCollections} from '../tools/release-checks/check-migration-collections';
85
import {assertValidNpmPackageOutput} from '../tools/release-checks/npm-package-output';
9-
import {fork} from 'child_process';
10-
import {join} from 'path';
11-
12-
// The `ng-dev` release tool exposes the `ReleaseAction` instance through `global`,
13-
// allowing it to be monkey-patched for our release checks. This can be removed
14-
// when the release tool has a public API for release checks.
15-
const actionProto = ((global as any).ReleaseAction ?? _ReleaseAction).prototype;
16-
const _origStageFn = actionProto.stageVersionForBranchAndCreatePullRequest;
17-
const _origVerifyFn = actionProto._verifyPackageVersions;
18-
19-
/** Runs the staging sanity release checks for the given new version. */
20-
async function runStagingReleaseChecks(newVersion: SemVer) {
21-
return new Promise<void>((resolve, reject) => {
22-
// Note: We run the staging release checks in a new node process. This is necessary
23-
// because before staging, the correct publish branch is checked out. If we'd
24-
// directly call into the release checks, the `.ng-dev/release` config would be
25-
// cached by NodeJS and release checks would potentially check for packages which
26-
// no longer exist in the publish branch (or the other way around).
27-
const releaseChecksProcess = fork(join(__dirname, '../tools/release-checks/index.js'), [
28-
newVersion.format(),
29-
]);
30-
31-
releaseChecksProcess.on('close', code => {
32-
if (code !== 0) {
33-
reject(new FatalReleaseActionError());
34-
} else {
35-
resolve();
36-
}
37-
});
38-
});
39-
}
40-
41-
// Patches the `@angular/dev-infra-private` release tool to perform sanity checks
42-
// before staging a release. This is temporary until the dev-infra team has implemented
43-
// a more generic solution to running sanity checks before releasing (potentially building
44-
// some of the checks we have in the components repository into the release tool).
45-
actionProto.stageVersionForBranchAndCreatePullRequest = async function (newVersion: SemVer) {
46-
await runStagingReleaseChecks(newVersion);
47-
48-
return await _origStageFn.apply(this, arguments);
49-
};
50-
51-
// Patches the `@angular/dev-infra-private` release tool to perform sanity
52-
// checks of the NPM package output, before publishing to NPM.
53-
actionProto._verifyPackageVersions = async function (
54-
newVersion: SemVer,
55-
builtPackages: BuiltPackage[],
56-
) {
57-
await assertValidNpmPackageOutput(builtPackages, newVersion);
58-
59-
return await _origVerifyFn.apply(this, arguments);
60-
};
616

627
/**
638
* Packages that will be published as part of the project.
@@ -104,4 +49,11 @@ export const release: ReleaseConfig = {
10449
const {performNpmReleaseBuild} = await import('../scripts/build-packages-dist');
10550
return performNpmReleaseBuild();
10651
},
52+
prereleaseCheck: async (newVersionStr, builtPackagesWithInfo) => {
53+
const newVersion = new SemVer(newVersionStr);
54+
55+
await assertValidFrameworkPeerDependency(newVersion);
56+
await assertValidUpdateMigrationCollections(newVersion);
57+
await assertValidNpmPackageOutput(builtPackagesWithInfo, newVersion);
58+
},
10759
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"@angular/bazel": "14.0.0-rc.1",
7575
"@angular/cli": "14.0.0-rc.1",
7676
"@angular/compiler-cli": "14.0.0-rc.1",
77-
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#60ee618299679aa32219529a59448833cc4dd943",
77+
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#932b9d5f6227d1a2dfa2a416fa317c2e55584994",
7878
"@angular/localize": "14.0.0-rc.1",
7979
"@angular/platform-browser-dynamic": "14.0.0-rc.1",
8080
"@angular/platform-server": "14.0.0-rc.1",

tools/release-checks/check-framework-peer-dependency.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {error, FatalReleaseActionError} from '@angular/dev-infra-private/ng-dev';
1+
import {error, ReleasePrecheckError} from '@angular/dev-infra-private/ng-dev';
22
import {SemVer} from 'semver';
33
import {join} from 'path';
44
import {existsSync, readFileSync} from 'fs';
@@ -34,7 +34,7 @@ export async function assertValidFrameworkPeerDependency(newVersion: SemVer) {
3434
),
3535
);
3636
error(chalk.red(` Please manually update the version range ` + `in: ${bzlConfigPath}`));
37-
throw new FatalReleaseActionError();
37+
throw new ReleasePrecheckError();
3838
}
3939
}
4040

@@ -50,7 +50,7 @@ function _extractAngularVersionPlaceholderOrThrow(): string {
5050
`the Angular peerDependency placeholder value. Looked for: ${bzlConfigPath}`,
5151
),
5252
);
53-
throw new FatalReleaseActionError();
53+
throw new ReleasePrecheckError();
5454
}
5555

5656
const configFileContent = readFileSync(bzlConfigPath, 'utf8');
@@ -63,7 +63,7 @@ function _extractAngularVersionPlaceholderOrThrow(): string {
6363
`Looked in: ${bzlConfigPath}`,
6464
),
6565
);
66-
throw new FatalReleaseActionError();
66+
throw new ReleasePrecheckError();
6767
}
6868
return matches[1];
6969
}

tools/release-checks/check-migration-collections.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {error} from '@angular/dev-infra-private/ng-dev';
1+
import {error, ReleasePrecheckError} from '@angular/dev-infra-private/ng-dev';
22
import chalk from 'chalk';
33
import {existsSync, readFileSync} from 'fs';
44
import {dirname, join} from 'path';
@@ -32,7 +32,7 @@ export async function assertValidUpdateMigrationCollections(newVersion: semver.S
3232
if (failures.length) {
3333
error(chalk.red(` ✘ Failures in ng-update migration collection detected:`));
3434
failures.forEach(f => error(f));
35-
process.exit(1);
35+
throw new ReleasePrecheckError();
3636
}
3737
}
3838

tools/release-checks/npm-package-output/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {SemVer} from 'semver';
22
import {checkReleasePackage} from './check-package';
3-
import {BuiltPackage, error} from '@angular/dev-infra-private/ng-dev';
3+
import {BuiltPackage, error, ReleasePrecheckError} from '@angular/dev-infra-private/ng-dev';
44
import chalk from 'chalk';
55

66
/** Asserts that the given built packages are valid for public consumption. */
@@ -16,6 +16,6 @@ export async function assertValidNpmPackageOutput(
1616

1717
if (!passing) {
1818
error(chalk.red(` ✘ NPM package output does not pass all release validations.`));
19-
process.exit(1);
19+
throw new ReleasePrecheckError();
2020
}
2121
}

yarn.lock

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
"@angular-devkit/core" "14.0.0-rc.1"
2626
rxjs "6.6.7"
2727

28-
"@angular-devkit/[email protected].2":
29-
version "0.1400.0-rc.2"
30-
resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.1400.0-rc.2.tgz#4ea95c11113c229b86be48bc2b425110b6cd7995"
31-
integrity sha512-k2ZGmKhbsMTg2htaSRO1rQW6xVN9lAAwaWIwOijTFehWxeSoAQUJd3V2e/jOy9hQSrrnkg6GI0p2VPie6Xw38A==
28+
"@angular-devkit/[email protected].3":
29+
version "0.1400.0-rc.3"
30+
resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.1400.0-rc.3.tgz#54e328a203f98f243298b014bf4ce2abfde32a06"
31+
integrity sha512-lv0HB50hyrKZDpImI3lk8BVzmD0zUIPARZ/2/wpS3ZCY5lpNSHZSGiN7SnMB9Y2h+RpbjTYeF7/5WLs0cXA6UA==
3232
dependencies:
33-
"@angular-devkit/core" "14.0.0-rc.2"
33+
"@angular-devkit/core" "14.0.0-rc.3"
3434
rxjs "6.6.7"
3535

3636
"@angular-devkit/[email protected]":
@@ -103,15 +103,15 @@
103103
optionalDependencies:
104104
esbuild "0.14.38"
105105

106-
"@angular-devkit/[email protected].2":
107-
version "14.0.0-rc.2"
108-
resolved "https://registry.yarnpkg.com/@angular-devkit/build-angular/-/build-angular-14.0.0-rc.2.tgz#49dd67da8be72c2f3db6ee0f2a5cc4288b34a966"
109-
integrity sha512-xOx11LAZ4JfYekmGxGOdfs98sKR+4a375SqYw/KAtqGjmF69FllIw9YmXqwFzSwQs3vAVt0aDd3NMWUEbW9qQQ==
106+
"@angular-devkit/[email protected].3":
107+
version "14.0.0-rc.3"
108+
resolved "https://registry.yarnpkg.com/@angular-devkit/build-angular/-/build-angular-14.0.0-rc.3.tgz#c168049a4e78b9ef6bed58521979aa5344983547"
109+
integrity sha512-Blta5TUS548p8yxdR4pBYdEuzp7XkVxX38EhrFiPEAqgXyqDM8LwxCk8o9XwqLM9LtgqGd86x5RCx6YgTntUdw==
110110
dependencies:
111111
"@ampproject/remapping" "2.2.0"
112-
"@angular-devkit/architect" "0.1400.0-rc.2"
113-
"@angular-devkit/build-webpack" "0.1400.0-rc.2"
114-
"@angular-devkit/core" "14.0.0-rc.2"
112+
"@angular-devkit/architect" "0.1400.0-rc.3"
113+
"@angular-devkit/build-webpack" "0.1400.0-rc.3"
114+
"@angular-devkit/core" "14.0.0-rc.3"
115115
"@babel/core" "7.17.10"
116116
"@babel/generator" "7.17.10"
117117
"@babel/helper-annotate-as-pure" "7.16.7"
@@ -122,7 +122,7 @@
122122
"@babel/runtime" "7.17.9"
123123
"@babel/template" "7.16.7"
124124
"@discoveryjs/json-ext" "0.5.7"
125-
"@ngtools/webpack" "14.0.0-rc.2"
125+
"@ngtools/webpack" "14.0.0-rc.3"
126126
ansi-colors "4.1.1"
127127
babel-loader "8.2.5"
128128
babel-plugin-istanbul "6.1.1"
@@ -181,12 +181,12 @@
181181
"@angular-devkit/architect" "0.1400.0-rc.1"
182182
rxjs "6.6.7"
183183

184-
"@angular-devkit/[email protected].2":
185-
version "0.1400.0-rc.2"
186-
resolved "https://registry.yarnpkg.com/@angular-devkit/build-webpack/-/build-webpack-0.1400.0-rc.2.tgz#6515ce601d34a6d6652c40a78ebca9dcfb955582"
187-
integrity sha512-TBeQKt5MdwTFILLXTPibzMepvqaV81/XluRua86U2gCOMWS0zWptecLVqCwaOL60jCe8pio7u/8PxrirsHF0Cw==
184+
"@angular-devkit/[email protected].3":
185+
version "0.1400.0-rc.3"
186+
resolved "https://registry.yarnpkg.com/@angular-devkit/build-webpack/-/build-webpack-0.1400.0-rc.3.tgz#b862775a13b12eb0334afaa837f63d22aceaf909"
187+
integrity sha512-AF+7lg4evuFGMYaU5S26zQm3bqRIjF2cA1HIwNFjwSLVBT/NC7+vZKY8HeyIXkeWid2LTiwgb+qZ/Qm1ei+1lg==
188188
dependencies:
189-
"@angular-devkit/architect" "0.1400.0-rc.2"
189+
"@angular-devkit/architect" "0.1400.0-rc.3"
190190
rxjs "6.6.7"
191191

192192
"@angular-devkit/[email protected]":
@@ -200,10 +200,10 @@
200200
rxjs "6.6.7"
201201
source-map "0.7.3"
202202

203-
"@angular-devkit/[email protected].2":
204-
version "14.0.0-rc.2"
205-
resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-14.0.0-rc.2.tgz#d979860dddb21fd31191ef7a231887e2af34461d"
206-
integrity sha512-8nZDWfhFnzSv2ps6YSA4MoKdHeMbTo7qiIzVD2oCpGoH5oaWEB4VJUWK5rZHSdK4ww0fpLc96tIDLcx28LNRfw==
203+
"@angular-devkit/[email protected].3":
204+
version "14.0.0-rc.3"
205+
resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-14.0.0-rc.3.tgz#65e3083451f859032942c4e037daf67095319bf0"
206+
integrity sha512-J+oWWvhJM1bOzsvyyIPxg56L0VEas/OwB9Sa8VdpZL873H03qnAgRdREOCPWhb/G6NBAG+UOFWPl62iMPIF+xw==
207207
dependencies:
208208
ajv "8.11.0"
209209
ajv-formats "2.1.1"
@@ -327,12 +327,11 @@
327327
dependencies:
328328
tslib "^2.3.0"
329329

330-
"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#60ee618299679aa32219529a59448833cc4dd943":
331-
version "0.0.0-000ac3f5424551e510250f5a63d3e5917f13af6a"
332-
uid "60ee618299679aa32219529a59448833cc4dd943"
333-
resolved "https://github.com/angular/dev-infra-private-builds.git#60ee618299679aa32219529a59448833cc4dd943"
330+
"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#932b9d5f6227d1a2dfa2a416fa317c2e55584994":
331+
version "0.0.0-d1a108d604fba8c761af9377545f90c0385f1f0a"
332+
resolved "https://github.com/angular/dev-infra-private-builds.git#932b9d5f6227d1a2dfa2a416fa317c2e55584994"
334333
dependencies:
335-
"@angular-devkit/build-angular" "14.0.0-rc.2"
334+
"@angular-devkit/build-angular" "14.0.0-rc.3"
336335
"@angular/benchpress" "0.3.0"
337336
"@babel/core" "^7.16.0"
338337
"@bazel/buildifier" "5.1.0"
@@ -2555,10 +2554,10 @@
25552554
resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-14.0.0-rc.1.tgz#1188257876a7c6e40cde7f017729a5f1cb89274a"
25562555
integrity sha512-9CqEafLlZD09eqcu1a/rZjiglyBD0ufve8U87kBwOFc7ezWfWi+GLmAIdm3qdTQDcrthqZTKBOugCnxItiJLtA==
25572556

2558-
"@ngtools/[email protected].2":
2559-
version "14.0.0-rc.2"
2560-
resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-14.0.0-rc.2.tgz#8ffbe4a0365e63db8c0cf54197314145a517b93c"
2561-
integrity sha512-8LapwOR7MAqRDj0CkPaksO40Qqxo/PTwp0UXTz59gxO+/SvHmfoGCijRHPeBXyV7Ct6fevTG0WwvQAovXNen1w==
2557+
"@ngtools/[email protected].3":
2558+
version "14.0.0-rc.3"
2559+
resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-14.0.0-rc.3.tgz#2ba0e2b3b5b75ef91e87fd3024840c3745ad44a0"
2560+
integrity sha512-1FnYsG44kjSTJmJNDD7UECUlTKnWox6eKDhescMDW3x0nz0Ijsqnj+VpVdtVwrzbSQZ41l1xFpQbbgU4nVCq9w==
25622561

25632562
"@nodelib/[email protected]":
25642563
version "2.1.5"

0 commit comments

Comments
 (0)