Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
274 commits
Select commit Hold shift + click to select a range
5b22a0c
fix: fixed params type and removed unused code
NivGreenstein Aug 11, 2024
bf25f8e
fix: added missig mgrs
NivGreenstein Aug 11, 2024
93e1c93
fix: changed mgrs to lowercase
NivGreenstein Aug 11, 2024
e8d48ed
feat: added NotImplementedError
NivGreenstein Aug 11, 2024
72bca0e
fix(tileRepository): fixed requested type
NivGreenstein Aug 11, 2024
7ce6ca7
fix(tileManager): throw BadRequestError if both tile and mgrs are not…
NivGreenstein Aug 11, 2024
0a7e459
fix(tileManager): throw NotImplementedError if mgrs is provided
NivGreenstein Aug 11, 2024
cc32252
fix(tileManager): throw BadRequestError tile is undefined but tries t…
NivGreenstein Aug 11, 2024
ab96328
feat(control/utils): extracted logic of geoContext query to a common …
NivGreenstein Aug 11, 2024
176fb1a
feat(control/constants): moved CONTROL_FIELDS to this file and create…
NivGreenstein Aug 11, 2024
80667da
fix(control/utils): moved additionalControlSearchProperties to this file
NivGreenstein Aug 11, 2024
85c1342
delete(elastic/utils): delete additionalControlSearchProperties
NivGreenstein Aug 11, 2024
0777861
delete(common/constants): removed CONTROL_FIELDS
NivGreenstein Aug 11, 2024
a9daf2c
feat: use geoContextQuery in all queries. use Elastic_keywords in sub…
NivGreenstein Aug 11, 2024
f03c666
fix(tileRepository): updated imports
NivGreenstein Aug 11, 2024
e7e1c30
fix(control/utils): fixed returned type of geoContextQuery
NivGreenstein Aug 11, 2024
6ef5843
feat(control/constants): added layerName and tiedTo to ELASTIC_KEYWORDS
NivGreenstein Aug 11, 2024
2aaa190
delete(elastic/utils): removed unused imports
NivGreenstein Aug 11, 2024
f76a470
feat(itemQuery): changed query to new parameters
NivGreenstein Aug 11, 2024
41c202b
fix(itemRepository): updated import
NivGreenstein Aug 11, 2024
87c6516
fix(itemManager): updated manager
NivGreenstein Aug 11, 2024
4d5d951
fix(itemController): updated controller based on new openapi
NivGreenstein Aug 11, 2024
2528bd8
feat(routeController): updated controller based on new openapi
NivGreenstein Aug 11, 2024
23c8d81
fix(routeManager): updated imports based on types
NivGreenstein Aug 11, 2024
61c1697
fix(routeRepository): updated import
NivGreenstein Aug 11, 2024
2e7ef58
fix(route query): updated query to use geoContextQuery
NivGreenstein Aug 11, 2024
2c57944
fix(routeController): added missing geo_context_mode
NivGreenstein Aug 12, 2024
026754b
feat(common/utils): added Type util that infers snake_case interface …
NivGreenstein Aug 12, 2024
49a280c
delete(common/interfaces): removed unused interface
NivGreenstein Aug 12, 2024
a68ce86
feat(item/queries): ItemQueryParams now extends converted snake-case …
NivGreenstein Aug 12, 2024
cf9792d
feat(route/queries): ItemQueryParams now extends converted snake-case…
NivGreenstein Aug 12, 2024
2b94a84
feat(tile/queries): ItemQueryParams now extends converted snake-case …
NivGreenstein Aug 12, 2024
8c8f7ec
fix(control/item): fixed imports based on new type
NivGreenstein Aug 12, 2024
cc22ded
fix(control/route): fixed imports based on new type
NivGreenstein Aug 12, 2024
635ff66
fix(control/tile): fixed imports based on new type
NivGreenstein Aug 12, 2024
cb13838
fix(control/utils): changed thrown message error at geoContextQuery
NivGreenstein Aug 12, 2024
4432c03
feat: moved formatResponse function from common/utils to control/utils
NivGreenstein Aug 12, 2024
059bcb5
fix: updated imports
NivGreenstein Aug 12, 2024
c662baa
fix: updated import
NivGreenstein Aug 12, 2024
622c77c
feat(control/interfaces): created ControlResponse interface
NivGreenstein Aug 12, 2024
1dd898a
feat(control/utils): added geocoding debug and stats data to response
NivGreenstein Aug 12, 2024
163c2fe
feat: added requestParams to formatResponse
NivGreenstein Aug 12, 2024
999c035
feat: added mock data
Aug 13, 2024
26f3bea
fix(control/utils): additionalControlSearchProperties refined returne…
Aug 13, 2024
ade19d1
feat(tile/queries): added fuzziness to sub_tile query
NivGreenstein Aug 14, 2024
d225c00
feat: added _score to each returned feature
NivGreenstein Aug 14, 2024
e98c839
fix(openapi3): changed sub_tile type to string
NivGreenstein Aug 14, 2024
6518983
fix(item/queries): changed subTile from number to string
NivGreenstein Aug 14, 2024
ae2d06a
fix(tileManager): removed filter function after response
NivGreenstein Aug 14, 2024
6a37102
fix(openapi3): changed other sub_tile query type from number to numer…
NivGreenstein Aug 14, 2024
d1ef322
fix(tile/queries): changed subTile from number to string
NivGreenstein Aug 14, 2024
559a3cd
fix(tile/controller): fixed passed value to subTile
NivGreenstein Aug 14, 2024
339d8a9
fix(control/interfaces): fixed ControlResponse.features returned type
NivGreenstein Aug 14, 2024
668a5bb
fix(openapi3): changed control_point type to numeric string
NivGreenstein Aug 14, 2024
d6fb588
fix(routeManager): removed fuzzy filter
NivGreenstein Aug 14, 2024
a6ce787
fix: changed controlPoint type to string
NivGreenstein Aug 14, 2024
ac4e3bf
fix: changed controlPoint passed value
NivGreenstein Aug 14, 2024
0ffe247
fix(itemManager): removed filter as disable fuzzy is on the query itself
NivGreenstein Aug 14, 2024
3f1208e
fix: fixed eslint error
NivGreenstein Aug 14, 2024
029251b
fix: changed geotext*.ts file names and imports to location*.ts
NivGreenstein Aug 14, 2024
bc22327
feat(location/interfaces): updated types to match new openapi
NivGreenstein Aug 14, 2024
f1a21a5
feat(location/utils): added es-response data and score to returned re…
NivGreenstein Aug 14, 2024
b5ade16
fix(location/queries): updated queries accroding to new openapi
NivGreenstein Aug 14, 2024
fdf2423
feat(locationRepository): added disableFuzziness to params
NivGreenstein Aug 14, 2024
c900baa
fix(locationManager): updated types and passed values to functions
NivGreenstein Aug 14, 2024
4ec66fa
fix(locationController): updated values passed to search function
NivGreenstein Aug 14, 2024
fe9e01c
fix: fixed school mock data
NivGreenstein Aug 14, 2024
5d0b68f
feat(locationManager): added sources function
NivGreenstein Aug 15, 2024
dceca46
feat(locationController): added sources
NivGreenstein Aug 15, 2024
ced8948
feat: changed postgres init to functionfactory init
NivGreenstein Aug 15, 2024
bc8832a
feat(errors): added ServiceUnavailableError
NivGreenstein Aug 15, 2024
15bfd84
fix: changed version
NivGreenstein Aug 15, 2024
ddc2376
fix(latlonRepository): added try-catch to getAll Request and thow Ser…
NivGreenstein Aug 15, 2024
18ba1a8
fix(utils/queryElastic): throw ServiceUnavailable instead of Internal…
NivGreenstein Aug 15, 2024
246b49f
feat: added /lookup/coordinates
NivGreenstein Aug 15, 2024
aee18ac
fix: changed type from Geometry
NivGreenstein Aug 15, 2024
6e88bf0
delete(location/convertResult):removed old region and sub_regions
NivGreenstein Aug 15, 2024
a66c254
fix(openapi3): re
NivGreenstein Aug 18, 2024
fa84efc
fix: updatd geocoding version
NivGreenstein Aug 18, 2024
42434a6
fix: changed convertWgs84ToUTM params to accept object to be more rea…
NivGreenstein Aug 20, 2024
c0861dc
feat(control/interfaces): added G= any generic to be more typesafe at…
NivGreenstein Aug 20, 2024
eac5bd5
delete: removed console.log
NivGreenstein Aug 20, 2024
c3a0928
feat: added convertCamelToSnakeCase util. on control response, in geo…
NivGreenstein Aug 20, 2024
8aedbc4
fix: changed control tests location
NivGreenstein Aug 20, 2024
a726428
feat(test/control/tiles): written new happy path tiles tests
NivGreenstein Aug 20, 2024
4e197c3
chore: changed syntax
NivGreenstein Aug 20, 2024
f5d1c2e
fix: added required for WGS84Circle, UTMCircle, geo_context
NivGreenstein Aug 20, 2024
3732cd0
chore: changed import location according eslint
NivGreenstein Aug 20, 2024
81a975b
feat(control/utils): added validateGeoContext
NivGreenstein Aug 20, 2024
1b7ed53
feat(tileManager): use validateGeoContext
NivGreenstein Aug 20, 2024
b01e071
fix(latLonController): fixed response types
NivGreenstein Aug 20, 2024
5a9464b
fix: removed required fields.
NivGreenstein Aug 20, 2024
0ec2571
chore: changed version
NivGreenstein Aug 20, 2024
8527d09
feat: added bad path tests
NivGreenstein Aug 20, 2024
d30ddf0
feat(geoContextQuery): added validateGeoContext
NivGreenstein Aug 21, 2024
23cacdc
delete(tileManager): removed validateGeoContext
NivGreenstein Aug 21, 2024
f0f80f9
feat(test/control/tile): added tests for invalid geo_context object.
NivGreenstein Aug 21, 2024
887b1ef
feat: added tests to item
NivGreenstein Aug 21, 2024
d3b84ed
feat: added mock data to control mock
NivGreenstein Aug 21, 2024
45d6252
feat(CONTROL_FIELDS): added properties.TIED_TO
NivGreenstein Aug 21, 2024
c17d2e1
fix(tests/tiles): changed place of mock data
NivGreenstein Aug 21, 2024
54bb9b7
fix(openapi): added minLength and maxLength to tile query in /search/…
NivGreenstein Aug 21, 2024
1c13b33
feat: added common utils to control testing
NivGreenstein Aug 21, 2024
e12f3ee
delete(control/utils): removed unused foreach
NivGreenstein Aug 21, 2024
d40744b
feat: added test for items inside tile
NivGreenstein Aug 21, 2024
a49060d
feat(test/tile): added test for no subtiles as disable_fuzziness true…
NivGreenstein Aug 21, 2024
ad8946e
feat(test/route): created tests for routes
NivGreenstein Aug 21, 2024
e8ca56e
feat: added utils to Convert Camel To SnakeCase
NivGreenstein Aug 22, 2024
76fffcb
fix: converting camel to snake case in geocoding.query
NivGreenstein Aug 22, 2024
9f1a445
feat: added mock data
NivGreenstein Aug 22, 2024
3f9bdfd
fix: fixed QueryResult interface
NivGreenstein Aug 22, 2024
3c085c3
delete: removed old geotext tests
NivGreenstein Aug 22, 2024
1b03e86
feat: added tests for location/query
NivGreenstein Aug 22, 2024
eef92c5
delete: removed highlight
NivGreenstein Aug 25, 2024
c5d51cb
fix: created new MockType for MockLocationQueryFeature
NivGreenstein Aug 25, 2024
876b2f6
fix: fixed types for location tests
NivGreenstein Aug 25, 2024
a3f6613
feat : new tests and fixed for location
NivGreenstein Aug 26, 2024
ea814da
fix: fixed failing test case
NivGreenstein Aug 26, 2024
7173646
test: added coverage
NatalieShaked Aug 26, 2024
cc1d43f
delete: removed old unit tests
NivGreenstein Aug 26, 2024
4689aa9
test: added mock data to tests in order to test regions properly
NatalieShaked Aug 26, 2024
d613ccd
fix(location): changed location feature response
NivGreenstein Aug 26, 2024
9c51555
test: added coverage
NatalieShaked Aug 26, 2024
6189f8d
feat: changed location response to match geocodingGenereicResponse sc…
NivGreenstein Aug 27, 2024
de51484
delete: removed duplicated test
NatalieShaked Aug 27, 2024
1dabf22
feat: added coverage
NatalieShaked Aug 27, 2024
7749d3f
feat: added redis configuration
NatalieShaked Aug 27, 2024
5bb7d11
test: added redis to tests
NatalieShaked Aug 27, 2024
fc2990c
feat: changed returned response to be genericGeocodingResponse
NivGreenstein Aug 27, 2024
e608ce8
fix: fixed map source elements to lowercase because of elasticsearch …
NivGreenstein Aug 27, 2024
b4a56ae
fix: changed scopre to be returned under properties
NivGreenstein Aug 27, 2024
448ac0c
fix: fixed mock objects and utils to return as expected in genericGeo…
NivGreenstein Aug 27, 2024
1bb8fbe
Merge branch 'feat/geocoding-v2-architecture' of https://github.com/M…
NivGreenstein Aug 27, 2024
46d0d06
fix: fixed location tests
NivGreenstein Aug 27, 2024
aaf433e
delete: removed removed parse geo string| geojson and deprecated code
NivGreenstein Aug 27, 2024
24b4602
feat: upload new default and test configs
NivGreenstein Aug 27, 2024
9217108
feat(config): added NAME_TRANSLATION_KEYS env
Aug 28, 2024
a195330
delete(tests/latlon): removed old tests
Aug 28, 2024
237fb95
feat(location/utils): added rejectUnauthorized: false to axios
Aug 28, 2024
4fa68b9
fixed env for controlObjectDisplayNamePrefixes. changed version
Aug 28, 2024
3536e6e
fix: fixed redis configuration
NatalieShaked Aug 29, 2024
a560876
feat: api responses get sent to redis
NatalieShaked Aug 29, 2024
1f97c76
feat: added ttl of 5 mins to redis set
NatalieShaked Aug 29, 2024
b5a4031
fix: removed unnecessary redis configs
NatalieShaked Sep 1, 2024
e0c9f30
fix: eslint fixes
NatalieShaked Sep 1, 2024
4ea3e2c
feat: created s3 repository
NivGreenstein Sep 4, 2024
6c0aed3
fix: fixed target_grid typo
NivGreenstein Sep 4, 2024
58e8c7c
feat: inject s3
NivGreenstein Sep 4, 2024
ec4be33
feat: changed to latLon from models/latLon
NivGreenstein Sep 4, 2024
0a2ede9
fix: lookup routes
NivGreenstein Sep 4, 2024
82784eb
fix: fixed logic at latLonToTile
NivGreenstein Sep 4, 2024
19b89df
delete: deleted postgresql
NivGreenstein Sep 4, 2024
4d2b037
feat: removed proj4
NivGreenstein Sep 4, 2024
09c7fcb
fix: added s3 config. removed postgres config
NivGreenstein Sep 4, 2024
941778e
feat: added aws-sdk dependencies
NivGreenstein Sep 4, 2024
229b1c5
fix: require target_grid in openapi
NivGreenstein Sep 4, 2024
eeefd86
added todo comment
NivGreenstein Sep 4, 2024
852c0c4
delete: removed postgres references
NivGreenstein Sep 4, 2024
91ff30f
fix: inject noting to s3 in order not to initialize it
NivGreenstein Sep 4, 2024
c47d07f
delete: removed unused code
NivGreenstein Sep 4, 2024
258b6de
feat: added healthCheckFactory. removed unused validateTile
NivGreenstein Sep 4, 2024
b70bb92
feat: remove file when finish
NivGreenstein Sep 4, 2024
44ddbfd
delete: removed unused code
NivGreenstein Sep 4, 2024
c6bb613
feat: added liveness and cleanup on signal
NivGreenstein Sep 4, 2024
bd3ac9c
feat: added cleanup-registry
NivGreenstein Sep 4, 2024
92f19a8
delete: removed unused code
NivGreenstein Sep 4, 2024
55fa288
fix: added missing query and response properties
NivGreenstein Sep 4, 2024
ae2ce64
feat: added getIsDataLoadError
NivGreenstein Sep 4, 2024
3a3e63d
feat: added latLon tests
NivGreenstein Sep 4, 2024
a8850c3
feat: added create bucket and cleanup after test
NivGreenstein Sep 5, 2024
f65e7e7
feat: added forcePathStyle true
NivGreenstein Sep 5, 2024
62f9b58
feat: changed indexes to have _index suffix
NivGreenstein Sep 5, 2024
6caae7d
feat: updated dev scripts
NivGreenstein Sep 5, 2024
0b6d318
fix: fixed typo
NivGreenstein Sep 5, 2024
26791c4
feat: added CLEANUP_REGISTRY symbol
NivGreenstein Sep 5, 2024
3dc6ded
feat: update imports,provide cleanup registry, change cleanupRegistr…
NivGreenstein Sep 5, 2024
be5b38b
feat: added globalTeardown and globalSetup for tests.
NivGreenstein Sep 5, 2024
1c25ef9
Update pull_request.yaml
NivGreenstein Sep 5, 2024
179574c
changed version
Sep 5, 2024
68b29b9
Merge branch '0.1.0' into feat/github-action-added-elasticsearch-s3
NivGreenstein Sep 5, 2024
d52f9d3
Update pull_request.yaml
NivGreenstein Sep 5, 2024
872ef3b
Update pull_request.yaml
NivGreenstein Sep 5, 2024
cb81f3f
Update pull_request.yaml
NivGreenstein Sep 5, 2024
119b412
Merge pull request #12 from MapColonies/feat/github-action-added-elas…
NivGreenstein Sep 5, 2024
19e6659
Merge pull request #13 from MapColonies/feat/geocoding-v2-responses
NivGreenstein Sep 5, 2024
6632a63
chore: removed data from default.json and changed it to be generic.
NivGreenstein Sep 5, 2024
1c383fe
Update pull_request.yaml
NivGreenstein Sep 6, 2024
588e673
feat: added MGRS to shape
NivGreenstein Sep 8, 2024
4c46357
fix: changed bbox type from explicit to Bbox type from 'geojson'
NivGreenstein Sep 8, 2024
1a5f0a4
delete: removed unused file
NivGreenstein Sep 8, 2024
9f21b64
feat: added request id to response header
NatalieShaked Sep 9, 2024
03d24d2
feat: sent x-api-key header to redis
NatalieShaked Sep 9, 2024
c02c9b7
feat: sent the current site to redis, will adjust the s3 entrypoint o…
NatalieShaked Sep 9, 2024
1f7bf3a
Merge branch '0.1.0' of https://github.com/MapColonies/geocoding into…
NatalieShaked Sep 12, 2024
5406ea1
feat: added redis health check
NatalieShaked Sep 12, 2024
3541c48
delete: removed redis healthcheck
NatalieShaked Sep 12, 2024
ebc5efe
fix: added missing redis config
NatalieShaked Sep 12, 2024
5b607a6
fix: added missing imports; removed pg
NatalieShaked Sep 12, 2024
5e6ff68
fix: added missing closing bracket
NatalieShaked Sep 12, 2024
259a029
fix: added missing closing bracket
NatalieShaked Sep 12, 2024
5084e3b
fix: application placement
NatalieShaked Sep 12, 2024
0d37f0b
fix: revised openapi schema
NivGreenstein Sep 12, 2024
c7e87dd
fix: fixed latLon routes and tests
NivGreenstein Sep 12, 2024
516d103
feat: added toSatisfyApiSpec(); to route
NivGreenstein Sep 12, 2024
04de080
updated version
NivGreenstein Sep 12, 2024
57361c3
fix: fixed healthCheckFactory so it won't cause server crush
NivGreenstein Sep 15, 2024
2d44e7b
Merge pull request #27 from MapColonies/bug/24-server-crush-when-it-c…
NivGreenstein Sep 15, 2024
5955e13
fix: made minor fixes to the code in order for it to be more tidy
NatalieShaked Sep 15, 2024
7f55e46
feat: added ajv and changed validateGeoContext to use it
NivGreenstein Sep 15, 2024
bfbeb91
feat: added parsePoint, parseBbox, parseGeo, geoContextQuery to /comm…
NivGreenstein Sep 15, 2024
c51a011
fix: changed function import location
NivGreenstein Sep 15, 2024
196ab76
feat: changed geotextQuery to use geoContextQuery
NivGreenstein Sep 15, 2024
59fcd5a
Merge branch '0.1.0' of https://github.com/MapColonies/geocoding into…
NatalieShaked Sep 15, 2024
e606411
fix: changed import
NivGreenstein Sep 15, 2024
7d21029
delete: deleted unused code
NivGreenstein Sep 15, 2024
2da6181
fix: fixed tests according to new changes
NivGreenstein Sep 15, 2024
78abec2
Merge pull request #29 from MapColonies/bug/25-geo_context-accepts-ob…
NivGreenstein Sep 15, 2024
c4d3fc1
feat: added elasticsearch query for tile by bbox
NivGreenstein Sep 18, 2024
7e7d2ae
feat(tileRepository): added getTilesByBbox
NivGreenstein Sep 18, 2024
e0a70fc
feat: removed no implementation error and added call to getTilesByBbox.
NivGreenstein Sep 18, 2024
9669e69
fix: removed size param becasue limit it is part of TileQueryParams
NivGreenstein Sep 18, 2024
f6a7f18
fix: added error handling for invalid MGRS tile
NivGreenstein Sep 18, 2024
28bf145
fix: fixed should to be object or undefined.
NivGreenstein Sep 18, 2024
7a13488
feat: added MGRS to control tile tests
NivGreenstein Sep 18, 2024
7595b04
Update pull_request.yaml
NivGreenstein Sep 19, 2024
eb63dff
Update pull_request.yaml
NivGreenstein Sep 19, 2024
5ab7784
Update test.json
NivGreenstein Sep 19, 2024
308fe5e
Update test.json
NivGreenstein Sep 19, 2024
ad94743
Merge pull request #31 from MapColonies/bug/30-lookupcoordinates-targ…
NivGreenstein Sep 19, 2024
97415fe
feat(latLon.spec.ts): added test should return error when cronPattern…
Sep 19, 2024
9916991
chore: changed version to 0.1.0-prealpha.4
Sep 19, 2024
f815de7
fix: changed s3 files download location in order to mount emptyDir in…
Sep 22, 2024
117ce76
fix: changed to node:crypto to specifically use the new nodejs crypto…
Sep 22, 2024
4b2a521
fix: added delete all indices before new init
NivGreenstein Sep 23, 2024
82cd127
fix: added mkdir to s3 downloads file
NivGreenstein Sep 23, 2024
2577db4
fix: change 'name' to 'names' according to openapi
NivGreenstein Sep 23, 2024
e2ca1b1
fix: feedback sends to redis without adding time to the response
NatalieShaked Sep 23, 2024
4ad4d0c
Merge branch '0.1.0' of https://github.com/MapColonies/geocoding into…
NatalieShaked Sep 23, 2024
2efa015
fix: added missing target_grid and version to the response
NivGreenstein Sep 23, 2024
a9aa8db
Merge pull request #32 from MapColonies/30-lookupcoordinates-target_g…
NivGreenstein Sep 23, 2024
e5dd67f
fix: minor fixes for code clearness
NatalieShaked Sep 23, 2024
c8e815c
Merge pull request #15 from MapColonies/feat/feedback-api-redis
NatalieShaked Sep 23, 2024
84e71e9
fix: app will work also if redis was not able to connect
NatalieShaked Sep 29, 2024
9422a04
fix: added site to env vars
NatalieShaked Sep 29, 2024
4628395
feat: created GenericGeocodingResponse
NivGreenstein Sep 29, 2024
4454246
fix: changed from ControlResponse to GenericGeocodingResponse
NivGreenstein Sep 29, 2024
73bb042
delete: removed ControlResponse
NivGreenstein Sep 29, 2024
d83f18b
fix: changed type from QueryResult to GenericGeocodingResponse
NivGreenstein Sep 29, 2024
e95c4e9
fix: fixed all tests to right types
NivGreenstein Sep 29, 2024
c340fd4
fix: fixed latLonDal init and prevent it from being created 3 times
NivGreenstein Sep 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ commitlint.config.json
dist
build
reports
devScripts
196 changes: 192 additions & 4 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,196 @@
name: pull_request

