I’m trying to understand how flathub’s backend works.
So far I understood external-data-checker is being ran hourly (through github actions) to check for external package changes, if there is a change, a pull request is issued to the corresponding repository to update the app’s yml file.
Kinda three answers here. Under the hood, Flatpak Command Reference — Flatpak documentation is what’s used to re-scan an ostree repo for Flatpaks, pull out and concatenate all of the appdata / metainfo xml pieces into one appstream, and check it back into the ostree repo.
On Flathub, that’s done by https://github.com/flatpak/flat-manager/ which is a Rust service which maintains the ostree repos for Flathub, and exposes an API which - with the right tokens - you can talk to using the client (https://github.com/flatpak/flat-manager/blob/master/flat-manager-client - or other code) to create temporary repos for your build, push your Flatpaks to them, download and test, and merge them to the main repo. After a timeout so that metadata updates are batched up, flat-manager re-runs that update repo command to generate and publish new ostree-metadata/appstream refs and a new summary file.