This is an automated email from the ASF dual-hosted git repository. yasith pushed a commit to branch feat/grpc-armeria-migration in repository https://gitbox.apache.org/repos/asf/airavata.git
commit c4e52b89c5c8ae34e7e0c569027ff1fc1878da11 Author: yasithdev <[email protected]> AuthorDate: Tue Mar 31 08:27:18 2026 -0400 fix: resolve 15 compilation errors from proto migration - ComputeMapper: remove stale gatewayID mappings (now gatewayId in proto), fix unicoreEndPointURL -> unicoreEndPointUrl - ExecutionMapper: bridge emailAddresses (CSV String in entity) to emailAddressesList (repeated string in proto) via expression mappings, add ByteString <-> byte[] converters for subTaskModel - GroupResourceProfileRepository: rename GroupSSHAccountProvisionerConfig to GroupAccountSSHProvisionerConfig and fix accessor casing - RegistryServerHandler: replace TException with Exception, fully qualify ComputeResource to resolve ambiguity with proto outer class --- .../airavata/compute/mapper/ComputeMapper.java | 8 ++------ .../repository/GroupResourceProfileRepository.java | 12 ++++++------ .../execution/handler/RegistryServerHandler.java | 4 ++-- .../airavata/execution/mapper/ExecutionMapper.java | 21 +++++++++++++++++---- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/airavata-api/src/main/java/org/apache/airavata/compute/mapper/ComputeMapper.java b/airavata-api/src/main/java/org/apache/airavata/compute/mapper/ComputeMapper.java index f6d48a5fe7..88861aa28f 100644 --- a/airavata-api/src/main/java/org/apache/airavata/compute/mapper/ComputeMapper.java +++ b/airavata-api/src/main/java/org/apache/airavata/compute/mapper/ComputeMapper.java @@ -119,10 +119,8 @@ public interface ComputeMapper { JobSubmissionInterfaceEntity jobSubmissionInterfaceToEntity(JobSubmissionInterface model); // --- GatewayResourceProfile / GatewayProfileEntity --- - @Mapping(source = "gatewayId", target = "gatewayID") GatewayResourceProfile gatewayProfileToModel(GatewayProfileEntity entity); - @Mapping(source = "gatewayID", target = "gatewayId") GatewayProfileEntity gatewayProfileToEntity(GatewayResourceProfile model); // --- ComputeResourcePreference --- @@ -151,10 +149,8 @@ public interface ComputeMapper { BatchQueueResourcePolicyEntity batchQueuePolicyToEntity(BatchQueueResourcePolicy model); // --- UserResourceProfile --- - @Mapping(source = "gatewayId", target = "gatewayID") UserResourceProfile userResourceProfileToModel(UserResourceProfileEntity entity); - @Mapping(source = "gatewayID", target = "gatewayId") UserResourceProfileEntity userResourceProfileToEntity(UserResourceProfile model); // --- UserComputeResourcePreference --- @@ -220,10 +216,10 @@ public interface ComputeMapper { ScpDataMovementEntity scpDataMovementToEntity(SCPDataMovement model); // UnicoreDataMovement - @Mapping(source = "unicoreEndpointUrl", target = "unicoreEndPointURL") + @Mapping(source = "unicoreEndpointUrl", target = "unicoreEndPointUrl") UnicoreDataMovement unicoreDataMovementToModel(UnicoreDatamovementEntity entity); - @Mapping(source = "unicoreEndPointURL", target = "unicoreEndpointUrl") + @Mapping(source = "unicoreEndPointUrl", target = "unicoreEndpointUrl") UnicoreDatamovementEntity unicoreDataMovementToEntity(UnicoreDataMovement model); // GridFTPDataMovement diff --git a/airavata-api/src/main/java/org/apache/airavata/compute/repository/GroupResourceProfileRepository.java b/airavata-api/src/main/java/org/apache/airavata/compute/repository/GroupResourceProfileRepository.java index a40530ff6f..d719e888bc 100644 --- a/airavata-api/src/main/java/org/apache/airavata/compute/repository/GroupResourceProfileRepository.java +++ b/airavata-api/src/main/java/org/apache/airavata/compute/repository/GroupResourceProfileRepository.java @@ -43,7 +43,7 @@ import org.apache.airavata.model.appcatalog.groupresourceprofile.proto.GroupComp import org.apache.airavata.model.appcatalog.groupresourceprofile.proto.GroupResourceProfile; import org.apache.airavata.model.appcatalog.groupresourceprofile.proto.ComputeResourceReservation; import org.apache.airavata.model.appcatalog.groupresourceprofile.proto.EnvironmentSpecificPreferences; -import org.apache.airavata.model.appcatalog.groupresourceprofile.proto.GroupSSHAccountProvisionerConfig; +import org.apache.airavata.model.appcatalog.groupresourceprofile.proto.GroupAccountSSHProvisionerConfig; import org.apache.airavata.model.appcatalog.groupresourceprofile.proto.ResourceType; import org.apache.airavata.model.appcatalog.groupresourceprofile.proto.SlurmComputeResourcePreference; @@ -97,15 +97,15 @@ public class GroupResourceProfileRepository SlurmComputeResourcePreference.Builder slurmBuilder = slurm.toBuilder(); // update SSH provisioner configs - if (slurm.getGroupSSHAccountProvisionerConfigsList() != null) { - List<GroupSSHAccountProvisionerConfig> updatedConfigs = new ArrayList<>(); - for (GroupSSHAccountProvisionerConfig gssh : slurm.getGroupSSHAccountProvisionerConfigsList()) { + if (slurm.getGroupSshAccountProvisionerConfigsList() != null) { + List<GroupAccountSSHProvisionerConfig> updatedConfigs = new ArrayList<>(); + for (GroupAccountSSHProvisionerConfig gssh : slurm.getGroupSshAccountProvisionerConfigsList()) { updatedConfigs.add(gssh.toBuilder() .setGroupResourceProfileId(groupResourceProfileId) .build()); } - slurmBuilder.clearGroupSSHAccountProvisionerConfigs() - .addAllGroupSSHAccountProvisionerConfigs(updatedConfigs); + slurmBuilder.clearGroupSshAccountProvisionerConfigs() + .addAllGroupSshAccountProvisionerConfigs(updatedConfigs); } // update reservations diff --git a/airavata-api/src/main/java/org/apache/airavata/execution/handler/RegistryServerHandler.java b/airavata-api/src/main/java/org/apache/airavata/execution/handler/RegistryServerHandler.java index 858984c06e..318aadd476 100644 --- a/airavata-api/src/main/java/org/apache/airavata/execution/handler/RegistryServerHandler.java +++ b/airavata-api/src/main/java/org/apache/airavata/execution/handler/RegistryServerHandler.java @@ -4653,7 +4653,7 @@ public class RegistryServerHandler implements RegistryService.Iface { /*Following method wraps the logic of isGatewayExist method and this is to be called by any other method of the API as needed.*/ private boolean isGatewayExistInternal(String gatewayId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, - TException { + Exception { try { return gatewayRepository.isGatewayExist(gatewayId); } catch (RegistryException e) { @@ -4738,7 +4738,7 @@ public class RegistryServerHandler implements RegistryService.Iface { } private String addDataMovementInterface( - ComputeResource computeResource, + org.apache.airavata.execution.util.cpi.ComputeResource computeResource, String computeResourceId, DMType dmType, String dataMovementInterfaceId, diff --git a/airavata-api/src/main/java/org/apache/airavata/execution/mapper/ExecutionMapper.java b/airavata-api/src/main/java/org/apache/airavata/execution/mapper/ExecutionMapper.java index e2a898093d..0f021a72bf 100644 --- a/airavata-api/src/main/java/org/apache/airavata/execution/mapper/ExecutionMapper.java +++ b/airavata-api/src/main/java/org/apache/airavata/execution/mapper/ExecutionMapper.java @@ -48,6 +48,7 @@ import org.apache.airavata.model.workspace.proto.Notification; import org.apache.airavata.model.workspace.proto.Project; import org.mapstruct.Mapper; import org.mapstruct.Mapping; +import org.mapstruct.Named; import org.mapstruct.ReportingPolicy; import org.mapstruct.factory.Mappers; @@ -57,10 +58,10 @@ public interface ExecutionMapper { ExecutionMapper INSTANCE = Mappers.getMapper(ExecutionMapper.class); // --- Experiment --- - @Mapping(target = "emailAddresses", source = "emailAddresses") + @Mapping(target = "emailAddressesList", expression = "java(csvToList(entity.getEmailAddresses()))") ExperimentModel experimentToModel(ExperimentEntity entity); - @Mapping(target = "emailAddresses", source = "emailAddresses") + @Mapping(target = "emailAddresses", expression = "java(listToCsv(model.getEmailAddressesList()))") ExperimentEntity experimentToEntity(ExperimentModel model); // --- ExperimentSummary --- @@ -69,10 +70,10 @@ public interface ExecutionMapper { ExperimentSummaryEntity experimentSummaryToEntity(ExperimentSummaryModel model); // --- Process --- - @Mapping(target = "emailAddresses", source = "emailAddresses") + @Mapping(target = "emailAddressesList", expression = "java(csvToList(entity.getEmailAddresses()))") ProcessModel processToModel(ProcessEntity entity); - @Mapping(target = "emailAddresses", source = "emailAddresses") + @Mapping(target = "emailAddresses", expression = "java(listToCsv(model.getEmailAddressesList()))") ProcessEntity processToEntity(ProcessModel model); // --- Task --- @@ -269,6 +270,7 @@ public interface ExecutionMapper { } /** CSV String to List<String> (replaces CsvStringConverter) */ + @Named("csvToList") default List<String> csvToList(String csv) { if (csv == null || csv.isEmpty()) { return null; @@ -277,6 +279,7 @@ public interface ExecutionMapper { } /** List<String> to CSV String (replaces CsvStringConverter) */ + @Named("listToCsv") default String listToCsv(List<String> list) { if (list == null || list.isEmpty()) { return null; @@ -293,4 +296,14 @@ public interface ExecutionMapper { default long timestampToLong(Timestamp ts) { return ts == null ? 0 : ts.getTime(); } + + /** ByteString to byte[] (proto ByteString fields mapped to JPA byte[] columns) */ + default byte[] map(com.google.protobuf.ByteString value) { + return value != null ? value.toByteArray() : null; + } + + /** byte[] to ByteString (JPA byte[] columns mapped to proto ByteString fields) */ + default com.google.protobuf.ByteString map(byte[] value) { + return value != null ? com.google.protobuf.ByteString.copyFrom(value) : com.google.protobuf.ByteString.EMPTY; + } }
