Skip to content

Commit

Permalink
Fix dartdoc status when loading sandboxed ScoreCard. (#6874)
Browse files Browse the repository at this point in the history
* Fix dartdoc status when loading sandboxed ScoreCard.

* Use taskbackend.packageStatus instead.
  • Loading branch information
isoos authored Aug 2, 2023
1 parent 7efa4e3 commit 83385b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/lib/fake/backend/fake_pub_worker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Future<void> processTasksWithFakePanaAndDartdoc() async {
}

for (final e in dartdocFiles.entries) {
await addFileAsStringGzipped(e.key, e.value);
await addFileAsStringGzipped('doc/${e.key}', e.value);
}
await addFileAsStringGzipped(
'summary.json', json.encode(summary.toJson()));
Expand Down
6 changes: 4 additions & 2 deletions app/lib/scorecard/backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ class ScoreCardBackend {
final status = PackageStatus.fromModels(package, version);
final summary =
await taskBackend.panaSummary(packageName, packageVersion);
final stateInfo = await taskBackend.packageStatus(packageName);
final versionInfo = stateInfo.versions[packageVersion];
final hasDartdocFile = versionInfo?.docs ?? false;

final data = ScoreCardData(
packageName: packageName,
Expand All @@ -162,9 +165,8 @@ class ScoreCardBackend {
packageVersionCreated: version.created,
dartdocReport: DartdocReport(
timestamp: summary?.createdAt ?? version.created,
// TODO: Embed dartdoc success status in summary, unclear if we need it
reportStatus:
summary == null ? ReportStatus.failed : ReportStatus.success,
hasDartdocFile ? ReportStatus.success : ReportStatus.failed,
dartdocEntry: null, // unused
documentationSection: null, // already embedded in summary
),
Expand Down
10 changes: 0 additions & 10 deletions app/test/frontend/golden/pkg_show_page_discontinued.html
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,6 @@ <h3 class="title">Topics</h3>
<p>
<a href="/packages?q=topic%3Achemical-element" rel="nofollow">#chemical-element</a>
</p>
<h3 class="title">Documentation</h3>
<p>
<a class="link" href="/documentation/pkg/latest/">API reference</a>
<br/>
</p>
<h3 class="title">Funding</h3>
<p>
Consider supporting this project:
Expand Down Expand Up @@ -346,11 +341,6 @@ <h3 class="title">Topics</h3>
<p>
<a href="/packages?q=topic%3Achemical-element" rel="nofollow">#chemical-element</a>
</p>
<h3 class="title">Documentation</h3>
<p>
<a class="link" href="/documentation/pkg/latest/">API reference</a>
<br/>
</p>
<h3 class="title">Funding</h3>
<p>
Consider supporting this project:
Expand Down

0 comments on commit 83385b1

Please sign in to comment.