Skip to content

Use stable IDs for saved query filenames - #64

Merged
JohanLorenzo merged 8 commits into
mozilla:mainfrom
JohanLorenzo:fix/query-filenames-by-id-61
Oct 14, 2026
Merged

JohanLorenzo merged 8 commits into
mozilla:mainfrom
JohanLorenzo:fix/query-filenames-by-id-61

Conversation

@JohanLorenzo

@JohanLorenzo JohanLorenzo commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Changing a query title left duplicate slugged files, and cleanup sometimes removed the wrong copy (#61). I switched saved-query filenames to use the stable Redash ID. Fetch migrates legacy files only when their tracked content matches the server and preserves divergent files; a successful deploy writes the resulting server copy under the ID-only name.

Fixes #61.

Evidence

  • stmo-cli fetch migrated a legacy {id}-{slug}.* pair to {id}.*. The migrated files matched the Redash copy byte-for-byte, and the legacy files were removed.
  • stmo-cli fetch on a legacy pair with a local SQL edit exited 1 with "Local SQL or metadata differs from Redash". It left the legacy files unchanged and created no {id}.* files.
Fetching 1 specific queries...

[...]

✓ Fetched 0/1 queries
Error: Failed to fetch 1 query operation(s): 127140: Local SQL or metadata differs from Redash for query 127140; leaving queries/127140-old-slug.* unchanged. Resolve or deploy the local changes before fetching
exit=1

@JohanLorenzo
JohanLorenzo force-pushed the fix/query-filenames-by-id-61 branch 2 times, most recently from 57a19e5 to 7ead453 Compare October 14, 2026 13:21
@JohanLorenzo
JohanLorenzo marked this pull request as ready for review October 14, 2026 13:37
@JohanLorenzo
JohanLorenzo force-pushed the fix/query-filenames-by-id-61 branch from 7ead453 to c45aa6c Compare October 14, 2026 13:40
@JohanLorenzo
JohanLorenzo merged commit 8da2299 into mozilla:main Oct 14, 2026
6 checks passed
@JohanLorenzo
JohanLorenzo deleted the fix/query-filenames-by-id-61 branch October 14, 2026 14:14
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.

Handle slug changes more elegantly

1 participant