feat: Add proper version parsing mapping for TuxCare advisories#5296
feat: Add proper version parsing mapping for TuxCare advisories#5296Korulag wants to merge 4 commits intogoogle:masterfrom
Conversation
Signed-off-by: Vasily Kleschov <vkleschov@cloudlinux.com>
|
Thanks for addressing this. I have concerns over the way this is being implemented as special logic just for handling TuxCare. something like class TuxCareEcosystem(OrderedEcosystem):
def __init__(self, suffix: str | None):
super().__init__(suffix)
# Lazy import to avoid circular dependency
from ._ecosystems import get
# Add the checks for TuxCare:TuxCare here
self._inner = get(suffix) if suffix else None
def _sort_key(self, version):
# check that _inner is set
return self._inner._sort_key(version)
# def coarse_version(...)Also, we're in the process of migrating stuff to go - could you also add a similar implementation to the equivalent go code |
Moved TuxCare ecosystem implementation into a separate file for Python part; Created corresponding Go implementation of the same thing. Signed-off-by: Vasily Kleschov <vkleschov@cloudlinux.com>
Signed-off-by: Vasily Kleschov <vkleschov@cloudlinux.com>
|
@michaelkedar could you please take a look again? I'm not sure about correctness of Go part, but Python one was reworked as you requested |
michaelkedar
left a comment
There was a problem hiding this comment.
Thanks! Happy to merge this.
| func (e tuxcareEcosystem) IsSemver() bool { | ||
| inner, err := e.resolve() | ||
| if err != nil { | ||
| return false | ||
| } | ||
|
|
||
| return inner.IsSemver() | ||
| } |
There was a problem hiding this comment.
One small thing:
I'd prefer this always return false
IsSemver() is mostly only to be used to convert affected[].ranges[].type from ECOSYSTEM to SEMVER for those ecosystems, which I don't think we want to do with TuxCare.
Added changes to parse package versions properly if the ecosystem is TuxCare as per discussion in #4913