Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix 4.3.4 #764

Merged
merged 24 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d5fcec5
#748: fully resolve asset-template content
JoernBerkefeld Feb 17, 2023
f7776e3
#748: standardize asset-message main content's file name
JoernBerkefeld Feb 17, 2023
ba8b301
#748: standardize asset-template's main extract's file name
JoernBerkefeld Feb 17, 2023
58ba657
#750: fix deploying only specified subtype
JoernBerkefeld Feb 17, 2023
a30f40f
#0: add "create PR to hotfix branch" for gitfork
JoernBerkefeld Feb 17, 2023
1a4c7cf
#750: explain type rewrites
JoernBerkefeld Feb 17, 2023
5951876
Merge pull request #751 from Accenture/bugfix/750-deploy-asset-subtyp…
JoernBerkefeld Feb 17, 2023
43edec6
Merge remote-tracking branch 'origin/hotfix' into bugfix/748-asset-te…
JoernBerkefeld Feb 17, 2023
7513f98
Merge pull request #752 from Accenture/bugfix/748-asset-template-can-…
JoernBerkefeld Feb 17, 2023
4b9709c
#747: SSJS support for codesnippets
JoernBerkefeld Feb 17, 2023
3ee3c56
#0: fix field-unknown debug msgs for the MIDs saved inside of busines…
JoernBerkefeld Feb 20, 2023
299d548
#747: add robust way of deciding if code block is SSJS or not and ext…
JoernBerkefeld Feb 20, 2023
c4a571b
#0: cleanup old code
JoernBerkefeld Feb 20, 2023
3343d1c
#747: improve regex to recognize edge cases
JoernBerkefeld Feb 20, 2023
4ddac12
Merge pull request #754 from Accenture/bugfix/747-code-snippets-made-…
JoernBerkefeld Feb 20, 2023
4db81cf
#747: clean up logs
JoernBerkefeld Feb 20, 2023
3c60fe5
Merge pull request #758 from Accenture/bugfix/747-code-snippets-made-…
JoernBerkefeld Feb 20, 2023
d5280d2
#706: ensure metadata is fully copied with all its extracted code blo…
JoernBerkefeld Feb 21, 2023
db8ba4e
#761: fix deploy folder not getting purged by createDeltaPkg
JoernBerkefeld Feb 21, 2023
8f58b87
Merge pull request #762 from Accenture/bugfix/757-cdp-command-does-no…
JoernBerkefeld Feb 21, 2023
1d64c04
#753: fix retrieve asset-subtype key
JoernBerkefeld Feb 21, 2023
623d775
Merge pull request #763 from Accenture/bugfix/753-regression-retrieve…
JoernBerkefeld Feb 21, 2023
66dd6ea
4.3.4
JoernBerkefeld Feb 21, 2023
bda0788
#0: prep 4.3.4
JoernBerkefeld Feb 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .fork/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"useTabs": false,
"tabWidth": 2,
"printWidth": 40,
"trailingComma": "none"
}
14 changes: 13 additions & 1 deletion .fork/custom-commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,17 @@
"type": "url",
"url": "https://github.com/Accenture/sfmc-devtools/compare/develop...$shortname?expand=1"
}
},
{
"name": "Create PR to hotfix branch",
"target": "ref",
"refTargets": [
"localbranch",
"remotebranch"
],
"action": {
"type": "url",
"url": "https://github.com/Accenture/sfmc-devtools/compare/hotfix...$shortname?expand=1"
}
}
]
]
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ body:
label: Version
description: What version of our software are you running? (mcdev --version)
options:
- 4.3.4
- 4.3.3
- 4.3.2
- 4.3.1
Expand Down
1 change: 1 addition & 0 deletions boilerplate/files/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"*-meta.ssjs": "${capture}-meta.json",
"*.asset-asset-meta.html": "${dirname}.asset-asset-meta.json",
"*.asset-message-meta.html": "${dirname}.asset-message-meta.json",
"*.asset-template-meta.html": "${dirname}.asset-template-meta.json",
"*.css": "${capture}.asset-code-meta.json",
"*.docx": "${capture}.asset-document-meta.json",
"*.eps": "${capture}.asset-image-meta.json",
Expand Down
4 changes: 4 additions & 0 deletions boilerplate/forcedUpdates.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[
{
"version": "4.3.4",
"files": [".vscode/settings.json"]
},
{
"version": "4.1.12",
"files": [".vscode/settings.json"]
Expand Down
68 changes: 65 additions & 3 deletions docs/dist/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5096,6 +5096,7 @@ CLI entry for SFMC DevTools
* [.logSubtypes(subTypeArr)](#Util.logSubtypes) ⇒ <code>void</code>
* [.getKeysString(keyArr, [isId])](#Util.getKeysString) ⇒ <code>string</code>
* [.sleep(ms)](#Util.sleep) ⇒ <code>Promise.&lt;void&gt;</code>
* [.getSsjs(code)](#Util.getSsjs) ⇒ <code>string</code>

<a name="Util.skipInteraction"></a>

Expand Down Expand Up @@ -5402,6 +5403,33 @@ pause execution of code; useful when multiple server calls are dependent on each
| --- | --- | --- |
| ms | <code>number</code> | time in miliseconds to wait |

<a name="Util.getSsjs"></a>

### Util.getSsjs(code) ⇒ <code>string</code>
helper for [_extractCode](#Asset._extractCode) and [prepExtractedCode](#Script.prepExtractedCode) to determine if a code block is a valid SSJS block

**Kind**: static method of [<code>Util</code>](#Util)
**Returns**: <code>string</code> - the SSJS code if code block is a valid SSJS block, otherwise null

| Param | Type | Description |
| --- | --- | --- |
| code | <code>string</code> | code block to check |

**Example**
```js
the following is invalid:
<script runat="server">
// 1
</script>
<script runat="server">
// 2
</script>

the following is valid:
<script runat="server">
// 3
</script>
```
<a name="MetadataTypeDefinitions"></a>

## MetadataTypeDefinitions
Expand Down Expand Up @@ -5665,7 +5693,8 @@ DevOps helper class
* [DevOps](#DevOps)
* [.getDeltaList(properties, [range], [saveToDeployDir], [filterPaths])](#DevOps.getDeltaList) ⇒ <code>Promise.&lt;Array.&lt;TYPE.DeltaPkgItem&gt;&gt;</code>
* [~delta](#DevOps.getDeltaList..delta) : <code>Array.&lt;TYPE.DeltaPkgItem&gt;</code>
* [~copied](#DevOps.getDeltaList..copied) : <code>TYPE.DeltaPkgItem</code>
* [~buObjects](#DevOps.getDeltaList..buObjects) : <code>Object.&lt;string, TYPE.BuObject&gt;</code>
* [~copied](#DevOps.getDeltaList..copied) : <code>Array.&lt;TYPE.DeltaPkgItem&gt;</code>
* [.buildDeltaDefinitions(properties, range, [diffArr])](#DevOps.buildDeltaDefinitions) ⇒ <code>Promise.&lt;Array.&lt;TYPE.DeltaPkgItem&gt;&gt;</code>
* [~deltaDeployAll](#DevOps.buildDeltaDefinitions..deltaDeployAll) : <code>Array.&lt;TYPE.DeltaPkgItem&gt;</code>
* [.document(directory, jsonReport)](#DevOps.document) ⇒ <code>void</code>
Expand All @@ -5690,15 +5719,20 @@ Interactive commit selection if no commits are passed.

* [.getDeltaList(properties, [range], [saveToDeployDir], [filterPaths])](#DevOps.getDeltaList) ⇒ <code>Promise.&lt;Array.&lt;TYPE.DeltaPkgItem&gt;&gt;</code>
* [~delta](#DevOps.getDeltaList..delta) : <code>Array.&lt;TYPE.DeltaPkgItem&gt;</code>
* [~copied](#DevOps.getDeltaList..copied) : <code>TYPE.DeltaPkgItem</code>
* [~buObjects](#DevOps.getDeltaList..buObjects) : <code>Object.&lt;string, TYPE.BuObject&gt;</code>
* [~copied](#DevOps.getDeltaList..copied) : <code>Array.&lt;TYPE.DeltaPkgItem&gt;</code>

<a name="DevOps.getDeltaList..delta"></a>

#### getDeltaList~delta : <code>Array.&lt;TYPE.DeltaPkgItem&gt;</code>
**Kind**: inner constant of [<code>getDeltaList</code>](#DevOps.getDeltaList)
<a name="DevOps.getDeltaList..buObjects"></a>

#### getDeltaList~buObjects : <code>Object.&lt;string, TYPE.BuObject&gt;</code>
**Kind**: inner constant of [<code>getDeltaList</code>](#DevOps.getDeltaList)
<a name="DevOps.getDeltaList..copied"></a>

#### getDeltaList~copied : <code>TYPE.DeltaPkgItem</code>
#### getDeltaList~copied : <code>Array.&lt;TYPE.DeltaPkgItem&gt;</code>
**Kind**: inner constant of [<code>getDeltaList</code>](#DevOps.getDeltaList)
<a name="DevOps.buildDeltaDefinitions"></a>

Expand Down Expand Up @@ -6911,6 +6945,7 @@ Util that contains logger and simple util methods
* [.logSubtypes(subTypeArr)](#Util.logSubtypes) ⇒ <code>void</code>
* [.getKeysString(keyArr, [isId])](#Util.getKeysString) ⇒ <code>string</code>
* [.sleep(ms)](#Util.sleep) ⇒ <code>Promise.&lt;void&gt;</code>
* [.getSsjs(code)](#Util.getSsjs) ⇒ <code>string</code>

<a name="Util.skipInteraction"></a>

Expand Down Expand Up @@ -7217,6 +7252,33 @@ pause execution of code; useful when multiple server calls are dependent on each
| --- | --- | --- |
| ms | <code>number</code> | time in miliseconds to wait |

<a name="Util.getSsjs"></a>

### Util.getSsjs(code) ⇒ <code>string</code>
helper for [_extractCode](#Asset._extractCode) and [prepExtractedCode](#Script.prepExtractedCode) to determine if a code block is a valid SSJS block

**Kind**: static method of [<code>Util</code>](#Util)
**Returns**: <code>string</code> - the SSJS code if code block is a valid SSJS block, otherwise null

| Param | Type | Description |
| --- | --- | --- |
| code | <code>string</code> | code block to check |

**Example**
```js
the following is invalid:
<script runat="server">
// 1
</script>
<script runat="server">
// 2
</script>

the following is valid:
<script runat="server">
// 3
</script>
```
<a name="csvToArray"></a>

## csvToArray(csv) ⇒ <code>Array.&lt;string&gt;</code>
Expand Down
9 changes: 4 additions & 5 deletions lib/Deployer.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class Deployer {
// prep folders for auto-creation
MetadataTypeInfo.folder.client = auth.getSDK(buObject);
MetadataTypeInfo.folder.properties = this.properties;
// Remove tmp folder of previous deploys
File.removeSync('tmp');
}
/**
* Deploys all metadata located in the 'deploy' directory to the specified business unit
Expand Down Expand Up @@ -239,13 +237,14 @@ class Deployer {
);
}
const foundDeployTypes = Object.keys(this.metadata)
// remove empty types
.filter((type) => Object.keys(this.metadata[type]).length)
// make sure we keep the subtype in this list if that's what the user defined
.map((type) =>
type === 'asset' && Util.includesStartsWith(typeArr, type)
? typeArr[Util.includesStartsWithIndex(typeArr, type)]
: type
)
// remove empty types
.filter((type) => Object.keys(this.metadata[type]).length);
);
if (!foundDeployTypes.length) {
throw new Error('No metadata found for deployment');
}
Expand Down
5 changes: 4 additions & 1 deletion lib/Retriever.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ class Retriever {
for (const type in deployOrder) {
const subTypeArr = deployOrder[type];
// if types were added by getMetadataHierachy() for caching, make sure the key-list is set to [null] for them which will retrieve all
typeKeyMap[type] = typeKeyMap[type] || [null];
// if we have a subtype, we need to find the correct key-list for it
typeKeyMap[type] = typeKeyMap[type] ||
typeKeyMap[Object.keys(typeKeyMap).find((k) => k.startsWith(type + '-'))] || [null];

// add client to metadata process class instead of passing every time
MetadataTypeInfo[type].client = auth.getSDK(this.buObject);
MetadataTypeInfo[type].properties = this.properties;
Expand Down
Loading