Skip to content

Commit

Permalink
Fixing minor problems in code. Clean up. Fixing and adding some print…
Browse files Browse the repository at this point in the history
… to builder-tool.sh
  • Loading branch information
trubbio83 committed Apr 29, 2024
1 parent 5c19746 commit e2fcf97
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 58 deletions.
14 changes: 12 additions & 2 deletions core-builder-tool/builder-tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ while IFS=, read -r protocol destination source; do

case "$protocol" in
"git+https")
echo "Protocol: $protocol"
echo "Downloading $rebuilt_url"
echo "to $destination_dir/$destination"


username=$GIT_USERNAME
password=$GIT_PASSWORD
token=$GIT_TOKEN
Expand All @@ -137,10 +142,16 @@ while IFS=, read -r protocol destination source; do
;;
"zip+s3") # for now accept a zip file - check if file is a zip, unpack zip
mc alias set $minio $S3_ENDPOINT_URL $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY
mc cp "$minio/$source" "$destination_dir/$destination"
echo "Protocol: $protocol"
echo "Downloading $minio/$rebuilt_url"
echo "to $destination_dir/$destination"
mc cp "$minio/$rebuilt_url" "$destination_dir/$destination"
unzip "$destination_dir/$destination"
;;
"http" | "https") # for now accept only zip file - check if file is a zip. unpack zip
echo "Protocol: $protocol"
echo "Downloading $source"
echo "to $destination_dir/$destination"
curl -o "$destination_dir/$destination" -L "$source"
unzip "$destination_dir/$destination"
;;
Expand All @@ -153,4 +164,3 @@ while IFS=, read -r protocol destination source; do
done < "$source_dir/context-refs.txt"

ls "$destination_dir"

