Skip to content

Commit ad5449a

Browse files
author
Adam Rutland
authored
Merge pull request #142 from vlocityinc/next
v1.8 - New Minor Version - Enhancements for Delta Deploy and Error Messaging
2 parents 5a589bc + 4e9d40d commit ad5449a

File tree

69 files changed

+69198
-2206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+69198
-2206
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
build_*.properties
22
dataPacksJobs/
3+
coverage/
34
!dataPacksJobs/Example.yaml
45
!dataPacksJobs/QueryDefinitions.yaml
56
!dataPacksJobs/ReadMeExample.yaml
@@ -8,6 +9,7 @@ node_modules/
89
vlocity-temp/
910
example_vlocity_build/
1011
test/testJobRunning/
12+
.nyc_output/
1113
.vscode/
1214
.sfdx/
1315
.npmrc

DataPackSettings/latest/DataRaptor/Attribute-Assignment-Rule-Migration/Attribute-Assignment-Rule-Migration_Mappings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"%vlocity_namespace%__FilterGroup__c": 2,
2222
"%vlocity_namespace%__FilterOperator__c": "=",
2323
"%vlocity_namespace%__FilterValue__c": "Id",
24-
"%vlocity_namespace%__InterfaceFieldAPIName__c": "%vlocity_namespace%__AttributeId__c",
24+
"%vlocity_namespace%__InterfaceFieldAPIName__c": "%vlocity_namespace%__AttributeCategoryId__c",
2525
"%vlocity_namespace%__InterfaceObjectLookupOrder__c": 1,
2626
"%vlocity_namespace%__InterfaceObjectName__c": "%vlocity_namespace%__AttributeAssignmentRule__c",
2727
"%vlocity_namespace%__MapId__c": "Attribute Assignment Rule Migration1",

DataPackSettings/latest/DataRaptor/OmniScript-Migration/OmniScript-Migration_Mappings.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"%vlocity_namespace%__DomainObjectFieldAPIName__c": "%vlocity_namespace%__OmniScript__c",
2121
"%vlocity_namespace%__FilterGroup__c": 2,
2222
"%vlocity_namespace%__FilterOperator__c": "=",
23-
"%vlocity_namespace%__FilterValue__c": "'true'",
23+
"%vlocity_namespace%__FilterValue__c": "'$Vlocity.TRUE'",
2424
"%vlocity_namespace%__InterfaceFieldAPIName__c": "%vlocity_namespace%__IsActive__c",
2525
"%vlocity_namespace%__InterfaceObjectLookupOrder__c": 1,
2626
"%vlocity_namespace%__InterfaceObjectName__c": "%vlocity_namespace%__OmniScript__c",
@@ -498,7 +498,7 @@
498498
},
499499
{
500500
"%vlocity_namespace%__ConfigurationAttribute__c": "Document",
501-
"%vlocity_namespace%__ConfigurationCategory__c": "Sibling",
501+
"%vlocity_namespace%__ConfigurationCategory__c": "Parent",
502502
"%vlocity_namespace%__ConfigurationProcess__c": "Export",
503503
"%vlocity_namespace%__ConfigurationType__c": "Relationship",
504504
"%vlocity_namespace%__ConfigurationValue__c": "%vlocity_namespace%__OmniScript__c:%vlocity_namespace%__Element__c:%vlocity_namespace%__PropertySet__c:documentNames",
@@ -654,6 +654,21 @@
654654
"VlocityDataPackType": "SObject",
655655
"VlocityRecordSObjectType": "%vlocity_namespace%__DRMapItem__c"
656656
},
657+
{
658+
"%vlocity_namespace%__ConfigurationAttribute__c": "VlocityUITemplate",
659+
"%vlocity_namespace%__ConfigurationCategory__c": "Parent",
660+
"%vlocity_namespace%__ConfigurationProcess__c": "Export",
661+
"%vlocity_namespace%__ConfigurationType__c": "Relationship",
662+
"%vlocity_namespace%__ConfigurationValue__c": "%vlocity_namespace%__OmniScript__c:%vlocity_namespace%__ElementTypeToHTMLTemplateList__c:ElementTypeToHTMLTemplateList",
663+
"%vlocity_namespace%__DomainObjectAPIName__c": "Configuration",
664+
"%vlocity_namespace%__DomainObjectCreationOrder__c": 0,
665+
"%vlocity_namespace%__DomainObjectFieldAPIName__c": "Configuration",
666+
"%vlocity_namespace%__InterfaceFieldAPIName__c": "Configuration",
667+
"%vlocity_namespace%__MapId__c": "OmniScript Migration411",
668+
"Name": "OmniScript Migration",
669+
"VlocityDataPackType": "SObject",
670+
"VlocityRecordSObjectType": "%vlocity_namespace%__DRMapItem__c"
671+
},
657672
{
658673
"%vlocity_namespace%__ConfigurationAttribute__c": "VlocityUITemplate",
659674
"%vlocity_namespace%__ConfigurationCategory__c": "Parent",

README.md

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,41 @@
33

44
Vlocity Build is a command line tool to export and deploy Vlocity DataPacks in a source control friendly format through a YAML Manifest describing your project. Its primary goal is to enable Continuous Integration for Vlocity Metadata through source control. It is written as a Node.js Command Line Tool.
55

6-
# Recent Major Changes
6+
# Recent Features
7+
--------
8+
9+
## v1.8 - Delta Deploys / Exports, Error Message Enhancements, Git Changes Based Deploys, and Auto Update Settings
10+
### Delta Deploys / Exports
11+
Add `deltaCheck: true` to your job file to enable checking to see if there are changes to the the items you are about to deploy or export. This check will run much faster than the getDiffsAndDeploy check, but at this time 100% consistency is not gauranteed for all DataPack Types. The checks will error on the side of caution and run the deploy /export automatically for any DataPack Type that may have changes.
12+
13+
### Error Message Enhancements
14+
Error messages have been improved to give more instrution on how to fix issues. An example change is as follows:
15+
16+
##### Previous:
17+
`Error >> AttributeCategory/ATTRIBUTE_CATEGORY --- ATTRIBUTE_CATEGORY --- duplicate value found: <unknown> duplicates value on record with id: <unknown>`
18+
19+
##### New:
20+
`Error >> AttributeCategory/ATTRIBUTE_CATEGORY -- DataPack >> ATTRIBUTE_CATEGORY -- Error Message -- duplicate field value found: 100 on the field: vlocity_cmt__DisplaySequence__c on record with id: a0K0b00000XabWUEAZ -- Change the vlocity_cmt__DisplaySequence__c field value of the vlocity_cmt__AttributeCategory__c on record with id: a0K0b00000XabWUEAZ in the target org to resolve the issue.`
21+
22+
### Git Changes Based Deploys
23+
Add `gitCheck: true` to your job file to enable checking what the latest git hash was before deploying to the target org. With this setting *only* the DataPacks that have changed between the previous git hash and the latest git hash will be deployed to the org.
24+
25+
### Auto Update Settings
26+
Add `autoUpdateSettings: true` to your job file to enable checking that you have the latest DataPack settings before every export and deploy. This check is very fast and it is advised that this is enabled.
27+
28+
## v1.7
29+
### OmniScript and IntegrationProcedure
30+
The OmniScript and IntegrationProcedure DataPacks have been modified to remove the Order and Level. This means that merging changes for these objects is now much easier.
31+
32+
### SFDX
33+
Authentication with Salesforce DX credentials is now possible. Use `-sfdx.username` to use a Salesforce DX Authorized Org for `vlocity` commands. Once you are passing this parameter you will not need a password or any other propertyfile information. The Salesforce DX Authorization from `sfdx force:org:display -u <username>` will handle all the information. Passing an alias will work as well.
34+
35+
# Recent Data Model Changes
736
--------
837

38+
## v1.8
39+
There were no data model changes for v1.8
40+
941
## v1.7 - OmniScript and IntegrationProcedure
1042
The OmniScript and IntegrationProcedure DataPacks have been modified to remove the Order and Level fields which previously controlled how the OmniScript Elements were ordered in the UI. Now the Elements__c Array in the OmniScript `_DataPack.json` file is ordered in the display order of the UI.
1143

@@ -28,16 +60,8 @@ If you have any issues with these changes you can install the previous version o
2860
npm install --global https://github.com/vlocityinc/vlocity_build#v1.5.7
2961
```
3062

31-
# Recent Features
32-
--------
33-
34-
## v1.7 - OmniScript and IntegrationProcedure
35-
The OmniScript and IntegrationProcedure DataPacks have been modified to remove the Order and Level. This means that merging changes for these objects is now much easier.
36-
37-
## v1.7 - SFDX
38-
Authentication with Salesforce DX credentials is now possible. Use `-sfdx.username` to use a Salesforce DX Authorized Org for `vlocity` commands. Once you are passing this parameter you will not need a password or any other propertyfile information. The Salesforce DX Authorization from `sfdx force:org:display -u <username>` will handle all the information. Passing an alias will work as well.
39-
40-
## Table of Contents
63+
# Table of Contents
64+
-----------
4165
* [Installation Instructions](#installation-instructions)
4266
* [Getting Started](#getting-started)
4367
* [Step by Step Guide](#step-by-step-guide)
@@ -57,6 +81,7 @@ Authentication with Salesforce DX credentials is now possible. Use `-sfdx.userna
5781
* [Advanced](#advanced)
5882
* [Matching Keys](#matching-keys)
5983
* [OmniOut](#omniout)
84+
* [Known Issues](#known-issues)
6085

6186
# Installation Instructions
6287
-----------
@@ -71,7 +96,7 @@ This project requires Node Version 8+.
7196
Use `node -v` to find out which version you are on.
7297

7398
## Install Vlocity Build through NPM
74-
You can install this package linke any other Node Package! *Do not clone the repo!*
99+
You can install this package like any other Node Package! *Do not clone the repo!*
75100
```bash
76101
npm install --global vlocity
77102
vlocity help
@@ -279,7 +304,7 @@ vlocity -propertyfile build_target.properties -job EPC.yaml packRetry # If any e
279304
### New Sandbox Orgs
280305
If you have recently installed the Vlocity Managed Package or created a Sandbox Org that is not a Full Copy Sandbox and have done *no* development this Salesforce Org, you should run the following command to load all the default Vlocity Metadata:
281306
```bash
282-
vlocity -propertyfile build_target.properties --nojob packUpdateSettings refreshVlocityBase
307+
vlocity -propertyfile build_target.properties --nojob packUpdateSettings installVlocityInitial
283308
```
284309
This will install the Base UI Templates, CPQ Base Templates, EPC Default Objects and any other default data delivered through Vlocity DataPacks. This command should only be run if the Org was not previously used for Vlocity Development.
285310

@@ -320,10 +345,8 @@ sfdx force:mdapi:deploy --deploydir managed_packages/vlocity_package --wait -1 -
320345
# Push Salesforce part of Project
321346
sfdx force:source:push --targetusername $SF_USERNAME
322347

323-
# Refresh Vlocity Base - Installs all the Base DataPacks that can also be installed manually through
324-
# the Vlocity Cards and Vlocity UI Templates Home Screens -
325-
# Should only be run on newly created Orgs - Never in Production!
326-
# vlocity -sfdx.username $SF_USERNAME -job VlocityComponents.yaml refreshVlocityBase
348+
# Refresh Vlocity Base - Installs all the Vlocity Authored Vlocity Cards and Vlocity UI Templates
349+
vlocity -sfdx.username $SF_USERNAME -job VlocityComponents.yaml refreshVlocityBase
327350

328351
# Update Settings
329352
vlocity -sfdx.username $SF_USERNAME -job VlocityComponents.yaml packUpdateSettings
@@ -337,7 +360,7 @@ The managed package in the example is installed through the Metadata API with `s
337360

338361
```xml
339362
<InstalledPackage xmlns="http://soap.sforce.com/2006/04/metadata">
340-
<versionNumber>900.171.0</versionNumber>
363+
<versionNumber>900.208.0</versionNumber>
341364
</InstalledPackage>
342365
```
343366

@@ -542,6 +565,7 @@ This will provide a list of files that are different locally than in the org. In
542565
`runApex`: Runs Anonymous Apex specified in the option -apex at the specified path or in the /apex folder
543566
`packGetAllAvailableExports`: Get list of all DataPacks that can be exported
544567
`refreshVlocityBase`: Deploy and Activate the Base Vlocity DataPacks included in the Managed Package
568+
`installVlocityInitial`: Deploy and Activate the Base Vlocity DataPacks and Configuration DataPacks included in the Managed Package
545569

546570
## Example Commands
547571

@@ -650,6 +674,7 @@ The Job file additionally supports some Vlocity Build based options and the opti
650674
| json | Output the result of the Job as JSON Only. Used in CLI API applications | Boolean | false |
651675
| json-pretty | Output the result of the Job as more readable JSON Only. Used in CLI API applications | Boolean | false |
652676
| job | Path to job file | String | none |
677+
| key | DataPack Key to Export or Deploy | String | none |
653678
| manifest | JSON of VlocityDataPackKeys to be processed | JSON | none |
654679
| simpleLogging | Remove the colors from console output. Good for Automation servers. | Boolean | false |
655680
| nojob | Run command without specifying a Job File. Will use all default settings | Boolean | false |
@@ -1207,3 +1232,9 @@ In order to Retrieve the OmniScripts that will be deployed as part of the OmniOu
12071232
`vlocity -propertyfile <filepath> -job <filepath> runJavaScript -js omniOutRetrieve.js`
12081233

12091234
This will export the retrieved files into the folder `OmniOut/scripts` in your Project.
1235+
1236+
# Known Issues
1237+
-----------
1238+
1239+
* When Multi Currency is enabled, you can only deploy data exported from another Multi Currency Org or to deploy to another Multi Currency Org. Non Multi Currency to Multi Currency Export / Deploy will not work as expected.
1240+
* OmniScripts that are embedded in many other OmniScripts cannot be activated due to SOQL Query limits.

apex/RemoveOldAttributeAssignments.cls

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
List<vlocity_namespace__AttributeAssignment__c> toDelete = new List<vlocity_namespace__AttributeAssignment__c>();
1+
Map<Id, vlocity_namespace__AttributeAssignment__c> toDelete = new Map<Id, vlocity_namespace__AttributeAssignment__c>();
22

33
Set<Id> allIds = new Set<Id>();
44
Set<Schema.SObjectType> types = new Set<Schema.SObjectType>();
@@ -16,14 +16,14 @@ for (vlocity_namespace__AttributeAssignment__c att : [ SELECT vlocity_namespace_
1616
}
1717
else
1818
{
19-
toDelete.add(att);
19+
toDelete.put(att.Id, att);
2020
}
2121
}
2222
catch (Exception e)
2323
{
2424
System.debug(e);
2525

26-
toDelete.add(att);
26+
toDelete.put(att.Id, att);
2727
}
2828
}
2929

@@ -43,11 +43,11 @@ for (vlocity_namespace__AttributeAssignment__c att : [ SELECT vlocity_namespace_
4343
{
4444
if (!allFoundIds.contains((Id)att.vlocity_namespace__ObjectId__c))
4545
{
46-
toDelete.add(att);
46+
toDelete.put(att.Id, att);
4747
allDeletedIds.add(att.Id);
4848
}
4949
}
5050

5151
delete [ SELECT Id FROM vlocity_namespace__OverrideDefinition__c WHERE vlocity_namespace__OverriddenAttributeAssignmentId__c in :allDeletedIds OR vlocity_namespace__OverridingAttributeAssignmentId__c in :allDeletedIds ];
5252

53-
delete toDelete;
53+
delete toDelete.values();

codeship/encrypted_files/jwt.key

0 Bytes
Binary file not shown.

codeship/encrypted_files/npmrc

0 Bytes
Binary file not shown.

codeship/encrypted_files/test.sfdx

0 Bytes
Binary file not shown.

codeship/env.encrypted

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
codeship:v2
2-
p+hofCEUeihsEgzPEwKyg8Et66Us8m5UahR/dQNB09cdviLXVq2cQBP4S84//sQ7KwJo++0DfxJcMNr1Zv3UxVEGKaW70EzdkqLuwYk3PeziCUvOgelPQ2BbJ/V6vyaJkw0IpFOP1ifx0qbLdiogpTqtB9mzSqZDr63daRDzMJ5WPTRdYG77rx5E9DFqyWD7f9odJqU7s39QnXDpoqF27LzAZDXngenLQmbY8PWW7Kf+RKV/2ZBjuYIvE8qfLFd+XEvMaA8vJsWzyuC3JcmrZnyzC9azTrznEw0Q0IXJNPIJR5ccoKKo+97cOGDmY4d7ROCotoDFbZWtfkBlco71rUjIMbCmzyvs41/Ddn9viH6aN1WukURj603HxrCp0hEH3f9m3g==
2+
Q1MCEppg8jb0cRYltQw31QBtHOEL++m6bR8bxnP25B0I4X1xkPz3+NfUDVBib5hx6QN9XxFTMYYNpD3xRxp5jDKf+QlzZGKboPWRQqUwYsT3qiH4PEwlyyPvNBwZXxfouLkKTLL60TOIuCvnKe5D+s7geulqMVMN2pw/tSt9UrCLBPFieYO1V7rNZsBB1etuXMhdK+jCTirhfu3LBzPa5k6YFvp2YZybPT7G2+3KYghlEWkaHxfOvyxdG4TcQa3b+5WHgsWue8Ji8KNX7M5hnm7czkkO8JSrRRYfFJ/Ix08trmn16ffQMlDJ/tG3nrQfT5Q7jboHC1pPZbkwbRev9jZD4zGoXv0jU8zvmIoBPfd+V4f9CfK0/QLghcC4chkiQ+B49w==

codeship/publish.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,22 @@ set -e
44
if [ $CI_BRANCH == "master" ]; then
55
CURRENT_VERSION=`npm show vlocity version`
66
npm version $CURRENT_VERSION --no-git-tag-version --allow-same-version
7-
npm version patch --no-git-tag-version
7+
8+
if [[ $CI_COMMIT_MESSAGE == *"New Minor Version"* ]]; then
9+
npm version minor --no-git-tag-version
10+
else
11+
npm version patch --no-git-tag-version
12+
fi
813
else
914
CURRENT_VERSION=`npm show vlocity@$CI_BRANCH version`
1015
npm version $CURRENT_VERSION --no-git-tag-version
16+
17+
echo $CI_COMMIT_MESSAGE
18+
19+
if [[ $CI_COMMIT_MESSAGE == *"New Minor Version"* ]]; then
20+
npm version minor --no-git-tag-version
21+
fi
22+
1123
npm version prerelease --no-git-tag-version
1224
fi
1325

0 commit comments

Comments
 (0)