Skip to content

Publish the dataset version that was declared - #5

Merged
m7md7sien merged 1 commit into
feat/azure-ai-evaluations-consolidatedfrom
fix/version-means-publish
Aug 20, 2026
Merged

Publish the dataset version that was declared#5
m7md7sien merged 1 commit into
feat/azure-ai-evaluations-consolidatedfrom
fix/version-means-publish

Conversation

@m7md7sien

Copy link
Copy Markdown
Owner

A declared version is the version to publish, never one to count from.

--version reached the incrementing path, so dataset 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. The flag was also
withheld from create for exactly that reason.

What changed

  • A declared version now goes to the exact-publish path; only an omitted one is
    derived from what is registered.
  • --version is offered on create too. The comment explaining why it was
    withheld went with the reason.
  • Help text: Version to publish. Omit to publish the next version after the
    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), and
the spec is corrected on PR Azure#251 (a93e73c).

Verified: gofmt, go vet untagged and under both hero and live, full
go test ./... green.

--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
m7md7sien requested a lite review from Copilot August 20, 2026 17:00
@m7md7sien
m7md7sien merged commit cf3a48a into feat/azure-ai-evaluations-consolidated Aug 20, 2026
6 of 7 checks passed
@m7md7sien
m7md7sien deleted the fix/version-means-publish branch August 20, 2026 17:03

Copilot AI left a comment

Copy link
Copy Markdown

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 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 --version support to dataset create (in addition to dataset 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() over context.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")
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.

2 participants