Skip to content

Commit

Permalink
Update Vlocity build tools to version 1.11.1
Browse files Browse the repository at this point in the history
Patch dependency export bug in Vlocity 1.11.1
Provide more logging for broken dependencies during deploy
  • Loading branch information
Codeneos committed Jun 20, 2019
1 parent fc4269c commit c2e2331
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 40 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog Vlocode

## [0.10.7] - 2019-06-20
### Changed
- Update Vlocity package to 1.11.1
### Fixed
- FPatch VLocity package to avoid partial exports for datapacks with more then 10 dependencies

## [0.10.6] - 2019-06-14
### Fixed
- Fix export from server command fails
Expand Down
62 changes: 36 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vlocode",
"displayName": "Vlocode",
"description": "Vlocity datapack development and deployment extension",
"version": "0.10.6",
"version": "0.10.7",
"license": "MIT",
"icon": "resources/icon.png",
"author": {
Expand Down Expand Up @@ -395,6 +395,6 @@
"jsforce": "^1.9.1",
"salesforce-alm": "^45.18.0",
"sfdx-node": "^1.3.2",
"vlocity": "^1.10.0"
"vlocity": "^1.11.1"
}
}
12 changes: 0 additions & 12 deletions patches/vlocity+1.10.0.patch

This file was deleted.

88 changes: 88 additions & 0 deletions patches/vlocity+1.11.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
patch-package
--- a/node_modules/vlocity/lib/datapacks.js
+++ b/node_modules/vlocity/lib/datapacks.js
@@ -208,16 +208,17 @@ DataPacks.prototype.runDataPackProcess = async function(dataPackData, options) {
result.Total = 1;
}

- if (result.Total > 0
- && !result.Async
- && dataPackData.processType == "Export"
- && result.Status != "Complete"
- && (!options.maxDepth
- || options.maxDepth == -1)
- && options.exportPacksMaxSize
- && result.Total > options.exportPacksMaxSize) {
- result.Status = "Complete";
- }
+ // Disable this as it causes dependencies to be ommited resulting in partial exports.
+ // if (result.Total > 0
+ // && !result.Async
+ // && dataPackData.processType == "Export"
+ // && result.Status != "Complete"
+ // && (!options.maxDepth
+ // || options.maxDepth == -1)
+ // && options.exportPacksMaxSize
+ // && result.Total > options.exportPacksMaxSize) {
+ // result.Status = "Complete";
+ // }

if (result.Total > 0 && result.Async && result.Total == result.Finished) {
result.Finished--;
--- a/node_modules/vlocity/lib/datapacksbuilder.js
+++ b/node_modules/vlocity/lib/datapacksbuilder.js
@@ -688,12 +688,19 @@ DataPacksBuilder.prototype.getNextImports = function(importPath, jobInfo, curren
return;
}

- if (jobInfo.currentStatus[parentKey] != null
- && !(jobInfo.currentStatus[parentKey] == 'Success'
+ if (jobInfo.currentStatus[parentKey] != null ) {
+ if (jobInfo.currentStatus[parentKey] == 'Success'
|| jobInfo.currentStatus[parentKey] == 'Header'
- || jobInfo.currentStatus[parentKey] == 'AddedHeader')
- && currentDataPackKeysInImport[parentKey] != true) {
- needsParents = true;
+ || jobInfo.currentStatus[parentKey] == 'AddedHeader') {
+ VlocityUtils.verbose(`Parent deployed (datapack: ${dataPackKey}): ${parentKey}`);
+ } else if (currentDataPackKeysInImport[parentKey] == true) {
+ VlocityUtils.verbose(`Parent in current import (datapack: ${dataPackKey}): ${parentKey}`);
+ } else {
+ VlocityUtils.verbose(`Skipping over ${dataPackKey}; parent not yet deployed: ${parentKey}; parent status: ${jobInfo.currentStatus[parentKey]}`);
+ needsParents = true;
+ }
+ } else {
+ VlocityUtils.verbose(`Skipping unknown dependency ${parentKey} from datapack: ${dataPackKey}`);
}
});

@@ -751,6 +758,7 @@ DataPacksBuilder.prototype.getNextImports = function(importPath, jobInfo, curren
&& jobInfo.currentStatus[referenceKey]
&& !(jobInfo.currentStatus[referenceKey] == 'Success'
|| jobInfo.currentStatus[referenceKey] == 'Header')) {
+ VlocityUtils.log(`Skipping over ${dataPackKey}; refernce not yet deployed: ${referenceKey}`);
hasReference = true;
}
}
--- a/node_modules/vlocity/lib/datapacksjob.js
+++ b/node_modules/vlocity/lib/datapacksjob.js
@@ -2034,7 +2034,7 @@ DataPacksJob.prototype.deployPack = async function(inputMap) {
throw e;
}

- VlocityUtils.error('Error', 'Deploying Pack', e.stack);
+ VlocityUtils.error('Error', 'Deploying Pack', e.stack || e);
}
}

--- a/node_modules/vlocity/lib/utilityservice.js
+++ b/node_modules/vlocity/lib/utilityservice.js
@@ -382,7 +382,7 @@ UtilityService.prototype.getPackageVersion = async function() {

VlocityUtils.verbose('Get Package Version');

- if (!this.vlocity.packageVersion) {
+ if (!this.vlocity.PackageVersion) {
var result = await this.vlocity.jsForceConnection.query("SELECT DurableId, Id, IsSalesforce, MajorVersion, MinorVersion, Name, NamespacePrefix FROM Publisher where NamespacePrefix = \'" + this.vlocity.namespace + "\' LIMIT 1");

this.vlocity.buildToolsVersionSettings = yaml.safeLoad(fs.readFileSync(path.join(__dirname, "buildToolsVersionSettings.yaml"), 'utf8'));

0 comments on commit c2e2331

Please sign in to comment.