Skip to content
Open
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
6 changes: 5 additions & 1 deletion src/maintenance-pool/maintenance-pool.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ export class MaintenancePoolService {
}

async list(): Promise<MaintenancePool[]> {
return this.poolRepo.find();
// Load repository/sponsor/escrow — the frontend's adaptMaintenancePool
// needs them; a bare find() returned rows with no relations (#591).
return this.poolRepo.find({
relations: ['repository', 'createdBy', 'escrow'],
});
}
}
16 changes: 14 additions & 2 deletions src/milestones/milestones.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,14 @@ export class MilestonesService {
`Milestone ${milestoneId} has not been funded yet`,
);
}
assertTransition(milestone.status, MilestoneStatus.IN_PROGRESS);
// Only assert the transition when the milestone isn't already in-flight —
// the first resolution moves FUNDED -> IN_PROGRESS, so re-asserting on
// every resolveIssue made IN_PROGRESS->IN_PROGRESS fail and a milestone
// could only ever pay out its first issue (#578). An already-IN_PROGRESS
// milestone paying another issue needs no transition.
if (milestone.status !== MilestoneStatus.IN_PROGRESS) {
assertTransition(milestone.status, MilestoneStatus.IN_PROGRESS);
}

// Verify the issue belongs to this milestone (#114).
const issue = milestone.issues.find((i) => i.id === issueId);
Expand Down Expand Up @@ -214,7 +221,12 @@ export class MilestonesService {
}

async list(): Promise<Milestone[]> {
return this.milestoneRepo.find();
// Load the relations the frontend's adaptMilestone renders — repository
// (org/repo display), sponsor, escrow (fund status), issues (the linked
// issues). A bare find() returned empty rows (#591).
return this.milestoneRepo.find({
relations: ['repository', 'sponsor', 'escrow', 'issues'],
});
}

allocateBudget(id: string) {
Expand Down