fix: read each cited path in its own repository

The resolver settles which declared repository holds each cited path,
but detection, the extras and the triage read every path in the source
repository at the primary revisions, and missed what a profile cites in
its upstream (geolith jg.c). The report now carries the repository and
revisions each path was settled in, and the bump guard asks whether any
repository the bump moves gained a file or a hash, not only the port.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 21:42:19 +01:00
1 parent 0530c007a8
commit f462ec5fa0
6 files changed
+249 -90

No files matched your search

+7 -6
View File
@@ -7,7 +7,6 @@ import sys
import time
from core import upstream
from profiling.detection import cited_paths
from profiling.reports import ProfileReport, triage_state
from profiling.repos import select_repo
from profiling.versions import VersionReport, check_version
@@ -117,19 +116,21 @@ def _score(
sampled = False
repo = select_repo(profile)
if report.head and repo is not None:
paths = cited_paths(report)
# Each cited path counted in the repository the resolver settled it
# in, between that repository's own pin and HEAD.
sources = report.cited_sources
try:
version = check_version(profile, repo, args.cache_dir, args.offline)
for path in paths[:TRIAGE_PATH_SAMPLE]:
for source in sources[:TRIAGE_PATH_SAMPLE]:
commits += upstream.commits_touching(
repo, path, report.pin, args.cache_dir, args.offline,
head=report.head,
source.repo, source.path, source.pin, args.cache_dir, args.offline,
head=source.head,
)
except upstream.UpstreamError as exc:
# One forge refusing a request (Eden's answers 403 to commit
# lookups) leaves this profile unscored, not the whole ranking.
refused = "commit history unreachable"
print(f"{report.name}: {exc}", file=sys.stderr)
sampled = len(paths) > TRIAGE_PATH_SAMPLE and not refused
sampled = len(sources) > TRIAGE_PATH_SAMPLE and not refused
ranked.append((drift_score(report, version, commits), report, refused))
return sampled