-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 support for rest api 1.1 interface #1396
Conversation
I thought we spoke that Add would also make a call to /information endpoint. Isnt that the case? or is it something that will be added later? In reply to: 907442626 In reply to: 907442626 In reply to: 907442626 In reply to: 907442626 In reply to: 907442626 Refers to: src/AppInstallerRepositoryCore/Rest/RestSourceFactory.cpp:27 in 3a19d8f. [](commit_id = 3a19d8f, deletion_comment = False) |
@@ -78,7 +79,22 @@ namespace AppInstaller::CLI | |||
Workflow::EnsureRunningAsAdmin << | |||
Workflow::GetSourceList << | |||
Workflow::CheckSourceListAgainstAdd << | |||
Workflow::AddSource; | |||
Workflow::AddSource << | |||
Workflow::OpenSourceForSourceAdd << |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, this workflow is awkward. If the process crashes then the source can be left configured (but presumably not accepted).
I would think it possible to OpenSourceFromDetails
in order to work with the agreement, then add the source with an indication of acceptance.
@@ -56,6 +57,7 @@ namespace AppInstaller::CLI | |||
Workflow::ReportExecutionStage(Workflow::ExecutionStage::Discovery) << | |||
Workflow::OpenSource << | |||
Workflow::OpenCompositeSource(Repository::PredefinedSource::Installed) << | |||
Workflow::HandleSourceAgreements << |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is just going to have to go in after every source open, should it not just be part of the workflow task itself. #Resolved
@@ -78,7 +79,22 @@ namespace AppInstaller::CLI | |||
Workflow::EnsureRunningAsAdmin << | |||
Workflow::GetSourceList << | |||
Workflow::CheckSourceListAgainstAdd << | |||
Workflow::AddSource; | |||
Workflow::AddSource << | |||
Workflow::OpenSourceForSourceAdd << |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, this workflow is awkward. If the process crashes then the source can be left configured (but presumably not accepted).
I would think it possible to OpenSourceFromDetails
in order to work with the agreement, then add the source with an indication of acceptance.
@@ -653,6 +673,12 @@ namespace AppInstaller::CLI::Workflow | |||
} | |||
|
|||
void ReportManifestIdentity(Execution::Context& context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what cases are we now not reporting the version? #Pending
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly show command will handle versioning differently depending on what arguments are passed in
std::vector<ValidationError> ValidateManifest(const Manifest& manifest); | ||
void ValidateManifestLocalization(const ManifestVer& manifestVersion, const ManifestLocalization& localization, std::vector<ValidationError>& resultErrors); | ||
// validateForRead: bool indicating the validation is performed during reading a manifest, which is less restrictive | ||
std::vector<ValidationError> ValidateManifest(const Manifest& manifest, bool validateForRead = false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that we called that fullValidation
before. It this different? #Resolved
std::vector<std::string> UnsupportedQueryParameters; | ||
std::vector<std::string> RequiredQueryParameters; | ||
|
||
std::string GetErrorFieldsMessage(const std::vector<std::string>& input) const noexcept |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be moved to cpp. #Resolved
} | ||
|
||
return "UnknownMatchField"sv; | ||
} | ||
|
||
inline PackageMatchField StringToPackageMatchField(std::string_view field) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both should be moved to cpp as well. #Resolved
Label(std::move(label)), Text(std::move(text)), Url(std::move(url)) {} | ||
}; | ||
|
||
struct SourceInformation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment on what this is. #Resolved
@@ -190,4 +226,10 @@ namespace AppInstaller::Repository | |||
// Return value indicates whether the named source was found. | |||
// Passing an empty string drops all sources. | |||
bool DropSource(std::string_view name); | |||
|
|||
// Checks the source agreements and return a list that needs user acceptance. | |||
std::vector<SourceDetails> CheckSourceAgreements(const std::vector<SourceDetails>& sources); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do these operate on vectors? You can get all of the sources from GetAvailableSources
and can operate on them one at a time. #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per offline chat, we'll make agreement checking one by one
}; | ||
|
||
// List of fields that require user agreements. | ||
enum class ImplicitAgreementField : int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is to be a flags enum, you should call that out. I would even suggest in the name. #Resolved
<value>Do you agree to all the source agreements terms?</value> | ||
</data> | ||
<data name="SourceAgreementsNotAgreedTo" xml:space="preserve"> | ||
<value>Source agreements not agreed to. Execution cancelled.</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ | ||
if (version == Version_1_0_0) | ||
{ | ||
return std::make_unique<Schema::V1_0::Interface>(api); | ||
} | ||
|
||
else if (version == Version_1_1_0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continue; | ||
} | ||
|
||
if (searchRequest.Filters.end() != std::find_if(searchRequest.Filters.begin(), searchRequest.Filters.end(), [&](const PackageMatchFilter& filter) { return filter.Field == matchField; })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ | ||
if (WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::SkipAgreementsAcceptance)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this an option?
I understand command line to auto accept agreement, but one should never be able to add a source and SKIP the agreement? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SkipAgreementAcceptance is not a command line option, it's a flag set by ComContext, where for Com flow, we should skip agreement checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we shouldn't call this skip agreements, but something like "User already agreed to agreements".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@denelon RE naming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming things is hard. I'm not sure how one would "read" this code. I agree we don't want this to be perceived as a way to programmatically skip agreements. I think the intent is either to indicate that we don't need to prompt because the agreement had already been accepted by the user or by the IT Administrator when set by policy.
AgreementPreviouslyAccepted ?
<data name="LicenseNotAgreedTo" xml:space="preserve"> | ||
<value>License not agreed to. Installation cancelled.</value> | ||
<data name="PackageAgreementsNotAgreedTo" xml:space="preserve"> | ||
<value>Package agreements not agreed to. Execution cancelled.</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Execution cancelled" seems like a wierd way to phrase this to me. #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps "Operation"?
<value>Failed to open the added source</value> | ||
</data> | ||
<data name="AcceptSourceAgreementsArgumentDescription" xml:space="preserve"> | ||
<value>Accept all source agreements during source operations</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these have ending punctuation. others do not. Intended? #ByDesign
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is for argument description, it aligns with other argument description, it does not have the ending period.
<value>Do you agree to all the source agreements terms?</value> | ||
</data> | ||
<data name="SourceAgreementsNotAgreedTo" xml:space="preserve"> | ||
<value>One or more of the source agreements not agreed to. Operation cancelled. Please accept the source agreements or remove the corresponding sources.</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Fix bad merge (microsoft#1408) * Add support for rest api 1.1 interface (microsoft#1396) Added support for market Added support for source agreements Added support for msstore type Minor changes to workflow ui Next pr will be the manifest v1.1 integration. * Remove the packagedAPI experimental feature flag (microsoft#1419) * Integrating custom header with V1.1 changes (microsoft#1422) Integrating custom header with V1.1 changes * Expose pass through header through com interface. (microsoft#1420) * Add custom header. * Update behavior for composites. * Revert line ending changes. * Add comment. * Update composite behavior. * Fix error code * Update Loggers to support multiple Win32 app installs in single process (microsoft#1399) * Update Loggers to support multi threaded processing of Win32 app install requests in WPMServer Co-authored-by: JohnMcPMS <[email protected]> Co-authored-by: yao-msft <[email protected]> Co-authored-by: Ashwini Patil <[email protected]> Co-authored-by: sachintaMSFT <[email protected]>
Related to #1243 |
…1373) * Add c# in proc winrt wrapper and projection * Add wrapper implementation and project * Override factory to return objects. * Fix unreferenced parameters. * Guid name updates. * Undo unneccessary changes. * Remove projection. * Spelling changes. * Simplify packaged test csproj file. * Update guids\packagereference versions. * Remove anycpu * Append defines instead of overriding. * Attempt switch to packages.config for nuget * Add packagereference back. * Try packages.config again. * Try direct restore of csproj * Try workaround solutiondir issue * Try fix bundleplatforms. * Change outputpath * Remove output path * Make client and server have separate lib names. * Add output path back. * Merge build break fix to allow pipeline run. * Move test package to its own solution. * Microsoft.Management.Deployment.Client buildchange * Merge local master to comtesting (#16) * Fix bad merge (#1408) * Add support for rest api 1.1 interface (#1396) Added support for market Added support for source agreements Added support for msstore type Minor changes to workflow ui Next pr will be the manifest v1.1 integration. * Remove the packagedAPI experimental feature flag (#1419) * Integrating custom header with V1.1 changes (#1422) Integrating custom header with V1.1 changes * Expose pass through header through com interface. (#1420) * Add custom header. * Update behavior for composites. * Revert line ending changes. * Add comment. * Update composite behavior. * Fix error code * Update Loggers to support multiple Win32 app installs in single process (#1399) * Update Loggers to support multi threaded processing of Win32 app install requests in WPMServer Co-authored-by: JohnMcPMS <[email protected]> Co-authored-by: yao-msft <[email protected]> Co-authored-by: Ashwini Patil <[email protected]> Co-authored-by: sachintaMSFT <[email protected]> * Remove unneccessary cpp files * Run Com Interface tests * Add appxrecipe to spelling * Update test path * Update test paths. * Remove test adapter dll from testassembly * Add powershell task to install wingetdev * Add runsettings file to publish logs. * Test installing package in vstest * Try newer windows server. * Try enable com tracing for tests. * Try direct run of vstest * Fix install script to call add script. * Fix appxpackages path. * Fix path again, remove trace * Extract unsigned package for loose register * reenable tracing * Include server in packagedtests * Remove build dependency on wingetserver project * Try tracelog comtracing. * Fix powershell args. * Handle variable azure src dir paths. * Make Dll version of com server and use for tests * Fix library name parameter. * Remove com tracing. Fix test. * Fix copyright and spelling. * Try decrease build disk size. Co-authored-by: JohnMcPMS <[email protected]> Co-authored-by: yao-msft <[email protected]> Co-authored-by: Ashwini Patil <[email protected]> Co-authored-by: sachintaMSFT <[email protected]>
Next pr will be the manifest v1.1 integration.
Microsoft Reviewers: Open in CodeFlow