Coder Social home page Coder Social logo

dxatscale / sfpowerscripts Goto Github PK

View Code? Open in Web Editor NEW
203.0 22.0 90.0 77.2 MB

A build system for modular development in Salesforce

Home Page: https://dxatscale.io

License: MIT License

TypeScript 95.76% JavaScript 3.03% Dockerfile 0.38% Apex 0.84% Batchfile 0.01%
sfdx-cli sfdx-plugin salesforce package pipeline nodejs

sfpowerscripts's Introduction

sfpowerscripts

Version GitHub stars GitHub contributors License PRs Welcome

DeepScan grade FOSSA Status CII Best Practices

Join slack

A build system for package based development in Salesforce, delivered as a node cli that can be implemented in any CI/CD system of choice.Read more about the cli and details here - https://docs.dxatscale.io

Features

  • Features an Orchestrator, which utilizes sfdx-project.json as the source of truth for driving the build system, ensuring very low maintenance on programs often dealing with multiple number of packages
  • Builds packages in parallel by respecting dependencies
  • Ability to selectively build changed packages in a mono repo
  • Ability to deploy only packages that are changed in repo
  • Pooling commands to prepare a pool of scratch org's with packages pre installed for optimized Pull/Merge Request validation
  • Artifacts Driven, all create commands produce an artifact or operate on an artifact
  • 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

The project is delivered as a CLI that can be deployed in any CI/CD system, The module is available in NPM or can be used by using the docker image

Motivation

  • Need for artifact driven build system for package based development models especially on complex and large programs

  • Providing additional functionality that is either not supported by the sfdx-cli, such as data packages or automatically understanding tests in a given package

  • Ease of use, one should not be spending too much time scripting a pipeline.

CI/CD Reference Implementation

Getting started guides for popular CI/CD platforms along with reference pipelines are available here

Installing sfpowerscripts locally

sfpowerscripts can be installed on your local device using npm

npm i -g @dxatscale/sfpowerscripts

Docker

Docker images for sfpowerscripts are available at GitHub Container Registry.

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:

npm i -g lerna #Install Lerna Globally
cd <sfpowerscripts directory> # Navigate to the checked out directory
pnpm i
lerna run build

To run unit tests

lerna run test

To debug and test plugin

 cd packages/sfpowerscripts-cli
 npm link

Maintainers

List of Maintainers are available in the link

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 as well.

License

FOSSA Status

sfpowerscripts's People

Contributors

alanjaouen avatar aly76 avatar azlam-abdulsalam avatar brandonmikeska avatar caitlyn-mills avatar cjbradshaw avatar crazynammer avatar dependabot[bot] avatar ethan-sargent avatar fossabot avatar github-actions[bot] avatar gnemiq avatar gz77a avatar jhawk-4 avatar joeffreychaucer avatar jonathankretzmer avatar manisfdcsfdx avatar michallachowski avatar nabondance avatar oscarrenalias avatar pelim avatar robinweymans avatar rocko1204 avatar rody avatar ruslan-kurchenko avatar rygramer-usds avatar schuchie avatar snyk-bot avatar vuha-acn avatar zhebinliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sfpowerscripts's Issues

sfpowerscripts task: Deploy source to targetorg failing; Error: Project directory not found even though it's specified

Description:
"Deploy source to targetorg" task fails after doing a conversion of list of components to be deployed. (Task version: 9)
image

The task keeps failing if my "Project Directory" is specified as "config" (delta created using project diff command in "config" folder)

Work around:
Absolute path of the "config" that was created by my "build delta task" had to be specified in "Project Directory" input field for the task to succeed.

This did not happen in the previous versions of this task.

Other information:
OS: Windows
sfpowerscripts task: Deploy source to org
Task version: 9

Consolidated Task Executor

In a monorepo, a project will be operating with multiple packages and new packages being added or removed during the course of development.
This means whenever a new package is added, additional tasks that need to be added including in validation (such as PMD, Metadata Validation, Trigger apex tests etc).Same applies for build and deployment stages.

One approach would be is to have a single task, that reads sfdx-project.json and executes the whole set. This has a downside as the logs of such a task is often hard to comprehend, but could be mitigated with folding ( see grouping in azure pipelines https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash#formatting-commands ).
This could be an optional addition to sfpowerkit where a pipeline could be set up and maintained only by changing the project manifest

Execute checklist command

Is your feature request related to a problem? Please describe.
Salesforce deployments always features manual steps and it is as critical as the code/metadata that is being deployed through pipelines. One approach is to use a YAML file with the manual steps defined which could then be saved as a versionable checklist

Having defined a yaml schema for manual steps required before a release, we need a sfpowerscripts: checklist:execute command that guides a release manager through the manual steps /checklist in a terminal, and then outputs a log of which manual steps were completed.

Describe the solution you'd like
The checklist execute command should accept the following parameters:

  • checklist filepath
  • Alias/username
  • Output path for logs

The execute command should validate whether the yaml file complies with the schema we have defined by converting it to JSON format and performing a type check against an interface definition.

Using an interactive command-line interface (e.g. inquirer), the execute command iterates through the tasks in a checklist, displaying each task and prompting the user whether the task has been a) completed or b) skipped. A timer logs the amount of time taken for each task and includes this in the output log.

The command outputs a checklist log file that lists the outcome for each task, as well as information like the date and user.

Describe alternatives you've considered

  • Including add, update and delete commands for the checklist
    • Decided that it would be more natural for users to make changes to the runbook through an editor - possibly creating a VScode extension in the future that validates whether the runbook yaml file is compliant with the schema we have defined.

Additional context
The log output of the execute command can be used to create a dashboard such as in Azure Pipelines or any other CI/CD, showing the manual steps that were done for a release.

Different between artifact name in build and release pipelines

I'm trying to deploy a package I've created in a build pipeline and I'm running into problems because the artifact that is downloaded at the start of the release pipeline is located at "d:\a\r1\a_TestPackage\sfpowerkit_artifact\0Ho4J000000JBbGSBW_artifact_metadata" but the "install package" step in the release pipeline is failing because it's trying to access the artifact at "d:\a\r1\a_TestPackage\sfpowerkit_artifact\artifact_metadata" and erroring. As you can see the package ID is prefixed in the build pipeline but I can't seem to specify the artifact name in the release pipeline or override it in the build pipeline.

I don't know if I've missed something in the documentation but it looks like there might be an issue with one of these tasks.

Authentication failed

Hi,
From today I am getting this issue. The authentication is failing every time for every sandbox/production from Azure DevOps. Can anyone please help me regarding this? Until yesterday it was working fine. Now I am getting this error message:
##[error]ENOENT: no such file or directory, open 'C:\Users\VssAdministrator.sfdx\key.json'

Azure task "sfpwowerscript-installsfdx-task@6" fails with "##[error]Command failed: sfdx plugins:install sfpowerkit@latest"

I just installed latest version sfpowerscripts in Azure devops : 13.8000.9 (Latest)
I ran the task sfpwowerscript-installsfdx-task@6
And it fails with :

Installing Plugin sfpowerkit@latest
'sfdx' is not recognized as an internal or external command,
operable program or batch file.
##[error]Command failed: sfdx plugins:install sfpowerkit@latest
'sfdx' is not recognized as an internal or external command,
operable program or batch file.

Cannot install extension

We are getting a vague error when trying to download and install extension from the Azure DevOps marketplace to our on prem Azure DevOps Server. I am not seeing any errors in the console or in the network tab of the developer tools in chrome.

image

Azure DevOps Demo Generator references fail

I have already installed sfpowerscripts extension into my Azure Pipeline org, and than I tried to use Azure DevOps Demo Generator to create a sample pipeline in my org. There, I use the file https://github.com/Accenture/sfpowerscripts/releases/download/13.8000.7/sfpowerscripts_sample_pipelines.zip as a template for this sample pipeline creation. After clicking on "Create Project" button, I got this error:

"Error while creating build definition: The pipeline is not valid. A task is missing. The pipeline references a task called 'f67abc38-a5b8-4196-946e-ba81df4cd57c'. This usually indicates the task isn't installed, and you may be able to install it from the Marketplace: https://marketplace.visualstudio.com. (Task version 7.*, job 'Job_1', step 'build'.)"

Please, how can I resolve it?

[FEATURE][AZURE] Add the ability to deploy a zip file instead of a directory

We currently run our deploys from azure based on a zip file. It would be really nice if we could use sfpowerscripts (DeploySourceToOrgTask) to manage our deployments but its just missing this one feature.
sfdx force:mdapi:deploy supports a -f option for a zip file.

DeploySourceToOrgImpl

      //directory
      command += ` -d ${this.mdapiDir}`;

Support for Azure Artifacts for published artifacts

** Context **
There has been use cases in some enterprise customers, where the build system is not on Azure Pipelines and is on alternate systems such as Jenkins, Buildkite etc. However due to the lack of release orchestration capabilities in such platform is a cause of concern, where Azure Pipelines especially the classic release pipelines really shines with features such as Manual tasks, Queue Control in getting to a stage, Quality Gates, Approval etc. In these cases the bridging artifact mechanism is an Artifact Repository such as Azure Artifacts, where the build server publishes the build artifacts, which then consumed by the release pipelines.

** Proposed Solution **

  • Support for Azure Artifacts as a Phase 1 where the artifacts from these build repositories will be published using sfpowerscripts cli
  • Update tasks which has support for build artifacts to support 'azure artifacts'

Support for NEXT version in package create task/increment version number

Context
Increment Build number task doesn't support the next nomenclature for unlocked packages, thus resulting in couple of issues with traceability when build umber from ci is used, often giving an wrong idea the intermediate package version is lost.

Proposed Solution
Add support for next for unlocked/runtime packages.

  • Packages can be determined runtime or unlocked by referring whether a package alias exists in the json file
  • Update the buildname to signify a 'next' build is being triggered as the version number is only received after a successful completion of the package create task.

Installating sfpowerkit@latest

I tried to setup this plugin on azuredevops hosted on prem.
First step - Install SFDX CLI with SFPowerscripts is failing on installing [ 'sfpowerkit@latest' ]
I tried to do this locally (installing this plugin) I got the same error. Can you please check what I am doing wrong?

sfdx plugins:install sfpowerkit@latest
This plugin is not digitally signed and its authenticity cannot be verified. Continue installation y/n?: y
Finished digital signature check.
warning sfpowerkit > [email protected]: request has been deprecated, see request/request#3142
warning sfpowerkit > @salesforce/core > jsforce > [email protected]: request has been deprecated, see request/request#3142
warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > [email protected]: request has been deprecated, see request/request#3142
warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > @salesforce/core > [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > selenium-standalone > [email protected]: request has been deprecated, see request/request#3142
warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > [email protected]: outdated version, please use @next
warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > webdriverio > [email protected]: request has been deprecated, see request/request#3142
warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > webdriverio > babel-runtime > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > webdriverio > css-parse > css > [email protected]: Please see https://github.com/lydell/urix#deprecated
warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > webdriverio > css-parse > css > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > webdriverio > css-parse > css > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
error An unexpected error occurred: "https://registry.yarnpkg.com/@salesforce/command/-/command-2.2.0.tgz: self signed certificate in certificate chain".
Installing plugin sfpowerkit... !
Error: yarn add sfpowerkit@latest --non-interactive --mutex=file:C:/Users/Praneeth Jonna/AppData/Local/sfdx/yarn.lock --preferred-cache-folder=C:/Users/Praneeth Jonna/AppData/Local/sfdx/yarn --check-files exited with code 1
at ChildProcess.forked.on (C:/Users/Praneeth Jonna/AppData/Local/sfdx/client/7.63.0-c897e8bb1a/node_modules/@oclif/plugin-plugins/lib/yarn.js:31:28)

Dependency Check before deploying unlocked packages

If an unlocked package is deployed to an org, and the dependencies are not met, the error is thrown by the platform during the course of installation. This sometime takes considerable time to surface.

We could surface this quite early, by having dependencies that was used to build this unlocked package added in the artifact metadata and have a check to see whether its already installed in the org before continuing to actual deployment

Add Parameter Options for My Domain Custom URLs JWT Authentication

For the AuthenticateOrg.ts Build Task, provide additional option to specify a custom URL to set up JWT for client orgs that restrict login under My Domain Settings > Login Policy

Code should that should be updated below:

else {
    console.log(`SFPowerScript.. Authenticate Sandbox ${alias} `);

    child_process.execSync(
      `npx sfdx force:auth:jwt:grant --clientid ${clientid} --jwtkeyfile ${jwt_key_filePath} --username ${username} --setdefaultusername --setalias ${alias} -r https://test.salesforce.com `
    );

Manage Scratchorg Task fails when it is used for delele action

Manage Scratchorg Task can be used for creating/deleting a scratchorg. When this task is used exclusively only for a delete scenario, (where a scratchorg is fetched from the pool) the post job of the task fails, as the scratchorg would already be deleted by the delete action.

The post job task should consider the action and decide accordingly

Add support for Resources in YAML

Azure Pipelines now support pipelines as a resource in a YAML Based CD pipeline. The artifacts published by a YAML / Classic based pipeline are downloaded to this location $(PIPELINE.WORKSPACE)//

sfpowerscripts 'checkout', install tasks should support the concept of resources when used in a YAML context

Export Metadata from an org null error

Issue from slack: trying to auth to a SF instance and extract the current metadata to a directory. I am getting an error on the export. See the attachments below. Any idea where I could get some more details on the error?

image
image

PMD Apex Analysis - Provide CSV File Output in Artifacts or Logs

For the Analyze using PMD task, the ability to output a CSV file (log files, artifact, etc.) on top of the tab "PMD Apex Analysis" would be good so that users can analyze, graph, and summarize the errors to assign to Developers to fix. Currently, if you try to copy the table, the values are not cleaning pasted into a spreadsheet.

Add support for .next in Source Packages

For uniformity, it is nice to have support for incrementing versions by means of supporting .next in Source based packages.

.next could simply be the build number of the pipeline the task is running

Error login using 'sfpowerkit' Azure task

In install sfdx-cli, using sfpowerkit, a error occure to install module 'lodash/core'.
Line 124: [MODULE_NOT_FOUND] Error Plugin: sfdx-cli: Cannot find module 'lodash/core'

Below, a complete log error:

2020-07-08T11:57:17.4816598Z ##[debug]Evaluating condition for step: 'Installing sfdx cli (login.yml)' 2020-07-08T11:57:17.4821396Z ##[debug]Evaluating: and(succeeded(), or(contains(variables['Agent.Name'], 'Hosted'), contains(variables['Agent.Name'], 'Azure'))) 2020-07-08T11:57:17.4821882Z ##[debug]Evaluating and: 2020-07-08T11:57:17.4829373Z ##[debug]..Evaluating succeeded: 2020-07-08T11:57:17.4829807Z ##[debug]..=> True 2020-07-08T11:57:17.4830063Z ##[debug]..Evaluating or: 2020-07-08T11:57:17.4836632Z ##[debug]....Evaluating contains: 2020-07-08T11:57:17.4839038Z ##[debug]......Evaluating indexer: 2020-07-08T11:57:17.4857358Z ##[debug]........Evaluating variables: 2020-07-08T11:57:17.4860799Z ##[debug]........=> Object 2020-07-08T11:57:17.4861720Z ##[debug]........Evaluating String: 2020-07-08T11:57:17.4862167Z ##[debug]........=> 'Agent.Name' 2020-07-08T11:57:17.4866293Z ##[debug]......=> 'Azure Pipelines 2' 2020-07-08T11:57:17.4867744Z ##[debug]......Evaluating String: 2020-07-08T11:57:17.4868048Z ##[debug]......=> 'Hosted' 2020-07-08T11:57:17.4868403Z ##[debug]....=> False 2020-07-08T11:57:17.4868858Z ##[debug]....Evaluating contains: 2020-07-08T11:57:17.4869164Z ##[debug]......Evaluating indexer: 2020-07-08T11:57:17.4869495Z ##[debug]........Evaluating variables: 2020-07-08T11:57:17.4869772Z ##[debug]........=> Object 2020-07-08T11:57:17.4870104Z ##[debug]........Evaluating String: 2020-07-08T11:57:17.4870414Z ##[debug]........=> 'Agent.Name' 2020-07-08T11:57:17.4870882Z ##[debug]......=> 'Azure Pipelines 2' 2020-07-08T11:57:17.4871224Z ##[debug]......Evaluating String: 2020-07-08T11:57:17.4871483Z ##[debug]......=> 'Azure' 2020-07-08T11:57:17.4871709Z ##[debug]....=> True 2020-07-08T11:57:17.4871990Z ##[debug]..=> True 2020-07-08T11:57:17.4872341Z ##[debug]=> True 2020-07-08T11:57:17.4874125Z ##[debug]Expanded: and(True, or(contains('Azure Pipelines 2', 'Hosted'), contains('Azure Pipelines 2', 'Azure'))) 2020-07-08T11:57:17.4874531Z ##[debug]Result: True 2020-07-08T11:57:17.4874880Z ##[section]Starting: Installing sfdx cli (login.yml) 2020-07-08T11:57:17.4878845Z ============================================================================== 2020-07-08T11:57:17.4879095Z Task : Install SFDX with sfpowerkit 2020-07-08T11:57:17.4879455Z Description : This plugin installs SFDX CLI, SFPowerkit plugin, Please install this task as the first task before any other tasks in the plugin This task is part of sfpowerscripts. 2020-07-08T11:57:17.4879907Z Version : 6.0.5 2020-07-08T11:57:17.4880069Z Author : azlam.abdulsalam 2020-07-08T11:57:17.4880956Z Help : Install SFDX - Use this task to install sfdx plugin and the open source sfpowerkit by providing the respective version. More details available at https://sfpowerscripts.com/tasks/common-utility-tasks/install%20sfdx%20cli 2020-07-08T11:57:17.4881481Z ============================================================================== 2020-07-08T11:57:17.6012390Z ##[debug]agent.TempDirectory=/home/vsts/work/_temp 2020-07-08T11:57:17.6033991Z ##[debug]loading inputs and endpoints 2020-07-08T11:57:17.6037490Z ##[debug]loading INPUT_SFDX_CLI_VERSION 2020-07-08T11:57:17.6046847Z ##[debug]loading INPUT_SFPOWERKIT_VERSION 2020-07-08T11:57:17.6051399Z ##[debug]loading INPUT_ISTELEMETRYENABLED 2020-07-08T11:57:17.6051787Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION 2020-07-08T11:57:17.6053445Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION 2020-07-08T11:57:17.6053884Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN 2020-07-08T11:57:17.6062692Z ##[debug]loading SECRET_SALESFORCE_CLIENTID_QA 2020-07-08T11:57:17.6063054Z ##[debug]loading SECRET_SALESFORCE_CLIENTID_DEV 2020-07-08T11:57:17.6063417Z ##[debug]loading SECRET_SALESFORCE_CLIENTID_PREDEPLOY 2020-07-08T11:57:17.6063766Z ##[debug]loading SECRET_SALESFORCE_CLIENTID_PROD 2020-07-08T11:57:17.6064113Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN 2020-07-08T11:57:17.6064443Z ##[debug]loading SECRET_SALESFORCE_CLIENTID_SQUAD 2020-07-08T11:57:17.6066105Z ##[debug]loading SECRET_SALESFORCE_CLIENTID_PREPROD 2020-07-08T11:57:17.6066779Z ##[debug]loaded 13 2020-07-08T11:57:17.6095165Z ##[debug]Agent.ProxyUrl=undefined 2020-07-08T11:57:17.6095525Z ##[debug]Agent.CAInfo=undefined 2020-07-08T11:57:17.6096071Z ##[debug]Agent.ClientCert=undefined 2020-07-08T11:57:17.6096425Z ##[debug]Agent.SkipCertValidation=undefined 2020-07-08T11:57:17.7003920Z ##[debug]isTelemetryEnabled=false 2020-07-08T11:57:17.7077819Z SFPowerScript.. Install SFDX/SFPowerkit 2020-07-08T11:57:17.7081949Z ##[debug]sfdx_cli_version=7.54.4 2020-07-08T11:57:17.7082285Z ##[debug]sfpowerkit_version=latest 2020-07-08T11:57:17.7082586Z ##[debug]plugins=null 2020-07-08T11:57:17.7082888Z ##[debug]salesforce_api_version=null 2020-07-08T11:57:17.7083194Z ##[debug]Agent.OS=Linux 2020-07-08T11:57:17.7083478Z ##[debug]Agent.OS=Linux 2020-07-08T11:57:39.4921349Z warning sfdx-cli > @salesforce/sfdx-trust > [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) 2020-07-08T11:57:39.4943266Z yarn global v1.22.4 2020-07-08T11:57:39.4943835Z [1/4] Resolving packages... 2020-07-08T11:57:39.4945489Z warning sfdx-cli > salesforcedx > salesforce-alm > [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) 2020-07-08T11:57:39.4946007Z [2/4] Fetching packages... 2020-07-08T11:57:39.4947634Z warning sfdx-cli > salesforcedx > salesforce-alm > @salesforce/core > [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) 2020-07-08T11:57:39.4948140Z [3/4] Linking dependencies... 2020-07-08T11:57:39.4949673Z warning sfdx-cli > salesforcedx > salesforce-alm > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 2020-07-08T11:57:39.4950138Z [4/4] Building fresh packages... 2020-07-08T11:57:39.4951665Z warning sfdx-cli > @salesforce/plugin-generator > yeoman-generator > yeoman-environment > npm-api > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 2020-07-08T11:57:39.4952437Z success Installed "[email protected]" with binaries: 2020-07-08T11:57:39.4954180Z warning sfdx-cli > @salesforce/plugin-analytics > @salesforce/core > jsforce > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 2020-07-08T11:57:39.4954764Z - sfdx 2020-07-08T11:57:39.4956181Z warning sfdx-cli > salesforcedx > salesforce-alm > selenium-standalone > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 2020-07-08T11:57:39.4956644Z Done in 20.97s. 2020-07-08T11:57:39.4957901Z warning sfdx-cli > salesforcedx > salesforce-alm > [email protected]: outdated version, please use @next 2020-07-08T11:57:39.4958202Z 2020-07-08T11:57:39.4959601Z warning sfdx-cli > salesforcedx > salesforce-alm > webdriverio > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 2020-07-08T11:57:39.4960088Z SFDX CLI Installed 2020-07-08T11:57:39.4961711Z warning sfdx-cli > salesforcedx > salesforce-alm > webdriverio > babel-runtime > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. 2020-07-08T11:57:39.4963893Z ##[debug]HomeDirectory: /home/vsts 2020-07-08T11:57:39.4964742Z warning sfdx-cli > salesforcedx > salesforce-alm > webdriverio > css-parse > css > [email protected]: Please see https://github.com/lydell/urix#deprecated 2020-07-08T11:57:39.4965617Z ##[debug]WhiteListPath: /home/vsts/.config/sfdx 2020-07-08T11:57:39.4967097Z warning sfdx-cli > @salesforce/plugin-generator > yeoman-environment > globby > fast-glob > micromatch > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated 2020-07-08T11:57:39.4967626Z Installing Plugins 2020-07-08T11:57:39.4968363Z [ 'sfpowerkit@latest' ] 2020-07-08T11:57:39.4968827Z Whitelisting Plugins 2020-07-08T11:57:39.4969288Z [ 'sfpowerkit' ] 2020-07-08T11:57:39.4970146Z warning sfdx-cli > salesforcedx > salesforce-alm > @salesforce/core > @salesforce/ts-sinon > sinon > @sinonjs/formatio > [email protected]: This package has been deprecated in favour of @sinonjs/samsam 2020-07-08T11:57:39.4971926Z warning sfdx-cli > @salesforce/plugin-generator > yeoman-environment > globby > fast-glob > micromatch > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated 2020-07-08T11:57:39.4972421Z Installing Plugin sfpowerkit@latest 2020-07-08T11:58:02.1963552Z (node:5425) [MODULE_NOT_FOUND] Error Plugin: sfdx-cli: Cannot find module 'lodash/core' 2020-07-08T11:58:02.1963911Z 2020-07-08T11:58:02.1964681Z Require stack: 2020-07-08T11:58:02.1964914Z Setting API Version if any.. 2020-07-08T11:58:02.1966291Z ##[debug]Release.ReleaseId=undefined 2020-07-08T11:58:02.1970403Z - /usr/local/share/.config/yarn/global/node_modules/jsforce/lib/api/analytics.js 2020-07-08T11:58:02.1971280Z - /usr/local/share/.config/yarn/global/node_modules/jsforce/lib/api/index.js 2020-07-08T11:58:02.1971909Z - /usr/local/share/.config/yarn/global/node_modules/jsforce/lib/jsforce.js 2020-07-08T11:58:02.1972578Z - /usr/local/share/.config/yarn/global/node_modules/jsforce/index.js 2020-07-08T11:58:02.1973261Z - /usr/local/share/.config/yarn/global/node_modules/@salesforce/core/lib/authInfo.js 2020-07-08T11:58:02.1973922Z - /usr/local/share/.config/yarn/global/node_modules/@salesforce/core/lib/exported.js 2020-07-08T11:58:02.1974638Z - /usr/local/share/.config/yarn/global/node_modules/@salesforce/telemetry/lib/telemetryReporter.js 2020-07-08T11:58:02.1975369Z - /usr/local/share/.config/yarn/global/node_modules/@salesforce/telemetry/lib/exported.js 2020-07-08T11:58:02.1976379Z - /usr/local/share/.config/yarn/global/node_modules/@salesforce/plugin-analytics/lib/hooks/analyticsPrerun.js 2020-07-08T11:58:02.1977136Z - /usr/local/share/.config/yarn/global/node_modules/sfdx-cli/node_modules/@oclif/config/lib/config.js 2020-07-08T11:58:02.1977875Z - /usr/local/share/.config/yarn/global/node_modules/sfdx-cli/node_modules/@oclif/config/lib/index.js 2020-07-08T11:58:02.1978644Z - /usr/local/share/.config/yarn/global/node_modules/sfdx-cli/node_modules/@oclif/command/lib/command.js 2020-07-08T11:58:02.1979643Z - /usr/local/share/.config/yarn/global/node_modules/sfdx-cli/node_modules/@oclif/command/lib/index.js 2020-07-08T11:58:02.1980302Z - /usr/local/share/.config/yarn/global/node_modules/sfdx-cli/dist/cli.js 2020-07-08T11:58:02.1981139Z - /usr/local/share/.config/yarn/global/node_modules/sfdx-cli/bin/run 2020-07-08T11:58:02.1981546Z module: @oclif/[email protected] 2020-07-08T11:58:02.1981874Z task: runHook prerun 2020-07-08T11:58:02.1982323Z plugin: sfdx-cli 2020-07-08T11:58:02.1982914Z root: /usr/local/share/.config/yarn/global/node_modules/sfdx-cli 2020-07-08T11:58:02.1983306Z See more details with DEBUG=* 2020-07-08T11:58:02.1983663Z Installing plugin sfpowerkit... yarn add v1.22.4 2020-07-08T11:58:02.1984403Z (node:5425) [MODULE_NOT_FOUND] Error Plugin: sfdx-cli: Cannot find module 'lodash/core' 2020-07-08T11:58:02.1984831Z Require stack: 2020-07-08T11:58:02.1985425Z - /usr/local/share/.config/yarn/global/node_modules/jsforce/lib/api/analytics.js 2020-07-08T11:58:02.1986153Z - /usr/local/share/.config/yarn/global/node_modules/jsforce/lib/api/index.js 2020-07-08T11:58:02.1990393Z - /usr/local/share/.config/yarn/global/node_modules/jsforce/lib/jsforce.js 2020-07-08T11:58:02.1992130Z ##[debug]Release.ReleaseId=undefined 2020-07-08T11:58:02.1992882Z - /usr/local/share/.config/yarn/global/node_modules/jsforce/index.js 2020-07-08T11:58:02.1993577Z ##[debug]system.collectionId=ceecbcb0-ab54-4ada-b993-25b756e7f6e3 2020-07-08T11:58:02.1994731Z - /usr/local/share/.config/yarn/global/node_modules/@salesforce/core/lib/authInfo.js 2020-07-08T11:58:02.1995420Z ##[debug]system.teamProjectId=6fdf78df-2f42-4e8e-8530-ef9a9dc78805 2020-07-08T11:58:02.1996395Z - /usr/local/share/.config/yarn/global/node_modules/@salesforce/core/lib/exported.js 2020-07-08T11:58:02.1997453Z - /usr/local/share/.config/yarn/global/node_modules/@salesforce/sfdx-trust/dist/hooks/verifyInstallSignature.js 2020-07-08T11:58:02.1998284Z - /usr/local/share/.config/yarn/global/node_modules/sfdx-cli/node_modules/@oclif/config/lib/config.js 2020-07-08T11:58:02.1999080Z - /usr/local/share/.config/yarn/global/node_modules/sfdx-cli/node_modules/@oclif/config/lib/index.js 2020-07-08T11:58:02.1999867Z - /usr/local/share/.config/yarn/global/node_modules/sfdx-cli/node_modules/@oclif/command/lib/command.js 2020-07-08T11:58:02.2000711Z - /usr/local/share/.config/yarn/global/node_modules/sfdx-cli/node_modules/@oclif/command/lib/index.js 2020-07-08T11:58:02.2001484Z - /usr/local/share/.config/yarn/global/node_modules/sfdx-cli/dist/cli.js 2020-07-08T11:58:02.2002156Z - /usr/local/share/.config/yarn/global/node_modules/sfdx-cli/bin/run 2020-07-08T11:58:02.2002586Z module: @oclif/[email protected] 2020-07-08T11:58:02.2002958Z task: runHook plugins:preinstall:verify:signature 2020-07-08T11:58:02.2003477Z plugin: sfdx-cli 2020-07-08T11:58:02.2004132Z root: /usr/local/share/.config/yarn/global/node_modules/sfdx-cli 2020-07-08T11:58:02.2004526Z See more details with DEBUG=* 2020-07-08T11:58:02.2010774Z Installing plugin sfpowerkit... info No lockfile found.Installing plugin sfpowerkit... [1/4] Resolving packages...Installing plugin sfpowerkit... [2/4] Fetching packages...Installing plugin sfpowerkit... [3/4] Linking dependencies...Installing plugin sfpowerkit... [4/4] Building fresh packages...Installing plugin sfpowerkit... success Saved lockfile.Installing plugin sfpowerkit... success Saved 394 new dependencies.Installing plugin sfpowerkit... info Direct dependenciesInstalling plugin sfpowerkit... └─ [email protected] plugin sfpowerkit... info All dependenciesInstalling plugin sfpowerkit... ├─ @babel/[email protected] plugin sfpowerkit... ├─ @salesforce/[email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... ├─ [email protected] plugin sfpowerkit... └─ [email protected] plugin sfpowerkit... Done in 20.58s.Installing plugin sfpowerkit... installed v1.46.6 2020-07-08T11:58:02.2015125Z warning sfpowerkit > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 2020-07-08T11:58:02.2016400Z warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 2020-07-08T11:58:02.2017178Z warning sfpowerkit > @salesforce/core > jsforce > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 2020-07-08T11:58:02.2018497Z warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) 2020-07-08T11:58:02.2019842Z warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > @salesforce/core > [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) 2020-07-08T11:58:02.2020903Z warning sfpowerkit > pino-pretty > @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained 2020-07-08T11:58:02.2021980Z warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > selenium-standalone > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 2020-07-08T11:58:02.2022992Z warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > [email protected]: outdated version, please use @next 2020-07-08T11:58:02.2024044Z warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > webdriverio > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 2020-07-08T11:58:02.2025409Z warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > webdriverio > babel-runtime > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. 2020-07-08T11:58:02.2026657Z warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > webdriverio > css-parse > css > [email protected]: Please see https://github.com/lydell/urix#deprecated 2020-07-08T11:58:02.2027805Z warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > webdriverio > css-parse > css > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated 2020-07-08T11:58:02.2028973Z warning sfpowerkit > @pony-ci/sfdx-node > salesforce-alm > webdriverio > css-parse > css > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated 2020-07-08T11:58:02.2029903Z warning "sfpowerkit > [email protected]" has unmet peer dependency "typescript@>=2.7". 2020-07-08T11:58:02.2030517Z warning "sfpowerkit > @salesforce/command > @oclif/[email protected]" has unmet peer dependency "@oclif/config@^1". 2020-07-08T11:58:02.3126312Z ##[section]Finishing: Installing sfdx cli (login.yml)

Artifact should not be a requirement for InstalledPackageTask

The last version (v9) of installedPackageTask introduced this bug, which made artifact field as a required variable.
This is not the case when the packageInstalledFrom is custom. This causes YAML/Classic pipelines to fail when using custom artifacts

sfpowerscript-deploysourcetoorg-task: "path should be a path.relative()d string" error

Hi,
I'm trying to execute the sfpowerscript-deploysourcetoorg-task in a release pipeline in yaml.
(It works fine in Azure pipeline classic).

The artifact is downloaded in the default directory: $(System.ArtifactsDirectory) (/home/vsts/work/1/a)
and I set the project_directory parameter of the task to: $(System.ArtifactsDirectory)/$(ARTIFACT_NAME)/source

I get the following error:
path should be a path.relative()d string, but got "../a//source/force-app/main"

Is this a bug or am I missing something?

Here's an extract of my pipeline yml file:

variables:
  - group: Dreamhouse
  - name: ARTIFACT_NAME
    value: $(PACKAGE_NAME)_sfpowerscripts_artifact
  - name: ARTIFACT_DIRECTORY
    value: '$(System.ArtifactsDirectory)/$(ARTIFACT_NAME)/source'

stages:
- stage: Packaging
  jobs:
  - job: BuildFullSourcePackage
    displayName: Source Package build
    condition: contains(variables['Build.SourceBranch'], 'refs/heads/feature')
    steps:
    - script: sudo npm install sfdx-cli --global
      displayName: 'Install sfdx'
    - task: AzlamSalam.sfpowerscripts.sfpwowerscript-incrementversionnumber-task.sfpwowerscript-incrementversionnumber-task@9
      displayName: 'Increments the BuildNumber version number '
      name: incBuildNumber
      inputs:
        commit_changes: true
        # pushchanges: true
        versionControlProvider: azureRepo
    - task: AzlamSalam.sfpowerscripts.sfpwowerscripts-createsourcepackage-task.sfpwowerscripts-createsourcepackage-task@12
      displayName: 'Creates a new version of source based repo for force-di'
      inputs:
        package: $(PACKAGE_NAME)
        version_number: $(incBuildNumber.sfpowerscripts_incremented_project_version)
  
- stage: Validation
  jobs:
  - job: ValidationUAT
    displayName: Validate the deployment on UAT
    steps:
    - checkout: none
    - task: DownloadBuildArtifacts@0
      inputs:
        artifactName: '$(ARTIFACT_NAME)'
    # - task: AzlamSalam.sfpowerscripts.sfpwowerscript-checkoutprojectfromartifact-task.sfpwowerscript-checkoutprojectfromartifact-task@14
    #   displayName: 'Checkout  from associated build pipeline'
    #   inputs:
    #     versionControlProvider: azureRepo
    #     package: '$(PACKAGE_NAME)'
    - task: AzlamSalam.sfpowerscripts.sfpwowerscript-installsfdx-task.sfpwowerscript-installsfdx-task@7
      displayName: 'Install SFDX'
    - task: AzlamSalam.sfpowerscripts.sfpwowerscript-authenticateorg-task.sfpwowerscript-authenticateorg-task@9
      displayName: 'Authenticate JWT'
      inputs:
        method: JWT
        jwt_key_file: server.key
        username: $(SF_USERNAME)
        alias: RAT
        isdevhub: true
        clientid: $(SF_CONSUMER_KEY)
    - task: AzlamSalam.sfpowerscripts.sfpowerscript-deploysourcetoorg-task.sfpowerscript-deploysourcetoorg-task@10
      displayName: 'Deploy source'
      inputs:
        target_org: RAT
        project_directory: '$(ARTIFACT_DIRECTORY)'
        source_directory: 'force-app'
        checkonly: true

Need a preview option for Generate Changelog

The ideal placement for current generate changelog task is after all deployment in a Release pipeline. This is good for understanding and keeping a record for the changes. However one of the common asks is to understand the list of changes in the current release displayed in the console, so a go/no go decision can be made

Install Source Package for CLI

Milestone 17 introduces install source package for Azure Pipelines. This comes in with built in orchestration support for

  • Utilising the attached source in artifact eliminating need for checkout
  • Destructive Changes
  • Reconciling Profiles
  • Option for optimising deployment
  • Skipping Source Packages already installed

This need to be carried forward to CLI, the only functionality that wont be available immediately will be skipping source packages, as we need to determine where to store the package metadata. This could be addressed subsequently.

List Packages command

Context
Unlike Azure DevOps, some automation platforms do not support templatization which helps with task repeatability. To mitigate this shortcoming, we propose a command that outputs the packages defined in the sfdx-project.json as an array. The array of packages can be iterated over, executing a set of tasks for each package.

Requirements

  • The command, by default, should list all the packages defined in the sfdx-project.json in order.
  • The command should output the list of packages as an array, omitting any packages that are defined in forceignore

PMD Analysis - Cannot Export Full HTML Scan Results

I'm currently experiencing an issue in which I can't seem to export PMD scan results as the specified format or file name based on the format and outputPath task variables. The published artifact containing all the results defaults to "sf-pmd-output.xml".

Running in ADO Classic, my YAML equivalent is:

steps:
- task: AzlamSalam.sfpowerscripts.sfpwowerscripts-analyzewithpmd-task.sfpwowerscripts-analyzewithpmd-task@7
  displayName: 'Analyze ''source/xyz'' using PMD'
  inputs:
    directory: '''source/xyz''
    outputPath: '$(Agent.BuildDirectory)/pmd_results'

Then I publish the file specified by outputPath:

steps:
- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact: pmd_results'
  inputs:
    ArtifactName: 'pmd_results'

I see the HTML get generated in the console, but not published to my artifacts. Instead, a directory is created that matches my outputPath "pmd_results", and only publishes a single Markdown file ".codeAnalysis/CodeAnalysisBuildSummary.md".

PMD found 2993 violations in 183 files with 45 critical defects

How can I export the full HTML results?

Unable to install this extension from Azure DevOps server

I am unable to download this extension and use it. Keep getting "Error occurred when downloading the extension, please try again later" and on the other side another error says "Permission section could not be loaded". I am on Azure DevOps server and I think I do have the permission because I was able to install a different extension. Are there any special privileges required to install this extension?
Screen Shot 2020-08-17 at 9 36 23 AM

Simplify CLI usage by deprecating readvars

sfpowerscripts cli supports output variables, which are written to the environment of the host. However to consume this, a source readvars has to be issued before any other command. This makes the scripts verbose and defeat the purpose.

sfpowerscripts cli should store this output variable in its own environment config, and all tasks when provided with a non dereferenced variable, should check the store and figure the value. It should also print the resolved variables

Package Diff

Context
In a mono repo scenario, it would be ideal for the build pipeline to determine which package has changed and build only those packages rather than rebuilding the entire set of packages consuming resources and increased lead time

Proposed Solution
Given a list of source directories, for each directory check whether any changes have occurred since the last successful build for that package, and output the directories through multiple output variables (for eg: packagename to_be_built or a similar mechanism ) Utilize git based tags as the mechanism to identify whether package has changed.

  • The last successful build is identified by the latest tag using a sfpowerscripts defined nomenclature or mention the schema we expect.
  • A change in the package is identified as a file change that does not match a rule in .forceignore
  • Pre-Requisite
    Every successful build should be tagged (Modify package creation tasks to support it. We would need to enhance the creation tasks)

Similar Solutions

  • Lerna
  • Yarn workspaces

Remove Confusion around source packages by introducing a new task

Source Packages is an idea to bring artifact based deployment (similar to unlocked packaging) but done off the platform and basically to carry over metadata that is not covered by unlocked packages. It is as simple as having a Json metadata with commit id and a version number, which can then be deployed by metadata api.
However the use of this tasks are not straight forward, one have to remember, to checkout the artifact and then deploy the directory.

It is better to have a single task that handles installation of source packages

As this will take some time, we need to ensure the current documents are clear on how to deploy source packages

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.