From 906c31055a74ca98802a8be01304c4a23127002b Mon Sep 17 00:00:00 2001 From: Rachel Tublitz Date: Tue, 3 Dec 2019 17:38:50 -0500 Subject: [PATCH 1/3] chore: tag 0.1.8 --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 12 ++++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d41a120f..7d298738 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,30 @@ + +### 0.1.8 (2019-12-03) + + +#### Doc + +* add descriptive comment ([84f25af5](https://github.com/mozilla-services/syncstorage-rs/commit/84f25af5e36c13f69d0c422c15783420051613a7)) +* adjust PR template, finish combining READMEs ([bbe744dd](https://github.com/mozilla-services/syncstorage-rs/commit/bbe744ddba933abac5e667e5374bc35b0b1832ee), closes [#344](https://github.com/mozilla-services/syncstorage-rs/issues/344)) +* combining setup instructions into one main doc ([a8ead778](https://github.com/mozilla-services/syncstorage-rs/commit/a8ead778b6d955b92d7d915dd72f0f78ad30bad7)) + +#### Bug Fixes + +* optimize batch commit mutations ([5dd3c651](https://github.com/mozilla-services/syncstorage-rs/commit/5dd3c65143e535a65bc99b2e22784c48d4b7cf25), closes [#318](https://github.com/mozilla-services/syncstorage-rs/issues/318)) +* remove redundant syncstorage metric root ([a2083477](https://github.com/mozilla-services/syncstorage-rs/commit/a2083477b9ebc95787cb51fea85ed1afc43f726c), closes [#346](https://github.com/mozilla-services/syncstorage-rs/issues/346)) +* specify the release name to sentry ([9cdfe7d7](https://github.com/mozilla-services/syncstorage-rs/commit/9cdfe7d7812281fb3c8d1c716ddd54be92edb8b4)) + +#### Chore + +* improve local logging ([d1a84219](https://github.com/mozilla-services/syncstorage-rs/commit/d1a842195849a78bcc7e8a048f65b069b85b808f), closes [#350](https://github.com/mozilla-services/syncstorage-rs/issues/350)) +* fix syntax and make one small formatting change to PR template ([11e47545](https://github.com/mozilla-services/syncstorage-rs/commit/11e4754558b217cbfa36dcb998e96e9a1057dfcc), closes [#344](https://github.com/mozilla-services/syncstorage-rs/issues/344)) + +#### Refactor + +* minor cleanup ([8dfb0d51](https://github.com/mozilla-services/syncstorage-rs/commit/8dfb0d5123310224ffe9b50701c3efbb938ebf61)) + + + ## 0.1.7 (2019-11-16) diff --git a/Cargo.lock b/Cargo.lock index fd798d2f..ef54cfef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2406,7 +2406,7 @@ dependencies = [ [[package]] name = "syncstorage" -version = "0.1.7" +version = "0.1.8" dependencies = [ "actix-cors 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "actix-http 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index afeb1055..8144ae3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "syncstorage" -version = "0.1.7" +version = "0.1.8" license = "MPL-2.0" authors = [ "Ben Bangert ", diff --git a/README.md b/README.md index f98ee191..53e1606b 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ - [Tests](#tests) - [Unit tests](#unit-tests) - [End-to-End tests](#end-to-end-tests) + - [Creating Releases](#creating-releases) - [Troubleshooting](#troubleshooting) - [Related Documentation](#related-documentation) @@ -134,6 +135,17 @@ Functional tests live in [server-syncstorage](https://github.com/mozilla-service $ SYNC_TEST_PREFIX=test_get_collection \ ./local/bin/python syncstorage/tests/functional/test_storage.py http://localhost:8000# +## Creating Releases + +Open a PR after doing the following: + +1. Bump the version number in [Cargo.toml](https://github.com/mozilla-services/syncstorage-rs/blob/master/Cargo.toml). +2. `cargo build --release` - Build with the release profile [release mode](https://doc.rust-lang.org/book/ch14-01-release-profiles.html). +3. `clog -C CHANGELOG.md` - Generate release notes. We're using [clog](https://github.com/clog-tool/clog-cli) for release notes. Add a `-p`, `-m` or `-M` flag to denote major/minor/patch version, ie `clog -C CHANGELOG.md -p`. + +Once your PR merges, then go ahead and create an official [GitHub release](https://github.com/mozilla-services/syncstorage-rs/releases). + + ## Troubleshooting - `rm Cargo.lock; cargo clean;` - Try this if you're having problems compiling. From bdd4cbe538b22b4a5d91f5572783931efa9eceda Mon Sep 17 00:00:00 2001 From: jrconlin Date: Wed, 4 Dec 2019 08:21:03 -0800 Subject: [PATCH 2/3] bug: Don't run mysql tests when testing spanner. Closes #360 --- src/db/mysql/test.rs | 21 +++++++++++++++------ src/web/extractors.rs | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/db/mysql/test.rs b/src/db/mysql/test.rs index 11db1b36..b8ccfac7 100644 --- a/src/db/mysql/test.rs +++ b/src/db/mysql/test.rs @@ -9,6 +9,7 @@ use diesel::{ Connection, ExpressionMethods, QueryDsl, RunQueryDsl, }; use env_logger; +use url::Url; use crate::db::mysql::{ models::{MysqlDb, Result}, @@ -27,11 +28,9 @@ impl CustomizeConnection for TestTransactionCustomiz } } -pub fn db() -> Result { - let _ = env_logger::try_init(); - // inherit SYNC_DATABASE_URL from the env +pub fn settings() -> Result { let settings = Settings::with_env_and_config_file(&None).unwrap(); - let settings = Settings { + Ok(Settings { debug: true, port: 8000, host: settings.host, @@ -41,7 +40,12 @@ pub fn db() -> Result { limits: ServerLimits::default(), master_secret: Secrets::default(), ..Default::default() - }; + }) +} + +pub fn db(settings: &Settings) -> Result { + let _ = env_logger::try_init(); + // inherit SYNC_DATABASE_URL from the env let pool = MysqlDbPool::new(&settings, &metrics::Metrics::noop())?; pool.get_sync() @@ -49,7 +53,12 @@ pub fn db() -> Result { #[test] fn static_collection_id() -> Result<()> { - let db = db()?; + let settings = settings()?; + if Url::parse(&settings.database_url).unwrap().scheme() != "mysql" { + // Skip this test if we're not using mysql + return Ok(()) + } + let db = db(&settings)?; // ensure DB actually has predefined common collections let cols: Vec<(i32, _)> = vec![ diff --git a/src/web/extractors.rs b/src/web/extractors.rs index 70ba9861..47d2b5c5 100644 --- a/src/web/extractors.rs +++ b/src/web/extractors.rs @@ -1143,7 +1143,7 @@ impl FromRequest for BatchRequestOpt { })?, None => continue, }; - let count = value.parse::<(u32)>().map_err(|_| { + let count = value.parse::().map_err(|_| { let err: ApiError = ValidationErrorKind::FromDetails( format!("Invalid integer value: {}", value), RequestErrorLocation::Header, From dba5fbe79700cbec6e61de125f4718e21d22a15a Mon Sep 17 00:00:00 2001 From: jrconlin Date: Wed, 4 Dec 2019 08:56:05 -0800 Subject: [PATCH 3/3] f fmt --- src/db/mysql/test.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db/mysql/test.rs b/src/db/mysql/test.rs index b8ccfac7..4acf4116 100644 --- a/src/db/mysql/test.rs +++ b/src/db/mysql/test.rs @@ -40,7 +40,7 @@ pub fn settings() -> Result { limits: ServerLimits::default(), master_secret: Secrets::default(), ..Default::default() - }) + }) } pub fn db(settings: &Settings) -> Result { @@ -56,7 +56,7 @@ fn static_collection_id() -> Result<()> { let settings = settings()?; if Url::parse(&settings.database_url).unwrap().scheme() != "mysql" { // Skip this test if we're not using mysql - return Ok(()) + return Ok(()); } let db = db(&settings)?;