-
Notifications
You must be signed in to change notification settings - Fork 67
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
Validate version consistency #510
Conversation
baseDir := filepath.Base(p.BasePath) | ||
versionDir, err := semver.Parse(baseDir) | ||
if err != nil { | ||
return nil // package content is not rooted in version directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you expect us to support this long term or only at the moment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I planned to leave it there long term. I put this check just in case.
return p.ValidateDatasets() | ||
} | ||
|
||
func (p *Package) validateVersionConsistency() error { | ||
versionPackage, err := semver.Parse(p.Version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use this one here:
package-registry/util/package.go
Line 38 in d4a6d00
versionSemVer semver.Version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I couldn't. The Validate()
method is called by Marshal()
, so the mentioned field is not filled yet.
@@ -32,10 +32,9 @@ const ( | |||
) | |||
|
|||
var ( | |||
packagesBasePath string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we don't use this anymore? My initial intention with this was to be able to pass it as a flag to to the docker container on which directories it should read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I the next step I have a plan to support multiple sources of packages (exactly for the docker environment). I think we can leave it as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My usual ask for a changelog ;-)
Issue: #509