feat: add custom Composer repository support for extension version checking#588
Conversation
|
I would like to add a proper queue before and migrate to that before, we add those things as next |
|
Makes sense! Just to make sure, by "proper queue" do you mean moving the scrape jobs (both the hourly cron and the manual refresh)? I'll hold off on this PR until the queue is in place. Is there an issue tracking the queuing feature? |
|
I would like to parallelize using queue the scrapes. Still not sure which of those NPM packages we're gonna will use at the end: https://bullmq.io/ I expect to be done this week. |
| return timeDifference >= 24 * 60 * 60 * 1000; | ||
| } | ||
|
|
||
| interface ComposerPackageVersion { |
There was a problem hiding this comment.
can you move this composer foo into an own typescript file.
There was a problem hiding this comment.
Extracted all Composer repository logic to api/src/modules/shop/composer-repo.service.ts
| const data = (await resp.json()) as ComposerPackagesJson; | ||
|
|
||
| // Composer v2 lazy provider: metadata-url + available-packages | ||
| if (data["metadata-url"] && data["available-packages"]?.length) { |
There was a problem hiding this comment.
available-packages is optional in composer spec and does not require it.
There was a problem hiding this comment.
available-packages is now treated as optional. If it's present, we fetch only those packages. When absent, we fall through to process inline packages from packages.json.
…ecking Allow shops to configure private Composer repositories (e.g. Packeton, Private Packagist, Satis) so that extension updates from custom package sources are detected during scraping. Supports Composer v1 and v2 formats with none, HTTP Basic, and Bearer token authentication. Credentials are encrypted at rest.
a27e7cb to
b2e01cd
Compare
|
@shyim I added in some changes to move composer checks to the queue as well + some refactor. Can you have a look ? |
Closes #587
APP_SECRETencryptionHow it works
composer-checkjob is enqueuedshop_extension, fetches versions from each Composer repo, and updates matching rows withlatestVersionandchangelogChanges
composer_repositoriesJSONB column onshoptable (migration0011)composerqueue +composer-checkjob type + dedicated worker (concurrency 2)composer-repo.service.ts— extracted Composer repo fetching logicTesting performed
make lintpasses with no new warningsSuggested tests