From 9f6100a52d3638bbd5aa1ee65fa2d7692fcd1ea0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Istv=C3=A1n=20So=C3=B3s?=
Date: Fri, 10 Jan 2025 13:53:51 +0100
Subject: [PATCH] Upgrade pana (#8453)
---
CHANGELOG.md | 1 +
app/lib/package/model_properties.dart | 10 ++---
app/pubspec.yaml | 2 +-
.../goldens/packages/oxygen/score.html | 45 -------------------
.../packages/oxygen/versions/1.0.0/score.html | 45 -------------------
.../lib/pub_package_reader.dart | 21 ++++-----
pkg/pub_worker/pubspec.yaml | 2 +-
pubspec.lock | 40 ++++++++---------
8 files changed, 36 insertions(+), 130 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 376cf86754..c12cbde684 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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`.
diff --git a/app/lib/package/model_properties.dart b/app/lib/package/model_properties.dart
index f753f92f8c..06c272a543 100644
--- a/app/lib/package/model_properties.dart
+++ b/app/lib/package/model_properties.dart
@@ -98,7 +98,7 @@ class Pubspec {
/// `>=` 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.
@@ -107,7 +107,7 @@ class Pubspec {
/// `>=` 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.
@@ -131,7 +131,7 @@ 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;
@@ -139,8 +139,8 @@ class Pubspec {
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;
diff --git a/app/pubspec.yaml b/app/pubspec.yaml
index 1f5f99d6c4..bebab7f024 100644
--- a/app/pubspec.yaml
+++ b/app/pubspec.yaml
@@ -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'
diff --git a/app/test/task/testdata/goldens/packages/oxygen/score.html b/app/test/task/testdata/goldens/packages/oxygen/score.html
index 40a8d98ef6..8846cbc899 100644
--- a/app/test/task/testdata/goldens/packages/oxygen/score.html
+++ b/app/test/task/testdata/goldens/packages/oxygen/score.html
@@ -297,51 +297,6 @@
requests.
-
- Failed to verify repository URL.
-
- Please provide a valid
-
- repository
-
- URL in
- pubspec.yaml
- , such that:
-
-
- -
-
repository
- can be cloned,
-
- -
- a clone of the repository contains a
-
pubspec.yaml
- , which:,
-
- -
- contains
-
name: oxygen
- ,
-
- -
- contains a
-
version
- property, and,
-
- -
- does not contain a
-
publish_to
- property.
-
-
-
-
-
- Unable to access git repository: Failed to run
- remote show origin
- .
-
-
5/5 points: Provide a valid
diff --git a/app/test/task/testdata/goldens/packages/oxygen/versions/1.0.0/score.html b/app/test/task/testdata/goldens/packages/oxygen/versions/1.0.0/score.html
index d479035a0d..2efeaea0b5 100644
--- a/app/test/task/testdata/goldens/packages/oxygen/versions/1.0.0/score.html
+++ b/app/test/task/testdata/goldens/packages/oxygen/versions/1.0.0/score.html
@@ -301,51 +301,6 @@
requests.
-
- Failed to verify repository URL.
-
- Please provide a valid
-
- repository
-
- URL in
- pubspec.yaml
- , such that:
-
-
- -
-
repository
- can be cloned,
-
- -
- a clone of the repository contains a
-
pubspec.yaml
- , which:,
-
- -
- contains
-
name: oxygen
- ,
-
- -
- contains a
-
version
- property, and,
-
- -
- does not contain a
-
publish_to
- property.
-
-
-
-
-
- Unable to access git repository: Failed to run
- remote show origin
- .
-
-
5/5 points: Provide a valid
diff --git a/pkg/pub_package_reader/lib/pub_package_reader.dart b/pkg/pub_package_reader/lib/pub_package_reader.dart
index 929523028b..f107facc17 100644
--- a/pkg/pub_package_reader/lib/pub_package_reader.dart
+++ b/pkg/pub_package_reader/lib/pub_package_reader.dart
@@ -271,7 +271,7 @@ Future summarizePackageArchive(
issues.addAll(checkFunding(pubspecContent));
issues.addAll(checkTopics(pubspecContent));
issues.addAll(checkHooks(
- _minVersion(pubspec.environment?['sdk']),
+ _minVersion(pubspec.environment['sdk']),
tar.fileNames,
));
@@ -431,7 +431,7 @@ Iterable 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),
@@ -450,7 +450,7 @@ final _postDart3 = VersionConstraint.parse('>=3.0.0-0');
/// Checks if the version range is acceptable by current SDKs.
Iterable checkSdkVersionRange(Pubspec pubspec) sync* {
- final sdk = pubspec.environment?['sdk'];
+ final sdk = pubspec.environment['sdk'];
if (sdk == null ||
sdk.isAny ||
sdk is! VersionRange ||
@@ -519,10 +519,7 @@ const _knownEnvironmentKeys = {
/// Validates that keys referenced in the `environment` section are
/// known and valid, otherwise `pub` won't be able to use the package.
Iterable 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;
@@ -646,9 +643,8 @@ Iterable 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,
@@ -679,9 +675,8 @@ Iterable 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,
diff --git a/pkg/pub_worker/pubspec.yaml b/pkg/pub_worker/pubspec.yaml
index 5e62f63682..94957eb4c9 100644
--- a/pkg/pub_worker/pubspec.yaml
+++ b/pkg/pub_worker/pubspec.yaml
@@ -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
diff --git a/pubspec.lock b/pubspec.lock
index 5ed8eb6fe5..872851472b 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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: