(#1137) Fix package gallery details url not showing on gallery packages#1138
Merged
vexx32 merged 5 commits intoMay 22, 2026
Merged
Conversation
Add three new unit test projects to the solution structure and configure the UITests project with necessary testing dependencies. This establishes a comprehensive testing framework across multiple project layers. Key Changes: - Add ChocolateyGui.Tests project - Add ChocolateyGui.Common.Tests project - Add ChocolateyGui.Common.Windows.Tests project - Create Tests solution folder to organize test projects - Add coverlet.msbuild package for code coverage support - Add Microsoft.NET.Test.Sdk package to UITests project - Configure all test projects with build configurations Reason for the change: - Improve test coverage across the codebase - Establish unit testing infrastructure for core components - Enable code coverage analysis and reporting - Organize test projects in a dedicated solution folder
Add mapping configuration for the GalleryDetailsUrl property in the AutoMapper profile for package metadata transformation. Key Changes: - Add ForMember mapping for GalleryDetailsUrl property - Map PackageDetailsUrl to GalleryDetailsUrl with null handling - Convert PackageDetailsUrl to its absolute URI string representation Reason of the change: - Ensure package gallery URL is properly mapped during object transformation - Handle null PackageDetailsUrl values gracefully to prevent mapping errors - Provide consistent access to package details URL through the mapped GalleryDetailsUrl property
11 tasks
vexx32
requested changes
May 21, 2026
vexx32
left a comment
Member
There was a problem hiding this comment.
Mostly looks good, a couple things I think we can improve, but nothing major.
Introduce a new utility class to handle gallery URI construction and validation for Chocolatey package sources. This centralizes the logic for building package gallery URLs and identifying known Chocolatey sources. Key Changes: - Add GalleryUriBuilder static class with URI construction methods - Implement BuildFromPackageAndSource to create URIs from package ID, source URL, and optional version - Implement BuildCommunityGalleryFromPackage for community gallery URIs - Implement IsKnownSource to validate if a URL is a known Chocolatey source Reason for the change: - Consolidate URI building logic in a reusable utility class - Reduce code duplication across the application - Provide consistent handling of gallery URLs and source validation
Enhance package mapping to automatically generate gallery details URLs for known package sources when the URL is not already set. Key Changes: - Add using statement for ChocolateyGui.Common.Windows.Utilities - Implement logic to build gallery details URL from package source information - Use GalleryUriBuilder to construct URLs for known sources - Populate mappedPackage.GalleryDetailsUrl when empty and source is recognized Reason of the change: - Improve user experience by automatically providing gallery links for packages from known sources (normally locally installed packages) - Reduce manual URL configuration requirements - Leverage existing GalleryUriBuilder utility for consistent URL generation
Move AutoMapper configuration logic from ChocolateyGuiModule into a dedicated ChocolateyMapperConfiguration class. This improves code organization and makes the mapper setup more testable and maintainable. Key Changes: - Create new ChocolateyMapperConfiguration class with CreateConfiguration method - Move all mapper configuration code from ChocolateyGuiModule to the new class - Remove unused imports from ChocolateyGuiModule - Configure all entity mappings including Package, Feature, Setting, Source, and AdvancedInstall types Reason for the change: - Reduce complexity in ChocolateyGuiModule by extracting mapper setup logic - Improve testability of mapper configuration - Follow single responsibility principle - Make mapper configuration reusable across the application
de3332c to
5a9465c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description Of Changes
Motivation and Context
Fix issue where Gallery URLs are not being visible despite them being available, as well as adding Gallery URLs for locally installed packages when the source is a known Gallery Source.
Testing
Before starting the testing step, ensure that you have at least 1 package installed from the Chocolatey Community Repository, one package from a non Chocolatey Community Repository source, as well as having the Chocolatey Community Repository source, and one non Chocolatey Community Repository source available and enabled.
This PCsidebar menu.Galleryis mentioned, and clicking on it navigates to the correct page.This PCsidebar menu.Gallery.chocolateysource.Galleryis mentioned, and clicking on it navigates to the correct page.Gallery.To note: FlaUI tests were attempted, but due to them seeming to need a specific initial state were not possible to complete at this moment.
Operating Systems Testing
Change Types Made
Change Checklist
Related Issue
Fixes #1137