yasithdev opened a new pull request, #169:
URL: https://github.com/apache/airavata-portals/pull/169
## Summary
Migrate `GroupResourceProfileViewSet` reads from the Thrift client to the
gRPC **compute** facade — the most deeply nested read model in Track D, and the
last read family. Reuses the existing serializer via a recursive
protobuf→Thrift-attribute adapter, so the portal's REST contract is unchanged.
- `get_list` and `get_instance` now call
`request.airavata.compute.get_group_resource_list` /
`get_group_resource_profile`.
- Write actions stay on Thrift pending D3.
- New `group_resource_profile` adapter recursively adapts:
- `computePreferences` (`GroupComputeResourcePreference`), each carrying a
**proto-oneof** `EnvironmentSpecificPreferences` union → `{slurm, aws}` (one
set, chosen via `WhichOneof`), with the SLURM branch's `reservations` and
`groupSSHAccountProvisionerConfigs`;
- `computeResourcePolicies` (`ComputeResourcePolicy`) and
`batchQueueResourcePolicies` (`BatchQueueResourcePolicy`).
- **Three enums** render as raw integers and are bridged by name to the
Thrift integer: `preferredJobSubmissionProtocol` and
`preferredDataMovementProtocol` reuse the existing name-divergent maps
(`JSP_CLOUD`→`CLOUD`, `LOCAL` prefixes); `resourceType` uses a new
`ResourceType` map (SLURM/AWS align by name, off by one in value).
- Empty credential-store tokens map to `None` so the serializer's
`userHasWriteAccess` token READ check (`token is None or ...`) skips unset
tokens; that check and the WRITE check migrate to the gRPC sharing helper.
## Test plan
- `manage.py check` clean.
- Empty list returns 200 live (full wiring: token → claims → facade →
adapter → serializer → JSON).
- Offline serializer render with a full SLURM-union profile (reservations,
SSH provisioner configs, both policy types, all three enum bridges, the
`allocationProjectNumber` flattening, and the multi-token sharing check)
renders byte-for-byte correct.
- Note: the dev backend's create path needs user context the service-account
token doesn't satisfy, so the nested live read was validated via the offline
render against real protobuf.
--
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]