Repository navigation
Conversation
New admin section at /wave/admin/repo-decisions (needs reviewWaveProgramRepos) replacing the "copy the access-token cookie and call the approve endpoint from the API docs" workaround for one-off approvals. Pick a program, paste GitHub URLs or owner/repo names, look them up, then approve or reject the batch. Rejected repos can be re-approved. Each repo is sent through the existing approve/reject endpoints with a per-row result. Malware-rejected repos (approve) and live approved repos (reject) are left out unless explicitly included; reject takes one optional shared reason. Depends on drips-network/wave#891 for the status/repoFullNames lookup params.
The page required the global reviewWaveProgramRepos permission, which is stricter than the API: the list/approve/reject endpoints also allow admins of the program. Program owners with other admin permissions couldn't use it. Drop the frontend permission gate (card and loader) and let the API decide per program. A 403 on lookup now shows "You're not an admin of <program>" instead of the generic error modal.
authenticatedCall reshapes API errors, so result rows showed raw
"API call failed: 400 ... {json}" strings, a bare {"message":"Forbidden"},
and, worst, "Your account is currently restricted" when approval was
refused because the APPLICANT is banned or restricted.
Map row errors through extractApiErrorMessage, explain the restricted
applicant case on approve, and describe other 403s as missing
program-admin rights.
There was a problem hiding this comment.
Written by Reviewer, a Ryph agent · Run · asked by @jlin95
Assessment: 🟡 Changes recommended
The malware/approved opt-in checkboxes stay ticked across lookups, so a new list can include dangerous repos without a fresh opt-in. The other remarks are smaller.
? The wave#891 backend contract (status and repoFullNames filters) is in another repo, so I couldn't check it.
| const programId = waveProgramId; | ||
| const parsed = parseRepoList(input); | ||
| invalidEntries = parsed.invalid; | ||
| results = {}; |
There was a problem hiding this comment.
Written by Reviewer, a Ryph agent · Run · asked by @jlin95
[should-fix] includeMalware and includeApproved are never reset. Tick the box, then look up a different list (or change program), and any malware or approved repos in the new list are pre-included with no fresh opt-in. The confirm modal does warn, but the guard is meant to be per-lookup. Reset both here and in the program onchange.
| return null; | ||
| } | ||
|
|
||
| let eligible = $derived(rows ? rows.filter((r) => skipReason(r) === null) : []); |
There was a problem hiding this comment.
Written by Reviewer, a Ryph agent · Run · asked by @jlin95
[should-fix] eligible is derived from the stale lookup status and ignores results. After a successful run the rows are still eligible, so the button still reads "Approve N repos" and a second click re-sends every one (they come back as "already approved" errors, or a repeated reject notification). Exclude rows whose result is done, or refresh the rows automatically after a run.
| <span class="typo-text-small dim" | ||
| >{doneCount} done{failedCount ? `, ${failedCount} failed` : ''}</span | ||
| > | ||
| <Button size="small" variant="normal" disabled={running} onclick={lookUp} |
There was a problem hiding this comment.
| findWaveProgramRepoApplications(fetch, programId, status, names), | ||
| ), | ||
| ); | ||
| for (const response of responses) { |
There was a problem hiding this comment.
Written by Reviewer, a Ryph agent · Run · asked by @jlin95
[should-fix] If this runs against a backend without wave#891, the unknown status and repoFullNames params are ignored. All three calls then return the first 100 pending applications. The code never checks that app.status matches the status requested, and unmatched names render as "Not found", which would be misleading. Add a guard that app.status === status, and fail loudly on a mismatch.
…point Use the new GET /repos/applications lookup (any status, max 20 names per request) instead of three status-filtered calls to /repos/pending. Chunks run one at a time. Also reset the malware and approved opt-in checkboxes on each lookup, so a new list needs a fresh opt-in.
Remove the two opt-in checkboxes. The page now only approves or rejects pending repos and re-approves repos rejected for a normal reason. - Malware-rejected repos are always skipped: re-approving one needs a real review, not a bulk click. - Approved repos are always skipped: rejecting a live repo unassigns contributors and removes its issues from the wave, and re-approving doesn't restore them. The skip rules move to skip-reason.ts with unit tests.
Move the lookup (chunks of 20, one request at a time, case-insensitive match, missing repos marked) out of the page into look-up-applications.ts and test it.
After a run the rows kept their old status, so repos approved a moment ago still read as pending. Switching to Reject then offered to reject them, which gets around the "never reject approved repos" rule. Store each approve/reject response in its row, so the table and the skip rules see the new status. The run loop moves to run-decisions.ts with unit tests.
If a lookup failed (other than a 403), the previous list stayed on screen with an active Approve/Reject button, so one click could act on repos the user meant to replace. Clear the rows when a lookup starts.
…tarts The Result column shows a row's last result before "Will …" or "Skipped", so after switching from Approve to Reject a row could still show the old approve error while being counted for the reject. The done/failed counter also added up across runs. Clear the results when the action changes and when a run starts.
There was a problem hiding this comment.
Written by Reviewer, a Ryph agent · Run · asked by @jlin95
Assessment: 🟡 Changes recommended
No blocking defects in the current head. The earlier "stale eligible rows" finding is fixed, because runDecisions replaces row.application and eligible re-derives. Mergeable once drips-network/wave#891 is deployed, with the two small items below addressed or accepted.
? The wave#891 contract (repoFullNames filter, 20-name cap, malware reason string) and the CI test jobs still running can't be checked from this repo.
| <span class="typo-text-small dim" | ||
| >{doneCount} done{failedCount ? `, ${failedCount} failed` : ''}</span | ||
| > | ||
| <Button size="small" variant="normal" disabled={running} onclick={lookUp} |
There was a problem hiding this comment.
Written by Reviewer, a Ryph agent · Run · asked by @jlin95
[should-fix] "Refresh statuses" calls lookUp, which re-parses the current textarea and the currently selected waveProgramId, not the list and program that were looked up. If the user edits the text or changes program after a lookup, the table is silently replaced (and results cleared). Refresh from the previous rows' names and lookedUpProgramId instead.
| z.object({ data: z.array(waveProgramRepoWithDetailsDtoSchema) }), | ||
| await authenticatedCall(f, `/api/wave-programs/${waveProgramId}/repos/applications?${params}`), | ||
| ); | ||
| } |
There was a problem hiding this comment.
Written by Reviewer, a Ryph agent · Run · asked by @jlin95
[nit] If this runs before wave#891 is live, the unknown repoFullNames param is ignored. The endpoint then returns pending applications, so rejected or approved repos show as "Not found" with no error. Consider checking that every returned gitHubRepoFullName was actually requested and throwing otherwise, so a rollout-order mistake fails loudly.
"Refresh statuses" called lookUp, which re-read the textarea and the selected program. After editing either one, a refresh silently showed a different list. Keep the names and program of the last lookup and refresh from those.
There was a problem hiding this comment.
Written by Reviewer, a Ryph agent · Run · asked by @jlin95
Assessment: ✅ LGTM
No issues found in 93bcbf5. "Refresh statuses" now reloads the saved names and program (refreshStatuses → loadRows), which fixes my earlier remark. Merge order (after wave#891) is covered by the author's rollout note.
? wave#891's /repos/applications contract and the malware reason string live in another repo, and CI was still running.
Why
When a repo has to be approved (often a repo the automated review rejected, approved on request), the workaround is to copy the Wave access-token cookie from the browser and call
POST /api/wave-programs/:id/repos/:orgRepoId/approvefrom the API docs. The per-program review page can't do it: it lists only pending applications (max 100), one at a time.What
New admin section Repo decisions at
/wave/admin/repo-decisions(card on the admin home). Access follows the API: program admins can act on their own programs, users withreviewWaveProgramReposon all programs; picking a program you don't administer shows a clear message.owner/reponames (one per line; trailing slashes,/tree/...,.git, case and duplicates are handled).Clicking on
Refresh statusesreloads the list and program that were looked up.So the page approves or rejects pending repos, and re-approves repos rejected for a normal reason.
Guards: two kinds of repo are never sent from this page:
The skip rules are in
skip-reason.ts. This is a UI guard only: the backend/approveendpoint still accepts malware-rejected repos (the appeals flow uses it).Failed rows show the API's message in plain text (e.g. "Repo is already approved"). An approval refused because the applicant is banned or restricted says so, instead of the shared API helper's misleading "Your account is currently restricted".
Depends on
drips-network/wave#891 (merge and deploy first). It adds
GET /repos/applications?repoFullNames=, which the lookup uses: up to 20 names per request, requests run one after another (5 requests per 100 pasted repos).Rollout
Merge drips-network/wave#891 first. Check it is live:
GET /api/wave-programs/<id>/repos/applications?repoFullNames=<a rejected repo>returns that repo with statusrejected. Then merge this PR. No Novu or config changes: the page uses the existing approve and reject endpoints and their existing notifications.Testing
parse-repo-list(12, incl. a real pasted list of mixed-org URLs),describe-decision-error(5),skip-reason(7),look-up-applications(5: chunks of 20, one request at a time, input order, case-insensitive match, missing repos, stops on error),run-decisions(3: rows take the new status, a failed row stays as it was, one request at a time).