-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: add crdb_internal.release_series
builtin
#113804
Conversation
45571b4
to
4f31543
Compare
4f31543
to
cbe481b
Compare
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.
LGTM -- thank you! looks great
Reviewed 12 of 14 files at r1, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @andyyang890, @RaduBerinde, and @rail)
pkg/sql/sem/builtins/builtins.go
line 5013 at r1 (raw file):
} if version.Less(clusterversion.MinSupported.Version()) || clusterversion.Latest.Version().Less(version) { return nil, errors.Newf(
maybe add test case to verify that less than MinSupport or greater than Latest returns error as expected?
(e.g. maybe to builtins_test.go?)
pkg/upgrade/upgrades/builtins_test.go
line 63 at r1 (raw file):
sqlDB.CheckQueryResults(t, "SELECT crdb_internal.release_series(version) FROM [SHOW CLUSTER SETTING version]", [][]string{{clusterversion.Latest.ReleaseSeries().String()}}) }
maybe add test case to verify that less than MinSupport or greater than Latest returns error as expected?
This commit adds a built-in that resolves dev versions (e.g. 23.2-10) to the corresponding release series (e.g. 24.1). This allows us to clean up some tests and make them stable - they will no longer need to be adjusted when minting a release. Informs: cockroachdb#112629 Release note: None
cbe481b
to
15f92e5
Compare
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.
TFTR!
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @andyyang890, @celiala, and @rail)
pkg/sql/sem/builtins/builtins.go
line 5013 at r1 (raw file):
Previously, celiala wrote…
maybe add test case to verify that less than MinSupport or greater than Latest returns error as expected?
(e.g. maybe to builtins_test.go?)
Added to crdb_internal
bors r+ |
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.
Late to the party but love how much cleaner this makes mixed-version logic tests!
Reviewed 1 of 14 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @celiala and @rail)
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @celiala, @RaduBerinde, and @rail)
pkg/clusterversion/dev_offset.go
line 90 at r2 (raw file):
// removeDevOffset removes DevOffset from the given version, if it was applied. func removeDevOffset(v roachpb.Version) roachpb.Version {
nit: maybe rename this to maybeRemoveDevOffset
for consistency
Build succeeded: |
Previously, andyyang890 (Andy Yang) wrote…
|
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.
Reviewable status: complete! 1 of 0 LGTMs obtained
pkg/clusterversion/dev_offset.go
line 90 at r2 (raw file):
Previously, RaduBerinde wrote…
maybeRemove
suggests that it might not be removed in some cases..
Hmm yeah I guess it's ambiguous, I personally interpret maybeRemove
as "remove if it was applied, otherwise do nothing"
Previously, andyyang890 (Andy Yang) wrote…
Maybe |
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.
Reviewable status: complete! 1 of 0 LGTMs obtained
pkg/clusterversion/dev_offset.go
line 90 at r2 (raw file):
Previously, RaduBerinde wrote…
Maybe
withoutDevOffset
?
Works for me! Also ok with just keeping it as-is, up to you.
This commit adds a built-in that resolves dev versions (e.g. 23.2-10)
to the corresponding release series (e.g. 24.1). This allows us to
clean up some tests and make them stable - they will no longer need to
be adjusted when minting a release.
Informs: #112629
Release note: None