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

Shift common installer fields to manifest root level #409

Merged
merged 16 commits into from
Jul 21, 2023

Conversation

mdanish-kh
Copy link
Contributor

@mdanish-kh mdanish-kh commented Jul 16, 2023

This change modifies the Update flow (both interactive and autonomous) to shift the manifest root values to installer level at the start of the update for easier program logic and then shifting the common installer values back to manifest root at the end of the update for better human readable manifests. Similar shifting done at the end of New Command flow as well.

Broke PromptPropertiesAndDisplayManifests into multiple functions for better separation of concerns and so that shifting can be done before the call to DisplayManifestPreview()

Manually verified with packages like DevHome, Terminal, PowerToys, WinGetCreate to make sure I wasn’t breaking any existing CIs with this change.

Also refactored previous function for consistent naming

Edit after merge: This should also fix #211 since the root values are now moved and overwritten to the installer level at the start of the update flow which will make it so that the ProductCode always correctly gets updated and then moved to the root level if it's common between all installers.


@mdanish-kh mdanish-kh requested a review from a team as a code owner July 16, 2023 20:58
@mdanish-kh mdanish-kh requested review from yao-msft and ryfu-msft and removed request for a team July 16, 2023 20:58
src/WingetCreateCLI/Commands/BaseCommand.cs Outdated Show resolved Hide resolved
src/WingetCreateCLI/Commands/BaseCommand.cs Outdated Show resolved Hide resolved
src/WingetCreateCLI/Commands/BaseCommand.cs Outdated Show resolved Hide resolved
src/WingetCreateCLI/Commands/BaseCommand.cs Show resolved Hide resolved
@ryfu-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mdanish-kh
Copy link
Contributor Author

mdanish-kh commented Jul 19, 2023

Took me some time to get around how the tests are added. While I was adding the test case I realized that the properties that are partial classes were not getting compared correctly and we needed to add the .Equals() override for those properties. Also had to redundantly move the methods to autonomous and interactive update methods so that the results are visible in test cases. Updated existing test cases to match the new behavior introduced by this PR.

Copy link
Contributor

@ryfu-msft ryfu-msft left a comment

Choose a reason for hiding this comment

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

Nice tests! Just a couple more modifications and this should be good to go.

@ryfu-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mdanish-kh
Copy link
Contributor Author

mdanish-kh commented Jul 20, 2023

Let me know if I messed up somewhere while addressing the review comments 😄VS is warning me to implement GetHashCode() overrides and separate each partial class into a separate file. Let me know if this is something I should look into or something that we can ignore for now.

@ryfu-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

No commit pushedDate could be found for PR 409 in repo microsoft/winget-create

@ryfu-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@ryfu-msft ryfu-msft left a comment

Choose a reason for hiding this comment

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

We want to make sure these build warnings go away as I think these may cause issues when we try to publish a new release. Don't worry about the GetHashCode() warnings, it is fine as is.

@ryfu-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@ryfu-msft ryfu-msft left a comment

Choose a reason for hiding this comment

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

:shipit:

@ryfu-msft ryfu-msft merged commit 4f8406f into microsoft:main Jul 21, 2023
4 checks passed
@mdanish-kh mdanish-kh deleted the moveCommonFieldsToManifestLevel branch July 21, 2023 06:50
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.

Items at root level are not modified
2 participants