Skip to content

Commit

Permalink
Update Sailor version to 2.6.21 (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Olha Virolainen authored Dec 17, 2020
1 parent 115305a commit a0d321c
Show file tree
Hide file tree
Showing 8 changed files with 529 additions and 253 deletions.
27 changes: 27 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 2
jobs:
test:
docker:
- image: circleci/node:14-stretch
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Audit Dependencies
command: npm audit --audit-level=high
- run:
name: Installing Dependencies
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- node_modules
- run:
name: Running Mocha Unit Tests
command: npm test
workflows:
version: 2
build_and_test:
jobs:
- test
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.7.1 (December 18, 2020)

* Update Sailor version to 2.6.21
* Annual audit of the component code to check if it exposes a sensitive data in the logs
* Annual npm vulnerabilities audit

## 1.7.0 (May 22, 2020)

* Update Sailor version to 2.6.7
Expand Down
5 changes: 1 addition & 4 deletions lib/actions/pub.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ let topic;
*/
async function processAction(msg, cfg) {
this.logger.info('Start publish action');
this.logger.trace('Current config: %j', cfg);
const self = this;
const { projectId, topicName } = cfg;

Expand All @@ -31,8 +30,6 @@ async function processAction(msg, cfg) {
topic = pubsubClient.topic(topicName);
}

this.logger.trace('Publishing message %j', msg.body);

// Google PubSub expects the payload to be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object

let bufferData;
Expand All @@ -57,7 +54,7 @@ async function processAction(msg, cfg) {
const data = messages.newMessageWithBody(body);
self.emit('data', data);
} catch (err) {
this.logger.info('Oops! Error occurred', err);
this.logger.info('Oops! Error occurred');
self.emit('error', err);
}

Expand Down
6 changes: 2 additions & 4 deletions lib/triggers/pull.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const { v1 } = require('@google-cloud/pubsub');
async function processAction(msg, cfg) {
const self = this;
self.logger.info('Start pull trigger');
self.logger.debug('Current config: %j', cfg);

const { projectId, topicName } = cfg;
const subscriptionName = `eio_${process.env.ELASTICIO_TASK_ID}`;
Expand Down Expand Up @@ -57,7 +56,6 @@ async function processAction(msg, cfg) {
// eslint-disable-next-line no-restricted-syntax
for (const message of response.receivedMessages) {
self.logger.info(`Message received with ID: ${message.message.messageId}`);
self.logger.debug(`Message body: ${message.message.data}, Message ackId: ${message.ackId}`);
ackIds.push(message.ackId);
newMsg = messages.newMessageWithBody(message.message.data.toString());
newMsg.headers = message.message.attributes || {};
Expand All @@ -75,11 +73,11 @@ async function processAction(msg, cfg) {
subscription: formattedSubscription,
ackIds,
};
self.logger.debug('About to acknowledge retrieved messages:', ackRequest);
self.logger.debug('Acknowledging retrieved messages...');
await subClient.acknowledge(ackRequest);
}
} catch (err) {
this.logger.info('Oops! Error occurred', err);
this.logger.info('Oops! Error occurred');
throw err;
}
}
Expand Down
Loading

0 comments on commit a0d321c

Please sign in to comment.