Publish the dataset version that was declared - #5
Merged
m7md7sien merged 1 commit intoAug 20, 2026
Merged
Conversation
--version reached the incrementing path, so 'update --version 1.0' published 2.0, while 'version: 1.0' in configuration published 1.0. One word, two answers, decided by where it was written. It is now the version to publish in both places, matching the same fix in azure.ai.dataset. The flag is offered on create too; it was withheld only because of the old meaning. A version the service already holds is refused rather than stepped past -- the conflict walk exists for a listing that lags, which makes it right for a version the CLI derived and wrong for one an author named. Nothing pinned the old behaviour, so nothing would have caught this. Every existing test called the upload with an empty version; two tests now cover the declared-version path.
m7md7sien
merged commit Aug 20, 2026
cf3a48a
into
feat/azure-ai-evaluations-consolidated
6 of 7 checks passed
There was a problem hiding this comment.
Pull request overview
This PR fixes inconsistent dataset version semantics in the azure.ai.evaluations extension by ensuring a declared version is published exactly as specified (rather than being treated as a “base” for auto-increment), and aligns command behavior/help text accordingly.
Changes:
- Route declared versions through the exact-publish path and keep 409 “walk-forward” retries only for derived versions.
- Add
--versionsupport todataset create(in addition todataset update) with clarified help text. - Add tests covering “declared version publishes exactly” and “declared version conflict does not walk forward”.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
cli/azd/extensions/azure.ai.evaluations/internal/pkg/dataset_api/upload_version_test.go |
Adds unit tests for declared-version publishing and conflict behavior. |
cli/azd/extensions/azure.ai.evaluations/internal/cmd/dataset.go |
Changes CLI upload logic to call UploadVersion when --version is set; updates --version flag help and availability. |
cli/azd/extensions/azure.ai.evaluations/CHANGELOG.md |
Documents the updated dataset --version meaning and availability. |
Suppressed comments (1)
cli/azd/extensions/azure.ai.evaluations/internal/pkg/dataset_api/upload_version_test.go:156
- Same as above: prefer
t.Context()overcontext.Background()in tests so they inherit the test's cancellation/timeout behavior. [azd-code-reviewer]
_, err := client.UploadVersion(context.Background(), "ds", "7.0", dir, "2025-11-15-preview")
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+156
to
+159
| ds, err = ec.datasetClient.UploadNextVersion( | ||
| ctx, name, "", localSource, ProjectEndpointAPIVersion, | ||
| ) | ||
| } |
| require.NoError(t, os.WriteFile( | ||
| filepath.Join(dir, "rows.jsonl"), []byte("{\"query\":\"q\"}\n"), 0o600)) | ||
|
|
||
| ds, err := client.UploadVersion(context.Background(), "ds", "7.0", dir, "2025-11-15-preview") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A declared version is the version to publish, never one to count from.
--versionreached the incrementing path, sodataset update --version 1.0published 2.0, while
version: 1.0in configuration published 1.0.One word, two answers, decided by where it was written. The flag was also
withheld from
createfor exactly that reason.What changed
derived from what is registered.
--versionis offered oncreatetoo. The comment explaining why it waswithheld went with the reason.
latest registered.
The conflict walk stays on the derived path only
The 409 retry exists because the version listing lags behind a publish, which
makes stepping forward right for a version the CLI derived. Applying it to one
an author named would publish a version they did not ask for and report success,
so a declared version that is taken is refused instead.
Tests
Nothing pinned the old behaviour, so nothing would have caught this: every
existing upload test passed an empty version. Two tests now cover the declared
path -- that it publishes exactly what was asked for, and that it does not walk
past a conflict.
The same change is on the dataset extension in Azure#9499 (
b2284f696), andthe spec is corrected on PR Azure#251 (
a93e73c).Verified: gofmt,
go vetuntagged and under bothheroandlive, fullgo test ./...green.