kunwp1 opened a new pull request, #6854:
URL: https://github.com/apache/texera/pull/6854

   ### What changes were proposed in this PR?
   
   Adds an ADMIN-only endpoint that returns every non-terminated computing unit 
across all users. Needed for the admin Computing Units dashboard.
   
   The endpoint queries all units via `WorkflowComputingUnitDao`, excludes rows 
with a non-null `terminate_time`, joins `UserDao` for each owner's name and 
avatar, and reuses the shared `ComputingUnitHelpers` (introduced in the 
preceding refactor PR) to reconcile vanished pods and resolve status/metrics.
   
   The new resource is registered in `ComputingUnitManagingService`, and the 
startup access-control coverage check is extended to include it.
   
   `accessPrivilege` is reported as `WRITE` for admin rows (an admin can manage 
any unit it can see), and `isOwner` reflects whether the requesting admin 
happens to own the unit.
   
   > 📌 **Stacked on #6853.** This branch builds on the shared-helpers refactor, 
so the diff below currently includes that PR's commit — review the second 
commit (the admin endpoint) here, and merge #6853 first. Once it lands and this 
is rebased, the diff reduces to just the admin resource + registration + specs.
   
   ### Any related issues, documentation, discussions?
   
   Closes #6477. Part of #6476 (Admin Computing Units Dashboard). Originates 
from discussion #6322.
   
   ### How was this PR tested?
   
   Added `AdminComputingUnitResourceSpec` (drives `listAllComputingUnits` 
end-to-end over the embedded DB: terminated rows excluded, `WRITE` access, 
`isOwner`) and extended `ComputingUnitManagingServiceRunSpec` to verify the 
admin resource registers.
   
   Ran `sbt 'ComputingUnitManagingService/testOnly 
org.apache.texera.service.resource.AdminComputingUnitResourceSpec 
org.apache.texera.service.ComputingUnitManagingServiceRunSpec'` (8 passed, 1 
canceled — the DB-gated `run()` registration test cancels when no Postgres is 
reachable) and `sbt 'ComputingUnitManagingService/scalafmtCheck; 
ComputingUnitManagingService/Test/scalafmtCheck'` (clean).
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code, Claude Opus 4.8
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to