-
Notifications
You must be signed in to change notification settings - Fork 8
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
refactor: DeploymentName to DeploymentKey #1073
Conversation
de5cf77
to
062985c
Compare
backend/controller/dal/dal.go
Outdated
if name, ok := row.DeploymentName.Get(); ok { | ||
deployment = optional.Some(model.DeploymentName(name)) | ||
var zero model.DeploymentName | ||
if row.DeploymentName != zero { |
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.
From what I can tell, sqlc won't give us an optional on RunnerRow.DeploymentName
because of the coalesce part of the sql statement?
This is also why parsing DeploymentName from "" is returning a DeploymentName without an error, but just a empty deployment name.
Is this all fine in Go or should we be more strict around using optionals vs zero?
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.
Wasn't this working before? Why would it change now?
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.
Fixed, optionals are maintained like before. And now parsing a deployment name of "" is an error
backend/controller/dal/dal.go
Outdated
if name, ok := row.DeploymentName.Get(); ok { | ||
deployment = optional.Some(model.DeploymentName(name)) | ||
var zero model.DeploymentName | ||
if row.DeploymentName != zero { |
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.
Wasn't this working before? Why would it change now?
internal/model/deployment_name.go
Outdated
@@ -77,6 +81,6 @@ func (d *DeploymentName) Scan(value any) error { | |||
return nil | |||
} | |||
|
|||
func (d *DeploymentName) Value() (driver.Value, error) { | |||
func (d DeploymentName) Value() (driver.Value, error) { |
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.
sneaking little pointer! :)
e9185cf
to
ab70af2
Compare
Separate PR on top of other PR, to separate them out for review This refactors everything to refer to a deployment's key instead of its name, including: - db - events - console
ab70af2
to
9fcf325
Compare
This refactors everything to refer to a deployment's key instead of its
name, including: