Skip to content

Commit

Permalink
Removing FF skip-requested-reviewers (#2526)
Browse files Browse the repository at this point in the history
- Removing FF SKIP_REQUESTED_REVIEWERS
  • Loading branch information
krazziekay authored Oct 31, 2023
1 parent 1e5043d commit 5ac73fe
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 33 deletions.
1 change: 0 additions & 1 deletion src/config/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export enum BooleanFlags {
USE_DYNAMODB_FOR_DEPLOYMENT_WEBHOOK = "use-dynamodb-for-deployment-webhook",
USE_DYNAMODB_FOR_DEPLOYMENT_BACKFILL = "use-dynamodb-for-deployment-backfill",
LOG_CURLV_OUTPUT = "log-curlv-output",
SKIP_REQUESTED_REVIEWERS = "skip-requested-reviewers",
ENABLE_SUBSCRIPTION_DEFERRED_INSTALL = "enable-subscription-deferred-install",
EARLY_EXIT_ON_VALIDATION_FAILED = "early-exit-on-validation-failed",
ENABLE_CONNECTED_REPOS_VIEW="enable-connected-repos-view",
Expand Down
26 changes: 0 additions & 26 deletions src/transforms/util/github-get-pull-request-reviews.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { getLogger } from "config/logger";
import { GitHubInstallationClient } from "~/src/github/client/github-installation-client";
import { getInstallationId } from "~/src/github/client/installation-id";
import pullRequest from "fixtures/api/pull-request.json";
import { booleanFlag, BooleanFlags } from "config/feature-flags";
import { when } from "jest-when";

jest.mock("config/feature-flags");

Expand Down Expand Up @@ -100,28 +98,4 @@ describe("getPullRequestReviews", () => {
expect(result[1].user.login).toStrictEqual(pullRequest.user.login);
expect(result[1].state).toStrictEqual("APPROVED");
});

it("should not fetch requested reviewers when skip FF is ON", async () => {
when(booleanFlag).calledWith(BooleanFlags.SKIP_REQUESTED_REVIEWERS, expect.anything()).mockResolvedValue(true);

githubNock
.get(`/repos/batman/gotham-city-bus-pass/pulls/2/requested_reviewers`)
.times(0);
githubUserTokenNock(GITHUB_INSTALLATION_ID);
githubNock
.get(`/repos/batman/gotham-city-bus-pass/pulls/2/reviews`)
.reply(200, [{
state: "APPROVED",
user: pullRequest.user
}]);
const client = new GitHubInstallationClient(getInstallationId(GITHUB_INSTALLATION_ID), gitHubCloudConfig, jiraHost, { trigger: "test" }, logger);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const result = await getPullRequestReviews(jiraHost, client, MOCK_REPOSITORY, MOCK_PR, logger);

expect(result).toHaveLength(1);
expect(result[0].user.login).toStrictEqual(pullRequest.user.login);
expect(result[0].state).toStrictEqual("APPROVED");
});

});
6 changes: 0 additions & 6 deletions src/transforms/util/github-get-pull-request-reviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Octokit } from "@octokit/rest";
import Logger from "bunyan";
import { statsd } from "config/statsd";
import { metricPrReviewers } from "config/metric-names";
import { booleanFlag, BooleanFlags } from "config/feature-flags";

export const getPullRequestReviews = async (
jiraHost: string,
Expand All @@ -18,11 +17,6 @@ export const getPullRequestReviews = async (
const { number: pullRequestNumber, id: pullRequestId } = pullRequest;

try {
if (await booleanFlag(BooleanFlags.SKIP_REQUESTED_REVIEWERS, jiraHost)) {
const response = await gitHubInstallationClient.getPullRequestReviews(repositoryOwner, repositoryName, pullRequestNumber);
return response.data;
}

const requestedReviewsResponse = await gitHubInstallationClient.getPullRequestRequestedReviews(repositoryOwner, repositoryName, pullRequestNumber);
const requestedReviewsData = requestedReviewsResponse.data;

Expand Down

0 comments on commit 5ac73fe

Please sign in to comment.