Skip to content

Commit f5713a2

Browse files
authored
Merge branch 'master' into dartdoc
2 parents 37e2ddf + 34534d8 commit f5713a2

34 files changed

+143
-236
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ AppEngine version, listed here to ease deployment and troubleshooting.
44
## Next Release (replace with git tag when deployed)
55
* Bump runtimeVersion to `2024.12.30`.
66
* Upgraded dartdoc to `8.3.1`.
7+
* Note: removed required flag from `isBlocked` fields.
8+
* Note: started deleting `Package.blocked` and `Package.blockedReason`.
79

810
## `20241217t132200-all`
911
* Bump runtimeVersion to `2024.12.17`.

app/lib/account/models.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ class User extends db.ExpandoModel<String> {
5252
/// [isBlocked] is set when a user account is blocked (is on administrative hold).
5353
/// When this happens user-data is preserved, but the user should not be able
5454
/// to perform any action.
55-
@db.BoolProperty(required: true)
55+
///
56+
/// TODO: remove after runtime version `2024.12.17` is no longer running.
57+
@db.BoolProperty(required: false)
5658
bool isBlocked = false;
5759

5860
/// `true` if user was moderated (pending moderation or deletion).

app/lib/frontend/handlers/custom_api.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ Future<VersionScore> packageVersionScoreHandler(
247247
maxPoints: card.maxPubPoints,
248248
likeCount: pkg.likes,
249249
downloadCount30Days: card.thirtyDaysDownloadCounts,
250-
popularityScore: card.popularityScore,
251250
tags: tags.toList(),
252251
lastUpdated: updated,
253252
);

app/lib/frontend/handlers/experimental.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ typedef PublicFlag = ({String name, String description});
1010

1111
const _publicFlags = <PublicFlag>{
1212
(name: 'dark', description: 'Dark mode'),
13-
(name: 'download-counts', description: 'Download count metrics'),
1413
(name: 'search-completion', description: 'Completions for the search bar'),
1514
(name: 'search-topics', description: 'Show matching topics when searching'),
1615
(
@@ -101,7 +100,6 @@ class ExperimentalFlags {
101100

102101
bool get showDownloadCountsVersionChart =>
103102
isEnabled('download-counts-version-chart');
104-
bool get showDownloadCounts => true;
105103

106104
String encodedAsCookie() => _enabled.join(':');
107105

app/lib/frontend/templates/_consts.dart

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
import 'package:_pub_shared/search/tags.dart';
6-
import 'package:pub_dev/frontend/request_context.dart';
76

87
import '../dom/dom.dart' as d;
98

@@ -116,19 +115,14 @@ final _sortDicts = const <SortDict>[
116115
label: 'most pub points',
117116
tooltip: 'Packages are sorted by pub points.'),
118117
SortDict(
119-
id: 'popularity',
120-
label: 'popularity',
121-
tooltip: 'Packages are sorted by their popularity score.'),
118+
id: 'downloads',
119+
label: 'downloads',
120+
tooltip: 'Packages are sorted by their download counts.'),
122121
];
123122

124123
List<SortDict> getSortDicts(bool isSearch) {
125124
final removeId = isSearch ? 'listing_relevance' : 'search_relevance';
126125
return <SortDict>[
127126
..._sortDicts.where((d) => d.id != removeId),
128-
if (requestContext.experimentalFlags.showDownloadCounts)
129-
SortDict(
130-
id: 'downloads',
131-
label: 'downloads',
132-
tooltip: 'Packages are sorted by their download counts.'),
133127
];
134128
}

app/lib/frontend/templates/views/pkg/info_box.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import 'package:_pub_shared/format/encoding.dart';
66
import 'package:pana/pana.dart';
7-
import 'package:pub_dev/frontend/request_context.dart';
87
import 'package:pub_dev/service/download_counts/download_counts.dart';
98
import 'package:pubspec_parse/pubspec_parse.dart' as pubspek;
109

@@ -83,8 +82,7 @@ d.Node packageInfoBoxNode({
8382
collectionsIcon(),
8483
]),
8584
_publisher(package.publisherId),
86-
if (data.weeklyDownloadCounts != null &&
87-
requestContext.experimentalFlags.showDownloadCounts)
85+
if (data.weeklyDownloadCounts != null)
8886
_downloadsChart(data.weeklyDownloadCounts!),
8987
_metadata(
9088
description: version.pubspec!.description,

app/lib/frontend/templates/views/pkg/labeled_scores.dart

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
import 'package:_pub_shared/format/number_format.dart';
6-
import 'package:pub_dev/frontend/request_context.dart';
7-
import 'package:pub_dev/shared/popularity_storage.dart';
86

97
import '../../../dom/dom.dart' as d;
108

@@ -31,30 +29,20 @@ d.Node labeledScoresNode({
3129
classes: ['packages-score', 'packages-score-health'],
3230
child: _labeledScore('points', grantedPubPoints?.toString(), sign: ''),
3331
),
34-
requestContext.experimentalFlags.showDownloadCounts
35-
? d.div(
36-
attributes: {
37-
'title':
38-
'Number of downloads of this package during the past 30 days'
39-
},
40-
classes: ['packages-score', 'packages-score-downloads'],
41-
child: _labeledScore(
42-
'downloads',
43-
thirtyDaysDownloads != null
44-
? '${compactFormat(thirtyDaysDownloads).value}'
45-
'${compactFormat(thirtyDaysDownloads).suffix}'
46-
: null,
47-
sign: '',
48-
),
49-
)
50-
: d.div(
51-
classes: ['packages-score', 'packages-score-popularity'],
52-
child: _labeledScore(
53-
'popularity',
54-
popularityStorage.isInvalid ? null : popularity.toString(),
55-
sign: popularityStorage.isInvalid ? '' : '%',
56-
),
57-
),
32+
d.div(
33+
attributes: {
34+
'title': 'Number of downloads of this package during the past 30 days'
35+
},
36+
classes: ['packages-score', 'packages-score-downloads'],
37+
child: _labeledScore(
38+
'downloads',
39+
thirtyDaysDownloads != null
40+
? '${compactFormat(thirtyDaysDownloads).value}'
41+
'${compactFormat(thirtyDaysDownloads).suffix}'
42+
: null,
43+
sign: '',
44+
),
45+
),
5846
],
5947
);
6048
}

app/lib/frontend/templates/views/pkg/score_tab.dart

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ import 'dart:convert';
77
import 'package:_pub_shared/data/download_counts_data.dart';
88
import 'package:_pub_shared/format/number_format.dart';
99
import 'package:pana/models.dart';
10-
import 'package:pub_dev/shared/popularity_storage.dart';
1110
import 'package:pub_dev/shared/utils.dart';
1211

1312
import '../../../../scorecard/models.dart' hide ReportStatus;
1413
import '../../../../shared/urls.dart' as urls;
1514
import '../../../dom/dom.dart' as d;
1615
import '../../../request_context.dart';
1716
import '../../../static_files.dart';
18-
import '../../package_misc.dart' show formatScore;
1917

2018
/// Renders the score page content.
2119
d.Node scoreTabNode({
@@ -45,9 +43,7 @@ d.Node scoreTabNode({
4543
children: [
4644
_likeKeyFigureNode(likeCount),
4745
_pubPointsKeyFigureNode(report, showPending),
48-
requestContext.experimentalFlags.showDownloadCounts
49-
? _downloadCountsKeyFigureNode(card.thirtyDaysDownloadCounts)
50-
: _popularityKeyFigureNode(card.popularityScore),
46+
_downloadCountsKeyFigureNode(card.thirtyDaysDownloadCounts),
5147
],
5248
),
5349
if (showPending)
@@ -281,21 +277,6 @@ d.Node _likeKeyFigureNode(int? likeCount) {
281277
);
282278
}
283279

284-
d.Node _popularityKeyFigureNode(double? popularity) {
285-
if (popularityStorage.isInvalid) {
286-
return _keyFigureNode(
287-
value: '--',
288-
supplemental: '',
289-
label: 'popularity',
290-
);
291-
}
292-
return _keyFigureNode(
293-
value: formatScore(popularity),
294-
supplemental: '%',
295-
label: 'popularity',
296-
);
297-
}
298-
299280
d.Node _downloadCountsKeyFigureNode(int? downloadCounts) {
300281
if (downloadCounts == null) {
301282
return _keyFigureNode(

app/lib/package/models.dart

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,11 @@ class Package extends db.ExpandoModel<String> {
126126

127127
/// Set to `true` if package should not be displayed anywhere, because of
128128
/// pending moderation or deletion.
129-
@db.BoolProperty(required: true)
129+
///
130+
/// TODO: remove after runtime version `2024.12.17` is no longer running.
131+
@db.BoolProperty(required: false)
130132
bool isBlocked = false;
131133

132-
/// The reason why the package was blocked.
133-
@db.StringProperty(indexed: false)
134-
String? blockedReason;
135-
136-
/// The timestamp when the package was blocked.
137-
@db.DateTimeProperty()
138-
DateTime? blocked;
139-
140134
/// `true` if package was moderated (pending moderation or deletion).
141135
@db.BoolProperty(required: true)
142136
bool isModerated = false;

app/lib/publisher/models.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ class Publisher extends db.ExpandoModel<String> {
6161
/// membership information, or invite new members.
6262
/// - Administrator roles of the publisher must not be able to publisher a new version
6363
/// for packages of the publisher, or change any of the existing package's properties.
64-
@db.BoolProperty(required: true)
64+
///
65+
/// TODO: remove after runtime version `2024.12.17` is no longer running.
66+
@db.BoolProperty(required: false)
6567
bool isBlocked = false;
6668

6769
/// `true` if publisher was moderated (pending moderation or deletion).

0 commit comments

Comments
 (0)