scolladon / sfdx-git-delta

Generate the sfdx content in source format from two git commits
Other
438 stars 115 forks source link

Warning: sgd:source:delta is not a sfdx command. #173

Closed afzal-tag closed 3 years ago

afzal-tag commented 3 years ago

Here is my yml file

trigger:
  batch: "true"
  branches:
    include:
    - features/*
  paths:
    exclude:
    - README.md
    - azure-pipelines.yml

pool:
  vmImage: 'ubuntu-latest'

steps:
- task: UseNode@1
- bash: 
    npm install sfdx-cli --global
  displayName: Installing Salesforce CLI
- bash: 
    npm install sfdx-git-delta@latest --global
  displayName: Installing Salesforce GIT Delta Plugin
- bash: 
    sfdx sgd:source:delta --to HEAD --from HEAD~4 --output B2B/packageToDeploy/
  displayName: Fetching delta changes from the repository
  workingDirectory: '$(system.defaultWorkingDirectory)'
- bash: 
    sfdx force:auth:jwt:grant --clientid $(salesforceDevOrgClientId) --jwtkeyfile buildfiles/server.key --username $(salesforceDevOrgUserName) --instanceurl $(salesforceDevOrgInstanceURL) -a sitOrg
  displayName: Authorizing salesforce org
  workingDirectory: '$(system.defaultWorkingDirectory)/B2B'
- bash: 
    sfdx force:source:deploy -x packageToDeploy/package/package.xml -c -u sitOrg
  displayName: Running validation in SIT org
  workingDirectory: '$(system.defaultWorkingDirectory)/B2B'

And here the error am getting

Warning: sgd:source:delta is not a sfdx command.

And here is raw error log

2021-07-30T14:56:34.8379515Z ##[debug]Evaluating condition for step: 'Fetching delta changes from the repository' 2021-07-30T14:56:34.8381554Z ##[debug]Evaluating: SucceededNode() 2021-07-30T14:56:34.8382095Z ##[debug]Evaluating SucceededNode: 2021-07-30T14:56:34.8383205Z ##[debug]=> True 2021-07-30T14:56:34.8383652Z ##[debug]Result: True 2021-07-30T14:56:34.8384293Z ##[section]Starting: Fetching delta changes from the repository 2021-07-30T14:56:34.8391418Z ============================================================================== 2021-07-30T14:56:34.8391686Z Task : Bash 2021-07-30T14:56:34.8391907Z Description : Run a Bash script on macOS, Linux, or Windows 2021-07-30T14:56:34.8392121Z Version : 3.189.0 2021-07-30T14:56:34.8392313Z Author : Microsoft Corporation 2021-07-30T14:56:34.8392626Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash 2021-07-30T14:56:34.8392935Z ============================================================================== 2021-07-30T14:56:34.8434969Z ##[debug]Using node path: /home/vsts/agents/2.189.0/externals/node10/bin/node 2021-07-30T14:56:34.9418155Z ##[debug]agent.TempDirectory=/home/vsts/work/_temp 2021-07-30T14:56:34.9438605Z ##[debug]loading inputs and endpoints 2021-07-30T14:56:34.9444661Z ##[debug]loading INPUT_TARGETTYPE 2021-07-30T14:56:34.9460060Z ##[debug]loading INPUT_FILEPATH 2021-07-30T14:56:34.9465271Z ##[debug]loading INPUT_SCRIPT 2021-07-30T14:56:34.9465703Z ##[debug]loading INPUT_WORKINGDIRECTORY 2021-07-30T14:56:34.9466125Z ##[debug]loading INPUT_FAILONSTDERR 2021-07-30T14:56:34.9466520Z ##[debug]loading INPUT_NOPROFILE 2021-07-30T14:56:34.9466918Z ##[debug]loading INPUT_NORC 2021-07-30T14:56:34.9467345Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION 2021-07-30T14:56:34.9467836Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION 2021-07-30T14:56:34.9469379Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN 2021-07-30T14:56:34.9470721Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN 2021-07-30T14:56:34.9471151Z ##[debug]loaded 11 2021-07-30T14:56:34.9475716Z ##[debug]Agent.ProxyUrl=undefined 2021-07-30T14:56:34.9476135Z ##[debug]Agent.CAInfo=undefined 2021-07-30T14:56:34.9476531Z ##[debug]Agent.ClientCert=undefined 2021-07-30T14:56:34.9476958Z ##[debug]Agent.SkipCertValidation=undefined 2021-07-30T14:56:34.9481999Z ##[debug]noProfile=true 2021-07-30T14:56:34.9482384Z ##[debug]noRc=true 2021-07-30T14:56:34.9490270Z ##[debug]check path : /home/vsts/work/_tasks/Bash_6c731c3c-3c68-459a-a5c9-bde6e6595b5b/3.189.0/task.json 2021-07-30T14:56:34.9493165Z ##[debug]adding resource file: /home/vsts/work/_tasks/Bash_6c731c3c-3c68-459a-a5c9-bde6e6595b5b/3.189.0/task.json 2021-07-30T14:56:34.9493788Z ##[debug]system.culture=en-US 2021-07-30T14:56:34.9503953Z ##[debug]failOnStderr=false 2021-07-30T14:56:34.9504404Z ##[debug]workingDirectory=/home/vsts/work/1/s 2021-07-30T14:56:34.9504850Z ##[debug]check path : /home/vsts/work/1/s 2021-07-30T14:56:34.9505270Z ##[debug]targetType=inline 2021-07-30T14:56:34.9505960Z ##[debug]script=sfdx sgd:source:delta --to HEAD --from HEAD~4 --output ./B2B/packageToDeploy/ 2021-07-30T14:56:34.9513718Z Generating script. 2021-07-30T14:56:34.9515608Z ##[debug]which 'bash' 2021-07-30T14:56:34.9526408Z ##[debug]found: '/usr/bin/bash' 2021-07-30T14:56:34.9526744Z Script contents: 2021-07-30T14:56:34.9527237Z sfdx sgd:source:delta --to HEAD --from HEAD~4 --output ./B2B/packageToDeploy/ 2021-07-30T14:56:34.9527658Z ##[debug]Agent.Version=2.189.0 2021-07-30T14:56:34.9528089Z ##[debug]agent.tempDirectory=/home/vsts/work/_temp 2021-07-30T14:56:34.9528547Z ##[debug]check path : /home/vsts/work/_temp 2021-07-30T14:56:34.9535426Z ========================== Starting Command Output =========================== 2021-07-30T14:56:34.9540006Z ##[debug]which '/usr/bin/bash' 2021-07-30T14:56:34.9540564Z ##[debug]found: '/usr/bin/bash' 2021-07-30T14:56:34.9541073Z ##[debug]/usr/bin/bash arg: --noprofile 2021-07-30T14:56:34.9541579Z ##[debug]/usr/bin/bash arg: --norc 2021-07-30T14:56:34.9542153Z ##[debug]/usr/bin/bash arg: /home/vsts/work/_temp/e5584ea0-8135-42e7-b2b1-d179a81ea01d.sh 2021-07-30T14:56:34.9544822Z ##[debug]exec tool: /usr/bin/bash 2021-07-30T14:56:34.9545220Z ##[debug]arguments: 2021-07-30T14:56:34.9545711Z ##[debug] --noprofile 2021-07-30T14:56:34.9546166Z ##[debug] --norc 2021-07-30T14:56:34.9546690Z ##[debug] /home/vsts/work/_temp/e5584ea0-8135-42e7-b2b1-d179a81ea01d.sh 2021-07-30T14:56:34.9548196Z [command]/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/e5584ea0-8135-42e7-b2b1-d179a81ea01d.sh 2021-07-30T14:56:35.8191720Z › Warning: sgd:source:delta is not a sfdx command. 2021-07-30T14:56:40.7260229Z Did you mean force:source:delete? [y/n]: 2021-07-30T14:56:40.7301658Z › Error: Run sfdx help for a list of available commands. 2021-07-30T14:56:40.7489607Z ##[debug]Exit code 127 received from tool '/usr/bin/bash' 2021-07-30T14:56:40.7490559Z ##[debug]STDIO streams have closed for tool '/usr/bin/bash' 2021-07-30T14:56:40.7530748Z ##[error]Bash exited with code '127'. 2021-07-30T14:56:40.7540543Z ##[debug]Processed: ##vso[task.issue type=error;]Bash exited with code '127'. 2021-07-30T14:56:40.7541896Z ##[debug]task result: Failed 2021-07-30T14:56:40.7545184Z ##[debug]Processed: ##vso[task.complete result=Failed;done=true;] 2021-07-30T14:56:40.7564078Z ##[section]Finishing: Fetching delta changes from the repository

scolladon commented 3 years ago

Hi @afzal-tag !

Thanks for your help on making this plugin better !

My understanding is that the plugin installation is run using the internal cli (directly via npm) and not via the sfdx plugin. This cause the issue you have (command not available via sfdx)

Could you try changing those lines:

- bash: 
    npm install sfdx-git-delta@latest --global
    displayName: Installing Salesforce GIT Delta Plugin

by the following lines:

- bash: 
    sfdx plugins:install sfdx-git-delta
    displayName: Installing Salesforce GIT Delta Plugin

then retry and let us know how it changed the result ?

afzal-tag commented 3 years ago

Tried that but with no luck. The task kept running over 15 minutes and never completed, so had to stop the run manually. Please refer attached screenshot.

sgd issue
scolladon commented 3 years ago

Hum, I think it is because of the prompt from the installation when installing a non digitally signed plugin.

You should try

- bash: 
    echo y | sfdx plugins:install sfdx-git-delta
    displayName: Installing Salesforce GIT Delta Plugin
afzal-tag commented 3 years ago

That did the trick. Thanks for your help. Really appreciate it.

And thanks for the awesome plugin!