Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 51 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions crates/library_config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
[package]
name = "library-config"
version = "0.1.0"
version = "0.2.0"
Comment thread
dmehala marked this conversation as resolved.
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
anyhow = "1"
datadog-library-config = { git = "https://github.com/DataDog/libdatadog.git", tag = "v16.0.3" }
datadog-library-config = { git = "https://github.com/DataDog/libdatadog.git", tag = "v18.1.0" }

wasm-bindgen = "0.2.84"
wasm-bindgen = "0.2.100"
serde = { version = "1.0", features = ["derive"] }
serde-wasm-bindgen = "0.4"

[dev-dependencies]
wasm-bindgen-test = "0.3.34"
wasm-bindgen-test = "0.3.50"

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
2 changes: 1 addition & 1 deletion crates/library_config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl JsConfigurator {
let config_entries: Vec<ConfigEntry> = config
.into_iter()
.map(|c| ConfigEntry {
name: c.name.to_str().into(),
name: c.name.to_string().into(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going back to Rustc 1.80 would this now remain to_str? Also, would you try to downgrade Rustc to 1.78, the same one libdatadog uses?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in 71ae510.
However, I had to use to_string instead of to_str.

value: c.value,
source: c.source.to_str().into(),
config_id: c.config_id.unwrap_or_default(),
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.80.0"
channel = "1.78.0"
profile = "minimal"
components = ["clippy", "rustfmt", "rust-src"]
9 changes: 6 additions & 3 deletions test/wasm/library_config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ function test_service_selector() {
});

assert.strictEqual(values.length, 2)
assert.strictEqual(values[0].name, 'DD_RUNTIME_METRICS_ENABLED')
assert.strictEqual(values[0].value, 'true')
assert.strictEqual(values[0].source, 'local_stable_config')
assert.strictEqual(values[0].name, 'DD_SERVICE')
assert.strictEqual(values[0].value, 'my-service_butremote')
assert.strictEqual(values[0].source, 'fleet_stable_config')
assert.strictEqual(values[1].name, 'DD_RUNTIME_METRICS_ENABLED')
assert.strictEqual(values[1].value, 'true')
assert.strictEqual(values[1].source, 'local_stable_config')

if (process.platform == 'linux') {
assert.strictEqual(configurator.get_config_local_path(process.platform), "/etc/datadog-agent/application_monitoring.yaml");
Expand Down
Loading