[go: nahoru, domu]

Skip to content
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

[ci] Migrate repo tooling from flutter/plugins #3198

Merged
merged 250 commits into from
Feb 13, 2023

Conversation

stuartmorgan
Copy link
Contributor

Imports the repository tooling from flutter/plugins. This is being moved in advance of the full repository merge in order to reduce the complexity of the final merge, since it is highly separable from the rest of the repository.

Rather than being a copy, this grafts the history of flutter/plugins's script/tool directory (rewritten to exclude other directories), to preserve git blame and related functionality. All of the commits here except those from today are migrating the code as-is. My commits from today:

  • Replace all the CI usage of flutter_plugin_tools from pub with the local copy, so that this PR tests the code being added.
  • Updates documentation about the tool.
  • Enables CI tests of the tool itself.
  • Updates metadata for the tool (version, source repo).

Part of flutter/flutter#113764

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

Emmanuel Garcia and others added 30 commits February 12, 2021 13:46
build_all_plugins_app.sh contains an exclusion list, which currently contains almost all of the non-app-facing plugins. However, the script those exclusions are passed to expects federated plugin exclusions to be of the form plugin_name/plugin_name_subplugin_name, not just plugin_name_subplugin_name, so in practice almost nothing on that list has actually been doing anything.

This fixes the script to allow either mode of exclusion (since clearly people expect using just the name to work), and scrubs everything from the list that clearly wasn't actually needed.
Plugins that don't actually support iOS are no longer required to have
an iOS stub to prevent build failures. This removes all iOS stubs from
plugins that don't support iOS.
Includes cleanup to simplify our setup. Major changes:
- Eliminate the NNBD plugin filtering for stable.
- Remove the temporarily-added beta branch testing.
- Enable Linux, macOS, and web on stable (Windows is LUCI-based)
- Combine the two different macOS matrix configurations now that they
  are the same.
- Combine the two different Linux matrix configurations by using a single
  Dockerfile (which now also includes clang-format)
  - The web integration smoke test temporarily still uses the old Dockerfile,
    now renamed, because the driver installer script doesn't support
    Chrome 89 yet.
- Move most of the Linux tasks to lower-CPU machines to allow more
  tasks to run in parallel without hitting the community limit.
- Reorder the tasks slightly and give them comments to identify
  platform groupings
- Enabled web "build all plugins together" and "build all examples"
  tests
Adds a new CI check that all code files have a copyright+license block (and that it's one we are expecting to see).

Fixes the ~350 files (!) that did not have them. This includes all of the files in the .../example/ directories, following the example of flutter/flutter. (This does mean some manual intervention will be needed when generating new example directories in the future, but it's one-time per example.)

Also standardized some variants that used different line breaks than most of the rest of the repo (likely added since I standardized them all a while ago, but didn't add a check for at the time to enforce going forward), to simplify the checks.

Fixes flutter/flutter#77114
Renames the old analysis_options.yaml to analysis_options_legacy.yaml,
replacing it with a slightly modified copy of flutter/flutter's analysis
options.

Each plugins has a temporary local analysis_options.yaml that points to
the legacy version. This allows for inceremental conversion on a
per-plugin basis, which should make the problem more tractable.

Since this hasn't yet been enabled for any packages, it's likely that as
it is we'll find a few local modification we need to make to the root
analysis_options (e.g., things that conflict with 'dart format').

Part of flutter/flutter#76229
- Replaces "the Flutter project authors" with the repo-standard version "The Flutter Authors"
  - Updates the license check not to allow "the Flutter project authors" in the future
- Fixes a few minor cosmetic variations that had crept back into LICENSE files since my
  mass-standardization of those files.
  - Updates the license check to validate those to prevent such drift in the future.
In all copyright messages (and in the Xcode project organization name) standardize on "The Flutter Authors", adding "The Chromium Authors" to the Flutter AUTHORS list. This reduces inconsistency in the copyright lines in this repository, moving closer to a single consistent copyright+license (as in flutter/engine and flutter/flutter)

Updates the validation script to no longer accept "The Chromium Authors" or "the Chromium project authors" in first-party code.
Standardizes all first-party copyrights on a single year, as is done in flutter/flutter and flutter/engine. All code now uses 2013, which is the earliest year that was in any existing copyright notice.

The script checks now enforce the exact format of first-party licenses and copyrights.

Fixes flutter/flutter#78448
This change enables the integration_tests of the following packages to run in Cirrus CI:

* google_sign_in_web
* connectivity_for_web
* google_maps_flutter_web
* url_launcher_web
…r#3748)

* Add CUSTOM_ANALYSIS_PLUGINS back with all the plugins that now have a custom analysis_options.yaml
Flutter master now creates NNBD code when running 'flutter create', so
the generated pubspec for build_all needs to use a compatible SDK
version. This updates from 2.0.0 to 2.12.0.

Also includes a test for this, which involved setting up tests for the
file, and doing some refactoring to make the command testable. As a
result, this fixes flutter/flutter#61049
(although more test backfill is needed).
Removes the legacy analysis options override and fixes all resulting issues. This is a combination of dart fix and manual changes (mostly mechanical, but some small restructuring to address warnings more cleanly, such as creating typed structs from args when they are used repeatedly to avoid repeated casting, or making things that were unnecessarily public private).

One small opportunistic extra cleanup is that the handling of null-safety prerelease versions is removed, as any new plugin would be written null-safe from the start, so we no longer need to allow those versions.

Part of flutter/flutter#76229
Currently our version update checks aren't actually working; the script doesn't work correctly if no explicit --base-sha is passed, but that's always how CI is calling it.

Fixes flutter/flutter#79823 (and version checks in general)

This makes a number of changes:
- Fixes it to work without --base-sha
- Adds tests that it works in that mode
  - And tightens existing tests to require ToolExit, not just any error, to reduce false-positive test success
- Adds verbose logging of the checks being done, to make it easier to debug this kind of issue in the future
- Tightens the exception handling for missing previous versions to just the line that's expected to fail in that case
- Only allows missing versions when "publish_to: none" is set
  - Adds that everywhere it's missing
  - Standardize the format in the repo to "none" (instead of also having "'none'").
- Allows the use of NEXT in CHANGELOG as a way of gathering changes that are worth noting, but not
  doing a publish cycle for. (Replaces the plan of using -dev versions, since that's actually harder to implement,
  and more confusing.)
  - Ensures that we don't forget to clean up NEXT entries when bumping versions
stuartmorgan and others added 21 commits December 11, 2022 01:09
Pigeon has an usual test structure since it generates test code to run
in a dummy plugin; add that structure to the list of recognized tests so
that changes to its platform tests won't be flagged by `version-check`.
* [various] Enable avoid_print

Enables the `avoid_print` lint, and fixes violations (mostly by opting
example files out of it).

* Version bumps

* Add tooling analysis option file that was accidentally omitted

* Fix typo in analysis_options found by adding tool sub-options

* Revert most version bumps

* Fix ios_platform_images
…ther executables in PATH (flutter#6853)

* If clang-format does not run, fall back to other executables in PATH

* Review edits
It's not clear why we are adding an outdated version of Guava; it is
likely cruft, so this test removing it.
* Enable the option

* Fix camera

* Fix webview

* Remove unnecessary 'call's from camera tests

* Fix maps

* Fix sign-in

* fix image_picker

* Fix IAP

* Fix shared_preferences

* Fix url_launcher_android

* Version bumps

* Fix tool

* Re-apply webview test fix

* Re-bump versions

* Fix one new tool issue
`flutter format` is deprecated on `master`, and prints a warning saying
to switch to `dart format` instead. This updates `format` to make that
switch.
When determining whether or not to fail with `--fail-on-change`, only
look at .md files. In some cases, running the necessary commands (e.g.,
`flutter pub get`) may change unrelated files, causing fales positive
failures. Only changed documentation files should be flagged.

Also log the specific files that were detected as changed, to aid in
debugging any future false positives.

Fixes flutter/flutter#111592
Fixes flutter/flutter#111590
* Rename command, bump version

* Update tests to write actual podspecs

* Add new check

* Analyzer fix

* Unhdo file move
Adds options to `pubspec.yaml` to check that the minimum supported SDK range for Flutter/Dart is at least a given version, to add CI enforcement that we're updating all of our support claims when we update our tested versions (rather than it being something we have to remember to do), and enables it in CI.

As part of enabling it, fixes some violations:
- path_provider_foundation had been temporarily dropped back to 2.10 as part of pushing out a regression fix.
- a number of examples were missing Flutter constraints even though they used Flutter.
- the non-Flutter `plugin_platform_interface` package hadn't been update since I hadn't thought about Dart-only constraints in the past.
* [tool] Improve main-branch detection

Currently main-branch detection for `--packages-for-branch` looks at
branch names, but this no longer works on LUCI which now seems to be
checking out specific hashes rather than branches. This updates the
behavior so that it will treat any hash that is an ancestor of `main` as
being part of `main`, which should allow post-submit detection to work
under LUCI.

Fixes flutter/flutter#119330

* Fix throw

* Fix typos

* Update comment
…r#7029)

* Standardize on .g.dart

* Remove unused exclusion patterns

* Mark pigeons/ as dev-only in the tooling

* Version bumps

* Add missed files

* More new import fixes
Follow-up to flutter/plugins#7038 to try to make
it work on LUCI. Looking at the checkout steps of a LUCI run, it looks
like we do a full `fetch` of `origin`, but likely only have a `master`
branch locally. Rather than rely on a specific local branch name
existing, this allows for checking `origin` (and just in case, since
it's another common remote name, `upstream`).

Hopefully fixes flutter/flutter#119330
…ocal_auth_android/android (flutter#6393)

* [local_auth]: Bump core

Bumps core from 1.8.0 to 1.9.0.

---
updated-dependencies:
- dependency-name: androidx.core:core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump compilesdkversion

* Bump fragment and update changelog

* Bump gradle version

* Bump compileSdkVersion

* Bump all plugins compilesdkversion

* Bump gradle version of example apps

* Update changelog

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: camsim99 <camillesimon90@gmail.com>
@google-cla
Copy link
google-cla bot commented Feb 13, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@tarrinneal
Copy link
Contributor

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

First pr huh?

We don't have an override for this do we? So it will need to be manually merged.

@stuartmorgan
Copy link
Contributor Author

First pr huh?

There's an annoying edge case with Google corp email addresses of former Googlers.

We don't have an override for this do we?

We do, I just need to have a repo admin do it.

@stuartmorgan stuartmorgan merged commit c149b81 into flutter:main Feb 13, 2023
@stuartmorgan stuartmorgan deleted the tool-migration branch February 13, 2023 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet