GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): scope pull request list diff stats by repository (#43557) · Ryoku-dev/hyakki@45ce79f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/web/src/components/pullRequest
    • pullRequestList.logic.test.ts
    • pullRequestList.logic.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/web/src/components/pullRequest/pullRequestList.logic.test.ts‎

Copy file name to clipboardExpand all lines: apps/web/src/components/pullRequest/pullRequestList.logic.test.ts
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
pullRequestStatsKeysToRequest,
2424
pullRequestStatsRefreshBatches,
2525
mergePullRequestDiffStats,
26+
withDiffStat,
2627
partitionPullRequestsWithPriority,
2728
pullRequestAuthorChoices,
2829
selectedPullRequestAuthor,
@@ -88,6 +89,7 @@ describe("visible pull request line-count targets", () => {
8889
{
8990
environmentId: ENV_1,
9091
projectId: "project-1",
92+
repository: "pingdotgg/t3code",
9193
number: 1,
9294
additions: 1,
9395
deletions: 1,
@@ -106,6 +108,24 @@ describe("visible pull request line-count targets", () => {
106108
]);
107109
});
108110

111+
it("matches diff stats by repository, ignoring case", () => {
112+
const own = entry({ additions: 0, deletions: 0, number: 42 });
113+
const stat = { environmentId: ENV_1, projectId: "project-1", number: 42, deletions: 2 };
114+
const stats = mergePullRequestDiffStats(new Map(), [
115+
{ ...stat, repository: "other/lib", additions: 120 },
116+
]);
117+
118+
expect(withDiffStat(own, stats)).toEqual(own);
119+
expect(
120+
withDiffStat(
121+
own,
122+
mergePullRequestDiffStats(stats, [
123+
{ ...stat, repository: "PingDotGG/T3Code", additions: 7 },
124+
]),
125+
),
126+
).toMatchObject({ additions: 7, deletions: 2 });
127+
});
128+
109129
it("keeps every per-environment batch within the stats contract limit", () => {
110130
const entries = Array.from({ length: 501 }, (_, index) =>
111131
entry({ additions: 0, deletions: 0, number: index + 1 }),
Collapse file

‎apps/web/src/components/pullRequest/pullRequestList.logic.ts‎

Copy file name to clipboardExpand all lines: apps/web/src/components/pullRequest/pullRequestList.logic.ts
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ export function mergePullRequestDiffStats(
500500
stats: ReadonlyArray<{
501501
readonly environmentId: string;
502502
readonly projectId: string;
503+
readonly repository: string;
503504
readonly number: number;
504505
readonly additions: number;
505506
readonly deletions: number;
@@ -519,8 +520,9 @@ export function mergePullRequestDiffStats(
519520
export const pullRequestDiffStatKey = (row: {
520521
readonly environmentId: string;
521522
readonly projectId: string;
523+
readonly repository: string;
522524
readonly number: number;
523-
}) => `${row.environmentId} ${row.projectId} ${row.number}`;
525+
}) => `${row.environmentId} ${row.projectId} ${row.repository.toLowerCase()} ${row.number}`;
524526

525527
export interface MergedPullRequestList {
526528
readonly viewers: PullRequestViewers;

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.