Skip to content

Commit

Permalink
Merge pull request #604 from Accenture/develop
Browse files Browse the repository at this point in the history
4.2.0
  • Loading branch information
JoernBerkefeld authored Dec 12, 2022
2 parents b4cfee4 + c706bd5 commit 1861682
Show file tree
Hide file tree
Showing 121 changed files with 6,509 additions and 2,414 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2020,
"ecmaVersion": 2022,
"sourceType": "module"
},
"root": true,
Expand Down
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.2.0
- 4.1.12
- 4.1.11
- 4.1.10
Expand Down
5 changes: 2 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ _Please delete options that are not relevant._
## Checklist

- [ ] I have performed a self-review of my own code
- [ ] ran `npm run test` to with 0 tests failing
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] ran `npm run test` to with 0 tests failing
- [ ] ESLint & Prettier are not outputting errors or warnings
- [ ] README.md updated (if applicable)
- [ ] Release Notes updated
- [ ] Wiki updated (if applicable)
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ tmp/
.mcdevrc.json
.vscode/tasks.json
!test/mockRoot/*
/.nyc_output/
5 changes: 5 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"all": true,
"include": ["lib/**"],
"exclude": ["lib/metadataTypes/definitions/*.js", "test/**", "types/**"]
}
1,562 changes: 34 additions & 1,528 deletions README.md

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions boilerplate/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,10 @@
},
"marketList": {
"deployment-source": {
"description": "Define one 1:1 BU-Market combo here to as source for automated creation of deployment packages; you can create more than one source market list",
"MySandbox/DEV-NL": "DEV-NL"
"description": "Define one 1:1 BU-Market combo here to as source for automated creation of deployment packages; you can create more than one source market list"
},
"deployment-target": {
"description": "Define n BU-Market combo here to as target for automated creation of deployment packages; you can create more than one target market list and they can be as complex as you like",
"MySandbox/QA-DE": "QA-DE",
"MyProduction/PROD-DE": "PROD-DE",
"MyProduction/PROD-NL": "PROD-NL"
"description": "Define n BU-Market combo here to as target for automated creation of deployment packages; you can create more than one target market list and they can be as complex as you like"
}
},
"metaDataTypes": {
Expand Down
1 change: 1 addition & 0 deletions boilerplate/files/.vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"sergey-agadzhanov.ampscript",
"FiB.beautyAmp",

// Markdown / Readme.md
"joernberkefeld.markdown-preview-bitbucket-innersource"
Expand Down
3 changes: 3 additions & 0 deletions boilerplate/files/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,8 @@
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[AMPscript]": {
"editor.defaultFormatter": "FiB.beautyAmp"
}
}
463 changes: 434 additions & 29 deletions docs/dist/documentation.md

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions lib/Deployer.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ class Deployer {
) {
const buObject = await Cli.getCredentialObject(
properties,
cred !== null ? cred + '/' + bu : null,
cred === null ? null : cred + '/' + bu,
null,
true
);
if (buObject !== null) {
if (buObject === null) {
return;
} else {
cred = buObject.credential;
bu = buObject.businessUnit;
} else {
return;
}
}

Expand Down Expand Up @@ -328,11 +328,11 @@ class Deployer {
const allowedDeFolderContentTypes = ['dataextension', 'shared_dataextension'];
for (const metadataType of metadataTypeArr) {
if (!MetadataTypeInfo[metadataType].definition.dependencies.includes('folder')) {
Util.logger.debug(` ☇ skipping ${metadataType}: folder not a dependency`);
Util.logger.debug(` ☇ skipping ${metadataType} folders: folder not a dependency`);
continue;
}
if (!MetadataTypeInfo[metadataType].definition.folderType) {
Util.logger.debug(` ☇ skipping ${metadataType}: folderType not set`);
Util.logger.debug(` ☇ skipping ${metadataType} folders: folderType not set`);
continue;
}
if (
Expand All @@ -341,11 +341,13 @@ class Deployer {
)
) {
Util.logger.warn(
` ☇ skipping ${metadataType}: folderType ${MetadataTypeInfo[metadataType].definition.folderType} not supported for deployment`
` ☇ skipping ${metadataType} folders: folderType ${MetadataTypeInfo[metadataType].definition.folderType} not supported for deployment. Please consider creating folders for this type manually as a pre-deployment step, if you see errors about missing dependent folders for this type later in this log.`
);
continue;
}
Util.logger.debug(`Creating relevant folders for ${metadataType} in deploy dir`);
Util.logger.debug(
` - create ${metadataType} folders: Creating relevant folders in deploy dir`
);

const allFolders = Object.keys(metadata[metadataType])
.filter(
Expand Down
3 changes: 3 additions & 0 deletions lib/MetadataTypeDefinitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ const MetadataTypeDefinitions = {
role: require('./metadataTypes/definitions/Role.definition'),
script: require('./metadataTypes/definitions/Script.definition'),
setDefinition: require('./metadataTypes/definitions/SetDefinition.definition'),
transactionalEmail: require('./metadataTypes/definitions/TransactionalEmail.definition'),
transactionalPush: require('./metadataTypes/definitions/TransactionalPush.definition'),
transactionalSMS: require('./metadataTypes/definitions/TransactionalSMS.definition'),
triggeredSendDefinition: require('./metadataTypes/definitions/TriggeredSendDefinition.definition'),
};

Expand Down
3 changes: 3 additions & 0 deletions lib/MetadataTypeInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ const MetadataTypeInfo = {
role: require('./metadataTypes/Role'),
script: require('./metadataTypes/Script'),
setDefinition: require('./metadataTypes/SetDefinition'),
transactionalEmail: require('./metadataTypes/TransactionalEmail'),
transactionalPush: require('./metadataTypes/TransactionalPush'),
transactionalSMS: require('./metadataTypes/TransactionalSMS'),
triggeredSendDefinition: require('./metadataTypes/TriggeredSendDefinition'),
};

Expand Down
21 changes: 14 additions & 7 deletions lib/Retriever.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ class Retriever {
}
Util.logger.info(
`Retrieving: ${metadataType}` +
(typeKeyMap[metadataType][0] !== null
? ` ${color.dim}(Keys: ${typeKeyMap[metadataType].join(', ')})${
(typeKeyMap[metadataType][0] === null
? ''
: ` ${color.dim}(Keys: ${typeKeyMap[metadataType].join(', ')})${
color.reset
}`
: '')
}`)
);
result = await (changelogOnly
? MetadataTypeInfo[type].retrieveChangelog(this.buObject, null, subType)
Expand Down Expand Up @@ -163,9 +163,16 @@ class Retriever {
}
}
} catch (ex) {
Util.logger.errorStack(ex, `Retrieving ${metadataType} failed`);
// do not continue retrieving if one type failed. simply skip processing the rest of the for-loop
break;
if (
ex.code === 'invalid_client' ||
ex.message.startsWith('Client authentication failed.')
) {
// do not continue retrieving if we logged an authentication issue
Util.logger.error(ex.message);
break;
} else {
Util.logger.errorStack(ex, ` - Retrieving ${metadataType} failed`);
}
}
}
return retrieveChangelog;
Expand Down
1 change: 1 addition & 0 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ yargs
* @returns {string[]} values split into an array.
*/
function csvToArray(csv) {
// eslint-disable-next-line unicorn/no-negated-condition
return !csv
? null
: csv.includes(',')
Expand Down
10 changes: 5 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ class Mcdev {
) {
const buObject = await Cli.getCredentialObject(
properties,
cred !== null ? cred + '/' + bu : null,
cred === null ? null : cred + '/' + bu,
null,
true
);
if (buObject !== null) {
if (buObject === null) {
return;
} else {
cred = buObject.credential;
bu = buObject.businessUnit;
} else {
return;
}
}

Expand Down Expand Up @@ -206,7 +206,7 @@ class Mcdev {
}
const buObject = await Cli.getCredentialObject(
properties,
cred !== null ? cred + '/' + bu : null,
cred === null ? null : cred + '/' + bu,
null,
true
);
Expand Down
4 changes: 2 additions & 2 deletions lib/metadataTypes/AccountUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class AccountUser extends MetadataType {
},
};
}

Util.logger.info(` - Loading ${this.definition.type}. This might take a while...`);
return super.retrieveSOAP(retrieveDir, buObject, requestParams);
}
/**
Expand Down Expand Up @@ -377,7 +377,7 @@ class AccountUser extends MetadataType {
metadata.AssociatedBusinessUnits__c = this.userIdBuMap[metadata.ID] || [];

let roles;
if (metadata.Roles.Role) {
if (metadata.Roles?.Role) {
// normalize to always use array
if (!metadata.Roles.Role.length) {
metadata.Roles.Role = [metadata.Roles.Role];
Expand Down
Loading

0 comments on commit 1861682

Please sign in to comment.