-
Notifications
You must be signed in to change notification settings - Fork 638
fix: forward incompatibility of prerelease in writer version #5116
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we baking in semver as a requirement for writers? Seems unnecessary for the format to be opinionated about that?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It still works with arbitrary string. But in general it feels like recording the full semver is beneficial that we can know if the writer is a specific version, if it is the main release version or a specific beta version.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I don't disagree with recording the full semver. More concerned that providing specific
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah I went back and forth with it tbh. Originally I just have a classifier field (that was originally what was proposed on Slack), then my internal debate is that for example I have a I also thought about storing So that was my thoughts to arrive at this state. I guess having a single classifier/version_extra field would also work, let me know which you prefer.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I was thinking you could just parse semver as
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem is I think the reverse, how do you move from a version string to The current approach provides a clear rule that (1) if it is semver, then can leverage those additional fields, (2) if it is not semver, everything is still stored in the version string. If we want to move to just a version_extra, looks like we will define something like if it starts with 3 numbers connected with 2 dots, those go to version, and the rest go to the extra. Does that sound good?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Okay, I guess that is fine. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,33 @@ message Manifest { | |
| // that the library is semantically versioned, this is a string. However, if it | ||
| // is semantically versioned, it should be a valid semver string without any 'v' | ||
| // prefix. For example: `2.0.0`, `2.0.0-rc.1`. | ||
| // | ||
| // For forward compatibility with older readers, when writing new manifests this | ||
| // field should contain only the core version (major.minor.patch) without any | ||
| // prerelease or build metadata. The prerelease/build info should be stored in | ||
| // the separate prerelease and build_metadata fields instead. | ||
|
jackye1995 marked this conversation as resolved.
|
||
| string version = 2; | ||
| // Optional semver prerelease identifier. | ||
| // | ||
| // This field stores the prerelease portion of a semantic version separately | ||
| // from the core version number. For example, if the full version is "2.0.0-rc.1", | ||
| // the version field would contain "2.0.0" and prerelease would contain "rc.1". | ||
| // | ||
| // This separation ensures forward compatibility: older readers can parse the | ||
| // clean version field without errors, while newer readers can reconstruct the | ||
| // full semantic version by combining version, prerelease, and build_metadata. | ||
| // | ||
| // If absent, the version field is used as-is. | ||
| optional string prerelease = 3; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the original proposal was to just use a single classifier string, but that makes it hard to leverage the semver parser, so I made it aligned with the semver spec |
||
| // Optional semver build metadata. | ||
| // | ||
| // This field stores the build metadata portion of a semantic version separately | ||
| // from the core version number. For example, if the full version is | ||
| // "2.0.0-rc.1+build.123", the version field would contain "2.0.0", prerelease | ||
| // would contain "rc.1", and build_metadata would contain "build.123". | ||
| // | ||
| // If absent, no build metadata is present. | ||
| optional string build_metadata = 4; | ||
| } | ||
|
|
||
| // The version of the writer that created this file. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
this is the old problem of #5044