-
Notifications
You must be signed in to change notification settings - Fork 0
draft: commons upload #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds a new file-processing pipeline (buffer extraction, MIME detection, hash/image metadata, validation, single/multi processing), a chunked Commons upload service with existence checks and retry/backoff, Wikibase upload-related runtime schemas/types, accompanying tests, and a minor import/formatting tweak in the project API module. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant FP as File Processor
participant FE as extractFileBuffer
participant MB as buildFileMetadata
participant VD as validateFile
Caller->>FP: processFile(uploadFile, options)
FP->>FE: Extract buffer/size/filename
FE-->>FP: { buffer, size, filename }
FP->>MB: Build metadata (extension, MIME, hash, image)
MB-->>FP: FileMetadata
FP->>VD: validateFile(metadata, mergedOptions)
VD-->>FP: errors[]
FP-->>Caller: ProcessedFile { metadata, buffer, isValid, errors }
sequenceDiagram
autonumber
actor Client
participant CU as CommonsUploadService
participant Auth as AuthService
participant API as Commons API
Client->>CU: uploadFile(processedFile, options, onProgress)
CU->>API: check file exists (query)
API-->>CU: exists?/info
CU->>API: init chunked upload (session key)
API-->>CU: session key, offset=0
loop for each chunk with retries
CU->>API: upload chunk(session, offset, data)
API-->>CU: ack new offset
CU-->>Client: onProgress(update)
end
CU->>API: finalize upload(ignorewarnings, metadata)
API-->>CU: result { url, pageUrl, warnings? }
CU-->>Client: UploadResult { success, urls, warnings, errors? }
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60–90 minutes Possibly related PRs
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (17)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
No description provided.