Skip to content

Conversation

@ag-ramachandran
Copy link
Contributor

Initial work on the IngestV2 API

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces the initial work on the IngestV2 API, implementing a new Kotlin-based ingestion service alongside the existing Java implementation. The major change is upgrading the project from Java 8 to Java 11 and updating various dependencies to support the new ingest-v2 module.

  • Project upgraded from Java 8 to Java 11 with dependency version updates
  • New ingest-v2 module written in Kotlin with modern async capabilities
  • Centralized dependency management moved to root POM for consistency

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pom.xml Upgraded Java version, updated dependencies, added ingest-v2 module, centralized dependency management
ingest/pom.xml Removed duplicate dependency management, cleaned up version specifications
data/pom.xml Removed duplicate dependency management, cleaned up version specifications
ingest-v2/pom.xml Complete new module configuration with Kotlin, Ktor, and OpenAPI generation
ingest-v2/src/main/resources/openapi.yaml OpenAPI specification for the new ingest REST API
ingest-v2/src/main/kotlin/... Core Kotlin implementation files for authentication, retry policies, data sources, and API clients
ingest-v2/src/test/kotlin/... Unit tests for retry policies and configuration API

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

github-actions bot commented Sep 9, 2025

Test Results

529 tests  ±0   520 ✅ ±0   3m 41s ⏱️ +49s
 31 suites ±0     9 💤 ±0 
 31 files   ±0     0 ❌ ±0 

Results for commit 31ff143. ± Comparison against base commit 353cd2c.

♻️ This comment has been updated with latest results.

@AsafMah AsafMah marked this pull request as ready for review September 18, 2025 09:12
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<azure-bom-version>1.2.28</azure-bom-version>
<java.version>11</java.version>
Copy link
Contributor

Choose a reason for hiding this comment

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

We discussed waiting with this until another PR, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello @AsafMah , The overall upgrade can be on another PR. But for ingest-v2 as a seperate module we can use Java 11. The changes to code will be very large if we cannot use 11 and fall back to JDK8.

For starters, kotlinx_serialization is not supported on Java-8

Copy link
Contributor Author

@ag-ramachandran ag-ramachandran Oct 30, 2025

Choose a reason for hiding this comment

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

I think I understand the confusion, apologies for it, What was intended was, when we update kusto-data and other modules that can be another PR using open-rewrite which is automated
https://docs.openrewrite.org/

* Address review comments
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 8 to 9
import kotlin.text.compareTo

Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

The import kotlin.text.compareTo is unused in this file. Consider removing it to keep imports clean.

Suggested change
import kotlin.text.compareTo

Copilot uses AI. Check for mistakes.

import com.microsoft.azure.kusto.ingest.v2.common.utils.PathUtils
import com.microsoft.azure.kusto.ingest.v2.models.Format
import java.lang.AutoCloseable
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

Use kotlin.AutoCloseable instead of java.lang.AutoCloseable for better Kotlin interoperability. Kotlin provides its own AutoCloseable interface as a typealias.

Suggested change
import java.lang.AutoCloseable
import kotlin.AutoCloseable

Copilot uses AI. Check for mistakes.
package com.microsoft.azure.kusto.ingest.v2.common

import com.microsoft.azure.kusto.ingest.v2.models.ConfigurationResponse
import java.lang.AutoCloseable
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

Use kotlin.AutoCloseable instead of java.lang.AutoCloseable for better Kotlin interoperability. Kotlin provides its own AutoCloseable interface as a typealias.

Suggested change
import java.lang.AutoCloseable

Copilot uses AI. Check for mistakes.
private val configurationProvider: suspend () -> ConfigurationResponse,
) : ConfigurationCache {
@Volatile private var cachedConfiguration: ConfigurationResponse? = null
private var lastRefreshTime: Long = 0
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

The field lastRefreshTime is not marked as @Volatile but is accessed from multiple threads (read outside synchronized block, written inside). This could lead to visibility issues where threads may see stale values. Mark it as @Volatile for proper thread visibility.

Suggested change
private var lastRefreshTime: Long = 0
@Volatile private var lastRefreshTime: Long = 0

Copilot uses AI. Check for mistakes.
<compilerPlugins>
<plugin>kotlinx-serialization</plugin>
</compilerPlugins>
<jvmTarget>1.8</jvmTarget>
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

The Kotlin compiler is targeting JVM 1.8, but the parent pom specifies Java 11 as the minimum version. For consistency and to take advantage of Java 11 features, consider updating jvmTarget to 11.

Suggested change
<jvmTarget>1.8</jvmTarget>
<jvmTarget>11</jvmTarget>

Copilot uses AI. Check for mistakes.
override val dmUrl: String,
override val tokenCredential: TokenCredential,
override val skipSecurityChecks: Boolean = false,
) : KustoBaseApiClient(dmUrl, tokenCredential, skipSecurityChecks) {
Copy link
Member

Choose a reason for hiding this comment

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

Are we consistently using this naming here (Data management URL)? In the portal it's called 'Data Ingestion URI' - might be a good idea to align with that for clarity.


when (decision) {
RetryDecision.Throw -> {
tracer?.invoke(
Copy link
Member

Choose a reason for hiding this comment

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

Why would the tracer be null? And if it's null do we not log the errors at all?

val leaveOpen: Boolean,
override val compressionType: CompressionType = CompressionType.NONE,
val baseName: String? = null,
override val sourceId: UUID = UUID.randomUUID(),
Copy link
Member

Choose a reason for hiding this comment

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

Do we prefer a random UUID? In C# SDK we use null

tanmaya-panda1 and others added 4 commits December 2, 2025 15:08
* Add IngestionSource Blob type and QueuedIngest
* Merge code with IngestV2 branch
* Reorganize code and remove DTO's
* * Fix some review comments

---------

Co-authored-by: ag-ramachandran <ramacg@microsoft.com>
* * Add boilerplate
* Merge code with IngestV2 branch
* * Add support for non-blob sources
* * Add support for non-blob sources
* * Add support for File and Stream uploads
* managed streaming ingest client
* * Minor edits - Make constants for ManagedStreamingIngestPolicy
* Add a method called size for determining size in the AbstractSourceInfo interface
---------

Co-authored-by: Ramachandran A G <ramacg@microsoft.com>

* * Fix some formatting

* * Remove unused config

---------

Co-authored-by: ag-ramachandran <ramacg@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants