Backport 2156 to release/0.4.z#2298
Open
jcrossley3 wants to merge 2 commits intoguacsec:release/0.4.zfrom
Open
Backport 2156 to release/0.4.z#2298jcrossley3 wants to merge 2 commits intoguacsec:release/0.4.zfrom
jcrossley3 wants to merge 2 commits intoguacsec:release/0.4.zfrom
Conversation
This fixes guacsec#2146 and therefore indirectly resolves the downstream issue, https://issues.redhat.com/browse/TC-3090 Ultimately, it'd be swell if we could instead depend on something less dead and more supported like https://github.com/csaf-rs/csaf (cherry picked from commit 665f115)
(cherry picked from commit bb4926e)
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideBackports the upgrade to packageurl 0.6 and associated API adjustments, cleans up error handling around purl construction/formatting, updates a csaf dependency reference, and adds a regression test for preserving encoded slashes in purls. Class diagram for updated Purl formatting and PackageUrl interactionclassDiagram
class Purl {
+String ty
+String name
+Option_String namespace
+Option_String version
+HashMap_String_String qualifiers
+Option_String subpath
+from_str(s~str~) Purl
+to_string() String
}
class PurlVisitor {
+expecting(formatter~Formatter~) fmt_Result
+visit_str(v~str~) Purl
}
class PackageUrl {
+new(ty~str~, name~str~) Result_PackageUrl_PackageUrlError
+with_namespace(namespace~impl_AsRef_str~) Result_Unit_PackageUrlError
+with_version(version~impl_AsRef_str~) Result_Unit_PackageUrlError
+add_qualifier(key~impl_AsRef_str~, value~impl_AsRef_str~) Result_Unit_PackageUrlError
+set_subpath(subpath~impl_AsRef_str~) Result_Unit_PackageUrlError
+to_string() String
}
class fmt_Result {
}
class Formatter {
}
class TranslateModule {
+translate(ecosystem~Ecosystem~, name~str~) Option_PackageUrl
+split_name(name~str~, ty~str~, separator~str~) Option_PackageUrl
}
Purl ..> PackageUrl : builds_via
Purl ..> fmt_Result : uses
PurlVisitor ..> Purl : produces
PurlVisitor ..> Formatter : formats_errors_with
PackageUrl ..> fmt_Result : returns
TranslateModule ..> PackageUrl : constructs_and_configures
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Switching the
csafdependency from a pinnedrevto tracking themainbranch may introduce non-deterministic behavior for therelease/0.4.zline; consider keeping a fixed commit hash (or tag) for the backport to ensure reproducible builds.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Switching the `csaf` dependency from a pinned `rev` to tracking the `main` branch may introduce non-deterministic behavior for the `release/0.4.z` line; consider keeping a fixed commit hash (or tag) for the backport to ensure reproducible builds.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
To address https://redhat.atlassian.net/browse/TC-3090
Summary by Sourcery
Update package URL handling to be compatible with newer dependencies and fix formatting and translation behavior.
Bug Fixes:
Enhancements:
Build:
Tests: