WaelHamze / dyn365-ce-vsts-tasks

VSTS Extension for Dynamics 365 Customer Engagement
https://marketplace.visualstudio.com/items?itemName=WaelHamze.xrm-ci-framework-build-tasks
GNU General Public License v3.0
115 stars 54 forks source link

Get Latest Patch (Preview) var error. #223

Open fmikowski opened 3 years ago

fmikowski commented 3 years ago

Hi Wael.

This is almost similar to #216, I have created the vars as described on #216 in the pipeline, and it seems that the component gets the right patch name, but it throws an error when it tries to set some values to the output vars.

Patch Name: AutomatedDedploymentTest_Patch_91298618 <- This is correct Unable to process command '##vso[task.setvariable variable=PATCH_EXISTS]True' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296) Value cannot be null. Unable to process command '##vso[task.setvariable variable=PATCH_NAME]AutomatedDedploymentTest_Patch_91298618' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296) Value cannot be null.

This is the task config:

image

This is the vars created in the pipeline:

image

By looking into the code I think that the script does not find the OUTPUT vars on line 50 and 51 of the MSCRMGetLatestPatch.ps1

Write-Host "##vso[task.setvariable variable=PATCH_EXISTS]$exists" Write-Host "##vso[task.setvariable variable=PATCH_NAME]$name"

I don't know a lot about PS development so I can't even build the solution, otherwise I would help, but would the code work without those two lines since you are setting the vars right after this section?

if ($existsVariableName) { Write-Host "##vso[task.setvariable variable=$existsVariableName]$exists" } if ($patchVariableName) { Write-Host "##vso[task.setvariable variable=$patchVariableName]$name" }

Write-Verbose 'Leaving MSCRMGetLatest.ps1'

Thank you!

Fernando.

fmikowski commented 3 years ago

Log: 2020-11-16T23:45:39.5434970Z ##[error]Unable to process command '##vso[task.setvariable variable=PATCH_EXISTS]True' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296) 2020-11-16T23:45:39.5434970Z ##[error]Value cannot be null. Parameter name: RefName 2020-11-16T23:45:39.5434970Z ##[error]Unable to process command '##vso[task.setvariable variable=PATCH_NAME]AutomatedDedploymentTest_Patch_91298618' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296) 2020-11-16T23:45:39.5434970Z ##[error]Value cannot be null. Parameter name: RefName

fmikowski commented 3 years ago

Update, I am getting the same error when trying to import the patch, BUT if force to continue on errors everything works. 2020-11-16T23:51:25.8728262Z ##[error]Unable to process command '##vso[task.setvariable variable=SOLUTION_IMPORT_LOG_FILE]\ImportLog_AutomatedDedploymentTest_Patch_912986182020_11_16__15_49.xml' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296) 2020-11-16T23:51:25.8728262Z ##[error]Value cannot be null. Parameter name: RefName

Sonali79-FS commented 1 year ago

Hello,

I am also going through the same issue. The output is not getting generated from the pipeline. This is what I have image Please let me know if this is resolved by someone. The pipeline succeeds so I do not get any errors.