Skip to content

Commit bbac3a0

Browse files
committed
Confirm a pinned dataset version still exists before reusing it
When the local file was unchanged and the declaration pinned a version, reconciliation returned that version without asking the service anything. Deleting the pinned version therefore left create reporting it unchanged while �ersions list showed nothing and the eval pointed at a version that was gone. A pin settles which version to use, not whether it is still there, so the pinned branch now reads it the same way the already-registered branch above does. Only a confirmed 404 refuses; any other read failure leaves the pin alone rather than turning a transient error into a failed deploy. Not covered by a unit test: the branch is only reachable once getEnvValue returns a recorded fingerprint, which needs a live azd client. Found by a bug bash agent against the published feed.
1 parent 0f80154 commit bbac3a0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • cli/azd/extensions/azure.ai.evaluations/internal/cmd

cli/azd/extensions/azure.ai.evaluations/internal/cmd/reconciler.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ func (r *evalReconciler) EnsureDataset(
102102
// it settles the question and the check does not apply.
103103
if version := r.ec.getEnvValue(ctx, versionKey("dataset", decl.Name)); version != "" {
104104
if decl.Version != "" {
105+
// A pin settles which version to use, not whether it is still
106+
// there. Skipping the service entirely let a deleted version
107+
// report as unchanged while the eval pointed at nothing. Only a
108+
// confirmed 404 refuses: anything else leaves the pin alone
109+
// rather than failing a deploy on a transient read.
110+
if _, err := r.ec.datasetClient.GetDataset(
111+
ctx, decl.Name, decl.Version, ProjectEndpointAPIVersion,
112+
); err != nil && dataset_api.IsNotFound(err) {
113+
return "", false, messages.DatasetVersionNotFoundWithHint(decl.Name, decl.Version)
114+
}
105115
return decl.Version, false, nil
106116
}
107117
if err := r.checkDatasetDrift(ctx, decl.Name, version); err != nil {

0 commit comments

Comments
 (0)