Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix(ng-dev): assorted typing fixes that typescript wants (#774)" #775

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ng-dev/caretaker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ ts_library(
deps = [
"//ng-dev/release/versioning",
"//ng-dev/utils",
"@npm//@octokit/plugin-rest-endpoint-methods",
"@npm//@types/inquirer",
"@npm//@types/node",
"@npm//@types/yargs",
Expand Down
10 changes: 3 additions & 7 deletions ng-dev/caretaker/handoff/update-github-team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import {getConfig} from '../../utils/config.js';
import {green, Log, yellow} from '../../utils/logging.js';
import {AuthenticatedGitClient} from '../../utils/git/authenticated-git-client.js';
import {assertValidCaretakerConfig} from '../config.js';
import {RestEndpointMethodTypes} from '@octokit/plugin-rest-endpoint-methods';

type GithubOrgMember =
RestEndpointMethodTypes['teams']['listMembersInOrg']['response']['data'][number];

/** Update the Github caretaker group, using a prompt to obtain the new caretaker group members. */
export async function updateCaretakerTeamViaPrompt() {
Expand Down Expand Up @@ -90,8 +86,8 @@ async function getGroupMembers(group: string) {
team_slug: group,
})
).data
.filter((member: GithubOrgMember) => !!member)
.map((member: GithubOrgMember) => member!.login);
.filter((_) => !!_)
.map((member) => member!.login);
}

async function setCaretakerGroup(group: string, members: string[]) {
Expand All @@ -102,7 +98,7 @@ async function setCaretakerGroup(group: string, members: string[]) {
/** The list of current members of the group. */
const current = await getGroupMembers(group);
/** The list of users to be removed from the group. */
const removed = current.filter((login: string) => !members.includes(login));
const removed = current.filter((login) => !members.includes(login));
/** Add a user to the group. */
const add = async (username: string) => {
Log.debug(`Adding ${username} to ${fullSlug}.`);
Expand Down
1 change: 0 additions & 1 deletion ng-dev/pr/check-target-branches/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ts_library(
"//ng-dev/pr/config",
"//ng-dev/release/versioning",
"//ng-dev/utils",
"@npm//@octokit/plugin-rest-endpoint-methods",
"@npm//@types/yargs",
],
)
5 changes: 1 addition & 4 deletions ng-dev/pr/check-target-branches/check-target-branches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ import {assertValidPullRequestConfig, PullRequestConfig} from '../config/index.j
import {getTargetBranchesAndLabelForPullRequest} from '../common/targeting/target-label.js';
import {ActiveReleaseTrains} from '../../release/versioning/active-release-trains.js';
import {getNextBranchName} from '../../release/versioning/version-branches.js';
import {RestEndpointMethodTypes} from '@octokit/plugin-rest-endpoint-methods';

type GithubLabel = RestEndpointMethodTypes['pulls']['get']['response']['data']['labels'][number];

async function getTargetBranchesForPr(
prNumber: number,
Expand All @@ -33,7 +30,7 @@ async function getTargetBranchesForPr(
// here.
// TODO(devversion): Remove the non-null cast once
// https://github.com/github/rest-api-description/issues/169 is fixed.
const labels = prData.labels.map((l: GithubLabel) => l.name!);
const labels = prData.labels.map((l) => l.name!);
/** The branch targetted via the Github UI. */
const githubTargetBranch = prData.base.ref;

Expand Down
6 changes: 2 additions & 4 deletions ng-dev/pr/merge/strategies/api-merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import {FatalMergeToolError, MergeConflictsFatalError} from '../failures.js';

/** Type describing the parameters for the Octokit `merge` API endpoint. */
type OctokitMergeParams = RestEndpointMethodTypes['pulls']['merge']['parameters'];
type OctokitListCommitsEntry =
RestEndpointMethodTypes['pulls']['listCommits']['response']['data'][number];

/** Separator between commit message header and body. */
const COMMIT_HEADER_SEPARATOR = '\n\n';
Expand Down Expand Up @@ -185,12 +183,12 @@ export class GithubApiMergeStrategy extends MergeStrategy {
}

/** Gets all commit messages of commits in the pull request. */
private async _getPullRequestCommitMessages({prNumber}: PullRequest): Promise<string[]> {
private async _getPullRequestCommitMessages({prNumber}: PullRequest) {
const allCommits = await this.git.github.paginate(this.git.github.pulls.listCommits, {
...this.git.remoteParams,
pull_number: prNumber,
});
return allCommits.map(({commit}: OctokitListCommitsEntry) => commit.message);
return allCommits.map(({commit}) => commit.message);
}

/** Determines the merge action from the given pull request. */
Expand Down