2 changes: 1 addition & 1 deletion frontend/console
Submodule console updated 43 files
+3 −3 .env.development
+0 −3 .env.production
+1 −4 package.json
+ public/favicon.ico
+4 −60 src/App.tsx
+2 −0 src/components/VersionsList.tsx
+0 −296 src/components/WorkflowView.tsx
+1 −25 src/i18n/englishMessages.tsx
+4 −24 src/i18n/italianMessages.tsx
+2 −4 src/index.tsx
+5 −175 src/layout/MyAppBar.tsx
+0 −1 src/layout/MyMenu.tsx
+1 −1 src/provider/authProvider.tsx
+1 −62 src/provider/dataProvider.ts
+0 −3 src/provider/schemaProvider.tsx
+4 −8 src/resources/dataitems/preview-table/GridCellExpand.tsx
+3 −5 src/resources/dataitems/preview-table/PreviewHeaderCell.tsx
+77 −65 src/resources/dataitems/preview-table/PreviewTabComponent.tsx
+86 −97 src/resources/dataitems/preview-table/usePreviewDataGridController.ts
+11 −4 src/resources/dataitems/schema-table/SchemaTabComponent.tsx
+60 −63 src/resources/dataitems/schema-table/useSchemaDataGridController.ts
+8 −54 src/resources/functions/TaskAndRuns.tsx
+1 −1 src/resources/runs/show.tsx
+59 −57 src/resources/secrets/edit.tsx
+4 −7 src/resources/secrets/show.tsx
+0 −246 src/resources/workflows/TaskAndRuns.tsx
+0 −185 src/resources/workflows/create.tsx
+0 −213 src/resources/workflows/edit.tsx
+0 −3 src/resources/workflows/icon.tsx
+0 −5 src/resources/workflows/index.ts
+0 −136 src/resources/workflows/list.tsx
+0 −531 src/resources/workflows/show.tsx
+0 −26 src/resources/workflows/types.ts
+0 −99 src/resources/workflows/update.tsx
+0 −196 src/search/DateIntervalInput.tsx
+0 −208 src/search/SearchList.tsx
+0 −304 src/search/searchbar/SearchBar.tsx
+0 −31 src/search/searchbar/SearchContext.tsx
+0 −42 src/search/searchbar/SearchContextProvider.tsx
+0 −33 src/search/searchbar/SearchProvider.ts
+0 −28 src/search/searchbar/utils.ts
+0 −119 src/search/useSearchController.ts
+1 −388 yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
@Builder
public class RunnableMonitorObject implements Serializable {

//TODO send run event to RunManager(todo) create an object of type RunState with stateId, runId, project, framework....
//TODO send run event to RunManager(todo)
// create an object of type RunState with stateId, runId, project, framework....

private String runId;
private String stateId;
private String project;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.dataformat.cbor.CBORFactory;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import it.smartcommunitylabdhub.commons.jackson.mixins.ConcreteSpecMixin;
Expand All @@ -13,7 +18,8 @@
public class JacksonMapper {

public static final ObjectMapper CUSTOM_OBJECT_MAPPER = new ObjectMapper();
public static final TypeReference<HashMap<String, Object>> typeRef = new TypeReference<>() {};
public static final TypeReference<HashMap<String, Object>> typeRef = new TypeReference<>() {
};
public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
public static final ObjectMapper CBOR_OBJECT_MAPPER = new ObjectMapper(new CBORFactory());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ public enum State {
STOP,
UNKNOWN,
NONE,
RUN_ERROR,
RUN_ERROR
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

public interface SearchCriteria<T> extends Specification<T> {
String getField();

Serializable getValue();

Operation getOperation();

Specification<T> toSpecification();
Expand All @@ -14,6 +16,6 @@ public enum Operation {
equal,
gt,
lt,
like,
like
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public interface SearchFilter<T> {

enum Condition {
and,
or,
or
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@ public class RunUtils {

public static final Pattern TASK_PATTERN = Pattern.compile(Keys.PATH_PATTERN);

private RunUtils() {}
private static final int first = 1;
private static final int second = 2;
private static final int third = 3;
private static final int fourth = 4;

private RunUtils() {
}

//TODO this goes into the accessor, via a with()
public static RunSpecAccessor parseTask(String value) {
Matcher matcher = TASK_PATTERN.matcher(value);
if (matcher.matches()) {
String task = matcher.group(1);
String project = matcher.group(2);
String function = matcher.group(3);
String version = matcher.group(4);
String task = matcher.group(first);
String project = matcher.group(second);
String function = matcher.group(third);
String version = matcher.group(fourth);

Map<String, String> map = new HashMap<>();
map.put("task", task);
Expand All @@ -50,6 +56,6 @@ public static String buildTaskString(@NotNull Task task) {
throw new IllegalArgumentException("invalid or missing function in task spec");
}

return (task.getKind() + "://" + matcher.group(2) + "/" + matcher.group(3) + ":" + matcher.group(4));
return (task.getKind() + "://" + matcher.group(second) + "/" + matcher.group(third) + ":" + matcher.group(fourth));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import it.smartcommunitylabdhub.commons.Keys;
import it.smartcommunitylabdhub.commons.accessors.spec.TaskSpecAccessor;
import it.smartcommunitylabdhub.commons.models.base.Executable;
import it.smartcommunitylabdhub.commons.models.entities.function.Function;
import it.smartcommunitylabdhub.commons.models.entities.workflow.Workflow;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
Expand All @@ -14,16 +12,22 @@ public class TaskUtils {

private static final Pattern FUNCTION_PATTERN = Pattern.compile(Keys.PATH_PATTERN);

private TaskUtils() {}
private static final int first = 1;
private static final int second = 2;
private static final int third = 3;
private static final int fourth = 4;

private TaskUtils() {
}

//TODO this goes into the accessor, via a with()
public static TaskSpecAccessor parseFunction(String taskString) {
Matcher matcher = FUNCTION_PATTERN.matcher(taskString);
if (matcher.matches()) {
String runtime = matcher.group(1);
String project = matcher.group(2);
String function = matcher.group(3);
String version = matcher.group(4);
String runtime = matcher.group(first);
String project = matcher.group(second);
String function = matcher.group(third);
String version = matcher.group(fourth);

Map<String, String> map = new HashMap<>();
map.put("runtime", runtime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
*/
public class DateUtils {

private final static long MULTIPLIER = 1000;

/**
* Parse a timestamp string into a Date object.
*
Expand All @@ -19,7 +21,7 @@ public class DateUtils {
*/
public static Date parseDateFromTimestamp(String timestampStr, boolean isMilliseconds) {
long timestamp = Long.parseLong(timestampStr);
return isMilliseconds ? new Date(timestamp) : new Date(timestamp * 1000);
return isMilliseconds ? new Date(timestamp) : new Date(timestamp * MULTIPLIER);
}

/**
Expand All @@ -31,7 +33,7 @@ public static Date parseDateFromTimestamp(String timestampStr, boolean isMillise
* @throws IllegalArgumentException if the date interval format is invalid.
*/
public static DateInterval parseDateIntervalFromTimestamps(String intervalStr, boolean isMilliseconds)
throws IllegalArgumentException {
throws IllegalArgumentException {
String[] timestampArray = intervalStr.split(",");

if (timestampArray.length != 2) {
Expand All @@ -41,8 +43,8 @@ public static DateInterval parseDateIntervalFromTimestamps(String intervalStr, b
long startTimestamp = Long.parseLong(timestampArray[0]);
long endTimestamp = Long.parseLong(timestampArray[1]);

Date startDate = isMilliseconds ? new Date(startTimestamp) : new Date(startTimestamp * 1000);
Date endDate = isMilliseconds ? new Date(endTimestamp) : new Date(endTimestamp * 1000);
Date startDate = isMilliseconds ? new Date(startTimestamp) : new Date(startTimestamp * MULTIPLIER);
Date endDate = isMilliseconds ? new Date(endTimestamp) : new Date(endTimestamp * MULTIPLIER);

return new DateInterval(startDate, endDate);
}
Expand Down Expand Up @@ -86,5 +88,6 @@ public static DateInterval parseDateInterval(String intervalStr, String format)
/**
* A record representing a date interval with start and end dates.
*/
public record DateInterval(Date startDate, Date endDate) {}
public record DateInterval(Date startDate, Date endDate) {
}
}

This file was deleted.

This file was deleted.

0 comments on commit e2fcf97

Please sign in to comment.