-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[All] Expand artifact hub to all plugins #4645
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
[All] Expand artifact hub to all plugins #4645
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with some minor comments. I'm looking forward to the reduced flake :)
@@ -82,6 +88,10 @@ class GradleCheckCommand extends PackageLoopingCommand { | |||
// Returns the gradle file in the given directory. | |||
File _getBuildGradleFile(Directory dir) => dir.childFile('build.gradle'); | |||
|
|||
// Returns the settings gradle file in the given directory. | |||
File _getSettignsGradleFile(Directory dir) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
final RegExp keyPresentRegex = | ||
RegExp("$keyVariable\\s+=\\s+'ARTIFACT_HUB_REPOSITORY'"); | ||
final RegExp documentationPresentRegex = RegExp( | ||
r'github.com.*wiki.*Plugins-and-Packages-repository-structure.*gradle-structure'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: github\.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get lint warnings when I use \ as unnecessary values in a string. I opted for the looser regex instead of ignoring the lint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you need \\
even in a raw string then? I forget the rules around \
for raw strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is actually a false warning where dart assumes \ is used to escape and it is warning me that I dont need to escape .
... Except I do for regular expressions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
final RegExp documentationPresentRegex = RegExp( | ||
r'github.com.*wiki.*Plugins-and-Packages-repository-structure.*gradle-structure'); | ||
final RegExp keyReadRegex = | ||
RegExp('if.*System.getenv.*containsKey.*$keyVariable'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the wildcards here just to avoid the readability hit of lots of \
s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes and I got lint warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the regex match a smaller set of inputs with \
final RegExp documentationPresentRegex = RegExp( | ||
r'github.com.*wiki.*Plugins-and-Packages-repository-structure.*gradle-structure'); | ||
final RegExp keyReadRegex = | ||
RegExp('if.*System.getenv.*containsKey.*$keyVariable'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: \.getenv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
final RegExp keyReadRegex = | ||
RegExp('if.*System.getenv.*containsKey.*$keyVariable'); | ||
final RegExp keyUsedRegex = | ||
RegExp('maven.*url.*System.getenv.*$keyVariable.*'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\.getenv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
gradleLines.any((String line) => keyUsedRegex.hasMatch(line)); | ||
|
||
if (!documentationPresent) { | ||
printError('Does not link artifact hub documentation.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should print out the comment to add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After seeing this output run on packages missing artifact hub implementation I removed documentation as a separate printed error since it is included in the combined string.
/// configuration that enables artifact hub env variable. | ||
@visibleForTesting | ||
static String exampleRootSettingsArtifactHubString = ''' | ||
// See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's extract this URL to a constant that's used in both statics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
bool _validateArtifactHubSettingsUsage( | ||
RepositoryPackage example, List<String> gradleLines) { | ||
final RegExp documentationPresentRegex = RegExp( | ||
r'github.com.*wiki.*Plugins-and-Packages-repository-structure.*gradle-structure'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments in these strings about escaping literal .
s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
.any((String line) => artifactRegistryPluginApplyRegex.hasMatch(line)); | ||
|
||
if (!documentationPresent) { | ||
printError('Does not link artifact hub documentation.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, please include the link to add.
flutter/packages@d7ee75a...ac41376 2023-08-08 engine-flutter-autoroll@skia.org Roll Flutter from ad0aa8d to 436df69 (17 revisions) (flutter/packages#4663) 2023-08-08 10687576+bparrishMines@users.noreply.github.com [webview_flutter_wkwebview] Repeatedly pump WebViews until one is garbage collected (flutter/packages#4662) 2023-08-08 erikgerman917@gmail.com [xdg_directories] Add example app (flutter/packages#4554) 2023-08-08 70025277+Nitin-Poojary@users.noreply.github.com [pigeon] Recursively create output target files (flutter/packages#4458) 2023-08-07 jpnurmi@gmail.com [path_provider] Add getApplicationCachePath() (flutter/packages#4483) 2023-08-07 10687576+bparrishMines@users.noreply.github.com [flutter_markdown] Adopt code excerpts in README (flutter/packages#4656) 2023-08-07 reidbaker@google.com [All] Expand artifact hub to all plugins (flutter/packages#4645) 2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter from 2ba9f7b to ad0aa8d (31 revisions) (flutter/packages#4659) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/flutter/issues/120119
Expansion of #4567
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.md
to add a description of the change, [following repository CHANGELOG style].///
).