Skip to content
This repository was archived by the owner on Oct 25, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ references:
TERM: xterm

environment:
NEO4J_VERSION: '3.5.0'
NEO4J_VERSION: '4.1.5'

workspace_root: &workspace_root ~/

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ node_modules/@financial-times/rel-engage/index.mk:
# ---------------------------
LOCAL_BOLT_URL=bolt://localhost:7687
BIZ_OPS_BOLT_URL=${NEO4J_BOLT_URL}
NEO4J_VERSION=3.5.0
NEO4J_VERSION=4.1.5
Copy link
Contributor Author

@wheresrhys wheresrhys Jan 20, 2021

Choose a reason for hiding this comment

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

There is now 4.1.6 - released yesterday

Copy link
Contributor

Choose a reason for hiding this comment

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

Upgraded to 4.1.6 (all three places) - thanks

PRODUCT_NAME=biz-ops
PROJECT_NAME=biz-ops-api

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: '3'
services:
neo4j:
image: neo4j:3.5.0
image: neo4j:4.1.5
environment:
- NEO4J_dbms_logs_query_enabled=true
- NEO4J_dbms_logs_query_enabled=VERBOSE
Copy link
Contributor

Choose a reason for hiding this comment

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

Slightly confused now with these settings as this v4.1 database can now be accessed by a v4 driver without the need for me to be explicit about the use of a certificate!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I've now realised that at well, silly me. However, this PR will now focus on the functionality delivered by the neo4j driver (e.g. CYPHER) not the security. The security will be tested via a similar PR for Biz Ops API

- NEO4J_AUTH=none
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_db_temporal_timezone=Z
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"http-errors": "^1.7.3",
"lodash": "^4.17.18",
"module-alias": "^2.2.2",
"neo4j-driver": "^1.7.7",
"neo4j-driver": "^4.0.0",
"node-fetch": "^2.6.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/tc-api-db-manager/db-connection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const neo4j = require('neo4j-driver').v1;
const neo4j = require('neo4j-driver');
const metrics = require('next-metrics');
const { logger } = require('@financial-times/tc-api-express-logger');

Expand Down
6 changes: 2 additions & 4 deletions packages/tc-api-db-manager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ const initConstraints = async () => {
const retrieveConstraints = async () => {
const constraints = await executeQuery('CALL db.constraints');
return constraints.records.map(constraint =>
constraint.get('description'),
constraint.get('name'),
Copy link
Contributor

Choose a reason for hiding this comment

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

This, and the similar line below, seem to be the solution to the original failure of the db to start. The reasons being that:
a) the description field is no longer available
b) the db.constraints and db.indexes procedures have been deprecated

);
};

const retrieveIndexes = async () => {
const indexes = await executeQuery('CALL db.indexes');
return indexes.records.map(constraint =>
constraint.get('description'),
);
return indexes.records.map(constraint => constraint.get('name'));
};

const existingConstraints = await retrieveConstraints();
Expand Down
2 changes: 1 addition & 1 deletion packages/tc-api-db-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@financial-times/n-logger": "^6.1.0",
"@financial-times/tc-api-express-logger": "file:../tc-api-express-logger",
"@financial-times/tc-schema-sdk": "file:../tc-schema-sdk",
"neo4j-driver": "^1.7.7",
"neo4j-driver": "^4.0.0",
"next-metrics": "^3.1.22"
},
"repository": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const neo4jTemporalTypes = require('neo4j-driver/lib/v1/temporal-types');
const neo4jTemporalTypes = require('neo4j-driver/lib/temporal-types');
const { setupMocks, neo4jTest } = require('../../../test-helpers');
const { dbUnavailable } = require('../../../test-helpers/error-stubs');
const { spyDbQuery } = require('../../../test-helpers/db-spies');
Expand Down
2 changes: 1 addition & 1 deletion packages/tc-api-rest-handlers/lib/diff-properties.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const neo4jTemporalTypes = require('neo4j-driver/lib/v1/temporal-types');
const neo4jTemporalTypes = require('neo4j-driver/lib/temporal-types');
const { getType } = require('@financial-times/tc-schema-sdk');

const isNullValue = val => val === null || val === '';
Expand Down
4 changes: 2 additions & 2 deletions packages/tc-api-rest-handlers/lib/neo4j-type-conversion.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const {
isDateTime,
isDate,
isTime,
} = require('neo4j-driver/lib/v1/temporal-types');
const neo4jTemporalTypes = require('neo4j-driver/lib/v1/temporal-types');
} = require('neo4j-driver/lib/temporal-types');
const neo4jTemporalTypes = require('neo4j-driver/lib/temporal-types');
const { getType } = require('@financial-times/tc-schema-sdk');

const entriesToObject = (map, [key, val]) => Object.assign(map, { [key]: val });
Expand Down
3 changes: 1 addition & 2 deletions packages/tc-api-rest-handlers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"common-tags": "^1.8.0",
"http-errors": "^1.7.3",
"lodash.isempty": "^4.4.0",
"lodash.groupby": "^4.6.0",
"neo4j-driver": "^1.7.6"
"lodash.groupby": "^4.6.0"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/tc-schema-sdk/data-accessors/graphql-defs.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const addStaticDefinitions = composer => {
};

const addEnumDefinitions = (composer, sdk) => {
Object.entries(sdk.getEnums({ withMeta: true })).map(
Object.entries(sdk.getEnums({ withMeta: true })).forEach(
([name, { description: enumDescription, options }]) => {
const values = {};
Object.values(options).forEach(
Expand Down
2 changes: 1 addition & 1 deletion scripts/neo4j-plugins
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

mkdir -p neo4j/{plugins,logs,data}
wget -O neo4j/plugins/apoc-3.5.0.1-all.jar https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.5.0.1/apoc-3.5.0.1-all.jar
wget -O neo4j/plugins/apoc-4.1.0.4-all.jar https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/4.1.0.4/apoc-4.1.0.4-all.jar
chmod 0644 neo4j/plugins/*.jar
ls -la neo4j/plugins
2 changes: 1 addition & 1 deletion test-helpers/db-connection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const neo4j = require('neo4j-driver').v1;
const neo4j = require('neo4j-driver');

const driver = neo4j.driver(
process.env.NEO4J_BOLT_URL || 'bolt://localhost:7687',
Expand Down
2 changes: 1 addition & 1 deletion test-helpers/test-fixtures.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { DateTime } = require('neo4j-driver/lib/v1/temporal-types.js');
const { DateTime } = require('neo4j-driver/lib/temporal-types.js');

const { driver } = require('./db-connection');

Expand Down