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

Allow winget configure from https location and extend winget configure validate for winget resource units #3833

Merged
merged 22 commits into from Dec 14, 2023

Conversation

yao-msft
Copy link
Contributor

@yao-msft yao-msft commented Oct 30, 2023

Microsoft Reviewers: Open in CodeFlow

@yao-msft
Copy link
Contributor Author

yao-msft commented Nov 6, 2023

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yao-msft yao-msft marked this pull request as ready for review December 12, 2023 05:36
@yao-msft yao-msft requested a review from a team as a code owner December 12, 2023 05:36
@denelon
Copy link
Contributor

denelon commented Dec 12, 2023

Is this related to:

for (auto const& settingsPair : settings)
{
auto settingsKey = Utility::ConvertToUTF8(settingsPair.Key());
if (Utility::CaseInsensitiveEquals("sources", settingsKey))
Copy link
Member

Choose a reason for hiding this comment

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

Move string literals to statics.

struct WinGetSource
{
std::string Name;
std::string Type = "Microsoft.PreIndexed.Package";
Copy link
Member

Choose a reason for hiding this comment

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

Why encode the default value here?


if (Utility::CaseInsensitiveEquals(UnitType_WinGetSources, unitType))
{
if (unitIntent == ConfigurationUnitIntent::Assert || unitIntent == ConfigurationUnitIntent::Apply)
Copy link
Member

Choose a reason for hiding this comment

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

I don't feel like the intent is necessarily relevant to ensuring that the properties are well formed.

if (isRemote)
{
// TODO: Suggestions welcome on what values to pass in.
result.Name(argPathWide);
Copy link
Member

Choose a reason for hiding this comment

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

We do have code that extracts the file name portion from a URL that we use when downloading installers. I would use that to set Name similarly to what we set for the local filesystem paths.

For Origin I think the remote URL is fine.

I agree that we should not set Path.

}
catch (...) {}

if (pathAsUri && !pathAsUri.Suspicious())
Copy link
Member

Choose a reason for hiding this comment

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

Should Suspicious be handled under the "parsed as a URI portion"? Or do some local file paths end up with that flag?

We could probably have an appropriately handled interactive prompt for suspicious URIs to still allow them through if the user agrees. Or we can just flat out block them until there are complaints.

@yao-msft
Copy link
Contributor Author

Is this related to:

Yes, this pr implements the issue. I did not know this issue existed. I just linked it to the pr. Thanks.

@yao-msft yao-msft linked an issue Dec 13, 2023 that may be closed by this pull request
@yao-msft yao-msft merged commit a471e28 into microsoft:master Dec 14, 2023
8 checks passed
@yao-msft yao-msft deleted the configcommand branch December 14, 2023 21:35
@microsoft-github-policy-service microsoft-github-policy-service bot added the Issue-Feature This is a feature request for the Windows Package Manager client. label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature This is a feature request for the Windows Package Manager client.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WinGet Configure accepts a URL
3 participants