Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/signals/local-branch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,10 @@
const queuePressureSimulation = simulateOpenPrPressure({
repoFullName: args.input.repoFullName,
generatedAt: nowIso(),
queueHealth: buildQueueHealth(args.repo, args.issues, args.pullRequests, buildCollisionReport(args.input.repoFullName, args.issues, args.pullRequests)),

Check notice on line 378 in src/signals/local-branch.ts

View check run for this annotation

Deleted GitHub App / Gittensory Context

Issue discovery is disabled for this repo

This repo is configured for direct contribution review rather than issue-discovery flow.

Check notice on line 378 in src/signals/local-branch.ts

View check run for this annotation

Deleted GitHub App / Gittensory Context

PR author has maintainer association

This PR appears to come from a maintainer-associated account.
roleContext,
contributorOpenPrCount: (args.contributorPullRequests ?? args.pullRequests).filter(
(pr) => pr.repoFullName === args.input.repoFullName && pr.state === "open" && (pr.authorLogin ?? "").toLowerCase() === args.input.login.toLowerCase(),
(pr) => sameRepo(pr.repoFullName, args.input.repoFullName) && pr.state === "open" && (pr.authorLogin ?? "").toLowerCase() === args.input.login.toLowerCase(),
).length,
});
const scenarioSummary = renderPublicScenarioSummary({
Expand Down
25 changes: 25 additions & 0 deletions test/unit/local-branch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1627,9 +1627,34 @@
const options = analysis.scenarioSummary.options;
expect(options[0]).toMatchObject({ label: "Open another PR now", recommended: true });
expect(options[0]?.rationale).toContain("Repo queue pressure is low.");
expect(options[0]?.obstacles).toEqual([]);

Check notice on line 1630 in test/unit/local-branch.test.ts

View check run for this annotation

Deleted GitHub App / Gittensory Context

Issue discovery is disabled for this repo

This repo is configured for direct contribution review rather than issue-discovery flow.

Check notice on line 1630 in test/unit/local-branch.test.ts

View check run for this annotation

Deleted GitHub App / Gittensory Context

PR author has maintainer association

This PR appears to come from a maintainer-associated account.
});

it("counts same-repo contributor open PRs case-insensitively when ranking pressure options", () => {
const analysis = buildLocalBranchAnalysis({
input: {
login: "Oktofeesh1",
repoFullName: "EnTrius/AllWays-UI",
changedFiles: [{ path: "src/util.ts", additions: 30, deletions: 2, status: "modified" }],
localScorer: { mode: "external_command", sourceTokenScore: 40, totalTokenScore: 60, sourceLines: 38 },
},
repo,
issues: [{ repoFullName: repo.fullName, number: 9, title: "Improve util", state: "open", labels: [], linkedPrs: [] }],
pullRequests: [],
contributorPullRequests: [
{ repoFullName: repo.fullName, number: 4, title: "WIP util", state: "open", authorLogin: "oktofeesh1", labels: [], linkedIssues: [] },
],
profile,
outcomeHistory,
scoringSnapshot,
scoringProfile,
});

const options = analysis.scenarioSummary.options;
expect(options[0]).toMatchObject({ label: "Clean up existing work first", recommended: true });
expect(options.find((option) => option.label === "Open another PR now")?.obstacles.join(" ")).toMatch(/already have open PR/i);
});

it("wires open-PR pressure strategy options into scenarioSummary.options (#348)", () => {
const analysis = buildLocalBranchAnalysis({
input: {
Expand Down
Loading