on: [pull_request]
on: [pull_request, workflow_dispatch]

jobs:
pull_request:
uses: MapColonies/shared-workflows/.github/workflows/pull_request.yaml@master
secrets: inherit
eslint:
name: Run eslint
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm ci

- name: Run linters
uses: wearerequired/lint-action@v1
with:
github_token: ${{ secrets.github_token }}
# Enable linters
eslint: true
prettier: true
eslint_extensions: ts

- name: OpenAPI Lint Checks
uses: nwestfall/openapi-action@v1.0.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
file: ./openapi3.yaml

integration-test:
name: Run Integration Tests
runs-on: ubuntu-latest
container: node:16

services:
# Label used to access the service container
elasticsearch:
# Docker Hub image
image: elasticsearch:8.13.0
env:
discovery.type: single-node
xpack.security.enabled: false
xpack.security.enrollment.enabled: false
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
ports:
- 9200:9200
# Set health checks to wait until elastic has started
options: >-
--health-cmd "curl -f http://localhost:9200/_cluster/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5

minio:
# Docker Hub image
image: minio/minio:edge-cicd
env:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
ports:
- 9000:9000
# Set health checks to wait until elastic has started
options: >-
--health-cmd "curl -f http://localhost:9000/minio/health/live || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5

strategy:
matrix:
node: [18.x, 20.x]

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Install Node.js dependencies
run: npm ci

