Skip to content

Implement ScoreCard's model and backend #1498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 4, 2018

Conversation

isoos
Copy link
Collaborator

@isoos isoos commented Aug 2, 2018

Many steps closer to #1352

  • ScoreCardData will replace AnalysisExtract with efficient storage and caching.
  • ScoreCard stores a lot of relevant information that is required for replacing Job scheduling.
  • ScoreCardReport will replace Analysis and at the same time will allow dartdoc and other reports reports to be stored and handled the same way.

@isoos isoos requested a review from sortie August 2, 2018 19:29
@isoos isoos force-pushed the scorecard_refactor branch from f642513 to 0ed5932 Compare August 28, 2018 08:16
@isoos
Copy link
Collaborator Author

isoos commented Aug 28, 2018

@sortie this has been updated with the latest 2.0 changes, and can be reviewed again

Copy link

@sortie sortie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

return null;
}
all.sort((a, b) =>
isNewer(a.semanticRuntimeVersion, b.semanticRuntimeVersion) ? -1 : 1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's faster to search for the latest rather than sort and then take the last.

ScoreCardBackend get scoreCardBackend =>
ss.lookup(#_scorecard_backend) as ScoreCardBackend;

class ScoreCardBackend {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the documentation on score cards? Can add you add some words on the data model and the operations done here?

Should there be tests for this code and score cards?

Future<Map<String, ReportData>> loadReports(
String packageName, String packageVersion,
{List<String> reportTypes}) async {
reportTypes ??= [ReportType.pana, ReportType.dartdoc];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are static const, can you set a default parameter value for reportTypes instead, if the list can be const?

static const String failed = 'failed';
static const String aborted = 'aborted';
}

/// Summary of various reports for a given PackageVersion.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This documentation seems a little sparse?

@CompatibleStringListProperty()
List<String> platformTags;

/// The flags for the package, version or analysis.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe list a few?

@CompatibleStringListProperty()
List<String> platformTags;

final String platformReason;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this?

@isoos isoos force-pushed the scorecard_refactor branch from 0ed5932 to 0c37605 Compare September 4, 2018 08:45
@isoos
Copy link
Collaborator Author

isoos commented Sep 4, 2018

I've updated the documentation, but looking at it after a month or so, I've found the field duplicates in the ScoreCard vs ScoreCardData a bit confusing. Maybe ScoreCardData should be stored as a serialized binary in ScoreCard like we do with the ReportData? That way the fields in the DataStore records won't be duplicates (it is unlikely that we'd want to filter any of these, as they would also require the runtimeVersion in the id and in the index).

@sortie
Copy link

sortie commented Sep 4, 2018

lgtm

@isoos isoos merged commit f2cc7a6 into dart-lang:master Sep 4, 2018
@isoos isoos deleted the scorecard_refactor branch September 4, 2018 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants