Skip to content

Commit

Permalink
fix: ensure all flows are serialized in deployment details #4563
Browse files Browse the repository at this point in the history
  • Loading branch information
jgomer2001 committed Apr 12, 2023
1 parent 4360b9d commit 3bed6c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ private void deployProject(String dn, String prjId, String name) throws IOExcept
if (dd.getError() == null) {
projectsFlows.put(prjId, flowIds);

Set<String> libsPaths = transferJarFiles(plib);
ZipFile zip = compileAssetsArchive(p, pweb, plib, prjBasepath);
byte[] bytes = extractZipFileWithPurge(zip, ASSETS_DIR,
projectsBasePaths.get(prjId), projectsLibs.get(prjId));

Set<String> basePaths = Set.of(prjBasepath);
projectsBasePaths.put(prjId, basePaths);

Set<String> libsPaths = transferJarFiles(plib);
//Update this project's libs paths
libsPaths.addAll(computeSourcePaths(plib));
projectsLibs.put(prjId, libsPaths);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ public Response getDeployment(@Parameter(description = "Agama project name") @Pa
return Response.noContent().build();

d.getDetails().setFolders(null);
return Response.ok(d).build();
try {
//Use own mapper so flows with no errors are effectively serialized
return Response.ok(mapper.writeValueAsString(d)).build();
} catch (JsonProcessingException e) {
logger.error(e.getMessage(), e);
return Response.serverError().build();
}

}

Expand Down Expand Up @@ -171,7 +177,8 @@ public Response undeploy(@Parameter(description = "Agama project name") @PathPar
@GET
@ProtectedApi(scopes = { ApiAccessConstants.AGAMA_READ_ACCESS }, groupScopes = {ApiAccessConstants.AGAMA_WRITE_ACCESS }, superScopes = { ApiAccessConstants.SUPER_ADMIN_READ_ACCESS })
@Path(ApiConstants.CONFIGS + ApiConstants.NAME_PARAM_PATH)
public Response getConfigs(@Parameter(description = "Agama project name") @PathParam(ApiConstants.NAME) @NotNull String projectName) throws JsonProcessingException {
public Response getConfigs(@Parameter(description = "Agama project name") @PathParam(ApiConstants.NAME) @NotNull String projectName)
throws JsonProcessingException {

Pair<Response, Set<String>> pair = projectFlows(projectName);
Response resp = pair.getFirst();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public PagedResult<Deployment> list(int start, int count, int maxCount) {

public Deployment getDeployment(String name) {

String[] attrs = new String[]{ "jansStartDate", "jansEndDate", "adsPrjDeplDetails" };
String[] attrs = new String[]{ "jansId", "jansStartDate", "jansEndDate", "adsPrjDeplDetails" };
logger.info("Looking up project named {}", name);

Deployment d = null;
Expand Down

0 comments on commit 3bed6c6

Please sign in to comment.