-
Notifications
You must be signed in to change notification settings - Fork 16
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: remove dynamodb legacy db impl #720
refactor: remove dynamodb legacy db impl #720
Conversation
7305226
to
25f7af4
Compare
autoconnect/autoconnect-ws/autoconnect-ws-sm/src/identified/on_server_notif.rs
Outdated
Show resolved
Hide resolved
@@ -1,5 +1,5 @@ | |||
pub fn main() { | |||
if !(cfg!(feature = "dynamodb") || cfg!(feature = "bigtable")) { | |||
panic!("No database defined! Please compile with either `features=dynamodb` or `features=bigtable`"); | |||
if !cfg!(feature = "bigtable") { |
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.
Note for Me:
I was debating that we should drop this check, but I can see us creating a dummy storage system in the future for testing purposes.
I still hold that bigtable
should be included in the default
feature set, since we have only one 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.
Ah good point, so update this to default
eh?
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'd leave it as feature = "bigtable"
here. I'd just make sure that both
autoendpoint/Cargo.toml &
autoconnect/Cargo.toml:
default = ["bigtable"]
So that it gets picked up. (I'm guessing that "emulator"
slipped into autoconnect/Cargo.toml
due to a bad merge or something. It's semi-harmless, but should be removed for production code.
@@ -150,7 +150,7 @@ impl TryFrom<&str> for BigTableDbSettings { | |||
type Error = DbError; | |||
fn try_from(setting_string: &str) -> Result<Self, Self::Error> { | |||
let me: Self = serde_json::from_str(setting_string) | |||
.map_err(|e| DbError::General(format!("Could not parse DdbSettings: {:?}", e)))?; | |||
.map_err(|e| DbError::General(format!("Could not parse DbSettings: {:?}", e)))?; |
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.
heh, and still very true.
autopush-common/src/db/mod.rs
Outdated
trace!("Found http"); | ||
return Self::DynamoDb; | ||
} | ||
.unwrap_or(std::env::var("GOOGLE_APPLICATION_CREDENTIALS").unwrap_or_default()); |
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, the GOOGLE_APPLICATION_CREDENTIALS
is a file holding the connection credentials, not the DSN to the database. We'd still need that DSN value. (AWS_LOCAL_DYNAMODB
was a DSN to the locally running database).
If the DSN is not set, we should fail out with a config 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.
Thanks for the clarification. Ah, so before it was returning an Option
, so are you saying I should change the function to return a Result
? I had looked at just calling expect()
or unwrap()
at the end of that chain.
631c91b
to
db17331
Compare
I don't know why the build failed in the Docker Image. I was able to build locally. (FWIW, you might be able to get around the build error by wrapping the |
38a553c
to
a5d78bb
Compare
Yeah, I am building fine locally but having the same issue in CI for autoconnect. I'm playing around with |
The current build failure looks to be due to the lack of the tokio |
I'm moderately curious why local builds are unaffected by that, but 🤷🏻. |
autopush-common/Cargo.toml
Outdated
@@ -65,7 +62,7 @@ form_urlencoded = { version = "1.2", optional = true } | |||
[dev-dependencies] | |||
mockito = "0.31" | |||
tempfile = "3.2.0" | |||
tokio = { version = "0.2", features = ["macros"] } | |||
tokio = { version = "1.38", features = ["macros"] } |
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.
tokio = { version = "1.38", features = ["macros"] } | |
tokio = { workspace=true, features = ["macros"] } |
This will pull the version from the main Cargo.toml file, so we don't run the risk of discrepancies later.
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.
Great point!
@jrconlin I think I figured out that it was the |
Closes SYNC-3451