Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't try to copy code/config/data folder if it does not exist #6380

Merged
merged 7 commits into from
Mar 2, 2018

Conversation

BinWuMSFT
Copy link
Contributor

No description provided.

@@ -148,6 +148,10 @@ function Copy-DiffPackage
$localPkgPath += ".zip"
$diffPkgPath += ".zip"
}
elseif (!(Test-Path -Path ($localPkgPath)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit-pick: ($localPkgPath) could just be $localPkgPath

@NCarlsonMSFT
Copy link
Member

Additional non-blocking Nit-Pick: a comment around why we are continuing would be nice.

@@ -148,6 +148,11 @@ function Copy-DiffPackage
$localPkgPath += ".zip"
$diffPkgPath += ".zip"
}
# The Code package for containerized service does not exist, but we want to continue the deployment
elseif (!(Test-Path -Path $localPkgPath))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ignores the scenario when package does not exist when service is non-containerized. Do we want to not throw in such case?
This should also be fine as we do a validation downstream using Test-ServiceFabricApplicationPackage - which anyways would fail
However, would it be better to move Test-ServiceFabricApplicationPackage before doing diff'ing as well. This will ensure that we do have a valid package before diffing - giving us more confidence that diffing has not invalidated the package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bishal-pdMSFT Added Test-ServiceFabricApplicationPackage before creating diff package in deploy.ps1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bishal-pdMSFT Do you have any other concern on this PR?

@@ -130,6 +130,8 @@ Register-Mock Get-ServiceFabricServiceManifest {$serviceManifest3} -- -Applicati
Register-Mock Get-ServiceFabricServiceManifest {$serviceManifest4} -- -ApplicationTypeName $applicationTypeName -ApplicationTypeVersion $applicationTypeVersion -ServiceManifestName "Stateless4Pkg"

Register-Mock Copy-Item {} $appManifestPath $appManifestDiffPath -Force
Register-Mock Test-Path { $true } -Path $codePkg1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a case for false also

@@ -102,8 +102,15 @@ try {
$useDiffPackage = [System.Boolean]::Parse((Get-VstsInput -Name useDiffPackage))
if ($useDiffPackage)
{
Import-Module "$PSScriptRoot\Create-DiffPackage.psm1"
$diffPackagePath = Create-DiffPackage -ApplicationName $applicationName -ApplicationPackagePath $applicationPackagePath -ConnectedServiceEndpoint $connectedServiceEndpoint -ClusterConnectionParameters $clusterConnectionParameters
if (Test-ServiceFabricApplicationPackage -ApplicationPackagePath $applicationPackagePath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should ignore Test-ServiceFabricApplicationPackage if skipValidation is set to true

}
else
{
Write-Host (Get-VstsLocString -Key DIFFPKG_TestAppPkgFailed)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a warning

{
$isPackageValid = Test-ServiceFabricApplicationPackage -ApplicationPackagePath $applicationPackagePath
}
if ($isPackageValid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put an empty line before starting if block

@BinWuMSFT BinWuMSFT merged commit 70bbe7a into master Mar 2, 2018
@starkmsu starkmsu deleted the dev/binwu/diffPkgFix2 branch July 14, 2023 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants