Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs and migration for 1.0.0 #225

Merged
merged 17 commits into from
Mar 6, 2024
Merged

Docs and migration for 1.0.0 #225

merged 17 commits into from
Mar 6, 2024

Conversation

AsafMah
Copy link
Contributor

@AsafMah AsafMah commented Feb 25, 2024

Added

  • Migration guides

Changed

  • doc files are re-written to be more standard

dependabot bot and others added 8 commits December 19, 2023 12:07
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](golang/crypto@v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](golang/crypto@v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Changed just sstream to false. the rest was fine

* Switched rows
@AsafMah AsafMah requested a review from yogilad February 25, 2024 10:00
Copy link

github-actions bot commented Feb 25, 2024

Test Results

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

Results for commit b30baf5.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Feb 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.19%. Comparing base (44f8e5a) to head (b30baf5).
Report is 79 commits behind head on the-big-split.

Additional details and impacted files
@@                Coverage Diff                @@
##           the-big-split     #225      +/-   ##
=================================================
+ Coverage          51.53%   54.19%   +2.65%     
=================================================
  Files                 53       70      +17     
  Lines               5877     5615     -262     
=================================================
+ Hits                3029     3043      +14     
+ Misses              2632     2345     -287     
- Partials             216      227      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


To migrate from the old SDK to the new one, you'll need to update your `go.mod` file's dependencies.

**Old SDK:**
Copy link
Contributor

Choose a reason for hiding this comment

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

why needed ? can just put the new ..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So people can find the parts of the code they need to replace. @yogilad WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Very much, this being a migration guide.

MIGRATION.md Outdated Show resolved Hide resolved

### Using the New Packages

Update your code to use the new packages.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Update your code to use the new packages.
Update your code with the new package API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this sentence is better, the point is the packages themselves are new

MIGRATION.md Outdated Show resolved Hide resolved
MIGRATION.md Outdated Show resolved Hide resolved

The new SDK returns a dataset object, with the ability to handle different tables as they come:
```go
dataset, err := client.QueryIterative(ctx, "database", query)
Copy link
Contributor

Choose a reason for hiding this comment

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

So we want iterative to be the default user behavior ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd show a non-iterative and an iterative example in that order

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Better?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes

MIGRATION.md Outdated Show resolved Hide resolved
MIGRATION.md Outdated

You can also use the `Query` method to get all the results at once:
```go
dataset, err := client.Query(ctx, "database", query)
Copy link
Contributor

Choose a reason for hiding this comment

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

add here how to get the primary resultsl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rewrote

// Handle error
}

defer ingestor.Close() // Always close the ingestor when done.
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldnt we close if err != nil ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If err != nil then the dataset is nil

@@ -1,4 +1,4 @@
# Microsoft Azure Data Explorer Public Preview (Kusto) [![GoDoc](https://godoc.org/github.com/Azure/azure-kusto-go?status.svg)](https://pkg.go.dev/github.com/Azure/azure-kusto-go/azkustodata) [![GoDoc](https://godoc.org/github.com/Azure/azure-kusto-go?status.svg)](https://pkg.go.dev/github.com/Azure/azure-kusto-go/azkustoingest)
# Microsoft Azure Data Explorer (Kusto) [![GoDoc](https://godoc.org/github.com/Azure/azure-kusto-go?status.svg)](https://pkg.go.dev/github.com/Azure/azure-kusto-go/azkustodata) [![GoDoc](https://godoc.org/github.com/Azure/azure-kusto-go?status.svg)](https://pkg.go.dev/github.com/Azure/azure-kusto-go/azkustoingest)
Copy link
Contributor

Choose a reason for hiding this comment

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

:)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

?

MIGRATION.md Outdated Show resolved Hide resolved
MIGRATION.md Outdated

Old SDK:
```go
kustoConnectionStringBuilder := kusto.NewConnectionStringBuilder(endpoint)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just a KCSB.
Do you want to show the client?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, is there value in showing these segmented line cases or do we want to focus on scenario examples (query, query with params, management command, ingest from , stream from, ... )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea is to demonstrate the new package name.

I wanted to give an overview of things they should change if they're migrating.
For more detailed examples they have the README and example files

query := kusto.NewStmt("systemNodes | project CollectionTime, NodeId")
```

For the new SDK, use the `azkustodata/kql` package to build queries, which has a type-safe query builder:
Copy link
Contributor

Choose a reason for hiding this comment

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

is there an example of query parameters somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes in the README.md

Should it also be in the migration?

Copy link
Contributor

Choose a reason for hiding this comment

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

only if there's a change to the class names or usage


The new SDK returns a dataset object, with the ability to handle different tables as they come:
```go
dataset, err := client.QueryIterative(ctx, "database", query)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd show a non-iterative and an iterative example in that order


To migrate from the old SDK to the new one, you'll need to update your `go.mod` file's dependencies.

**Old SDK:**
Copy link
Contributor

Choose a reason for hiding this comment

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

Very much, this being a migration guide.


The new SDK returns a dataset object, with the ability to handle different tables as they come:
```go
dataset, err := client.QueryIterative(ctx, "database", query)
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes

AsafMah added 5 commits March 4, 2024 15:23
# Conflicts:
#	.github/workflows/build.yml
#	CHANGELOG.md
#	azkustoingest/go.mod
#	azkustoingest/go.sum
#	quickstart/go.mod
#	quickstart/go.sum
@AsafMah AsafMah merged commit f037b7d into the-big-split Mar 6, 2024
8 checks passed
AsafMah added a commit that referenced this pull request Mar 11, 2024
* Split & rename modules

* fix go.mod

* rename to azkustodata and azkustoingest

* update

* Update build.yml

* build.yml changes

* fixes

* build

* fixed merge

* try

* restore dataset.csv

* ### Added
- azidentity package dependency

### Changed
- Update azkustoingest/test/etoe/etoe_test.go to use azkustoingest.FileOption

### Fixed

### Removed

### Security

* Fixed

* Centralize deps

* Fixed once_test.go

* Fixed once_test.go

* Fixed once_test.go

* Minor fixes

* Solved flakeyness maybe

* remove replace

* no replacements

* Will this fail?

* Will this fail?

* Will this fail?

* Will this fail?

* Will this fail?

* Will this fail?

* Ok check 1

* Tidy

* TidyDoc fixes

* Split e2e tests

* Updated deps

* go work sync

* this is not good

* Test change

* Test change

* PR fixes

* Fix more

* Stop more queries

* Stop more queries

* Check if problem test

* Rename package

* Rename package

* Rename package

* Gofmt

* Fixed error

* tidy

* Tidy part 2

* go.sum

