From d2f9574a80ac3f6afa5fcce23127de54cd5031a6 Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Fri, 12 Apr 2024 09:33:50 +0200 Subject: [PATCH 01/10] Enable Windows tests --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfdf0216..3adb3436 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: strategy: matrix: # os: [ "ubuntu-latest", "windows-latest", "macos-latest" ] - os: [ "ubuntu-latest"] + os: [ "ubuntu-latest", "windows-latest" ] rust: [ "stable" ] continue-on-error: ${{ matrix.rust != 'stable' }} runs-on: ${{ matrix.os }} @@ -187,4 +187,4 @@ jobs: uses: codecov/codecov-action@v4.0.1 with: token: ${{ secrets.CODECOV_TOKEN }} - slug: open-telemetry/weaver \ No newline at end of file + slug: open-telemetry/weaver From e34c1c857d7aba7998e483b2d62d407a92b2bad7 Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Fri, 12 Apr 2024 09:55:45 +0200 Subject: [PATCH 02/10] Fix line endings in lineage source --- crates/weaver_resolved_schema/src/lineage.rs | 4 ++-- crates/weaver_resolver/src/registry.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/weaver_resolved_schema/src/lineage.rs b/crates/weaver_resolved_schema/src/lineage.rs index 371c9667..f25c1e97 100644 --- a/crates/weaver_resolved_schema/src/lineage.rs +++ b/crates/weaver_resolved_schema/src/lineage.rs @@ -397,9 +397,9 @@ impl AttributeLineage { impl GroupLineage { /// Creates a new group lineage. - pub fn new(provenance: String) -> Self { + pub fn new(provenance: &str) -> Self { Self { - source_file: provenance, + source_file: provenance.replace("\\", "/"), attributes: Default::default(), } } diff --git a/crates/weaver_resolver/src/registry.rs b/crates/weaver_resolver/src/registry.rs index 9e5c43d5..f9a8d4bf 100644 --- a/crates/weaver_resolver/src/registry.rs +++ b/crates/weaver_resolver/src/registry.rs @@ -310,7 +310,7 @@ fn group_from_spec(group: GroupSpecWithProvenance) -> UnresolvedGroup { instrument: group.spec.instrument, unit: group.spec.unit, name: group.spec.name, - lineage: Some(GroupLineage::new(group.provenance.clone())), + lineage: Some(GroupLineage::new(&group.provenance)), }, attributes: attrs, provenance: group.provenance, From 3dfd6455da4cc12947bf9961f3be5aeb0563bf35 Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Fri, 12 Apr 2024 10:07:17 +0200 Subject: [PATCH 03/10] Fix line endings --- crates/weaver_semconv_gen/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/weaver_semconv_gen/src/lib.rs b/crates/weaver_semconv_gen/src/lib.rs index 9473e864..6adf0ab6 100644 --- a/crates/weaver_semconv_gen/src/lib.rs +++ b/crates/weaver_semconv_gen/src/lib.rs @@ -188,7 +188,7 @@ pub fn update_markdown( dry_run: bool, attribute_registry_base_url: Option<&str>, ) -> Result<(), Error> { - let original_markdown = fs::read_to_string(file)?; + let original_markdown = fs::read_to_string(file)?.replace("\r\n", "\n"); let updated_markdown = update_markdown_contents(&original_markdown, lookup, attribute_registry_base_url)?; if !dry_run { From 2c7eaf411de677fc432dab1f4950ec299afe0553 Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Fri, 12 Apr 2024 10:16:42 +0200 Subject: [PATCH 04/10] Add nocapture flag --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3adb3436..d49f7a5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,12 +43,12 @@ jobs: # [ToDo LQ] Re-enable --all-features once the issue is resolved in Tantivy (zstd-safe). This is an experimental feature anyway. run: cargo test --no-run --workspace - name: Default features - run: cargo test --workspace + run: cargo test --workspace -- --nocapture # [ToDo LQ] Re-enable --all-features once the issue is resolved in Tantivy (zstd-safe). This is an experimental feature anyway. # - name: All features # run: cargo test --workspace --all-features - name: No-default features - run: cargo test --workspace --no-default-features + run: cargo test --workspace --no-default-features -- --nocapture msrv: name: Check MSRV runs-on: ubuntu-latest From 95bd27095f9d1a0889f74ee0f4ea91bffccdfd49 Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Fri, 12 Apr 2024 10:56:54 +0200 Subject: [PATCH 05/10] Fix path separators --- crates/weaver_template/src/sdkgen.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/weaver_template/src/sdkgen.rs b/crates/weaver_template/src/sdkgen.rs index 7ea0b162..ef1b3ed2 100644 --- a/crates/weaver_template/src/sdkgen.rs +++ b/crates/weaver_template/src/sdkgen.rs @@ -255,6 +255,7 @@ impl ClientSdkGenerator { .map_err(|e| InternalError(e.to_string()))?; let tmpl_file = relative_path .to_str() + .map(|path| path.replace("\\", "/")) .ok_or(InvalidTemplateFile(tmpl_file_path.clone()))?; if tmpl_file.ends_with(".macro.tera") { @@ -269,7 +270,7 @@ impl ClientSdkGenerator { if let Some(resource_metrics) = schema_spec.resource_metrics.as_ref() { for metric in resource_metrics.metrics.iter() { templates.push(TemplateObjectPair::Metric { - template: tmpl_file.into(), + template: tmpl_file.clone(), metric, }); } @@ -279,7 +280,7 @@ impl ClientSdkGenerator { if let Some(resource_metrics) = schema_spec.resource_metrics.as_ref() { for metric_group in resource_metrics.metric_groups.iter() { templates.push(TemplateObjectPair::MetricGroup { - template: tmpl_file.into(), + template: tmpl_file.clone(), metric_group, }); } @@ -289,7 +290,7 @@ impl ClientSdkGenerator { if let Some(events) = schema_spec.resource_events.as_ref() { for event in events.events.iter() { templates.push(TemplateObjectPair::Event { - template: tmpl_file.into(), + template: tmpl_file.clone(), event, }); } @@ -299,7 +300,7 @@ impl ClientSdkGenerator { if let Some(spans) = schema_spec.resource_spans.as_ref() { for span in spans.spans.iter() { templates.push(TemplateObjectPair::Span { - template: tmpl_file.into(), + template: tmpl_file.clone(), span, }); } @@ -311,7 +312,7 @@ impl ClientSdkGenerator { _ = relative_path.set_extension(""); templates.push(TemplateObjectPair::Other { - template: tmpl_file.into(), + template: tmpl_file.clone(), relative_path, object: schema, }); From e72aed46815f705ad5853678d996aa103e734b02 Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Fri, 12 Apr 2024 11:06:02 +0200 Subject: [PATCH 06/10] Fix clippy error --- crates/weaver_resolved_schema/src/lineage.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/weaver_resolved_schema/src/lineage.rs b/crates/weaver_resolved_schema/src/lineage.rs index f25c1e97..ba127dac 100644 --- a/crates/weaver_resolved_schema/src/lineage.rs +++ b/crates/weaver_resolved_schema/src/lineage.rs @@ -399,7 +399,7 @@ impl GroupLineage { /// Creates a new group lineage. pub fn new(provenance: &str) -> Self { Self { - source_file: provenance.replace("\\", "/"), + source_file: provenance.replace('\\', '/'), attributes: Default::default(), } } From c610c41fcbd98c31cb96e145a8050b8fa874052c Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Fri, 12 Apr 2024 11:06:37 +0200 Subject: [PATCH 07/10] Remove debug output --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d49f7a5c..77ef074e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: strategy: matrix: # os: [ "ubuntu-latest", "windows-latest", "macos-latest" ] - os: [ "ubuntu-latest", "windows-latest" ] + os: [ "ubuntu-latest", "windows-latest", "macos-latest" ] rust: [ "stable" ] continue-on-error: ${{ matrix.rust != 'stable' }} runs-on: ${{ matrix.os }} @@ -43,12 +43,12 @@ jobs: # [ToDo LQ] Re-enable --all-features once the issue is resolved in Tantivy (zstd-safe). This is an experimental feature anyway. run: cargo test --no-run --workspace - name: Default features - run: cargo test --workspace -- --nocapture + run: cargo test --workspace # [ToDo LQ] Re-enable --all-features once the issue is resolved in Tantivy (zstd-safe). This is an experimental feature anyway. # - name: All features # run: cargo test --workspace --all-features - name: No-default features - run: cargo test --workspace --no-default-features -- --nocapture + run: cargo test --workspace --no-default-features msrv: name: Check MSRV runs-on: ubuntu-latest From c8d3f3eaa4b953247db7bdb621b2010d878cc25a Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Fri, 12 Apr 2024 11:10:53 +0200 Subject: [PATCH 08/10] Clippy error --- crates/weaver_resolved_schema/src/lineage.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/weaver_resolved_schema/src/lineage.rs b/crates/weaver_resolved_schema/src/lineage.rs index ba127dac..5c8cdd0b 100644 --- a/crates/weaver_resolved_schema/src/lineage.rs +++ b/crates/weaver_resolved_schema/src/lineage.rs @@ -399,7 +399,7 @@ impl GroupLineage { /// Creates a new group lineage. pub fn new(provenance: &str) -> Self { Self { - source_file: provenance.replace('\\', '/'), + source_file: provenance.replace('\\', "/"), attributes: Default::default(), } } From 20b33a6a45530298f5f5c5ce2dc9a891c16fa07b Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Fri, 12 Apr 2024 11:13:27 +0200 Subject: [PATCH 09/10] Clippy error --- crates/weaver_template/src/sdkgen.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/weaver_template/src/sdkgen.rs b/crates/weaver_template/src/sdkgen.rs index ef1b3ed2..779b101e 100644 --- a/crates/weaver_template/src/sdkgen.rs +++ b/crates/weaver_template/src/sdkgen.rs @@ -255,7 +255,7 @@ impl ClientSdkGenerator { .map_err(|e| InternalError(e.to_string()))?; let tmpl_file = relative_path .to_str() - .map(|path| path.replace("\\", "/")) + .map(|path| path.replace('\\', "/")) .ok_or(InvalidTemplateFile(tmpl_file_path.clone()))?; if tmpl_file.ends_with(".macro.tera") { From 8aa2d535ac8e669524c381992e70a60069b9a7a3 Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Fri, 12 Apr 2024 11:21:58 +0200 Subject: [PATCH 10/10] Remove obsolete line --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77ef074e..3191fcea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,6 @@ jobs: name: Test strategy: matrix: - # os: [ "ubuntu-latest", "windows-latest", "macos-latest" ] os: [ "ubuntu-latest", "windows-latest", "macos-latest" ] rust: [ "stable" ] continue-on-error: ${{ matrix.rust != 'stable' }}