Skip to content

Commit

Permalink
Upgrade pana (dart-lang#8453)
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Jan 10, 2025
1 parent 6921911 commit 9f6100a
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 130 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ AppEngine version, listed here to ease deployment and troubleshooting.
## Next Release (replace with git tag when deployed)
* Bump runtimeVersion to `2025.01.10`.
* Upgraded stable Dart analysis SDK to `3.6.1`
* Upgraded pana to `0.22.18`.

## `20250107t105700-all`
* Bump runtimeVersion to `2025.01.07`.
Expand Down
10 changes: 5 additions & 5 deletions app/lib/package/model_properties.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class Pubspec {
/// `>=<version>` pattern.
MinSdkVersion? get minSdkVersion {
_load();
return MinSdkVersion.tryParse(_inner.environment?['sdk']);
return MinSdkVersion.tryParse(_inner.environment['sdk']);
}

/// Returns the minimal SDK version for the Flutter SDK.
Expand All @@ -107,7 +107,7 @@ class Pubspec {
/// `>=<version>` pattern.
late final _minFlutterSdkVersion = () {
_load();
return MinSdkVersion.tryParse(_inner.environment?['flutter']);
return MinSdkVersion.tryParse(_inner.environment['flutter']);
}();

/// True if the min SDK version constraint is higher than the current SDK.
Expand All @@ -131,16 +131,16 @@ class Pubspec {
)) {
return true;
}
final v = MinSdkVersion.tryParse(_inner.environment?['flutter']);
final v = MinSdkVersion.tryParse(_inner.environment['flutter']);
if (v != null &&
v.value.compareTo(versions.semanticToolStableFlutterSdkVersion) > 0) {
return true;
}
return false;
}

late final _dartSdkConstraint = _inner.environment?['sdk'];
late final _flutterSdkConstraint = _inner.environment?['flutter'];
late final _dartSdkConstraint = _inner.environment['sdk'];
late final _flutterSdkConstraint = _inner.environment['flutter'];
late final _hasDartSdkConstraint = _dartSdkConstraint != null &&
!_dartSdkConstraint.isAny &&
!_dartSdkConstraint.isEmpty;
Expand Down
2 changes: 1 addition & 1 deletion app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dependencies:
watcher: ^1.0.0
yaml: ^3.1.0
# pana version to be pinned
pana: '0.22.17'
pana: '0.22.18'
# 3rd-party packages with pinned versions
mailer: '6.2.0'
ulid: '2.0.1'
Expand Down
45 changes: 0 additions & 45 deletions app/test/task/testdata/goldens/packages/oxygen/score.html
Original file line number Diff line number Diff line change
Expand Up @@ -297,51 +297,6 @@ <h3>
requests.
</p>
</details>
<details>
<summary>Failed to verify repository URL.</summary>
<p>
Please provide a valid
<a href="https://dart.dev/tools/pub/pubspec#repository">
<code>repository</code>
</a>
URL in
<code>pubspec.yaml</code>
, such that:
</p>
<ul>
<li>
<code>repository</code>
can be cloned,
</li>
<li>
a clone of the repository contains a
<code>pubspec.yaml</code>
, which:,
<ul>
<li>
contains
<code>name: oxygen</code>
,
</li>
<li>
contains a
<code>version</code>
property, and,
</li>
<li>
does not contain a
<code>publish_to</code>
property.
</li>
</ul>
</li>
</ul>
<p>
Unable to access git repository: Failed to run
<code>remote show origin</code>
.
</p>
</details>
<h3>
<img class="report-summary-icon" src="/static/hash-%%etag%%/img/report-ok-icon-green.svg"/>
5/5 points: Provide a valid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,51 +301,6 @@ <h3>
requests.
</p>
</details>
<details>
<summary>Failed to verify repository URL.</summary>
<p>
Please provide a valid
<a href="https://dart.dev/tools/pub/pubspec#repository">
<code>repository</code>
</a>
URL in
<code>pubspec.yaml</code>
, such that:
</p>
<ul>
<li>
<code>repository</code>
can be cloned,
</li>
<li>
a clone of the repository contains a
<code>pubspec.yaml</code>
, which:,
<ul>
<li>
contains
<code>name: oxygen</code>
,
</li>
<li>
contains a
<code>version</code>
property, and,
</li>
<li>
does not contain a
<code>publish_to</code>
property.
</li>
</ul>
</li>
</ul>
<p>
Unable to access git repository: Failed to run
<code>remote show origin</code>
.
</p>
</details>
<h3>
<img class="report-summary-icon" src="/static/hash-%%etag%%/img/report-ok-icon-green.svg"/>
5/5 points: Provide a valid
Expand Down
21 changes: 8 additions & 13 deletions pkg/pub_package_reader/lib/pub_package_reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ Future<PackageSummary> summarizePackageArchive(
issues.addAll(checkFunding(pubspecContent));
issues.addAll(checkTopics(pubspecContent));
issues.addAll(checkHooks(
_minVersion(pubspec.environment?['sdk']),
_minVersion(pubspec.environment['sdk']),
tar.fileNames,
));

Expand Down Expand Up @@ -431,7 +431,7 @@ Iterable<ArchiveIssue> checkStrictVersions(Pubspec pubspec) sync* {

final versions = [
pubspec.version,
...?pubspec.environment?.values.expand(expandConstraint),
...pubspec.environment.values.expand(expandConstraint),
...pubspec.dependencies.values.expand(expandDependency),
...pubspec.devDependencies.values.expand(expandDependency),
...pubspec.dependencyOverrides.values.expand(expandDependency),
Expand All @@ -450,7 +450,7 @@ final _postDart3 = VersionConstraint.parse('>=3.0.0-0');

/// Checks if the version range is acceptable by current SDKs.
Iterable<ArchiveIssue> checkSdkVersionRange(Pubspec pubspec) sync* {
final sdk = pubspec.environment?['sdk'];
final sdk = pubspec.environment['sdk'];
if (sdk == null ||
sdk.isAny ||
sdk is! VersionRange ||
Expand Down Expand Up @@ -519,10 +519,7 @@ const _knownEnvironmentKeys = <String>{
/// Validates that keys referenced in the `environment` section are
/// known and valid, otherwise `pub` won't be able to use the package.
Iterable<ArchiveIssue> validateEnvironmentKeys(Pubspec pubspec) sync* {
final keys = pubspec.environment?.keys;
if (keys == null) {
return;
}
final keys = pubspec.environment.keys;
for (final key in keys) {
if (_knownEnvironmentKeys.contains(key)) {
continue;
Expand Down Expand Up @@ -646,9 +643,8 @@ Iterable<ArchiveIssue> forbidConflictingFlutterPluginSchemes(
}

if (usesNewPluginFormat &&
(pubspec.environment == null ||
pubspec.environment!['flutter'] == null ||
pubspec.environment!['flutter']!.allowsAny(VersionRange(
(pubspec.environment['flutter'] == null ||
pubspec.environment['flutter']!.allowsAny(VersionRange(
min: Version.parse('0.0.0'),
max: Version.parse('1.10.0'),
includeMin: true,
Expand Down Expand Up @@ -679,9 +675,8 @@ Iterable<ArchiveIssue> requireIosFolderOrFlutter2_20(
final usesNewPluginFormat = plugin['platforms'] != null;

if (usesNewPluginFormat &&
(pubspec.environment == null ||
pubspec.environment!['flutter'] == null ||
pubspec.environment!['flutter']!.allowsAny(VersionRange(
(pubspec.environment['flutter'] == null ||
pubspec.environment['flutter']!.allowsAny(VersionRange(
min: Version.parse('0.0.0'),
max: Version.parse('1.20.0'),
includeMin: true,
Expand Down
2 changes: 1 addition & 1 deletion pkg/pub_worker/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
appengine: ^0.13.6
json_annotation: ^4.3.0
jsontool: ^2.0.0
pana: ^0.22.17
pana: ^0.22.18
path: ^1.8.0
lints: ^5.0.0 # required for pana
meta: ^1.7.0
Expand Down
40 changes: 20 additions & 20 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,10 @@ packages:
dependency: transitive
description:
name: io
sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e"
sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b
url: "https://pub.dev"
source: hosted
version: "1.0.4"
version: "1.0.5"
js:
dependency: transitive
description:
Expand Down Expand Up @@ -482,10 +482,10 @@ packages:
dependency: "direct dev"
description:
name: lints
sha256: "4a16b3f03741e1252fda5de3ce712666d010ba2122f8e912c94f9f7b90e1a4c3"
sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7
url: "https://pub.dev"
source: hosted
version: "5.1.0"
version: "5.1.1"
logging:
dependency: transitive
description:
Expand Down Expand Up @@ -626,10 +626,10 @@ packages:
dependency: transitive
description:
name: pana
sha256: be1fdf41fb7b1085069d596ef55c0172cce336692e4b4ee97957c999694d777d
sha256: "3bd9ca2adbfdb9a3ac0fc75039a1a007811826ade9bc05cf3a30b803812f99f8"
url: "https://pub.dev"
source: hosted
version: "0.22.17"
version: "0.22.18"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -674,18 +674,18 @@ packages:
dependency: transitive
description:
name: pub_semver
sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c"
sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.1.5"
pubspec_parse:
dependency: transitive
description:
name: pubspec_parse
sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8
sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
version: "1.5.0"
puppeteer:
dependency: transitive
description:
Expand Down Expand Up @@ -818,10 +818,10 @@ packages:
dependency: transitive
description:
name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.10.1"
sprintf:
dependency: transitive
description:
Expand Down Expand Up @@ -858,10 +858,10 @@ packages:
dependency: transitive
description:
name: string_scanner
sha256: "0bd04f5bb74fcd6ff0606a888a30e917af9bd52820b178eaa464beb11dca84b6"
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.4.1"
tar:
dependency: transitive
description:
Expand All @@ -882,10 +882,10 @@ packages:
dependency: transitive
description:
name: test
sha256: "7afaf571fe4476e3cf7c5f822daa5a295dbbca227b52cb246d6ed3216e282f44"
sha256: "8391fbe68d520daf2314121764d38e37f934c02fd7301ad18307bd93bd6b725d"
url: "https://pub.dev"
source: hosted
version: "1.25.10"
version: "1.25.14"
test_api:
dependency: transitive
description:
Expand All @@ -898,10 +898,10 @@ packages:
dependency: transitive
description:
name: test_core
sha256: "3e47cac78f28a4dd71ea232db15fda6345934f472c2f70f97d35476809e045ca"
sha256: "84d17c3486c8dfdbe5e12a50c8ae176d15e2a771b96909a9442b40173649ccaa"
url: "https://pub.dev"
source: hosted
version: "0.6.7"
version: "0.6.8"
test_process:
dependency: transitive
description:
Expand Down Expand Up @@ -1002,10 +1002,10 @@ packages:
dependency: transitive
description:
name: yaml
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce
url: "https://pub.dev"
source: hosted
version: "3.1.2"
version: "3.1.3"
yaml_edit:
dependency: transitive
description:
Expand Down

0 comments on commit 9f6100a

Please sign in to comment.