From b8b02bc3d6a3c3bdb03796d263c720d0fc9225df Mon Sep 17 00:00:00 2001 From: ohad bitton <32278684+ohadbitt@users.noreply.github.com> Date: Tue, 6 Feb 2024 16:35:27 +0200 Subject: [PATCH 01/12] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 31 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..1ce2882 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Setup (please complete the following information):** + - rust version [e.g 1.74.1 (f571d3945c 2023-12-08)] + - SDK commit id [e.g 5deb758..] + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From f400f62de767e2e751dee2de2ae143e35600d673 Mon Sep 17 00:00:00 2001 From: AsafMah Date: Tue, 6 Feb 2024 16:41:20 +0200 Subject: [PATCH 02/12] Update build.yml --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4109f3..b74cb50 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,9 @@ name: Rust Build, Test, and Lint jobs: build-data: runs-on: ubuntu-latest + permissions: + checks: write + pull-requests: write environment: sdke2e env: RUST_BACKTRACE: 1 From 4cae5f332729f93118b17d8214ef84de758205de Mon Sep 17 00:00:00 2001 From: AsafMah Date: Sun, 3 Mar 2024 17:04:24 +0200 Subject: [PATCH 03/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fb881c4..cce32f8 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ See the SDK [best practices guide](https://docs.microsoft.com/azure/data-explore - **Have a feature request for SDKs?** Please post it on [User Voice](https://feedback.azure.com/forums/915733-azure-data-explorer) to help us prioritize - **Have a technical question?** Ask on [Stack Overflow with tag "azure-data-explorer"](https://stackoverflow.com/questions/tagged/azure-data-explorer) - **Need Support?** Every customer with an active Azure subscription has access to [support](https://docs.microsoft.com/en-us/azure/azure-supportability/how-to-create-azure-support-request) with guaranteed response time. Consider submitting a ticket and get assistance from Microsoft support team -- **Found a bug?** Please help us fix it by thoroughly documenting it and [filing an issue](https://github.com/Azure/azure-kusto-python/issues/new). +- **Found a bug?** Please help us fix it by thoroughly documenting it and [filing an issue](https://github.com/Azure/azure-kusto-rust/issues/new). ## Looking for SDKs for other languages/platforms? From 1920c45355608d5c2076dff6fad392dc9b6e9c7a Mon Sep 17 00:00:00 2001 From: AsafMah Date: Sun, 3 Mar 2024 17:06:46 +0200 Subject: [PATCH 04/12] Update README.md --- azure-kusto-data/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-kusto-data/README.md b/azure-kusto-data/README.md index 52e979d..67754e0 100644 --- a/azure-kusto-data/README.md +++ b/azure-kusto-data/README.md @@ -5,4 +5,4 @@ `azure-data-kusto` offers functionality needed to interact with Azure Data Explorer (Kusto) from Rust. As an abstraction over the [Azure Data Explorer REST API](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/api/rest/) -For usage have a look at the [examples](https://github.com/Azure/azure-sdk-for-rust/tree/main/sdk/data_kusto/examples). +For usage have a look at the [examples]([https://github.com/Azure/azure-kusto-rust/tree/main/azure-kusto-data/examples]). From d96d233841003f937d1f034331c2740ce83ee080 Mon Sep 17 00:00:00 2001 From: AsafMah Date: Sun, 3 Mar 2024 17:07:06 +0200 Subject: [PATCH 05/12] Update README.md --- azure-kusto-data/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-kusto-data/README.md b/azure-kusto-data/README.md index 67754e0..adb1e0f 100644 --- a/azure-kusto-data/README.md +++ b/azure-kusto-data/README.md @@ -5,4 +5,4 @@ `azure-data-kusto` offers functionality needed to interact with Azure Data Explorer (Kusto) from Rust. As an abstraction over the [Azure Data Explorer REST API](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/api/rest/) -For usage have a look at the [examples]([https://github.com/Azure/azure-kusto-rust/tree/main/azure-kusto-data/examples]). +For usage have a look at the [examples](https://github.com/Azure/azure-kusto-rust/tree/main/azure-kusto-data/examples). From e254d544ecda6edd1dba7de2e55715bcdf0f1263 Mon Sep 17 00:00:00 2001 From: asafmahlev Date: Thu, 11 Apr 2024 10:15:49 +0300 Subject: [PATCH 06/12] Secretless build --- .github/workflows/build.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b74cb50..186ea1f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,8 @@ -on: [push] +on: + push: + branches: [ 'master' ] + pull_request: + branches: [ '**' ] name: Rust Build, Test, and Lint @@ -8,16 +12,19 @@ jobs: permissions: checks: write pull-requests: write - environment: sdke2e + id-token: write + contents: read + environment: build env: RUST_BACKTRACE: 1 RUST_LOG: debug - KUSTO_CLUSTER_URL: https://sdkse2etest.eastus.kusto.windows.net - KUSTO_DATABASE: fastbatchinge2e - AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} - AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} - AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} steps: + - name: Azure login + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - uses: actions/checkout@v1 - uses: actions-rs/toolchain@v1 with: @@ -47,6 +54,8 @@ jobs: CARGO_INCREMENTAL: '0' RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' + KUSTO_CLUSTER_URL: https://sdkse2etest.eastus.kusto.windows.net + KUSTO_DATABASE: fastbatchinge2e - uses: actions-rs/grcov@v0.1 id: coverage - name: Publish Unit Test Results From 808be007bc561efb1a2f0f2babcfeb638846f018 Mon Sep 17 00:00:00 2001 From: asafmahlev Date: Thu, 11 Apr 2024 10:33:58 +0300 Subject: [PATCH 07/12] Fixed build error --- azure-kusto-data/Cargo.toml | 2 +- azure-kusto-data/src/cloud_info.rs | 2 +- azure-kusto-data/src/operations/query.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-kusto-data/Cargo.toml b/azure-kusto-data/Cargo.toml index 4366ad6..0f89f4c 100644 --- a/azure-kusto-data/Cargo.toml +++ b/azure-kusto-data/Cargo.toml @@ -44,7 +44,7 @@ once_cell = "1" arrow = { version = "50.0.0", features = ["prettyprint"] } dotenv = "0.15.0" env_logger = "0.10.0" -tokio = { version = "1.25.0", features = ["macros"] } +tokio = { version = "1.25.0", features = ["macros", "rt-multi-thread"] } oauth2 = "4.3.0" criterion = "0.5" clap = { version = "4.1.6", features = ["derive", "env"] } diff --git a/azure-kusto-data/src/cloud_info.rs b/azure-kusto-data/src/cloud_info.rs index 2abfcc9..ad7baeb 100644 --- a/azure-kusto-data/src/cloud_info.rs +++ b/azure-kusto-data/src/cloud_info.rs @@ -62,7 +62,7 @@ impl CloudInfo { ); request.insert_headers(&Accept::from("application/json")); request.insert_headers(&AcceptEncoding::from("gzip, deflate")); - let response = pipeline.send(&mut Context::new(), &mut request).await?; + let response = pipeline.send(&Context::new(), &mut request).await?; let (status_code, _header_map, pinned_stream) = response.deconstruct(); match status_code { StatusCode::Ok => { diff --git a/azure-kusto-data/src/operations/query.rs b/azure-kusto-data/src/operations/query.rs index 0d7ee4a..b846e39 100644 --- a/azure-kusto-data/src/operations/query.rs +++ b/azure-kusto-data/src/operations/query.rs @@ -80,7 +80,7 @@ impl QueryRunner { let response = self .client .pipeline() - .send(&mut context, &mut request) + .send(&context, &mut request) .await?; Ok(response) } From ef78c8f2248b9989ae8ce80791c69c2ebcdec1c7 Mon Sep 17 00:00:00 2001 From: asafmahlev Date: Thu, 11 Apr 2024 10:41:45 +0300 Subject: [PATCH 08/12] Fixed build error --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 186ea1f..ea00867 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,15 +5,15 @@ on: branches: [ '**' ] name: Rust Build, Test, and Lint +permissions: + checks: write + pull-requests: write + id-token: write + contents: read jobs: build-data: runs-on: ubuntu-latest - permissions: - checks: write - pull-requests: write - id-token: write - contents: read environment: build env: RUST_BACKTRACE: 1 From 82bcc39709dd7626a042f398709b193507430acb Mon Sep 17 00:00:00 2001 From: asafmahlev Date: Thu, 11 Apr 2024 10:44:03 +0300 Subject: [PATCH 09/12] Fixed build error --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea00867..3d6a1c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,7 @@ jobs: - uses: mbrobbel/rustfmt-check@master with: token: ${{ secrets.GITHUB_TOKEN }} + mode: review - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} From 5bddbcf26c6aeac8f2a65162e7729cc6abf54da6 Mon Sep 17 00:00:00 2001 From: asafmahlev Date: Thu, 11 Apr 2024 10:45:37 +0300 Subject: [PATCH 10/12] fmt --- azure-kusto-data/src/operations/query.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/azure-kusto-data/src/operations/query.rs b/azure-kusto-data/src/operations/query.rs index b846e39..20da6a3 100644 --- a/azure-kusto-data/src/operations/query.rs +++ b/azure-kusto-data/src/operations/query.rs @@ -77,11 +77,7 @@ impl QueryRunner { let bytes = bytes::Bytes::from(serde_json::to_string(&body)?); request.set_body(bytes); - let response = self - .client - .pipeline() - .send(&context, &mut request) - .await?; + let response = self.client.pipeline().send(&context, &mut request).await?; Ok(response) } From b5d5acfa6eb93246bf1d67ef766f36639f79c385 Mon Sep 17 00:00:00 2001 From: asafmahlev Date: Thu, 11 Apr 2024 10:48:14 +0300 Subject: [PATCH 11/12] simpler fmt check --- .github/workflows/build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d6a1c7..d31de3f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,10 +32,7 @@ jobs: override: true components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 - - uses: mbrobbel/rustfmt-check@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - mode: review + - run: cargo fmt --all -- --check - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} From 83114e791a83052619d96439e8bc494da1af8f1e Mon Sep 17 00:00:00 2001 From: AsafMah Date: Thu, 11 Apr 2024 12:06:12 +0300 Subject: [PATCH 12/12] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d31de3f..ea15ec5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ on: push: - branches: [ 'master' ] + branches: [ 'main' ] pull_request: branches: [ '**' ]