Skip to content

feat: Add proper version parsing mapping for TuxCare advisories#5296

Open
Korulag wants to merge 4 commits intogoogle:masterfrom
Korulag:fix-tuxcare-version-parsing
Open

feat: Add proper version parsing mapping for TuxCare advisories#5296
Korulag wants to merge 4 commits intogoogle:masterfrom
Korulag:fix-tuxcare-version-parsing

Conversation

@Korulag
Copy link
Copy Markdown
Contributor

@Korulag Korulag commented May 4, 2026

Added changes to parse package versions properly if the ecosystem is TuxCare as per discussion in #4913

Signed-off-by: Vasily Kleschov <vkleschov@cloudlinux.com>
@Korulag Korulag mentioned this pull request May 4, 2026
6 tasks
@Ly-Joey Ly-Joey requested a review from michaelkedar May 4, 2026 23:32
@michaelkedar
Copy link
Copy Markdown
Member

Thanks for addressing this.

I have concerns over the way this is being implemented as special logic just for handling TuxCare.
Could you create a tuxcare.py and implement an OrderedEcosystem that can call get itself?

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

vasilykleschov and others added 3 commits May 5, 2026 13:26
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>
@Korulag
Copy link
Copy Markdown
Contributor Author

Korulag commented May 5, 2026

@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

Copy link
Copy Markdown
Member

@michaelkedar michaelkedar left a comment

Choose a reason for hiding this comment

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

Thanks! Happy to merge this.

Comment on lines +75 to +82
func (e tuxcareEcosystem) IsSemver() bool {
inner, err := e.resolve()
if err != nil {
return false
}

return inner.IsSemver()
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

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.

3 participants