Extend license-interfacer to find licenses for Swift packages
Introduction
We want to enrich PMDB (aka license-db
) with swift package metadata. In order to do that we have to extend the license-interfacer
with the ability to find license data for Swift packages.
Overall Architecture
License-interfacer Architecture
Performance improvements
Since the license-interfacer will perform a shallow clone for each repo we should try to minimize the number of clones. The feeder could group different tags from the same repo to one message. This way we could avoid a big number of cloning actions. In other words we clone every repo once independently of the number of tags. This can be easily done by grouping multiple versions in a comma separated list in the version field.
Risks
The main risk is here is to reach the rate limiting of the github repo resulting in 429. This risk has a low probability of happening since we can control how much Cloud run can scale.
Implementation Plan
-
Create a new swift interfacer and implement only an empty Handle
, theRegistryName
andNewRegistry
functionalities. -
Register the new swift interfacer in the packageInterfacers in main.go
-
Create a swift package file with license_collector.go
. This file should be responsible for identifying licenses. -
Create a git
file for cloning and checking out a repo. -
Add relevant unit tests -
Test E2E and check performance --> #506730 (comment 2253138348) -
Deploy on dev and prod