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

Add upgrade functionality in Com api #1853

Merged
merged 4 commits into from
Jan 21, 2022
Merged

Conversation

yao-msft
Copy link
Contributor

@yao-msft yao-msft commented Jan 14, 2022

Change

  • Added upgrade Com api
  • Fixed Com install issue for msstore type
  • Fixed Com install issue when an installer has dependencies

Validation

Since the Com packaged tests are not ready yet, I manually verified the fixed Com install api and the newly added upgrade api works on wnget source and msstore rest source.

Next I'll work on enabling Com tests as part of the e2e tests.

Microsoft Reviewers: Open in CodeFlow

@yao-msft yao-msft requested a review from a team as a code owner January 14, 2022 21:55
@@ -27,8 +27,7 @@ namespace AppInstaller::CLI
void COMInstallCommand::ExecuteInternal(Context& context) const
{
context <<
Workflow::GetInstallerHash <<
Workflow::VerifyInstallerHash <<
Workflow::ReverifyInstallerHash <<
Copy link
Member

@JohnMcPMS JohnMcPMS Jan 20, 2022

Choose a reason for hiding this comment

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

nit: This seems overly aggressive on combining tasks. #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll leave it as is for bug fix now

@@ -341,6 +341,9 @@ namespace winrt::Microsoft::Management::Deployment::implementation
Microsoft::Management::Deployment::PackageVersionInfo packageVersionInfo = GetPackageVersionInfo(package, options);
AddPackageManifestToContext(packageVersionInfo, context.get());

// If the installer has dependencies, DependencySource needs to be set.
Copy link
Member

@JohnMcPMS JohnMcPMS Jan 20, 2022

Choose a reason for hiding this comment

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

Is there not a way that we can set the actual Source object rather than adding an argument? #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's my test manifest is pointing to invalid dependencies. I'll remove this line as it's unnecessary.

}
else
{
co_return GetInstallResult(executionStage, APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE, correlationData, false);
Copy link
Member

@JohnMcPMS JohnMcPMS Jan 20, 2022

Choose a reason for hiding this comment

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

I think that we might need to break down the specific cases more for these errors. Specifically, I'm concerned about overloading this error (based on what I think is returning it, so I could be wrong). If the update does not have an applicable installer, do we get this error?

If the caller gives us a version that is less than or equal to the current version, should we have a different error? If the caller does not give us a version, but the latest version is already installed, what error will be produced, if any?
#Resolved

winrt::Windows::Foundation::IAsyncOperationWithProgress<winrt::Microsoft::Management::Deployment::InstallResult, winrt::Microsoft::Management::Deployment::InstallProgress>
GetInstallProgress(winrt::Microsoft::Management::Deployment::CatalogPackage package, winrt::Microsoft::Management::Deployment::PackageCatalogInfo catalogInfo);
// Contract 4.0
Copy link
Member

@JohnMcPMS JohnMcPMS Jan 20, 2022

Choose a reason for hiding this comment

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

What happened to 3? Was that the enum value I added? #Resolved

@ghost ghost added Needs-Author-Feedback Issue needs attention from issue or PR author and removed Needs-Author-Feedback Issue needs attention from issue or PR author labels Jan 20, 2022
@@ -199,6 +199,8 @@ namespace winrt::Microsoft::Management::Deployment::implementation
resultStatus = winrt::Microsoft::Management::Deployment::InstallResultStatus::NoApplicableInstallers;
break;
case APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE:
case APPINSTALLER_CLI_ERROR_UPGRADE_VERSION_UNKNOWN:
case APPINSTALLER_CLI_ERROR_UPGRADE_VERSION_NOT_NEWER:
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure what the existing interactions look like, but we might need to separate these into new InstallResultStatus values as well.

It looks like we didn't split the "expected return codes" out in the InstallResultStatus, which itself seems like it might be an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants