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
This commit is contained in:
parent
ccbb913f4b
commit
907363348a
@ -44,7 +44,7 @@ export class ConfigureNextAsMajorAction extends ReleaseAction {
|
|||||||
info(yellow(` Please ask team members to review: ${pullRequest.url}.`));
|
info(yellow(` Please ask team members to review: ${pullRequest.url}.`));
|
||||||
}
|
}
|
||||||
|
|
||||||
static async isActive(active: ActiveReleaseTrains) {
|
static override async isActive(active: ActiveReleaseTrains) {
|
||||||
// The `next` branch can always be switched to a major version, unless it already
|
// The `next` branch can always be switched to a major version, unless it already
|
||||||
// is targeting a new major. A major can contain minor changes, so we can always
|
// is targeting a new major. A major can contain minor changes, so we can always
|
||||||
// change the target from a minor to a major.
|
// change the target from a minor to a major.
|
||||||
|
@ -74,7 +74,7 @@ export class CutLongTermSupportPatchAction extends ReleaseAction {
|
|||||||
return {name: `v${branch.version.major} (from ${branch.name})`, value: branch};
|
return {name: `v${branch.version.major} (from ${branch.name})`, value: branch};
|
||||||
}
|
}
|
||||||
|
|
||||||
static async isActive(active: ActiveReleaseTrains) {
|
static override async isActive(active: ActiveReleaseTrains) {
|
||||||
// LTS patch versions can be only cut if there are release trains in LTS phase.
|
// LTS patch versions can be only cut if there are release trains in LTS phase.
|
||||||
// This action is always selectable as we support publishing of old LTS branches,
|
// This action is always selectable as we support publishing of old LTS branches,
|
||||||
// and have prompt for selecting an LTS branch when the action performs.
|
// and have prompt for selecting an LTS branch when the action performs.
|
||||||
|
@ -36,7 +36,7 @@ export class CutNewPatchAction extends ReleaseAction {
|
|||||||
await this.cherryPickChangelogIntoNextBranch(releaseNotes, branchName);
|
await this.cherryPickChangelogIntoNextBranch(releaseNotes, branchName);
|
||||||
}
|
}
|
||||||
|
|
||||||
static async isActive(active: ActiveReleaseTrains) {
|
static override async isActive(active: ActiveReleaseTrains) {
|
||||||
// Patch versions can be cut at any time. See:
|
// Patch versions can be cut at any time. See:
|
||||||
// https://hackmd.io/2Le8leq0S6G_R5VEVTNK9A#Release-prompt-options.
|
// https://hackmd.io/2Le8leq0S6G_R5VEVTNK9A#Release-prompt-options.
|
||||||
return true;
|
return true;
|
||||||
|
@ -64,7 +64,7 @@ export class CutNextPrereleaseAction extends ReleaseAction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async isActive() {
|
static override async isActive() {
|
||||||
// Pre-releases for the `next` NPM dist tag can always be cut. Depending on whether
|
// Pre-releases for the `next` NPM dist tag can always be cut. Depending on whether
|
||||||
// there is a feature-freeze/release-candidate branch, the next pre-releases are either
|
// there is a feature-freeze/release-candidate branch, the next pre-releases are either
|
||||||
// cut from such a branch, or from the actual `next` release-train branch (i.e. master).
|
// cut from such a branch, or from the actual `next` release-train branch (i.e. master).
|
||||||
|
@ -34,7 +34,7 @@ export class CutReleaseCandidateAction extends ReleaseAction {
|
|||||||
await this.cherryPickChangelogIntoNextBranch(releaseNotes, branchName);
|
await this.cherryPickChangelogIntoNextBranch(releaseNotes, branchName);
|
||||||
}
|
}
|
||||||
|
|
||||||
static async isActive(active: ActiveReleaseTrains) {
|
static override async isActive(active: ActiveReleaseTrains) {
|
||||||
// A release-candidate can be cut for an active release-train currently
|
// A release-candidate can be cut for an active release-train currently
|
||||||
// in the feature-freeze phase.
|
// in the feature-freeze phase.
|
||||||
return active.releaseCandidate !== null &&
|
return active.releaseCandidate !== null &&
|
||||||
|
@ -73,7 +73,7 @@ export class CutStableAction extends ReleaseAction {
|
|||||||
return semver.parse(`${version.major}.${version.minor}.${version.patch}`)!;
|
return semver.parse(`${version.major}.${version.minor}.${version.patch}`)!;
|
||||||
}
|
}
|
||||||
|
|
||||||
static async isActive(active: ActiveReleaseTrains) {
|
static override async isActive(active: ActiveReleaseTrains) {
|
||||||
// A stable version can be cut for an active release-train currently in the
|
// A stable version can be cut for an active release-train currently in the
|
||||||
// release-candidate phase. Note: It is not possible to directly release from
|
// release-candidate phase. Note: It is not possible to directly release from
|
||||||
// feature-freeze phase into a stable version.
|
// feature-freeze phase into a stable version.
|
||||||
|
@ -100,7 +100,7 @@ export class MoveNextIntoFeatureFreezeAction extends ReleaseAction {
|
|||||||
info(yellow(` Please ask team members to review: ${nextUpdatePullRequest.url}.`));
|
info(yellow(` Please ask team members to review: ${nextUpdatePullRequest.url}.`));
|
||||||
}
|
}
|
||||||
|
|
||||||
static async isActive(active: ActiveReleaseTrains) {
|
static override async isActive(active: ActiveReleaseTrains) {
|
||||||
// A new feature-freeze/release-candidate branch can only be created if there
|
// A new feature-freeze/release-candidate branch can only be created if there
|
||||||
// is no active release-train in feature-freeze/release-candidate phase.
|
// is no active release-train in feature-freeze/release-candidate phase.
|
||||||
return active.releaseCandidate === null;
|
return active.releaseCandidate === null;
|
||||||
|
@ -35,7 +35,7 @@ export class TagRecentMajorAsLatest extends ReleaseAction {
|
|||||||
await invokeSetNpmDistCommand('latest', this.active.latest.version);
|
await invokeSetNpmDistCommand('latest', this.active.latest.version);
|
||||||
}
|
}
|
||||||
|
|
||||||
static async isActive({latest}: ActiveReleaseTrains, config: ReleaseConfig) {
|
static override async isActive({latest}: ActiveReleaseTrains, config: ReleaseConfig) {
|
||||||
// If the latest release-train does currently not have a major version as version. e.g.
|
// If the latest release-train does currently not have a major version as version. e.g.
|
||||||
// the latest branch is `10.0.x` with the version being `10.0.2`. In such cases, a major
|
// the latest branch is `10.0.x` with the version being `10.0.2`. In such cases, a major
|
||||||
// has not been released recently, and this action should never become active.
|
// has not been released recently, and this action should never become active.
|
||||||
|
@ -16,23 +16,23 @@ import {ReleaseNotes} from '../../../notes/release-notes';
|
|||||||
* returning versioned entry strings.
|
* returning versioned entry strings.
|
||||||
*/
|
*/
|
||||||
class MockReleaseNotes extends ReleaseNotes {
|
class MockReleaseNotes extends ReleaseNotes {
|
||||||
static async fromRange(version: semver.SemVer, startingRef: string, endingRef: string) {
|
static override async fromRange(version: semver.SemVer, startingRef: string, endingRef: string) {
|
||||||
return new MockReleaseNotes(version, startingRef, endingRef);
|
return new MockReleaseNotes(version, startingRef, endingRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getChangelogEntry() {
|
override async getChangelogEntry() {
|
||||||
return `Changelog Entry for ${this.version}`;
|
return `Changelog Entry for ${this.version}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getGithubReleaseEntry() {
|
override async getGithubReleaseEntry() {
|
||||||
return `Github Release Entry for ${this.version}`;
|
return `Github Release Entry for ${this.version}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overrides of utility functions which call out to other tools and are unused in this mock.
|
// Overrides of utility functions which call out to other tools and are unused in this mock.
|
||||||
protected async getCommitsInRange(from: string, to?: string) {
|
protected override async getCommitsInRange(from: string, to?: string) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
protected getReleaseConfig(config?: Partial<DevInfraReleaseConfig>) {
|
protected override getReleaseConfig(config?: Partial<DevInfraReleaseConfig>) {
|
||||||
return {} as ReleaseConfig;
|
return {} as ReleaseConfig;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,19 +31,19 @@ export class AuthenticatedGitClient extends GitClient {
|
|||||||
private _cachedOauthScopes: Promise<string[]>|null = null;
|
private _cachedOauthScopes: Promise<string[]>|null = null;
|
||||||
|
|
||||||
/** Instance of an authenticated github client. */
|
/** Instance of an authenticated github client. */
|
||||||
readonly github = new AuthenticatedGithubClient(this.githubToken);
|
override readonly github = new AuthenticatedGithubClient(this.githubToken);
|
||||||
|
|
||||||
protected constructor(readonly githubToken: string, baseDir?: string, config?: NgDevConfig) {
|
protected constructor(readonly githubToken: string, baseDir?: string, config?: NgDevConfig) {
|
||||||
super(baseDir, config);
|
super(baseDir, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sanitizes a given message by omitting the provided Github token if present. */
|
/** Sanitizes a given message by omitting the provided Github token if present. */
|
||||||
sanitizeConsoleOutput(value: string): string {
|
override sanitizeConsoleOutput(value: string): string {
|
||||||
return value.replace(this._githubTokenRegex, '<TOKEN>');
|
return value.replace(this._githubTokenRegex, '<TOKEN>');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Git URL that resolves to the configured repository. */
|
/** Git URL that resolves to the configured repository. */
|
||||||
getRepoGitUrl() {
|
override getRepoGitUrl() {
|
||||||
return getRepositoryGitUrl(this.remoteConfig, this.githubToken);
|
return getRepositoryGitUrl(this.remoteConfig, this.githubToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ export class AuthenticatedGitClient extends GitClient {
|
|||||||
* Static method to get the singleton instance of the `AuthenticatedGitClient`,
|
* Static method to get the singleton instance of the `AuthenticatedGitClient`,
|
||||||
* creating it if it has not yet been created.
|
* creating it if it has not yet been created.
|
||||||
*/
|
*/
|
||||||
static get(): AuthenticatedGitClient {
|
static override get(): AuthenticatedGitClient {
|
||||||
if (!AuthenticatedGitClient._authenticatedInstance) {
|
if (!AuthenticatedGitClient._authenticatedInstance) {
|
||||||
throw new Error('No instance of `AuthenticatedGitClient` has been set up yet.');
|
throw new Error('No instance of `AuthenticatedGitClient` has been set up yet.');
|
||||||
}
|
}
|
||||||
|
@ -78,12 +78,12 @@ export class VirtualGitClient extends AuthenticatedGitClient {
|
|||||||
* Override the actual GitClient getLatestSemverTag, as an actual tag cannot be retrieved in
|
* Override the actual GitClient getLatestSemverTag, as an actual tag cannot be retrieved in
|
||||||
* testing.
|
* testing.
|
||||||
*/
|
*/
|
||||||
getLatestSemverTag() {
|
override getLatestSemverTag() {
|
||||||
return new SemVer('0.0.0');
|
return new SemVer('0.0.0');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Override for the actual Git client command execution. */
|
/** Override for the actual Git client command execution. */
|
||||||
runGraceful(args: string[], options: SpawnSyncOptions = {}): SpawnSyncReturns<string> {
|
override runGraceful(args: string[], options: SpawnSyncOptions = {}): SpawnSyncReturns<string> {
|
||||||
const [command, ...rawArgs] = args;
|
const [command, ...rawArgs] = args;
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case 'push':
|
case 'push':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user