GRI-2200: fail-first server tests for assign refusals (campus_mismatch, device_already_assigned) #315

Open
astraea wants to merge 3 commits from test/GRI-2200-assign-refusal-tests into dev
Member

Summary

  • Fail-first server tests for the contract on forge #310 (chief of staff comment, 2026-11-17 19:32 UTC): POST /api/v1/devices/{device_id}/playlist campus check (every role, ordering before "already assigned", not skipped by replace: true), already-assigned 409 vs same-playlist 200 vs replace: true move, and the device/playlist campus-change refusals on PATCH /api/v1/devices/{device_id} and PATCH /api/v1/playlists/{playlist_id}.
  • This PR is expected to be red: none of replace, campus_mismatch or device_already_assigned exists in crates/server yet. GRI-2201 (Nyssa) implements the handlers against this file.

Test plan

  • cargo test -p server --test assign_playlist_refusal_acceptance_integration against a real PostgreSQL: 9 of 14 tests fail (the new refusals/campus-clearing, not yet implemented), 5 pass (already-true states: same-campus assign, no-campus-either-side assign, idempotent re-assign, and store::assign's existing upsert already "moves" without a replace flag).
  • cargo fmt -p server --check and cargo clippy -p server --test assign_playlist_refusal_acceptance_integration --locked -- -D warnings both clean.
  • Will go green once GRI-2201 lands.
## Summary - Fail-first server tests for the contract on forge #310 (chief of staff comment, 2026-11-17 19:32 UTC): `POST /api/v1/devices/{device_id}/playlist` campus check (every role, ordering before "already assigned", not skipped by `replace: true`), already-assigned 409 vs same-playlist 200 vs `replace: true` move, and the device/playlist campus-change refusals on `PATCH /api/v1/devices/{device_id}` and `PATCH /api/v1/playlists/{playlist_id}`. - This PR is expected to be red: none of `replace`, `campus_mismatch` or `device_already_assigned` exists in `crates/server` yet. GRI-2201 (Nyssa) implements the handlers against this file. ## Test plan - [x] `cargo test -p server --test assign_playlist_refusal_acceptance_integration` against a real PostgreSQL: 9 of 14 tests fail (the new refusals/campus-clearing, not yet implemented), 5 pass (already-true states: same-campus assign, no-campus-either-side assign, idempotent re-assign, and `store::assign`'s existing upsert already "moves" without a `replace` flag). - [x] `cargo fmt -p server --check` and `cargo clippy -p server --test assign_playlist_refusal_acceptance_integration --locked -- -D warnings` both clean. - [ ] Will go green once GRI-2201 lands.
GRI-2200: fail-first server tests for assign-playlist campus and already-assigned refusals
Some checks failed
CI / the pre-push hook (pull_request) Successful in 4s
CI / install.sh client upgrade (pull_request) Successful in 12s
CI / cargo fmt (pull_request) Successful in 5s
CI / cargo clippy (pull_request) Successful in 1m9s
CI / cargo deny advisories (pull_request) Successful in 17s
CI / cargo deny (pull_request) Successful in 20s
CI / repository boundary (pull_request) Successful in 3s
CI / frontend-web (pull_request) Successful in 54s
CI / cargo test (pull_request) Failing after 2m7s
CI / Notify gate failed (pull_request) Successful in 1s
CI / CI (pull_request) Failing after 2s
518e34da50
Merge remote-tracking branch 'origin/dev' into test/GRI-2200-assign-refusal-tests
Some checks failed
CI / the pre-push hook (pull_request) Successful in 4s
CI / install.sh client upgrade (pull_request) Successful in 19s
CI / cargo fmt (pull_request) Successful in 5s
CI / cargo clippy (pull_request) Successful in 1m30s
CI / cargo deny (pull_request) Successful in 18s
CI / cargo deny advisories (pull_request) Successful in 21s
CI / repository boundary (pull_request) Successful in 5s
CI / cargo test (pull_request) Failing after 2m34s
CI / frontend-web (pull_request) Successful in 1m7s
CI / CI (pull_request) Failing after 1s
CI / Notify gate failed (pull_request) Successful in 1s
4ab66f2daf
Merge remote-tracking branch 'origin/dev' into test/GRI-2200-assign-refusal-tests
Some checks failed
CI / the pre-push hook (pull_request) Successful in 3s
CI / cargo fmt (pull_request) Successful in 4s
CI / install.sh client upgrade (pull_request) Successful in 13s
CI / cargo deny (pull_request) Successful in 11s
CI / cargo deny advisories (pull_request) Successful in 16s
CI / repository boundary (pull_request) Successful in 5s
CI / cargo clippy (pull_request) Successful in 1m3s
CI / frontend-web (pull_request) Successful in 59s
CI / cargo test (pull_request) Failing after 2m3s
CI / Notify gate failed (pull_request) Successful in 1s
CI / CI (pull_request) Failing after 1s
149a6807eb
Some checks failed
CI / the pre-push hook (pull_request) Successful in 3s
CI / cargo fmt (pull_request) Successful in 4s
Required
Details
CI / install.sh client upgrade (pull_request) Successful in 13s
CI / cargo deny (pull_request) Successful in 11s
Required
Details
CI / cargo deny advisories (pull_request) Successful in 16s
Required
Details
CI / repository boundary (pull_request) Successful in 5s
Required
Details
CI / cargo clippy (pull_request) Successful in 1m3s
Required
Details
CI / frontend-web (pull_request) Successful in 59s
Required
Details
CI / cargo test (pull_request) Failing after 2m3s
Required
Details
CI / Notify gate failed (pull_request) Successful in 1s
CI / CI (pull_request) Failing after 1s
This pull request is blocked because it's outdated.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'test/GRI-2200-assign-refusal-tests:test/GRI-2200-assign-refusal-tests'
git switch 'test/GRI-2200-assign-refusal-tests'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!315
No description provided.