Skip to content

Commit 973ee3d

Browse files
devversionjosephperrott
authored andcommitted
refactor(dev-infra): ensure compatibility with noImplicitOverride (#42512)
Adds the `override` keyword to the `dev-infra` sources to ensure compatibility with `noImplicitOverride`. PR Close #42512
1 parent ad33e61 commit 973ee3d

11 files changed

+19
-19
lines changed

release/publish/actions/configure-next-as-major.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class ConfigureNextAsMajorAction extends ReleaseAction {
4444
info(yellow(` Please ask team members to review: ${pullRequest.url}.`));
4545
}
4646

47-
static async isActive(active: ActiveReleaseTrains) {
47+
static override async isActive(active: ActiveReleaseTrains) {
4848
// The `next` branch can always be switched to a major version, unless it already
4949
// is targeting a new major. A major can contain minor changes, so we can always
5050
// change the target from a minor to a major.

release/publish/actions/cut-lts-patch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class CutLongTermSupportPatchAction extends ReleaseAction {
7474
return {name: `v${branch.version.major} (from ${branch.name})`, value: branch};
7575
}
7676

77-
static async isActive(active: ActiveReleaseTrains) {
77+
static override async isActive(active: ActiveReleaseTrains) {
7878
// LTS patch versions can be only cut if there are release trains in LTS phase.
7979
// This action is always selectable as we support publishing of old LTS branches,
8080
// and have prompt for selecting an LTS branch when the action performs.

release/publish/actions/cut-new-patch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class CutNewPatchAction extends ReleaseAction {
3636
await this.cherryPickChangelogIntoNextBranch(releaseNotes, branchName);
3737
}
3838

39-
static async isActive(active: ActiveReleaseTrains) {
39+
static override async isActive(active: ActiveReleaseTrains) {
4040
// Patch versions can be cut at any time. See:
4141
// https://hackmd.io/2Le8leq0S6G_R5VEVTNK9A#Release-prompt-options.
4242
return true;

release/publish/actions/cut-next-prerelease.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class CutNextPrereleaseAction extends ReleaseAction {
6464
}
6565
}
6666

67-
static async isActive() {
67+
static override async isActive() {
6868
// Pre-releases for the `next` NPM dist tag can always be cut. Depending on whether
6969
// there is a feature-freeze/release-candidate branch, the next pre-releases are either
7070
// cut from such a branch, or from the actual `next` release-train branch (i.e. master).

release/publish/actions/cut-release-candidate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class CutReleaseCandidateAction extends ReleaseAction {
3434
await this.cherryPickChangelogIntoNextBranch(releaseNotes, branchName);
3535
}
3636

37-
static async isActive(active: ActiveReleaseTrains) {
37+
static override async isActive(active: ActiveReleaseTrains) {
3838
// A release-candidate can be cut for an active release-train currently
3939
// in the feature-freeze phase.
4040
return active.releaseCandidate !== null &&

release/publish/actions/cut-stable.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class CutStableAction extends ReleaseAction {
7373
return semver.parse(`${version.major}.${version.minor}.${version.patch}`)!;
7474
}
7575

76-
static async isActive(active: ActiveReleaseTrains) {
76+
static override async isActive(active: ActiveReleaseTrains) {
7777
// A stable version can be cut for an active release-train currently in the
7878
// release-candidate phase. Note: It is not possible to directly release from
7979
// feature-freeze phase into a stable version.

release/publish/actions/move-next-into-feature-freeze.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class MoveNextIntoFeatureFreezeAction extends ReleaseAction {
100100
info(yellow(` Please ask team members to review: ${nextUpdatePullRequest.url}.`));
101101
}
102102

103-
static async isActive(active: ActiveReleaseTrains) {
103+
static override async isActive(active: ActiveReleaseTrains) {
104104
// A new feature-freeze/release-candidate branch can only be created if there
105105
// is no active release-train in feature-freeze/release-candidate phase.
106106
return active.releaseCandidate === null;

release/publish/actions/tag-recent-major-as-latest.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class TagRecentMajorAsLatest extends ReleaseAction {
3535
await invokeSetNpmDistCommand('latest', this.active.latest.version);
3636
}
3737

38-
static async isActive({latest}: ActiveReleaseTrains, config: ReleaseConfig) {
38+
static override async isActive({latest}: ActiveReleaseTrains, config: ReleaseConfig) {
3939
// If the latest release-train does currently not have a major version as version. e.g.
4040
// the latest branch is `10.0.x` with the version being `10.0.2`. In such cases, a major
4141
// has not been released recently, and this action should never become active.

release/publish/test/release-notes/release-notes-utils.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ import {ReleaseNotes} from '../../../notes/release-notes';
1616
* returning versioned entry strings.
1717
*/
1818
class MockReleaseNotes extends ReleaseNotes {
19-
static async fromRange(version: semver.SemVer, startingRef: string, endingRef: string) {
19+
static override async fromRange(version: semver.SemVer, startingRef: string, endingRef: string) {
2020
return new MockReleaseNotes(version, startingRef, endingRef);
2121
}
2222

23-
async getChangelogEntry() {
23+
override async getChangelogEntry() {
2424
return `Changelog Entry for ${this.version}`;
2525
}
2626

27-
async getGithubReleaseEntry() {
27+
override async getGithubReleaseEntry() {
2828
return `Github Release Entry for ${this.version}`;
2929
}
3030

3131
// Overrides of utility functions which call out to other tools and are unused in this mock.
32-
protected async getCommitsInRange(from: string, to?: string) {
32+
protected override async getCommitsInRange(from: string, to?: string) {
3333
return [];
3434
}
35-
protected getReleaseConfig(config?: Partial<DevInfraReleaseConfig>) {
35+
protected override getReleaseConfig(config?: Partial<DevInfraReleaseConfig>) {
3636
return {} as ReleaseConfig;
3737
}
3838
}

utils/git/authenticated-git-client.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ export class AuthenticatedGitClient extends GitClient {
3131
private _cachedOauthScopes: Promise<string[]>|null = null;
3232

3333
/** Instance of an authenticated github client. */
34-
readonly github = new AuthenticatedGithubClient(this.githubToken);
34+
override readonly github = new AuthenticatedGithubClient(this.githubToken);
3535

3636
protected constructor(readonly githubToken: string, baseDir?: string, config?: NgDevConfig) {
3737
super(baseDir, config);
3838
}
3939

4040
/** Sanitizes a given message by omitting the provided Github token if present. */
41-
sanitizeConsoleOutput(value: string): string {
41+
override sanitizeConsoleOutput(value: string): string {
4242
return value.replace(this._githubTokenRegex, '<TOKEN>');
4343
}
4444

4545
/** Git URL that resolves to the configured repository. */
46-
getRepoGitUrl() {
46+
override getRepoGitUrl() {
4747
return getRepositoryGitUrl(this.remoteConfig, this.githubToken);
4848
}
4949

@@ -102,7 +102,7 @@ export class AuthenticatedGitClient extends GitClient {
102102
* Static method to get the singleton instance of the `AuthenticatedGitClient`,
103103
* creating it if it has not yet been created.
104104
*/
105-
static get(): AuthenticatedGitClient {
105+
static override get(): AuthenticatedGitClient {
106106
if (!AuthenticatedGitClient._authenticatedInstance) {
107107
throw new Error('No instance of `AuthenticatedGitClient` has been set up yet.');
108108
}

utils/testing/virtual-git-client.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ export class VirtualGitClient extends AuthenticatedGitClient {
7878
* Override the actual GitClient getLatestSemverTag, as an actual tag cannot be retrieved in
7979
* testing.
8080
*/
81-
getLatestSemverTag() {
81+
override getLatestSemverTag() {
8282
return new SemVer('0.0.0');
8383
}
8484

8585
/** Override for the actual Git client command execution. */
86-
runGraceful(args: string[], options: SpawnSyncOptions = {}): SpawnSyncReturns<string> {
86+
override runGraceful(args: string[], options: SpawnSyncOptions = {}): SpawnSyncReturns<string> {
8787
const [command, ...rawArgs] = args;
8888
switch (command) {
8989
case 'push':

0 commit comments

Comments
 (0)