Repository navigation
feat: view and edit a project's risk level in Manage > Projects - #86
Conversation
pmd gained a 0-10 risk level per project (project-manager#104). The Projects
dialog now lists it in a Risk column and edits it with a 0-10 chooser beside
priority. The value rides the existing full-row PUT with If-Match, so the
"Changed elsewhere" flow shows a risk difference like any other field, and
pmd's 400 ("riskLevel must be an integer 0-10") lands on the field.
A row without riskLevel (a pmd that predates it) reads as unset, shows as
"—", and saves without the field, since pmd refuses null and an older pmd
refuses the unknown key. A new project leaves it to pmd, which starts at 5.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@sfl review |
|
SFL review stopped: failed; post a fresh request. |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The existing conflict capture at 760 px leaves the panel below the fold, so the risk difference had no screenshot. This adds projects-risk-conflict at 1000 px on gh-x, which has a checkout and so no Link checkout box. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Risk level: 2/10 (project-dashboard)
Worked on by: Claude Opus 5.5 on home, for Chief request discord-1568058109484597350
What
pmd added a 0-10 risk level per project in project-manager#104 (
riskLevel, optional onPUT /v1/projects/{slug},default 5 for new rows). Until now the dashboard couldn't show or edit it. This PR adds it to Manage > Projects:
4/10, or—when pmd gives none). The row's accessible label includes it as well.PUTwithIf-Match.409 stale_versionshowsRisk level: yours 8, now 6next to the other differences. Reapply and Discard work the same as for every other field.400 bad_request, "riskLevel must be an integer 0-10") goes on the field, because its messagestarts with the field name. The client checks 0 to 10 before sending.
Rows from an older pmd
A row without
riskLevel, or withnull, reads as unset. It shows—in the list and "Not set in pmd. Pick one toset it." in the editor, and it saves without the key. Two reasons: pmd refuses
null(
intValuetreatsnullas missing), and a pmd from before #104 would reject an unknown key. A new project alsoleaves the key out ("Not set: pmd starts a new project at 5."), so pmd applies its own default. A value outside
0-10 in a response reads as unset, the same way an unknown priority tier already does.
The board's main table still doesn't show risk. It reads
/v1/projectsthroughpmd.rs, and a new board column wouldbe a separate change.
Tests
Two commits:
abf636d(the feature and its tests) andd18e565(one more headless capture, nothing else).cargo test --workspace --lockedon Windows: 417 passed, 0 failed. New tests:dashboard-core/tests/projects.rs: parsing (present, missing,null, out of range, wrong type), the body (0 and 10are sent; empty or blank leaves the key out;
11,-1,4.5andhighare refused on the field), the conflictdifference and reapply on the new version, and pmd's 400 landing on
riskLevelagainst the loopback stub.dashboard-app/src/projects_tests.rs(headless): picking a value doesn't write until Save, then the list shows thenew value; a risk changed elsewhere shows both values and reapplies with the new
If-Match; a list from an olderpmd shows
—and saves withoutriskLevel; a new project shows the pmd-default note.cargo fmt --all --checkandcargo clippy --workspace --all-targets --locked -- -D warningsare clean.Screenshots
Rendered headlessly on Linux (mini) with
CAPTURE_DIR=… cargo test -p dashboard-app captures -- --ignoredat headd18e565. All 14 capture tests passed and no window opened.List with the Risk column (
projects-list):Editor with the 0-10 chooser, 8 picked and not yet saved (
projects-edit-risk):Changed elsewhere: risk changed to 6 in pmd while 8 was being saved (
projects-risk-conflict). This capture wasadded in
d18e565. It uses a 1000 px window because at the existing 760 px conflict capture the panel sits below thedialog's scroll fold, as it already did before this PR.
At 150% zoom:
🤖 Generated with Claude Code