upload.rb uploads auto-translated screenshots to Commons after creating them. It is not unique to VisualEditor and can be used by other MediaWiki features. The screenshot capturing itself was already moved to a gem. The uploading functionality is distinct and should be in a different module, although I'm not sure where exactly: maybe a gem, maybe a part of the MediaWiki API gem, or maybe something else.
Customize query in gerrit
|mediawiki/extensions/VisualEditor||master||+6 -41||[BrowserTest] Move the screenshot uploading to a gem|