Skip to content

Commit 76e1510

Browse files
committed
Removed TODOs, implemented some, fixed code smells.
1 parent 9f8b5db commit 76e1510

File tree

7 files changed

+14
-19
lines changed

7 files changed

+14
-19
lines changed

.circleci/config.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ jobs:
4141
- setup_remote_docker:
4242
version: 20.10.7
4343
- login_docker
44-
- install_and_login_doctl
45-
- kubernetes/install-kubectl
44+
- k8s/install
45+
- k8s/initialize:
46+
cluster: predecos-kubernetes-cluster
4647
- kubernetes/delete-resource:
4748
now: true
4849
resource-names: mongodb-deployment
@@ -51,7 +52,7 @@ jobs:
5152
- kubernetes/create-or-update-resource:
5253
get-rollout-status: true
5354
resource-file-path: ./packages/deep-microservice-collection/k8s/mongodb-deployment.yml
54-
resource-name: mongodb-deployment
55+
resource-name: deployment/mongodb-deployment
5556
show-kubectl-command: true
5657

5758
deploy_postgres:
@@ -65,8 +66,9 @@ jobs:
6566
- setup_remote_docker:
6667
version: 20.10.7
6768
- login_docker
68-
- install_and_login_doctl
69-
- kubernetes/install-kubectl
69+
- k8s/install
70+
- k8s/initialize:
71+
cluster: predecos-kubernetes-cluster
7072
- kubernetes/delete-resource:
7173
now: true
7274
resource-names: postgres-deployment

packages/deep-microservice-analysis/src/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ const startApolloServer = async () => {
6666
);
6767
};
6868

69-
startApolloServer().then(() => { }, (reason) => {
69+
startApolloServer().then(() => { /* Do nothing */ }, (reason) => {
7070
logger.error(`An Error Occurred: ${JSON.stringify(reason)}`);
7171
});

packages/deep-microservice-analysis/src/logging-plugin.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ const loggingPlugin = {
1010
return {
1111
// Fires whenever Apollo Server will parse a GraphQL
1212
// request to create its associated document AST.
13-
async parsingDidStart(requestContext) {
13+
async parsingDidStart() {
1414
logger.debug('Parsing started.');
1515
},
1616

1717
// Fires whenever Apollo Server will validate a
1818
// request's document AST against your GraphQL schema.
19-
async validationDidStart(requestContext) {
19+
async validationDidStart() {
2020
logger.debug('Validation started.');
2121
},
2222

packages/deep-microservice-collection/src/index.mjs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {getLogger} from './get-logger.mjs'
88
import {getPublicIP} from './get-public-ip.mjs';
99
import {loggingPlugin} from './logging-plugin.mjs';
1010
import {MongoClient} from 'mongodb';
11-
import os from 'os';
1211
import process from 'process';
1312
import {resolvers} from './resolvers.mjs';
1413
import {typeDefs} from './schema.mjs';
@@ -43,7 +42,6 @@ const startApolloServer = async () => {
4342
console.log("Connected successfully to server");
4443

4544
const twitterAPI = new TwitterAPI();
46-
// TODO: remove admin
4745
const tweetStore = new TweetStore(mongoClient.db('admin').collection('tweets'));
4846
const collectionService = new CollectionService(twitterAPI, tweetStore, logger);
4947

@@ -63,9 +61,6 @@ const startApolloServer = async () => {
6361
// of the schema. This can be dangerous in production. However, these services are intended to be visible so this isn't
6462
// currently an issue.
6563
introspection: true,
66-
67-
// TODO: Disable this later
68-
playground: isProduction
6964
});
7065
await server.start();
7166

@@ -85,7 +80,6 @@ const startApolloServer = async () => {
8580
server.applyMiddleware({
8681
app,
8782
cors: {
88-
// TODO: Remove localhost from prod deployments. Security.
8983
origin: allowedOrigins,
9084
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS,CONNECT,TRACE',
9185
credentials: true,
@@ -101,6 +95,6 @@ const startApolloServer = async () => {
10195
);
10296
};
10397

104-
startApolloServer().then(() => { }, (reason) => {
98+
startApolloServer().then(() => { /* Do nothing */ }, (reason) => {
10599
logger.error(`An Error Occurred: ${JSON.stringify(reason)}`);
106100
});

packages/deep-microservice-collection/src/logging-plugin.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ const loggingPlugin = {
1010
return {
1111
// Fires whenever Apollo Server will parse a GraphQL
1212
// request to create its associated document AST.
13-
async parsingDidStart(requestContext) {
13+
async parsingDidStart() {
1414
logger.debug('Parsing started.');
1515
},
1616

1717
// Fires whenever Apollo Server will validate a
1818
// request's document AST against your GraphQL schema.
19-
async validationDidStart(requestContext) {
19+
async validationDidStart() {
2020
logger.debug('Validation started.');
2121
},
2222

packages/deep-microservice-gateway/src/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ const startGatewayService = async () => {
8383
);
8484
};
8585

86-
startGatewayService().then(() => { }, (reason) => {
86+
startGatewayService().then(() => { /* Do nothing */ }, (reason) => {
8787
logger.error(`An Error Occurred: ${JSON.stringify(reason)}`);
8888
});

packages/deep-template-analyzer/rollup.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import merge from 'deepmerge';
22

33
// NOTE: The relative path below is required otherwise the build errors out.
4-
// TODO: Fix
54
import baseConfig from "../../node_modules/@thinkdeep/tools/rollup.config.mjs";
65

76
export default merge(baseConfig, {

0 commit comments

Comments
 (0)