- name: Wait for Elasticsearch
run: |
until curl -s http://elasticsearch:9200/_cluster/health | grep '"status":"green"'; do
echo "Waiting for Elasticsearch...";
sleep 5;
done

- name: Run integration tests
run: npm run test:integration

- uses: actions/upload-artifact@v4
with:
name: Test Reporters
path: reports/**

unit-test:
name: Run Unit Tests
runs-on: ubuntu-latest
container: node:16

services:
# Label used to access the service container
elasticsearch:
# Docker Hub image
image: elasticsearch:8.13.0
env:
discovery.type: single-node
xpack.security.enabled: false
xpack.security.enrollment.enabled: false
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
ports:
- 9200:9200
# Set health checks to wait until elastic has started
options: >-
--health-cmd "curl -f http://localhost:9200/_cluster/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5

minio:
# Docker Hub image
image: minio/minio:edge-cicd
env:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
ports:
- 9000:9000
# Set health checks to wait until elastic has started
options: >-
--health-cmd "curl -f http://localhost:9000/minio/health/live || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5

strategy:
matrix:
node: [18.x, 20.x]

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Install Node.js dependencies
run: npm ci

- name: Wait for Elasticsearch
run: |
until curl -s http://elasticsearch:9200/_cluster/health | grep '"status":"green"'; do
echo "Waiting for Elasticsearch...";
sleep 5;
done

- name: Run unit tests
run: npm run test:unit

- uses: actions/upload-artifact@v4
with:
name: Test Reporters
path: reports/**

security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

build_image:
name: Build Image
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: build Docker image
run: docker build -t test-build:latest .
43 changes: 31 additions & 12 deletions config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,39 @@
}
}
},
"postgresql": {
"host": "POSTGRES_URL",
"s3": {
"endpoint": "S3_ENDPOINT",
"credentials": {
"accessKeyId": "S3_ACCESS_KEY",
"secretAccessKey": "S3_SECRET_KEY"
},
"region": "S3_REGION",
"files": {
"__name": "S3_FILES_DATA",
"__format": "json"
}
Comment on lines +77 to +80
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is supposed to be a large file, don't we want to provide it in another way?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the config and metadata for the files that are being stores in S3.
This way the service knows what bucket and file's name to pull.

},
"redis": {
"host": "REDIS_HOST",
"port": {
"__name": "POSTGRES_PORT",
"__name": "REDIS_PORT",
"__format": "number"
},
"username": "POSTGRES_USERNAME",
"password": "POSTGRES_PASSWORD",
"username": "REDIS_USERNAME",
"password": "REDIS_PASSWORD",
"enableSslAuth": {
"__name": "POSTGRES_ENABLE_SLL_AUTH",
"__name": "REDIS_ENABLE_SSL_AUTH",
"__format": "boolean"
},
"sslPaths": {
"ca": "POSTGRES_CA_PATH",
"key": "POSTGRES_KEY_PATH",
"cert": "POSTGRES_CERT_PATH"
"ca": "REDIS_CA_PATH",
"key": "REDIS_KEY_PATH",
"cert": "REDIS_CERT_PATH"
},
"database": "POSTGRES_DB_NAME",
"schema": "POSTGRES_DB_SCHEMA"
"database": {
"__name": "REDIS_DATABASE",
"__format": "number"
}
}
},
"application": {
Expand All @@ -104,6 +118,11 @@
"__name": "NAME_TRANSLATION_KEYS",
"__format": "json"
},
"mainLanguageRegex": "MAIN_LANGUAGE_REGEX"
"controlObjectDisplayNamePrefixes": {
"__name": "CONTROL_DISPLAY_KEY_TRANSLATIONS",
"__format": "json"
},
"mainLanguageRegex": "MAIN_LANGUAGE_REGEX",
"site": "SITE"
}
}
53 changes: 31 additions & 22 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,21 @@
"db": {
"elastic": {
"control": {
"node": "http://localhost:9200",
"node": "http://control_elastic:9200",
"auth": {
"username": "control",
"password": "password"
"username": "elastic",
"password": "changeme"
Comment on lines +31 to +34
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should stay as default values. These seem to be actual credentials (even if for local work).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elastic and changeme are the default Elasticsearch credentials.
control_elastic is just the placeholder. for local env, you need to change it to localhost if you are running it locally.

},
"requestTimeout": 60000,
"properties": {
"index": "control_index",
"defaultResponseLimit": 3
"index": "control_index"
}
},
"geotext": {
"node": "http://localhost:9200",
"node": "http://geotext_elastic:9200",
"auth": {
"username": "geotext",
"password": "password"
"username": "elastic",
"password": "changeme"
Comment on lines +42 to +45
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

},
"requestTimeout": 60000,
"properties": {
Expand All @@ -52,25 +51,37 @@
"placetypes": "placetypes_index",
"hierarchies": "hierarchies_index"
},
"defaultResponseLimit": 3,
"textTermLanguage": "en"
}
}
},
"postgresql": {
"type": "postgres",
"host": "localhost",
"port": 5432,
"username": "postgres",
"password": "postgres",
"s3": {
"endpoint": "http://s3:9000",
"credentials": {
"accessKeyId": "accessKeyId",
"secretAccessKey": "secretAccessKey"
},
"forcePathStyle": true,
"region": "local",
"files": {
"latLonConvertionTable": {
"bucket": "geocoding",
"fileName": "table.json"
}
}
},
"redis": {
"host": "REDIS_HOST",
"port": 6379,
"username": "",
"password": "",
"enableSslAuth": false,
"sslPaths": {
"ca": "",
"key": "",
"cert": ""
},
"database": "postgres",
"schema": "geocoder"
"database": 0
}
},
"application": {
Expand All @@ -85,12 +96,10 @@
"hierarchy": 1.1,
"viewbox": 1.1
},
"sources": {
"SOURCE_A": "a",
"SOURCE_B": "b"
},
"sources": {},
"regions": {},
"nameTranslationsKeys": ["en", "fr"],
"controlObjectDisplayNamePrefixes": {},
"nameTranslationsKeys": [],
"mainLanguageRegex": "[a-zA-Z]"
}
}
Loading