-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Closed
Copy link
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.SuggestedIssues that may be good for new contributors looking for work to do.Issues that may be good for new contributors looking for work to do.help wantedpkgsite
Milestone
Description
As part of the new data model migration (#39629), we will have a single function get licenses for a given path (regardless of whether that path is a package, module, or directory).
This function will replace the existing LegacyGetPackageLicenses and LegacyGetModuleLicenses.
The function signature will be:
GetLicenses(ctx context.Context, fullpath, modulePath, resolvedVersion string)([]*licenses.License, error)
The function will execute the query below:
SELECT
l.types,
l.file_path,
l.contents,
l.coverage
FROM
licenses l
INNER JOIN
paths p
ON
p.module_id=l.module_id
INNER JOIN
modules m
ON
p.module_id=m.id
WHERE
p.path = $1
AND m.module_path = $2
AND m.version = $3;
Only licenses relevant to the path should be returned. A license applies to the path if the license is in the path directory, or any of its parent directories.
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.SuggestedIssues that may be good for new contributors looking for work to do.Issues that may be good for new contributors looking for work to do.help wantedpkgsite