Skip to content

Commit

Permalink
Remove mergable badge
Browse files Browse the repository at this point in the history
  • Loading branch information
dbharris2 committed Apr 11, 2024
1 parent 24d3b15 commit b09271e
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 53 deletions.
14 changes: 0 additions & 14 deletions src/components/PullRequestStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ const DRAFT = (
</Badge>
);

const MERGEABLE = (
<Badge pill bg="success" key="mergeable">
Mergeable
</Badge>
);

const NOT_MERGEABLE = (
<Badge pill bg="danger" key="not_mergeable">
Mergeable
</Badge>
);

const MERGED = (
<Badge pill bg="" style={{ backgroundColor: "#8259DD" }} key="merged">
Merged
Expand Down Expand Up @@ -138,7 +126,6 @@ function getIncomingStateBadges(state: PullRequestState): JSX.Element[] {
badges.push(AUTHOR_REPLIED);
}

badges.push(state.mergeable ? MERGEABLE : NOT_MERGEABLE);
badges.push(...getCheckStatusBadge(state.checkStatus));

return badges;
Expand All @@ -160,7 +147,6 @@ function getOutgoingStateBadges(state: PullRequestState): JSX.Element[] {
badges.push(NEEDS_REVIEW);
}

badges.push(state.mergeable ? MERGEABLE : NOT_MERGEABLE);
badges.push(...getCheckStatusBadge(state.checkStatus));

return badges;
Expand Down
8 changes: 0 additions & 8 deletions src/filtering/status.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ describe("pullRequestState", () => {
draft: false,
noReviewers: true,
changesRequested: false,
mergeable: false,
approved: false,
});

Expand All @@ -204,7 +203,6 @@ describe("pullRequestState", () => {
draft: true,
noReviewers: true,
changesRequested: false,
mergeable: false,
approved: false,
});

Expand All @@ -222,7 +220,6 @@ describe("pullRequestState", () => {
draft: false,
noReviewers: false,
changesRequested: false,
mergeable: false,
approved: false,
});

Expand All @@ -234,7 +231,6 @@ describe("pullRequestState", () => {
.addReview("kevin", "CHANGES_REQUESTED")
.addComment("fwouts")
.addReview("kevin", "APPROVED")
.mergeable()
.seenAs("fwouts")
.build(),
"fwouts"
Expand All @@ -244,7 +240,6 @@ describe("pullRequestState", () => {
draft: false,
noReviewers: false,
changesRequested: false,
mergeable: true,
approved: false,
});

Expand All @@ -266,7 +261,6 @@ describe("pullRequestState", () => {
draft: false,
noReviewers: false,
changesRequested: false,
mergeable: false,
approved: true,
});

Expand All @@ -288,7 +282,6 @@ describe("pullRequestState", () => {
draft: false,
noReviewers: false,
changesRequested: false,
mergeable: false,
approved: false,
});

Expand All @@ -310,7 +303,6 @@ describe("pullRequestState", () => {
draft: false,
noReviewers: false,
changesRequested: false,
mergeable: false,
approved: false,
});
});
Expand Down
3 changes: 0 additions & 3 deletions src/filtering/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ function incomingPullRequestState(
authorResponded: hasReviewed && hasNewCommentByAuthor,
checkStatus: pr.checkStatus,
changesRequested: states.has("CHANGES_REQUESTED") || !pr.reviewRequested,
mergeable: pr.mergeable === true,
approved: false,
isMerged: pr.isMerged,
};
Expand Down Expand Up @@ -97,7 +96,6 @@ function outgoingPullRequestState(
kind: "outgoing",
draft: pr.draft === true,
changesRequested: states.has("CHANGES_REQUESTED") || !pr.reviewRequested,
mergeable: pr.mergeable === true,
approved: states.has("APPROVED"),
checkStatus: pr.checkStatus,
newReviewRequested: states.has("PENDING"),
Expand All @@ -112,7 +110,6 @@ export type PullRequestState = {
changesRequested: boolean;
draft: boolean;
kind: "incoming" | "outgoing";
mergeable: boolean;
newReviewRequested: boolean;
isMerged: boolean;
checkStatus?: CheckStatus;
Expand Down
19 changes: 0 additions & 19 deletions src/loading/internal/pull-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
PullRequestStatus,
RepoReference,
} from "../../github-api/api";
import { nonEmptyItems } from "../../helpers";
import {
Comment,
PullRequest,
Expand Down Expand Up @@ -35,7 +34,6 @@ export function testPRs(): Promise<PullRequest[]> {
},
title: "Codemod old API to new API",
draft: false,
mergeable: true,
reviewRequested: true,
requestedReviewers: [],
requestedTeams: [],
Expand Down Expand Up @@ -73,7 +71,6 @@ export function testPRs(): Promise<PullRequest[]> {
},
title: "Use new endpoint on homepage",
draft: false,
mergeable: true,
reviewRequested: true,
requestedReviewers: [],
requestedTeams: [],
Expand Down Expand Up @@ -105,7 +102,6 @@ export function testPRs(): Promise<PullRequest[]> {
},
title: "Use new routing API",
draft: false,
mergeable: true,
reviewRequested: false,
requestedReviewers: [],
requestedTeams: [],
Expand Down Expand Up @@ -137,7 +133,6 @@ export function testPRs(): Promise<PullRequest[]> {
},
title: "Update unit tests for nav bar",
draft: true,
mergeable: false,
reviewRequested: true,
requestedReviewers: [],
requestedTeams: [],
Expand Down Expand Up @@ -169,7 +164,6 @@ export function testPRs(): Promise<PullRequest[]> {
},
title: "Ship new accounts page",
draft: false,
mergeable: true,
reviewRequested: true,
requestedReviewers: [],
requestedTeams: [],
Expand Down Expand Up @@ -198,7 +192,6 @@ export function testPRs(): Promise<PullRequest[]> {
},
title: "Fix bug when scrolling through accounts",
draft: false,
mergeable: true,
reviewRequested: true,
requestedReviewers: [],
requestedTeams: [],
Expand Down Expand Up @@ -229,7 +222,6 @@ export function testPRs(): Promise<PullRequest[]> {
},
title: "Add caching to queries",
draft: false,
mergeable: true,
reviewRequested: false,
requestedReviewers: [],
requestedTeams: [],
Expand Down Expand Up @@ -303,15 +295,13 @@ async function updateCommentsAndReviews(
number: rawPullRequest.number,
};
const [
freshPullRequestDetails,
freshChangeSummary,
freshReviews,
freshComments,
freshReviewComments,
pullRequestStatus,
isMerged,
] = await Promise.all([
githubApi.loadPullRequestDetails(pr),
githubApi.loadPullRequestChangeSummary(pr),
githubApi.loadReviews(pr).then((reviews) =>
reviews.map((review) => ({
Expand All @@ -338,7 +328,6 @@ async function updateCommentsAndReviews(

return pullRequestFromResponse(
rawPullRequest,
freshPullRequestDetails,
freshChangeSummary,
freshReviews,
freshComments,
Expand All @@ -351,7 +340,6 @@ async function updateCommentsAndReviews(

function pullRequestFromResponse(
response: RestEndpointMethodTypes["search"]["issuesAndPullRequests"]["response"]["data"]["items"][number],
details: RestEndpointMethodTypes["pulls"]["get"]["response"]["data"],
changeSummary: any,
reviews: Review[],
comments: Comment[],
Expand Down Expand Up @@ -385,14 +373,7 @@ function pullRequestFromResponse(
},
title: response.title,
draft: response.draft,
mergeable: details.mergeable || false,
reviewRequested,
requestedReviewers: nonEmptyItems(
details.requested_reviewers?.map((reviewer) => reviewer?.login)
),
requestedTeams: nonEmptyItems(
details.requested_teams?.map((team) => team?.name)
),
reviews,
comments: [...comments, ...reviewComments],
reviewDecision: status.reviewDecision,
Expand Down
1 change: 0 additions & 1 deletion src/storage/loaded-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export interface PullRequest {
};
title: string;
draft?: boolean;
mergeable?: boolean;
/**
* Whether a review is requested from the current user.
*/
Expand Down
8 changes: 0 additions & 8 deletions src/testing/fake-pr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class FakePullRequestBuilder {
private _reviews: Review[] = [];
private _commits: Commit[] = [];
private _draft = false;
private _mergeable = false;

private _nextTimestamp = 1;

Expand All @@ -54,11 +53,6 @@ class FakePullRequestBuilder {
return this;
}

mergeable() {
this._mergeable = true;
return this;
}

reviewRequested(logins: string[], teams?: string[]) {
this._reviewerLogins = logins;
this._reviewerTeams = teams || [];
Expand Down Expand Up @@ -121,15 +115,13 @@ class FakePullRequestBuilder {
pullRequestNumber: this._ref.number,
nodeId: `${this._ref.repo.owner}/${this._ref.repo.name}/${this._ref.number}`,
draft: this._draft,
mergeable: this._mergeable,
updatedAt: "1 June 2019",
htmlUrl: `http://github.com/${this._ref.repo.owner}/${this._ref.repo.name}/${this._ref.number}`,
reviewRequested: reviewRequested,
requestedReviewers: this._reviewerLogins,
requestedTeams: this._reviewerTeams,
comments: this._comments,
reviews: this._reviews,
commits: this._commits,
reviewDecision: "REVIEW_REQUIRED",
};
}
Expand Down

0 comments on commit b09271e

Please sign in to comment.