Repository navigation
Description
Description
An idempotent update of a saved query/alert with auto_resolve_display_name=true treats the object itself as a name collision and renames it.
Reproduced on MiniLake 1.9.0, commit fe8837dcfac9df621dfabc440abc07ebb4cdbcbb, using the repository's Docker test image, a real HTTP server, and fresh disposable state. Image Python sources were verified byte-for-byte against this commit. No mocks or production data were used.
Affected Components
- src/minilake/services/saved_queries.py —
_resolve_display_name - src/minilake/services/saved_queries.py —
update_query - src/minilake/services/alerts.py —
_resolve_display_name - src/minilake/services/alerts.py —
update_alert
Steps to Reproduce
Use a disposable instance and data directory. Paths below are relative to its HTTP base URL; bodies are JSON unless explicitly described as raw bytes. IDs shown as W/J/R/Q/C/HANDLE are replaced with the IDs returned by prior calls.
- POST
/api/2.0/sql/querieswith{"query":{"display_name":"unchanged name"}}; capture Q. - PATCH
/api/2.0/sql/queries/Qwith{"query":{"display_name":"unchanged name"},"update_mask":"display_name","auto_resolve_display_name":true}. - Repeat for alerts using
/api/2.0/sql/alerts, thealertenvelope, and the created alert ID.
Expected Behavior
Each unchanged name remains unchanged name because no other object uses it.
Actual Behavior
Both services rename the object to unchanged name (1).
Root Cause Analysis
The ordinary update collision check accepts exclude_id, but _resolve_display_name does not. Update calls that helper against the complete store, including the current object.
Impact
Repeating a logically idempotent update changes display names and creates user-visible drift.
Severity is assessed within MiniLake's documented local development/CI use; it does not assume a shared production Databricks deployment.
Suggested Fix
Allow _resolve_display_name to exclude the current ID during update while retaining create-time collision handling.
Test Coverage Gaps
Auto-resolution tests cover conflicting creates only. Add same-name updates, repeated identical updates, and collisions with a distinct object for both services.
Severity
Low
Confidence
High — reproduced through the real HTTP API and traced to the source paths above.
Recommended Labels
bug
Existing Issue Matches
No reasonable duplicate found. Reviewed all open and closed issues and open pull requests in dmux/minilake, then searched component/function/symptom terms for this finding. The only open PR at review time, #29, changes the virtualenv lock entry and does not address this defect. The documented intentional limitations were checked before reporting.
Activity