Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

fix: some typos in documentation and comments #1433

Merged
merged 4 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ A build system for package based development in Salesforce, delivered as a node
- Integrate with any CI/CD system of choice
- All commands are enabled with statsD, for collecting metrics about your pipeline.

There are lot more features to explore. Read more at https://docs.dxatscale.io
There are lot more features to explore. Read more at https://docs.dxatscale.io

The project is delivered as a <b>CLI</b> that can be deployed in any CI/CD system, The module is available in [NPM](https://www.npmjs.com/package/@dxatscale/sfpowerscripts) or can be
The project is delivered as a <b>CLI</b> that can be deployed in any CI/CD system, The module is available in [NPM](https://www.npmjs.com/package/@dxatscale/sfpowerscripts) or can be
used by using the [docker image](https://github.com/dxatscale/sfpowerscripts/pkgs/container/sfpowerscripts)


Expand All @@ -51,8 +51,8 @@ Getting started guides for popular CI/CD platforms along with reference pipeline

sfpowerscripts can be installed on your local device using npm

```
npm i -g @dxatscale/sfpowerscripts
```
npm i -g @dxatscale/sfpowerscripts
```


Expand All @@ -62,12 +62,12 @@ Docker images for sfpowerscripts are available at [GitHub Container Registry](ht

We recommend using the sfpowerscripts docker image to avoid breakages in your CI/CD pipelines due to updates in sfpowerscripts or any of its dependencies such as the SFDX CLI.

#### Build Instructions
To build sfpowerscripts execute the following on the terminal:
#### Build Instructions
To build sfpowerscripts execute the following on the terminal:
```
npm i -g lerna #Install Lerna Globally
cd <sfpowerscrips directory> # Navigate to the checked out directory
npm i
cd <sfpowerscripts directory> # Navigate to the checked out directory
pnpm i
lerna run build
```

Expand All @@ -80,7 +80,7 @@ lerna run test
To debug and test plugin

```
cd sfpowerscripts-cli
cd packages/sfpowerscripts-cli
npm link
```

Expand All @@ -91,7 +91,7 @@ List of Maintainers are available in the [link](https://docs.dxatscale.io/about-

#### Where do I reach for queries?

Please create an issue in the repo for bugs or utilize GitHub Discussions for other queries. Join our [Slack Community](https://launchpass.com/dxatscale) as well.
Please create an issue in the repo for bugs or utilize GitHub Discussions for other queries. Join our [Slack Community](https://launchpass.com/dxatscale) as well.


## License
Expand Down
14 changes: 7 additions & 7 deletions decision records/001-sfpowerscripts-artifact-customsettings.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Migrate sfpowerscripts artifact to utilize custom settings instead of a custom object

* Status: Accepted <!-- optional -->
* Status: Accepted <!-- optional -->
* Deciders: Azlam, Alan <!-- optional -->
* Date: <!-- optional -->
* Date: <!-- optional -->

Issue [Issue #476](https://github.com/dxatscale/sfpowerscripts/issues/476) <!-- optional -->

Expand All @@ -13,11 +13,11 @@ sfpowerscripts artifacts is an unlocked package that keeps track of all the pack
To solve this, these records should be stored in custom settings, which are preserved during refreshes. The cli should support utilising custom settings to store these records with a backward compatibility layer, so that none of the data gets lost while the migration is underway


## Decision
## Decision


This migration will be done in the following manner in the intermiediate release
- CLI commands to check for the existense of sfpowerscripts_artifact_c object and any associate records on every run
This migration will be done in the following manner in the intermediate release
- CLI commands to check for the existence of sfpowerscripts_artifact_c object and any associate records on every run
- If associated records are found, proceed to migrate all the existing records into the newly created custom setting object
- Delete all the records in sfpowerscripts_artifact_c object.
- Utilize custom settings moving forward
Expand All @@ -27,9 +27,9 @@ An upgrade to sfpowerscripts_package will be pushed to all the users who are uti
On a subsequent release, the custom object will be deprecated and CLI commands will remove the associated check and migration code


## Conseuqences <!-- optional -->
## Consequences <!-- optional -->

There will be a slight delay during deploy command, as it has to check for the existense. But once this migration is over it will be provide better accuracy and tie it back to the exact version of the package even when the org is refreshed from another one.
There will be a slight delay during deploy command, as it has to check for the existence. But once this migration is over it will be provide better accuracy and tie it back to the exact version of the package even when the org is refreshed from another one.


<!-- markdownlint-disable-file MD013 -->
2 changes: 1 addition & 1 deletion packages/core/src/deployers/DeploySourceToOrgImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export default class DeploySourceToOrgImpl implements DeploymentExecutor {
return result;
}

//For compatibilty with cli output
//For compatibility with cli output
private formatResultAsJSON(result) {
const response = result?.response ? result.response : {};
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class InstallSourcePackageImpl extends InstallPackage {

// Apply Destructive Manifest
await this.applyDestructiveChanges();


//Apply Reconcile if Profiles are found
//To Reconcile we have to go for multiple deploys, first we have to reconcile profiles and deploy the metadata
Expand Down Expand Up @@ -118,7 +118,7 @@ export default class InstallSourcePackageImpl extends InstallPackage {
}

//Check if there are components to be deployed after filtering
//Asssume its suscessfully deployed
//Assume its successfully deployed
if (componentSet.size == 0) {
return {
deploy_id: `000000`,
Expand All @@ -132,8 +132,9 @@ export default class InstallSourcePackageImpl extends InstallPackage {
PackageComponentPrinter.printComponentTable(components, this.logger);


if (!this.options.isInstallingForValidation)
if (!this.options.isInstallingForValidation) {
DeploymentOptionDisplayer.printDeploymentOptions(deploymentOptions, this.logger);
}

let deploySourceToOrgImpl: DeploymentExecutor = new DeploySourceToOrgImpl(
this.sfpOrg,
Expand Down Expand Up @@ -188,7 +189,7 @@ export default class InstallSourcePackageImpl extends InstallPackage {


if (status.result == 'break') {
throw new Error('No compoments in the package, Please check your build again');
throw new Error('No components in the package, Please check your build again');
} else if (status.result == 'skip') {
return {
isToSkip: true,
Expand Down Expand Up @@ -238,7 +239,7 @@ export default class InstallSourcePackageImpl extends InstallPackage {
Either the components are already deleted or there are components which \
have dependency to components in the manifest. \
Please check whether this manifest works! \
Acutal Error Observed: \
Actual Error Observed: \
-------------------------------------- \
${COLOR_ERROR(error.message)}`,
LoggerLevel.INFO,
Expand Down Expand Up @@ -325,7 +326,7 @@ export default class InstallSourcePackageImpl extends InstallPackage {
);
await reconcileProfileAgainstOrg.exec();

//Now deploy the profies alone
//Now deploy the profiles alone

const profilesDirs = globSync('**/profiles/', {
cwd: path.join(sourceDirectoryPath, sourceDirectory),
Expand Down
18 changes: 9 additions & 9 deletions packages/sfpowerscripts-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ A build system for package based development in Salesforce, delivered as a node
- Integrate with any CI/CD system of choice
- All commands are enabled with statsD, for collecting metrics about your pipeline.

There are lot more features to explore. Read more at https://docs.dxatscale.io
There are lot more features to explore. Read more at https://docs.dxatscale.io

The project is delivered as a <b>CLI</b> that can be deployed in any CI/CD system, The module is available in [NPM](https://www.npmjs.com/package/@dxatscale/sfpowerscripts) or can be
The project is delivered as a <b>CLI</b> that can be deployed in any CI/CD system, The module is available in [NPM](https://www.npmjs.com/package/@dxatscale/sfpowerscripts) or can be
used by using the [docker image](https://github.com/dxatscale/sfpowerscripts/pkgs/container/sfpowerscripts)


Expand All @@ -51,8 +51,8 @@ Getting started guides for popular CI/CD platforms along with reference pipeline

sfpowerscripts can be installed on your local device using npm

```
npm i -g @dxatscale/sfpowerscripts
```
npm i -g @dxatscale/sfpowerscripts
```


Expand All @@ -62,11 +62,11 @@ Docker images for sfpowerscripts are available at [GitHub Container Registry](ht

We recommend using the sfpowerscripts docker image to avoid breakages in your CI/CD pipelines due to updates in sfpowerscripts or any of its dependencies such as the SFDX CLI.

#### Build Instructions
To build sfpowerscripts execute the following on the terminal:
#### Build Instructions
To build sfpowerscripts execute the following on the terminal:
```
npm i -g lerna #Install Lerna Globally
cd <sfpowerscrips directory> # Navigate to the checked out directory
cd <sfpowerscripts directory> # Navigate to the checked out directory
npm i
lerna run build
```
Expand All @@ -80,7 +80,7 @@ lerna run test
To debug and test plugin

```
cd sfpowerscripts-cli
cd packages/sfpowerscripts-cli
npm link
```

Expand All @@ -91,7 +91,7 @@ List of Maintainers are available in the [link](https://docs.dxatscale.io/about-

#### Where do I reach for queries?

Please create an issue in the repo for bugs or utilize GitHub Discussions for other queries. Join our [Slack Community](https://launchpass.com/dxatscale) as well.
Please create an issue in the repo for bugs or utilize GitHub Discussions for other queries. Join our [Slack Community](https://launchpass.com/dxatscale) as well.


## License
Expand Down
34 changes: 16 additions & 18 deletions packages/sfpowerscripts-cli/src/impl/deploy/DeployImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ export default class DeployImpl {

//Filter artifacts based on release config
sfpPackages = this.filterSfPPackagesBasedOnReleaseConfig(sfpPackages,this.props.releaseConfigPath,this.props.logger);

//Grab the latest projectConfig from Packages
let sfpPackageInquirer: SfpPackageInquirer = new SfpPackageInquirer(sfpPackages, this.props.logger);
let sfdxProjectConfig = sfpPackageInquirer.getLatestProjectConfig();
if (sfdxProjectConfig == null) {
// If unable to find latest package manfest in artifacts, use package manifest in project directory
// If unable to find latest package manifest in artifacts, use package manifest in project directory
sfdxProjectConfig = ProjectConfig.getSFDXProjectConfig(null);
}

Expand Down Expand Up @@ -232,7 +232,7 @@ export default class DeployImpl {
result: PackageInstallationStatus.Failed,
message: error,
};


FileOutputHandler.getInstance().writeOutput(`deployment-error.md`,`### 💣 Deployment Failed 💣`);
FileOutputHandler.getInstance().appendOutput(`deployment-error.md`,`Package Installation failed for **${queue[i].packageName}**`);
Expand All @@ -255,7 +255,7 @@ export default class DeployImpl {
return true;
else if (isToBeRetried && retryCount <= maxRetryCount )
return true;
else
else
return false;
} else return false;
}
Expand Down Expand Up @@ -306,7 +306,7 @@ export default class DeployImpl {
failed: failed,
queue: queue,
packagesToPackageInfo: packagesToPackageInfo,
error: null
error: null
};
} catch (err) {
SFPLogger.log(err, LoggerLevel.ERROR, this.props.logger);
Expand All @@ -331,7 +331,7 @@ export default class DeployImpl {
let packages = releaseConfig.getPackagesAsPerReleaseConfig();
//Filter artifacts based on packages
let filteredSfPPackages:SfpPackage[] = [];

for (const sfpPackage of sfpPackages) {
if (packages.includes(sfpPackage.packageName)) {
filteredSfPPackages.push(sfpPackage);
Expand Down Expand Up @@ -376,7 +376,6 @@ export default class DeployImpl {
SFPLogger.printHeaderLine('',COLOR_HEADER,LoggerLevel.INFO);
SFPLogger.log(`Retrying On Failure Attempt: ${count}`, LoggerLevel.INFO, this.props.logger);
SFPLogger.printHeaderLine('',COLOR_HEADER,LoggerLevel.INFO);

}
}

Expand Down Expand Up @@ -469,7 +468,6 @@ export default class DeployImpl {
});

queue.forEach((pkg) => {

maxTable.push(processColoursForAllPackages(pkg));
});

Expand All @@ -479,7 +477,7 @@ export default class DeployImpl {
//Insane Hack
//TODO: Export the value to the caller
printDeploymentBreakDownInMarkdown();

groupSection.end();

groupSection = new GroupConsoleLogs(`Packages to be deployed`, this.props.logger).begin();
Expand Down Expand Up @@ -531,12 +529,12 @@ export default class DeployImpl {

function processColoursForAllPackages(pkg) {
const pkgInfo = packagesToPackageInfo[pkg.packageName];

let packageName = pkg.packageName;
let versionNumber = pkg.versionNumber;
let versionInstalledInOrg = pkgInfo.versionInstalledInOrg ? pkgInfo.versionInstalledInOrg : 'N/A';
let isPackageInstalled = pkgInfo.isPackageInstalled ? 'No' : 'Yes';

if (pkgInfo.isPackageInstalled) {
packageName = COLOR_SUCCESS(packageName);
versionNumber = COLOR_SUCCESS(versionNumber);
Expand All @@ -551,20 +549,20 @@ export default class DeployImpl {
isPackageInstalled = COLOR_ERROR(isPackageInstalled);

}

return [packageName, versionNumber, versionInstalledInOrg, isPackageInstalled];
}


function getRowForMarkdownTable(pkg:SfpPackage, props:DeployProps) {
const pkgInfo = packagesToPackageInfo[pkg.packageName];

let packageName = pkg.packageName;
let versionNumber = pkg.versionNumber;
let versionInstalledInOrg = pkgInfo.versionInstalledInOrg ? pkgInfo.versionInstalledInOrg : 'N/A';
let isPackageToBeInstalled = pkgInfo.isPackageInstalled ? 'No' : 'Yes';
let promotionStatus = 'N/A';

if(isPackageToBeInstalled=="Yes")
{
isPackageToBeInstalled = `![Yes](https://img.shields.io/badge/Yes-green.svg)`;
Expand Down Expand Up @@ -615,10 +613,10 @@ export default class DeployImpl {
});
SFPLogger.log(table.toString(), LoggerLevel.INFO, this.props.logger);
groupSection.end();

printDeploymentBreakDownInMarkdown();


function printDeploymentBreakDownInMarkdown() {
let tableData = {
table: {
Expand Down Expand Up @@ -731,7 +729,7 @@ export default class DeployImpl {

//Add Installation Options
let installationOptions = new SfpPackageInstallationOptions();
installationOptions.installationkey = null,
installationOptions.installationkey = null,
installationOptions.apexcompile = 'package';
installationOptions.waitTime = waitTime;
installationOptions.apiVersion = apiVersion;
Expand Down