Skip to content

feat: Implement azkustoingestv2 - Ingest V2 SDK#339

Draft
asaharn wants to merge 7 commits into
masterfrom
feature/ingest-v2
Draft

feat: Implement azkustoingestv2 - Ingest V2 SDK#339
asaharn wants to merge 7 commits into
masterfrom
feature/ingest-v2

Conversation

@asaharn

@asaharn asaharn commented Apr 21, 2026

Copy link
Copy Markdown
Member

Summary

Implements the Ingest V2 SDK for Azure Kusto Go, porting the design from Java SDK PR #466.

Changes

New module: azkustoingestv2

Core implementation:

  • Shared BaseClient with bearer auth, tracing headers, and S2S token support
  • QueuedIngestClient — queued ingestion via DM with blob upload
  • StreamingIngestClient — direct streaming ingestion to engine
  • ManagedStreamingIngestClient — smart routing with retry + queued fallback
  • Error classification for managed streaming fallback decisions
  • Configuration client with caching (DM endpoint)
  • Full request properties with validation and tag synthesis

REST API endpoints:

  • POST /v1/rest/ingestion/queued/{db}/{table} — queued ingest
  • POST /v1/rest/ingest/{db}/{table} — streaming ingest
  • GET /v1/rest/ingestion/queued/{db}/{table}/{operationId} — status tracking
  • GET /v1/rest/ingestion/configuration — DM configuration

Testing:

  • 93 unit/flow tests covering all client types, error classification, upload validation
  • E2E test framework with support for static token, service principal, and az cli auth
  • E2E tests: streaming, managed streaming, queued ingestion, status tracking, client validation

How to run E2E tests

export ENGINE_CONNECTION_STRING="https://<cluster>.kusto.windows.net"
export TEST_DATABASE="<db>"
export KUSTO_ACCESS_TOKEN="<token>"  # or use AZURE_CLIENT_ID/SECRET/TENANT_ID
export BLOB_URI_FOR_TEST="https://<storage>.blob.core.windows.net/<container>/demo.json?<sas>"

cd azkustoingestv2 && go test ./test/etoe/ -v -count=1

@github-actions

github-actions Bot commented Apr 21, 2026

Copy link
Copy Markdown

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 1d376dd. ± Comparison against base commit 7c44a0a.

♻️ This comment has been updated with latest results.

… APIs, and tests

- Add shared BaseClient with bearer auth, tracing headers, S2S token support
- Implement queued, streaming, and managed streaming ingestion clients
- Add error classification for managed streaming fallback decisions
- Add configuration client with caching (DM endpoint)
- Add comprehensive unit tests (93 tests) and E2E test framework
- E2E tests support static token, service principal, and az cli auth
- Port ingest-v2 spec from Java SDK (PR #466)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@asaharn asaharn changed the title initial changes feat: Implement azkustoingestv2 - Ingest V2 SDK May 20, 2026
- Add comprehensive README.md with API overview, quick start, and reference
- Add streaming ingestion sample (samples/streaming/)
- Add queued ingestion sample with status tracking (samples/queued/)
- Add managed streaming sample with automatic fallback (samples/managed/)
- Add KUSTO_ACCESS_TOKEN support to E2E test env for easy local testing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
asaharn and others added 2 commits May 20, 2026 12:14
- Add azkustoingestv2 to root README.md with documentation links,
  description, and usage example
- Add build/test steps for azkustoingestv2 in build.yml workflow
- Add azkustoingestv2 tag trigger in release.yml workflow
- Add test result display/parse steps for ingest-v2

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Keep azkustoingest release job from master
- Add separate azkustoingestv2 release job
- Fix TAG_PREFIX_REGEX for azkustodata job (was incorrectly combined)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The azkustodata TokenProvider requires SetHttp() to be called before
AcquireToken() can work — it needs an HTTP client to fetch cloud metadata.
Normally this is done during query execution, but the V2 E2E tests call
AcquireToken() directly. This caused a nil interface panic in CI.

Also updates README ingestion documentation to clearly distinguish V1
(legacy) from V2 (recommended) with comparison table and all client types.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nit()

Multiple parallel test functions were calling testshared.SetDefaultDatabase()
concurrently, causing a data race on the package-level 'database' variable.
Fix: call it once in init() (which runs before any tests) and remove it
from individual test functions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@asaharn
asaharn marked this pull request as ready for review May 21, 2026 04:56
@asaharn
asaharn requested a review from tanmaya-panda1 May 21, 2026 05:00
@asaharn
asaharn marked this pull request as draft June 12, 2026 10:01
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.

1 participant