From 7f882d1e22d38807605566412030bfc5271541db Mon Sep 17 00:00:00 2001 From: Anders Richardsson <2107110+caravinci@users.noreply.github.com> Date: Tue, 24 Sep 2024 14:40:24 -0400 Subject: [PATCH] =?UTF-8?q?use=20Float=20as=20a=20stopgap=20for=20GraphQL?= =?UTF-8?q?=E2=80=99s=20number=20type=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 14 +++++++------- docker/Dockerfile.jenkins.dockerignore | 1 - .../server/src/mapping/mappingToScalarFields.js | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 68bab7686..db5586e97 100644 --- a/Makefile +++ b/Makefile @@ -19,11 +19,10 @@ INFO_HEADER := "**************** " DONE_MESSAGE := $(YELLOW)$(INFO_HEADER) "- done\n" $(END) - # Variables DOCKER_DIR := $(ROOT_DIR)/docker ES_DATA_DIR := $(DOCKER_DIR)/elasticsearch -# ES_DOCS_DIR can be given with a custom directory for docs to be seeded +ES_DOCS_DIR := $(ES_DATA_DIR)/documents ES_HOST := http://localhost:9200 ES_INDEX := file_centric_1.0 ES_LOAD_SCRIPT := $(ES_DATA_DIR)/load-es-data.sh @@ -36,10 +35,11 @@ ES_BASIC_AUTH := $(shell printf "$(ES_USER):$(ES_PASS)" | base64) # Commands DOCKER_COMPOSE_CMD := \ - ES_USER=$(ES_USER) \ + ES_USER=$(ES_USER) \ ES_PASS=$(ES_PASS) \ - $(DOCKER_COMPOSE_EXE) -f \ + $(DOCKER_COMPOSE_EXE) -f \ $(ROOT_DIR)/docker-compose.yml + DC_UP_CMD := COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 $(DOCKER_COMPOSE_CMD) up -d --build @@ -49,9 +49,9 @@ DC_UP_CMD := COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 $(DOCKER_COMPOSE_CMD) _ping_elasticsearch_server: @echo $(YELLOW)$(INFO_HEADER) "Pinging ElasticSearch on $(ES_HOST)" $(END) @sh $(RETRY_CMD) "curl --retry 10 \ - --retry-delay 0 \ - --retry-max-time 40 \ - --retry-connrefuse \ + --retry-delay 0 \ + --retry-max-time 40 \ + --retry-connrefused \ -H \"Authorization: Basic $(ES_BASIC_AUTH)\" \ \"$(ES_HOST)/_cluster/health?wait_for_status=yellow&timeout=100s&wait_for_no_initializing_shards=true\"" @echo "" diff --git a/docker/Dockerfile.jenkins.dockerignore b/docker/Dockerfile.jenkins.dockerignore index bf45dd97c..6871a41f8 100644 --- a/docker/Dockerfile.jenkins.dockerignore +++ b/docker/Dockerfile.jenkins.dockerignore @@ -6,7 +6,6 @@ docks integration-tests modules/**/* !modules/server -scripts Jenkinsfile lerna* prettier* \ No newline at end of file diff --git a/modules/server/src/mapping/mappingToScalarFields.js b/modules/server/src/mapping/mappingToScalarFields.js index 78185ee93..b640363e0 100644 --- a/modules/server/src/mapping/mappingToScalarFields.js +++ b/modules/server/src/mapping/mappingToScalarFields.js @@ -5,9 +5,9 @@ export let esToGraphqlTypeMap = { double: 'Float', float: 'Float', half_float: 'Float', - integer: 'Int', + integer: 'Float', keyword: 'String', - long: 'Int', + long: 'Float', // hack to compensate for graphql not supporting Long. TODO: add a Long custom type https://github.com/overture-stack/arranger/issues/796 object: 'JSON', // https://github.com/overture-stack/arranger/blob/master/modules/schema/src/index.js#L9 scaled_float: 'Float', string: 'String',