Skip to content

Commit

Permalink
Increase priority of package requests with versions #502
Browse files Browse the repository at this point in the history
Signed-off-by: Jono Yang <[email protected]>
  • Loading branch information
JonoYang committed Jul 17, 2024
1 parent 0cf86a1 commit 7af9f61
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packagedb/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,9 +1009,11 @@ def _reindex_package(package, reindexed_packages, **kwargs):
# add to queue
extra_fields = dict()
if source_purl := package.get('source_purl'):
extra_fields["source_uri"] = source_purl
extra_fields['source_uri'] = source_purl
if addon_pipelines := package.get('addon_pipelines'):
extra_fields["addon_pipelines"] = [pipe for pipe in addon_pipelines if is_supported_addon_pipeline(pipe)]
extra_fields['addon_pipelines'] = [pipe for pipe in addon_pipelines if is_supported_addon_pipeline(pipe)]
if priority := package.get('priority'):
extra_fields['priority'] = priority
priority_resource_uri = PriorityResourceURI.objects.insert(purl, **extra_fields)
if priority_resource_uri:
queued_packages.append(purl)
Expand Down Expand Up @@ -1238,6 +1240,8 @@ def get_resolved_packages(packages, supported_ecosystems):
continue

if parsed_purl.version:
# We prioritize Package requests that have explicit versions
package['priority'] = 100
resolved_packages_by_purl[purl] = package
continue

Expand Down

0 comments on commit 7af9f61

Please sign in to comment.