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

Support nightly #264

Merged
merged 5 commits into from
May 26, 2020
Merged

Support nightly #264

merged 5 commits into from
May 26, 2020

Conversation

july2993
Copy link
Contributor

@july2993 july2993 commented May 25, 2020

cc #261

@codecov-commenter
Copy link

codecov-commenter commented May 25, 2020

Codecov Report

Merging #264 into master will not change coverage.
The diff coverage is 7.14%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #264   +/-   ##
=======================================
  Coverage   42.09%   42.09%           
=======================================
  Files          38       38           
  Lines        2960     2960           
=======================================
  Hits         1246     1246           
  Misses       1507     1507           
  Partials      207      207           
Impacted Files Coverage Δ
pkg/meta/meta.go 48.38% <0.00%> (ø)
pkg/repository/v1_repository.go 59.93% <0.00%> (ø)
pkg/repository/v1manifest/types.go 0.00% <0.00%> (ø)
pkg/repository/v0manifest/version.go 43.75% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d232727...f2d9846. Read the comment docs.

Copy link
Contributor

@nrc nrc left a comment

Choose a reason for hiding this comment

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

I think using version == "nightly" in the component spec rather than passing a nightly bool will simplify things a lot (e.g., not needing the IsNightly check). Otherwise looks good.

pkg/meta/meta.go Outdated Show resolved Hide resolved
@@ -54,8 +54,7 @@ func (v Version) IsEmpty() bool {

// IsNightly returns true if the version is nightly
func (v Version) IsNightly() bool {
return string(v) == version.NightlyVersion

return strings.Contains(string(v), "nightly")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not true for v1 - although the nightly version should include nightly it doesn't have to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems the only way we can check this is checking weather it contains "nightly" according to #261 @AstroProfundis

Copy link
Contributor

Choose a reason for hiding this comment

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

I think if we put nightly in the component spec, then we don't need to check the version to know (from the manifests, whether a version is nightly is external to the version identifier).

Copy link
Contributor

Choose a reason for hiding this comment

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

The idea in #261 was that, "nightly" is only a pointer to some version, and we have multiple such versions from daily builds but they are all treated as normal versions, except the one pointed by "nightly".

Copy link
Contributor

Choose a reason for hiding this comment

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

A problem is that we must skip nightly versions when getting the latest version of a component, so we need to know which component versions are nightly and which aren't

@nrc nrc mentioned this pull request May 25, 2020
13 tasks
@july2993
Copy link
Contributor Author

I think using version == "nightly" in the component spec rather than passing a nightly bool will simplify things a lot (e.g., not needing the IsNightly check). Otherwise looks good.

I think maybe need to instal specified version as v1.2.2-nightly-yyyy-mm-dd, not just "nightly" ?

@nrc
Copy link
Contributor

nrc commented May 26, 2020

I think maybe need to instal specified version as v1.2.2-nightly-yyyy-mm-dd, not just "nightly" ?

Ah, in that case I think we can add a nightly field to the component spec.

@july2993 july2993 requested a review from nrc May 26, 2020 04:07
@july2993
Copy link
Contributor Author

@nrc PTAL
I have add a nightly field to the component spec

Copy link
Contributor

@AstroProfundis AstroProfundis left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@nrc nrc left a comment

Choose a reason for hiding this comment

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

Thanks for the changes! I left some more comments, but I think they are small. LGTM otherwise.

pkg/repository/v1_repository.go Outdated Show resolved Hide resolved
@@ -188,6 +200,10 @@ func (r *V1Repository) selectVersion(id string, versions map[string]v1manifest.V
var latest string
var latestItem v1manifest.VersionItem
for version, item := range versions {
if v0manifest.Version(version).IsNightly() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we inline the 'is nightly' check here so we don't need to use v0manifest.Version?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that we should add to manifests.md that a nightly version must contain the substring nightly. We could also check that in Component.IsValid

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch by the way, I did not think about this issue with nightlies.

@@ -54,8 +54,7 @@ func (v Version) IsEmpty() bool {

// IsNightly returns true if the version is nightly
func (v Version) IsNightly() bool {
return string(v) == version.NightlyVersion

return strings.Contains(string(v), "nightly")
Copy link
Contributor

Choose a reason for hiding this comment

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

A problem is that we must skip nightly versions when getting the latest version of a component, so we need to know which component versions are nightly and which aren't

Co-authored-by: Nick Cameron <nrc@ncameron.org>
@july2993 july2993 merged commit c1bc951 into pingcap:master May 26, 2020
@july2993 july2993 deleted the nightly-versions branch May 26, 2020 05:20
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.

4 participants