Repository navigation
Conversation
Adds `bin/rails reconcile:azure`, which compares topics, their documents, ActiveStorage and the Azure File Share and writes one CSV row per discrepancy: topics with no documents, 0 byte documents, files missing from storage or Azure, size mismatches, files in the wrong folder, failed deletes, orphaned files and duplicate topics. It changes nothing. The azure_file_shares gem's `list` drops the continuation marker and returns at most 5,000 entries, so DirectoryLister pages through each folder itself, reusing the gem's request signing. Refs: #736 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Azure returns the error body as binary with a byte order mark, which made the detail parsing raise an encoding error and hide the string Azure signed. Refs: #736 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
What Issue Does This PR Cover, If Any?
Part of #736 (does not close it). Finds the "find any others" items: topics with no document, 0 byte documents, duplicate topics, and files missing from or left behind in Azure.
What Changed? And Why Did It Change?
Adds
bin/rails reconcile:azure. It compares topics, their documents, ActiveStorage and the Azure File Share, and writes one CSV row per discrepancy plus a count by language and category. It changes nothing.Categories:
topic_without_documents,empty_document,missing_in_storage,missing_in_azure,size_mismatch,wrong_folder,failed_delete,orphan_stale_copy,orphan_unmatched_name,orphan_no_topic,duplicate_topic,missing_directory,broken_topic.azure_file_sharesgem'slistdrops the continuation marker and returns at most 5,000 entries per folder.AzureReconciliation::DirectoryListerfollowsNextMarkeritself and reuses the gem's request signing.FileManager: Pi and v2 Content, v2 VideoContent for mp4, and the_Archivefolders for archived topics.orphan_unmatched_name. That covers topics whose provider, date or file was changed after upload, because the Azure name doesn't change.Options:
LANGUAGE=<id|name>,SKIP_BLOB_CHECK=1(skips one S3 request per file),DEST=<path>orDEST=-for stdout.How Has This Been Tested?
AuthenticationErrorDetail.Please Provide Screenshots
None. No UI changes.
Additional Comments
Independent of #735. To run on staging after deploying this branch:
The CSV starts at the line beginning
category,language,.🤖 Generated with Claude Code