* Ingest updates for split (#198)

* * [BREAKING] [MAJOR] Constructing ingest clients is now done using a KustoConnectionStringBuilder, and not a client struct.
* In addition, passing a default database and table for ingestion is not necessary anymore, and can be done using Options.
   ```go
   // before:
  	queryClient := kusto.New("https://ingest-somecluster.kusto.windows.net")
    client := ingest.New(quetryClient, "some-db", "some-table")

    // after:
    client := azkustoingest.New("https://ingest-somecluster.kusto.windows.net", azkustoingest.WithDefaultDatabase("someDb"), azkustoingest.WithDefaultTable("someTable"))
  ```
* Added autocorrection for endpoints for ingest clients. When creating a client, the "ingest-" will be added or removed as needed. To avoid this behavior, use the `azkustoingest.WithoutEndpointCorrection()` option.
* ManagedStreamingClient constructor now only requires the query endpoint, and will infer the ingest endpoint from it. If you want to use a different endpoint, use the `azkustoingest.WithCustomIngestConnectionString()` option.
* Removed the old deprecated Stream() method on queued ingest client, instead use azkustoingest.NewStreaming() or azkustoingest.NewManaged() for proper streaming ingest client.
* Removed `QueryIngestion()` option for Query client. If you want to perform commands against the dm, create a query client with the "ingest-" endpoint.

* Tests and docs

* More tests

* fmt

* fmt

* Try to improve build errors

* f

* f

* Try again

* Try again

* Try again

* Fix

* Update README.md

Co-authored-by: Yochai Gilad <[email protected]>

* Update azkustoingest/common.go

Co-authored-by: Yochai Gilad <[email protected]>

* Rename

* Remove queryclient

* Remove queryclient

* Remove queryclient

* Remove queryclient

---------

Co-authored-by: Yochai Gilad <[email protected]>

* Merge branch 'master' into query-v2

* merge from main

* Updated deps

* Fixed

* Merge fixes

* Merge fixes

* Query v2 (#216)

* Frame definitions

* Working json (kinda)

* Improved values

* Improved values

* Improved values

* Compilation errors

* More fixes

* meanwhile commit

* merge from main

* Reworked kusto types -
No more duplications between packages.
Removed old system of query building.
Fixed tests, etc.

* Query v2 - tables, frames, all

* Added query

* More tests

* Working tests

* More tests

* Something is off

* Something is off

* Fixed error

* More tests, more tables

* Fixed tests, aligned types, etc

* -int types can be deserialized to struct (with error on overflow)
-fixed secondary tables

* Easy row consumption and op for errors

* Some docs

* Examples and tests

* Fixed tests

* Fixed data races. Removed fixed table (for now)

* Fixed deadlock + parallel tests

* Fixed deadlocks

* Fixed deadlocks

* Rework tables into results

* Big refactor - split common data from v2 specific

* More v1 stuff

* More v1 stuff

* Moving stuff around for compile errors

* Fixed tests

* Fixed recursive lock issue

* Fixed recursive lock issue

* Fixed recursive lock issue

* Fixed missing break

* Fixed missing break

* Fixed test

* Make sure the correct error is always called, without race condition

* Make sure the correct error is always called, without race condition

* Make sure the correct error is always called, without race condition

* upgrade

* Merge fixes

* Merge fixes

* Tests and fixes

* Tests and fixes

* Split v2 tables to streaming and non-streaming

* Fixed tests

* Renames

* Fixed error

* Renaming

* More api and partial results test

* Fixed read

* Some docs

* -Renames and add apis
-Fixed partial Results text
-Fixed full errors tests

* full dataset tests

* Fixed tests

* Handle partial errors in v2 & fixed number handling in v1

* Naming and comments

* PR fixes

* PR fixes

* Added error description and table progress

* Added error description and table progress

* Fix tests

* PR fixes

* Fix tests

* Removed more old code, fixed tests, still wip

* Fixed all tests

* Fixed + added benchmark

* Fixed ingest tests by relocating mock

* Fixed tests

* More fixed tests

* Fixed race

* typo

* remove todo (for now)

* Cherrypick changes from other branch

* -Simplify and rename

* PR Changes:
- Simplify code to handle only what needed
- Rename ordinal to index
- Some comments

* Fixed samples

* Fixed cycle

* Removed old full dataset things

* Renames and bug fixes

* Aligned types, made full tables make more sense.

* Properly close tables, fixed deadlocks and tests.

* Fixed ingest tests

* Fixed test

* build.yml

* Updated sample app

* Improve allocations and fix benchmarks

* Improve values system

* -Reduced code dups in structs
-Fixed edge cases

* Jsontest - correct order of params

* cache decodeToStruct result

* PR stuff

* PR stuff

* PR changes - part 1

* PR Changes - renames

* Readne

* Lock Cache

* Docs and migration for 1.0.0 (#225)

* Bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#219)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](golang/crypto@v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump golang.org/x/crypto from 0.14.0 to 0.17.0 in /quickstart (#218)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](golang/crypto@v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Changed just sstream to false. the rest was fine (#220)

* Update issue templates (#223)

* Update build.yml

* Update build.yml (#224)

* T ronmoneta/compression auto detect fix (#222)

* Changed just sstream to false. the rest was fine

* Switched rows

* New doc files and Migration guide

* Update MIGRATION.md

Co-authored-by: ohad bitton <[email protected]>

* Update MIGRATION.md

Co-authored-by: ohad bitton <[email protected]>

* Update MIGRATION.md

Co-authored-by: Yochai Gilad <[email protected]>

* New doc files and Migration guide

* Last fixes

* azkustodata tidy

* version fixing

* version fixing

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: t-ronmoneta <[email protected]>
Co-authored-by: ohad bitton <[email protected]>
Co-authored-by: Yochai Gilad <[email protected]>

* v1.0.0-preview

* last adjustments

* last adjustments

* last adjustments

* last adjustments

* last adjustments

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Yochai Gilad <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: t-ronmoneta <[email protected]>
Co-authored-by: ohad bitton <[email protected]>
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.

4 participants