Ruigao/list disappeared vc jobs#112
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for tracking and using historical Virtual Cluster (VC) access for users. When users query their jobs, they can now see jobs from VCs they previously had access to, not just their current VCs.
Key changes:
- Added
history_vclistfield to user schema to store historical VC access - Implemented
getHistoryVCs()function that retrieves VCs from user's job history and group memberships - Modified job listing logic to include historical VCs alongside current VCs
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/rest-server/src/utils/manager/user/user.js | Added history_vclist field to user schema validation |
| src/rest-server/src/utils/manager/user/crudK8sSecret.js | Implemented getHistoryVCs() function and updated create/read/update operations to populate and persist historical VC list |
| src/rest-server/src/models/v2/job/k8s.js | Added listVCsFromJob() function to retrieve unique VCs from a user's job history |
| src/rest-server/src/controllers/v2/user.js | Added getUserHistoryVCs() controller function and initialized history_vclist in user creation |
| src/rest-server/src/controllers/v2/job.js | Updated job list logic to merge current and historical VCs for filtering |
Comments suppressed due to low confidence (1)
src/rest-server/src/controllers/v2/job.js:53
- Variable currentvcs is used like a local variable, but is missing a declaration.
currentvcs = await userController.getUserVCs(username);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
and here is a question, if a user had one vc, but currently the vcs still work, but admin delete this user from this vc, under current design, it still has access to this vc's jobs, this seems not make sense |
ecdcd9e to
d44541f
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d44541f to
c28c8c1
Compare
34dc20d to
de4b412
Compare
|
For help reviewers' better understanding: this PR is used for the user to access the jobs which are in the VCs that are not existing anymore. The basic logic is that we add a history VC list in user info, which remembers all the VCs the users used to be included in. When the user requests the job list, the jobs which are in both current VCs and history VCs will be retrieved from the database and return the user. These history jobs can be accessed in detail, and their logs can be accessed by its owner too. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
de4b412 to
abba159
Compare
List user's history jobs which in the virtual clusters that have been removed from the service.