@sap/hdi-deploy
Advanced tools
Comparing version 3.11.4 to 3.11.6
@@ -0,1 +1,13 @@ | ||
## 3.11.6 | ||
Fixes: | ||
- remove duplicate messages when using the deployer as a library | ||
- update dependencies | ||
## 3.11.5 | ||
Fixes: | ||
- when used as a library, do not exit until all messages have been sent to the parent process | ||
Features: | ||
- use hana-client 2.4.162 | ||
## 3.11.4 | ||
@@ -2,0 +14,0 @@ Fixes: |
@@ -665,2 +665,5 @@ 'use strict'; | ||
let deployError; | ||
// Don't exit after this in case of deployment errors | ||
// we still need to send the messages to the parent! | ||
function processFilesAndDeploy(cb) { | ||
@@ -674,3 +677,9 @@ try { | ||
} else { | ||
deploy(opt, services, cb); | ||
deploy(opt, services, (e,r) => { | ||
if(e){ | ||
deployError = e; | ||
} | ||
return cb(undefined, r); | ||
}); | ||
} | ||
@@ -682,2 +691,11 @@ } catch (error) { | ||
function checkDeployError(cb){ | ||
return cb(deployError); | ||
} | ||
// Send all messages to the parent process that | ||
// We couldn't send JIT | ||
function sendAllMessages(cb){ | ||
return logger.sendAllMessages(cb); | ||
} | ||
function sendFinalMessageToParentProcess(cb) { | ||
@@ -747,3 +765,5 @@ var timeout; | ||
processFilesAndDeploy, | ||
sendFinalMessageToParentProcess | ||
sendAllMessages, | ||
sendFinalMessageToParentProcess, | ||
checkDeployError | ||
]; | ||
@@ -750,0 +770,0 @@ |
@@ -7,2 +7,3 @@ 'use strict'; | ||
var util = require('util'); | ||
const async = require('async'); | ||
@@ -167,8 +168,64 @@ var trace = process.env.TRACE; | ||
const couldNotSend = []; | ||
/** | ||
* Send the message - retry 5 times, waiting 1s between attempts | ||
* | ||
* @param {any} message Message to send to parent | ||
* @returns {AsyncFunction} | ||
*/ | ||
function send (message) { | ||
return function (cb) { | ||
/** | ||
* Attemp to send the message | ||
* | ||
* @param {any} attempt Current attempt | ||
* @returns {undefined} | ||
*/ | ||
function attemptToSendMessage (attempt) { | ||
if (attempt >= 5) { | ||
// after 5 attempts give up. | ||
return cb(new Error('Could not send message to parent process')); | ||
} | ||
process.send(message, function (err) { | ||
if (err) { | ||
var msg; | ||
if (err.message) { | ||
msg = err.message; | ||
} else { | ||
msg = err; | ||
} | ||
writeToStdErr('could not send message to parent process: ' + msg + '\n trying again in one second...'); | ||
setTimeout(attemptToSendMessage, 1000, attempt + 1); | ||
} else { | ||
return cb(); | ||
} | ||
}); | ||
} | ||
attemptToSendMessage(message); | ||
}; | ||
} | ||
exports.sendAllMessages = (cb) => { | ||
if (sendMessagesToParentProcess) { | ||
async.series(couldNotSend.map((m) => send(m)), cb); | ||
} else { | ||
return cb(); | ||
} | ||
}; | ||
exports.getLeftoverMessages = () => couldNotSend; | ||
exports.logToParent = function (message) { | ||
if (sendMessagesToParentProcess) { | ||
if (process.send) { | ||
process.send(message); | ||
if (!process.send(message)) { | ||
// Saving the message to send later | ||
couldNotSend.push(message); | ||
} | ||
} | ||
} | ||
}; |
@@ -10,2 +10,25 @@ 'use strict'; | ||
/** | ||
* Remove duplicate messages - detect duplicated by their "id" property. | ||
* | ||
* @param {String[]} messages Array of messages | ||
* @returns {String[]} Array of messages without duplicates | ||
*/ | ||
exports.dedupeMessagesById = function (messages) { | ||
const map = {}; | ||
const dedupedMessages = []; | ||
const length = messages.length; | ||
for (let i = 0; i < length; i++) { | ||
const message = messages[i]; | ||
if (!map[message.id]) { | ||
map[message.id] = true; | ||
dedupedMessages.push(message); | ||
} | ||
} | ||
return dedupedMessages; | ||
}; | ||
/** | ||
* Read the given file. Strip comments from the file before parsing it as JSON. | ||
@@ -12,0 +35,0 @@ * |
@@ -9,2 +9,3 @@ /* eslint no-console: 0 */ | ||
const fs = require('fs'); | ||
const { dedupeMessagesById } = require('./lib/utils'); | ||
@@ -98,2 +99,5 @@ /** | ||
} | ||
// Dedupe and sort messages, since they might be disordered due to "late sending" | ||
response.messages = dedupeMessagesById(response.messages); | ||
response.messages.sort((a, b) => parseInt(a.id) - parseInt(b.id)); | ||
return callback(null, response); | ||
@@ -100,0 +104,0 @@ }); |
{ | ||
"name": "@sap/hdi-deploy", | ||
"version": "3.11.4", | ||
"version": "3.11.6", | ||
"lockfileVersion": 1, | ||
@@ -8,3 +8,3 @@ "requires": true, | ||
"@sap/hana-client": { | ||
"version": "2.4.144", | ||
"version": "2.4.162", | ||
"requires": { | ||
@@ -26,5 +26,5 @@ "debug": "3.1.0" | ||
"@sap/hdi": { | ||
"version": "2.2.3", | ||
"version": "2.2.4", | ||
"requires": { | ||
"@sap/hana-client": "2.4.144", | ||
"@sap/hana-client": "2.4.162", | ||
"async": "3.1.0" | ||
@@ -58,3 +58,3 @@ } | ||
"commander": { | ||
"version": "2.20.1" | ||
"version": "2.20.3" | ||
}, | ||
@@ -68,3 +68,3 @@ "core-util-is": { | ||
"handlebars": { | ||
"version": "4.3.0", | ||
"version": "4.5.3", | ||
"requires": { | ||
@@ -94,6 +94,6 @@ "neo-async": "^2.6.0", | ||
"uglify-js": { | ||
"version": "3.6.0", | ||
"version": "3.6.9", | ||
"optional": true, | ||
"requires": { | ||
"commander": "~2.20.0", | ||
"commander": "~2.20.3", | ||
"source-map": "~0.6.1" | ||
@@ -100,0 +100,0 @@ } |
@@ -1,1 +0,1 @@ | ||
{"bundleDependencies":false,"dependencies":{"@sap/hana-client":"2.4.144","@sap/hdi":"2.2.3","@sap/xsenv":"1.2.9","async":"3.1.0","handlebars":"4.3.0"},"deprecated":false,"description":"HDI content deployment","devDependencies":{"command-line-args":"^4.0.7","command-line-usage":"^4.0.2","eslint":"^4.18.2","filter-node-package":"2.0.0","istanbul":"0.4.5","jshint":"2.9.4","mocha":"3.1.2","node-style":"^2.0.1","rewire":"2.5.2","semver":"^6.1.1","shelljs":"0.6.0","should":"11.1.1","sinon":"1.17.6","uuid":"3.1.0"},"engines":{"node":">=6.9.1 <=10.16.x"},"main":"deploy.js","name":"@sap/hdi-deploy","repository":{},"scripts":{"eslint":"eslint *.js lib/","lint":"jshint *.js lib/ test/","prepare-release":"clean-packages && npm prune --production && ls -al","start":"node deploy.js","test":"test/test-quick.sh","test-all":"test/test-all.sh","test-all-filtered":"test/test-all-filtered.sh","test-all-filtered.win":"test\\test-all-filtered.bat","test-all.js":"node test-all-filtered.js","test-all.win":"test\\test-all.bat","test.js":"node test-quick.js","test.win":"test\\test-quick.bat","wrap":"rm -rf node_modules && rm npm-shrinkwrap.json && npm install && npm dedupe && npm shrinkwrap && clean-shrinkwrap"},"version":"3.11.4","license":"SEE LICENSE IN developer-license-3.1.txt"} | ||
{"bundleDependencies":false,"dependencies":{"@sap/hana-client":"2.4.162","@sap/hdi":"2.2.4","@sap/xsenv":"1.2.9","async":"3.1.0","handlebars":"4.5.3"},"deprecated":false,"description":"HDI content deployment","devDependencies":{"command-line-args":"^4.0.7","command-line-usage":"^4.0.2","eslint":"^4.18.2","filter-node-package":"2.0.0","istanbul":"0.4.5","jshint":"2.9.4","mocha":"3.1.2","node-style":"^2.0.1","rewire":"2.5.2","semver":"^6.1.1","shelljs":"0.6.0","should":"11.1.1","sinon":"1.17.6","uuid":"3.1.0"},"engines":{"node":">=6.9.1 <=10.16.x"},"main":"deploy.js","name":"@sap/hdi-deploy","repository":{},"scripts":{"eslint":"eslint *.js lib/","lint":"jshint *.js lib/ test/","prepare-release":"clean-packages && npm prune --production && ls -al","start":"node deploy.js","test":"test/test-quick.sh","test-all":"test/test-all.sh","test-all-filtered":"test/test-all-filtered.sh","test-all-filtered.win":"test\\test-all-filtered.bat","test-all.js":"node test-all-filtered.js","test-all.win":"test\\test-all.bat","test.js":"node test-quick.js","test.win":"test\\test-quick.bat","wrap":"rm -rf node_modules && rm npm-shrinkwrap.json && npm install && npm dedupe && npm shrinkwrap && clean-shrinkwrap"},"version":"3.11.6","license":"SEE LICENSE IN developer-license-3.1.txt"} |
@@ -104,3 +104,3 @@ @sap/hdi-deploy | ||
"dependencies": { | ||
"@sap/hdi-deploy": "3.11.4" | ||
"@sap/hdi-deploy": "3.11.6" | ||
}, | ||
@@ -519,3 +519,3 @@ "scripts": { | ||
"dependencies": { | ||
"@sap/hdi-deploy": "3.11.4", | ||
"@sap/hdi-deploy": "3.11.6", | ||
"module1": "1.3.1", | ||
@@ -1044,3 +1044,3 @@ "module2": "1.7.0" | ||
"name": "@sap/hdi-deploy", | ||
"version": "3.11.4", | ||
"version": "3.11.6", | ||
"features": { | ||
@@ -1047,0 +1047,0 @@ "info": 2, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
544697
9595
1
+ Added@sap/hana-client@2.4.162(transitive)
+ Added@sap/hdi@2.2.4(transitive)
+ Addedhandlebars@4.5.3(transitive)
- Removed@sap/hana-client@2.4.1392.4.144(transitive)
- Removed@sap/hdi@2.2.3(transitive)
- Removedhandlebars@4.3.0(transitive)
Updated@sap/hana-client@2.4.162
Updated@sap/hdi@2.2.4
Updatedhandlebars@4.5.3