fix(hardened): remove PURL qualifier double-encoding and enable Hummingbird URL#636
Merged
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRemoves redundant URL encoding when building hardened image PackageURLs, enables the Hummingbird hardened recommendation provider by activating its URL config property, and updates the generated UI report bundle. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
containerRefToPackageRef, consider adding a brief comment explaining whyrepoUrlis left unencoded to avoid future double-encoding regressions when working withPackageURL. - Uncommenting
trustedcontent.recommendation.hardened.urlmeans the provider may now initialize even whenHUMMINGBIRD_URLis empty; it may be worth adding a guard or validation to avoid starting the hardened provider without a valid URL.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `containerRefToPackageRef`, consider adding a brief comment explaining why `repoUrl` is left unencoded to avoid future double-encoding regressions when working with `PackageURL`.
- Uncommenting `trustedcontent.recommendation.hardened.url` means the provider may now initialize even when `HUMMINGBIRD_URL` is empty; it may be worth adding a guard or validation to avoid starting the hardened provider without a valid URL.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #636 +/- ##
=========================================
Coverage 56.77% 56.77%
Complexity 815 815
=========================================
Files 94 94
Lines 4793 4793
Branches 618 618
=========================================
Hits 2721 2721
Misses 1800 1800
Partials 272 272
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…ngbird URL PackageURL constructor auto-encodes qualifier values, so manual URLEncoder.encode() in containerRefToPackageRef() caused double-encoding of the repository_url qualifier. This removes the redundant encoding and uncomments the Hummingbird URL configuration property. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
52d1966 to
d525ac6
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.
Summary
URLEncoder.encode()inHardenedImageResponseHandler.containerRefToPackageRef()— thePackageURLconstructor already encodes qualifier values, so this was causing double-encoding of therepository_urlqualifiertrustedcontent.recommendation.hardened.urlconfiguration property to enable Hummingbird integrationTest plan
repository_urlqualifiers (no%25double-encoding)🤖 Generated with Claude Code
Summary by Sourcery
Fix hardened image recommendation integration by correcting PURL qualifier encoding and enabling the Hummingbird provider configuration.
Bug Fixes:
Enhancements: