Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1999 introduce versioneer #59

Merged
merged 33 commits into from
Dec 5, 2023
Merged

1999 introduce versioneer #59

merged 33 commits into from
Dec 5, 2023

Conversation

jimmykarily
Copy link
Contributor

@jimmykarily jimmykarily commented Dec 1, 2023

Part of kairos-io/kairos#1999

After this is merged, the list-releases command of kairos-agent will be re-implemented using the versioneer library.
The provider-kairos ListVersions will also be implemented using the same library, so the results will be consistent whether in a core or a standard Kairos image.

This library also implements all the functionality of the naming.sh which means we can now replace that script everywhere. A PR to replace naming.sh should follow.

The library can be consumed either through the standalone cli (bin/versioneer in this repo) or through the kairos-agent where we will embed it under a kairos-agent versioneer command (https://github.com/kairos-io/kairos-agent/blob/89c3ab4f798138f0c4426cfd3fb319736ef1c443/main.go#L795-L800).

to replace the naming.sh script in kairos-io/kairos

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
also introduce Version and SoftwareVersion fields

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
to be used with ContainerName

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
to be used within a Kairos image

See also discussion: kairos-io/kairos#2035

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
the existing method had to be adapted to accept and optional path to
the os-release file to allow the tests to pass a tmp file.

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
also introduce RegistryInspector which finds tags from a container
registry for a specific repository.

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
to return different Kairos versions of the exact same artifact.

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
and change OtherVersions test to ensure it also returns older versions too.

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Now the Artifact has a TagList method that returns a TagList which is
associated to the specific Artifact.

All methods of TagList are now available to the Artifact.

E.g.
tagList, _ := artifact.TagList("quay.io/kairos")
tagList.NewerAnyVersion(...)

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Copy link

codecov bot commented Dec 1, 2023

Codecov Report

Attention: 198 lines in your changes are missing coverage. Please review.

Comparison is base (f73090d) 46.59% compared to head (a3087d1) 50.45%.
Report is 1 commits behind head on main.

Files Patch % Lines
versioneer/versioneer.go 36.84% 94 Missing and 14 partials ⚠️
versioneer/cli.go 0.00% 65 Missing ⚠️
versioneer/tag_list.go 88.65% 12 Missing and 4 partials ⚠️
versioneer/registry_inspector.go 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #59      +/-   ##
==========================================
+ Coverage   46.59%   50.45%   +3.86%     
==========================================
  Files          12       16       +4     
  Lines         880     1306     +426     
==========================================
+ Hits          410      659     +249     
- Misses        406      551     +145     
- Partials       64       96      +32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

versioneer/README.md Outdated Show resolved Hide resolved
jimmykarily and others added 8 commits December 4, 2023 13:32
to provide a user interface that will replace naming.sh script of the
kairos repository

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@spectrocloud.com>
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
Signed-off-by: Dimitris Karakasilis <dimitris@spectrocloud.com>
and just nest the cli

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
to allow it to be imported in kairos-agent

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
to replace the logic in Earthly and Dockerfiles

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
@jimmykarily jimmykarily marked this pull request as ready for review December 5, 2023 09:20
@jimmykarily jimmykarily requested a review from a team December 5, 2023 09:20
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
@jimmykarily jimmykarily self-assigned this Dec 5, 2023
versioneer/cli.go Outdated Show resolved Hide resolved
Copy link
Member

@Itxaka Itxaka left a comment

Choose a reason for hiding this comment

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

just one question about the validation, rest looks good to me!

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
@jimmykarily jimmykarily merged commit 29fc485 into main Dec 5, 2023
4 checks passed
@jimmykarily jimmykarily deleted the 1999-introduce-versioneer branch December 5, 2023 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants