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

Added extra check for valid arguments in upgrade. #1874

Merged
merged 3 commits into from
Feb 1, 2022

Conversation

jedieaston
Copy link
Contributor

@jedieaston jedieaston commented Jan 23, 2022


Resolves #1869.

This PR adds a extra validation for arguments in winget upgrade, making sure that arguments that require a package search (--accept-package-agreements for example) don't cause a empty package search to run.

Tested: manually.

Microsoft Reviewers: Open in CodeFlow

@jedieaston jedieaston requested a review from a team as a code owner January 23, 2022 20:08
@florelis
Copy link
Member

I was also working on some extra checks for arguments to upgrade in #1795. Do you know if there is any conflict or overlap between the changes? I'll try to figure it out later, just wondering if you already know the answer.

(BTW, I love your branch names :))

@jedieaston
Copy link
Contributor Author

There isn't direct overlap (since this PR adds a check for no query and no list parameters). However, it could be simplified by having those functions present I think. (if !HasArgumentsForSinglePackage(execArgs) && !ShouldListUpgrade(execArgs) would give me the same thing I believe)

Do you want me to throw this in a draft, or do you want to add it to your PR?

@florelis
Copy link
Member

Do you want me to throw this in a draft, or do you want to add it to your PR?

I'm not sure how soon I'll complete that PR so I think we could get this change in first. You can grab my changes to the validation to simplify this check if you want, or I'll do it later when dealing with the merge conflicts. Up to you.

@jedieaston
Copy link
Contributor Author

I merged the bulk of your validation changes (git checkout --patch <branch> <file> is magical :D), if you want to take a peek. I was able to get the same effect via those functions.

Copy link
Member

@florelis florelis left a comment

Choose a reason for hiding this comment

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

Looks good to me, but I'll wait for somebody else to approve it since you used some of my changes.

@yao-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JohnMcPMS
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JohnMcPMS JohnMcPMS merged commit d386744 into microsoft:master Feb 1, 2022
@jedieaston jedieaston deleted the dude-wheres-my-query branch February 1, 2022 01:52
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.

winget upgrade --accept-source-agreement list all packages even if new version isn't available
4 participants