Misc docs cleanup and fixes (#155501)

This commit is contained in:
Parker Lougheed
2024-09-24 16:03:08 -04:00
committed by GitHub
parent 35d57144ce
commit 22570daa18
49 changed files with 229 additions and 109 deletions

View File

@@ -150,7 +150,7 @@ It looks like the only issue filed for this directly has been
An explanation and migration path exists in the CHANGELOG.md of each plugin, but
this information is hard to find and the actual Gradle error is not helpful.
Several bugs on Github have been filed from affected users.
Several bugs on GitHub have been filed from affected users.
* [flutter/flutter#27106](https://github.com/flutter/flutter/issues/27106)
* [flutter/flutter#27226](https://github.com/flutter/flutter/issues/27226)
@@ -198,7 +198,7 @@ did not provide any obvious ways to debug the incompatibility.
scale of the breakage. We didn't realize that it applied to all untouched
`build.gradle` files produced by released versions of `flutter create`. Also
failed to verify that the Gradle errors mentioned AndroidX or were otherwise
easily understable.
easily understandable.
* The `flutter/plugins` CI failed to verify that the new plugins could be used
with the template from `flutter create` on stable.
* No manual sanity checks were recommended and insufficient ones were performed

View File

@@ -1,21 +1,26 @@
Flutter postmortem: Platform-View-android-14-regression
# Flutter postmortem: Platform-View-android-14-regression
Status:Published
Owners: johnmccutchen, reidbaker, jrect
##Summary
## Summary
Flutter “Platform Views” on Android 14 stopped displaying when apps were backgrounded and onMemoryTrim was called. Confounding investigation, the OEM had a different but related issue that impacted viewing Platform Views. Platform Views are particularly important because they are the mechanism used to display ads.
Component: Android, Platform Views
Date/time: 2024-05-28
Duration: 6 months
###Purpose of this doc
### Purpose of this doc
This is a postmortem for the regression in Flutter Platform Views on Android 14. The purpose is to understand what went wrong, why it took so long to diagnose and/or fix, and how to avoid such breakages and long resolution periods in the future.
###User Impact
### User Impact
All Flutter customers using Platform Views on Android 14, including apps that use ads for revenue.
### Root Cause(s)
An AOSP public Android API was subtly broken in the commit here.
An OEM specific broken public API that was caused by similar roots but had different observable outcomes.
Flutter integration tests did not catch this class of error.
@@ -73,7 +78,7 @@ Timeline (all times in PST/PDT)
13:10 - Flutter team shares the model information so that we can get a build with the fix while awaiting an explanation of what is wrong.
2024-01-31
00:00 - On an external bug with active comentary from multiple flutter contributors. Flutter still believes the issue to be the OEM only. https://github.com/pichillilorenzo/flutter_inappwebview/issues/1981#issuecomment-1919482839
00:00 - On an external bug with active commentary from multiple flutter contributors. Flutter still believes the issue to be the OEM only. https://github.com/pichillilorenzo/flutter_inappwebview/issues/1981#issuecomment-1919482839
2024-02-16
@@ -181,20 +186,23 @@ medium (?) news: workaround isn't that bad at least, you'll need to switch to Ha
16:47 - Android rejected AOSP patch for partners. https://buganizer.corp.google.com/issues/339659092#comment12
2024-06-06
Discussion among Flutter leads about whether the the OEM-specific workaround(s) that were CP’d into Flutter 3.22 should be reverted. The workarounds imply additional Flutter public APIs that are not believed to be sustainable.
Discussion among Flutter leads about whether the OEM-specific workaround(s) that were CP’d into Flutter 3.22 should be reverted. The workarounds imply additional Flutter public APIs that are not believed to be sustainable.
https://github.com/flutter/flutter/issues/148417
3.22.2 released to the public with the second mitigation. Flutter apps need to recompile and republish. https://groups.google.com/g/flutter-announce/c/0PEE5AvDZqc
End of outage.
###What went well:
### What went well
Once the Flutter team found the build range, the Android team fixed the problem for AOSP quickly.
###Where we got lucky:
### Where we got lucky
The issue did not affect all Platform Views on launch.
Drawing on prior experience, the Flutter team was able to quickly bisect on Android builds. Presumably, most Android customers wouldn’t be able to do this.
###What could have gone better?
### What could have gone better?
The Flutter team struggled for several months to identify the difference between an Android issue from one manufacturer and an Android issue in AOSP.
The root-causing effort could have been more collaborative.
Platform Views are high risk and high value.
@@ -210,11 +218,12 @@ Action items
* P1 Screenshot Integration test for an arbitrary version of android that displays a platform view.
* P2 Screenshot Integration test for an arbitrary version of android that displays a platform view after backgrounding the activity and triggering memory trim
###Process
### Process
go/critical-partner-patches this document describes the work to escalate android patches to other android manufacturers.
go/pr-bug form required to get a patch shipped to pixel devices.
###Fixes
### Fixes
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/27015418
https://github.com/flutter/engine/pull/52370

View File

@@ -14,12 +14,15 @@ User impact: Users of the following plugins: url_launcher, google_sign_in, video
## Timeline (all times in PST/PDT)
### 2019-09-01
stuartmorgan@ notices that Flutter applications that are using non-Android plugins are failing to build for Android (same for iOS) and files https://github.com/flutter/flutter/issues/39657. The root cause is that the Flutter gradle plugin assumes that all plugins include an Android implementation and tries to build it.
### 2019-09-16
stuargmorgan@ prototypes [a fix](https://github.com/flutter/flutter/compare/main...stuartmorgan:wip-platform-plugin-files?expand=1). That fix requires migration of existing plugins.
### 2019-09-18
As a temporary workaround for the issue above (Android only), amirh@ lands https://github.com/flutter/flutter/pull/40640 which makes `flutter.gradle` skip packages that do not have an `android/build.gradle` file, this workaround lives in the Flutter SDK and does not require plugin migration.
The change lands with a test that:
@@ -31,37 +34,42 @@ The change lands with a test that:
In the following months work starts on federated web and mac implementations of `flutter/plugins` and `FirebaseExtended/flutterfire` plugins. With #40640 landed, these implementations all land without an `android/` folder.
### 2019-11-25
blasten@ lands https://github.com/flutter/flutter/pull/45379 which reworks the Gradle workflow.
This patch introduces a different code path for building transitive dependencies, the new code path again assumes that all plugins support `android/`. Though no one notices, and no tests fail (the test introduced in #40640 passes as flutter_plugin_test isn’t included as a transitive dependency).
### 2019-12-06
In preparation for the new pub.dev version that supports multi platform federated plugins and for the coming stable Flutter release the team decides to start endorsing web plugins (by adding them as a dependency of the app-facing plugins, so e.g url_launcher_web becomes a dependency of url_launcher). When staging the first PR for url_launcher, CI alerts us that the example application fails building for Android. After some investigation amirh@ and blasten@ figure out that https://github.com/flutter/flutter/pull/45379 introduced the regression.
amirh@ starts adding a no-op `android/` implementations to the offending plugins, at the same time blasten@ sends https://github.com/flutter/flutter/pull/46282 which allows gradle to build apps with non Android plugins as transitive dependencies. At this point the release candidate for the next stable (1.12.13) was already cut without #46282.
The logic in #46282 is somewhat similar to #40640 and skips packages that do not have an `android/` folder, amirh@ asks blasten@ whether we should be consistent with #46282 and check for `android/build.gradle` but both figure it shouldn’t matter and the PR lands as-is.
### 2019-12-09
The web team makes the case that #46282 should be cherry picked into 1.12.13 to avoid adding no-op `android/` folders to all web implementations. It’s cherry picked into v.12.13+hotfix.4 and the team decides to not add any more no-op `android/` implementations and endorse the existing with a minimal Flutter SDK constraint of `>=1.12.13+hotfix.4`.
The team moves forward to publish the endorsements for: url_launcher, google_sign_in, video_player, firebase_auth, firebase_core, shared_preferences. At this point users of stable Flutter aren’t impacted as there is not yet a stable Flutter release which satisfies the version constraint, so pub won’t fetch the new plugin versions which include the endorsements.
### 2019-12-11
06:15pm - V1.12.13+hotfix.6 is released to stable **<START OF OUTAGE>**
At this point, users of any of {url_launcher, google_sign_in, video_player, firebase_auth, firebase_core, shared_preferences} are affected by 2 issues:
#### 1. Android Studio users can’t build their apps
Android studio automatically creates an `android/` folder for all the Gradle subprojects during the “analyzing project phase”. This essentially disables the fix in #46282. (note that it does not create a build.gradle file.)
This is not detected by CI as we’re not using Android Studio on CI.
#### 2. Non fully AndroidX-compatible projects fail to build
The Flutter tool has a backup build strategy to deal with AndroidX failures - if the first build attempt fails due to an AndroidX issue, the Flutter tool tries a secondary build strategy which builds all plugins as AARs (this enables Jettifier). This AAR workflow was not updated to support non-Android plugins, which guarantees the build retry will fail if any of the affected plugins are included as dependencies.
### 2019-12-12
10:45am - amirh@ skims over new Flutter issues and notices multiple reports on Gradle errors due to plugins missing Android support and files https://github.com/flutter/flutter/issues/46898 to start tracking.
While blasten@ is investigating the Gradle issue the team starts to mitigate by adding no-op `android/` implementations to the endorsed web plugins.
@@ -69,6 +77,7 @@ While blasten@ is investigating the Gradle issue the team starts to mitigate by
01:34pm - All endorsed web plugins got a no-op `android/` folder **<END OF OUTAGE>**
### 2019-12-13
blasten@ figures the underlying Gradle issue (https://github.com/flutter/flutter/issues/46898#issuecomment-565612416) and start working on a fix.
@@ -109,21 +118,16 @@ Users of multiple popular Flutter plugins were not able to build their Android a
### Detection
{link to github issues for things that would have detected this failure before it became An Incident, such as better testing, monitoring, etc}
* All `dev/devicelab/bin/tasks/gradle_*` tests should run with the AAR workflow as well - https://github.com/flutter/flutter/issues/48089.
* All `dev/devicelab/bin/tasks/gradle_*` tests should run with and without the projects being opened (and built?) by Android Studio - https://github.com/flutter/flutter/issues/48088.
### Process
{link to github issues for things that would have helped us resolve this failure faster, such as documented processes and protocols, etc}
* A better process for flagging erupting fires quickly:
* Alerts for issues that quickly gain thumb ups
* Increased issue monitoring following a Flutter release
### Fixes
{link to github issues or PRs/commits for the actual fixes that were necessary to resolve this incident}
https://github.com/flutter/flutter/pull/47015

View File

@@ -1,8 +1,11 @@
# Flutter 2.8 Stable Retrospective
Date: 16 December 2021
Facilitator: Kevin Chisholm
## Attendees
1. Nuritzi Sanchez
1. Alexander Thomas
1. Godofredo Contreras
@@ -17,23 +20,33 @@ Facilitator: Kevin Chisholm
1. Andrew Brogdon
1. Kevin Chisholm
## Retrospective Guidelines
### Blameless
Focus on the actions and behaviors, not the people. Our retrospectives should be a safe place to reflect on what we can do to improve as a team.
### Inclusive
All input is valuable, we should never make someone feel as if their thoughts and contributions are not valued.
### Actionable
Work toward defining the issues that can be actioned on to be more successful in the future.
## Retrospective Items
### What went well
* We released a quality SDK on the expected date.
* No P0 issues to hotfix.
* Our infrastructure and test owners responded rapidly to the chat allowing us to address issues.
* The social team was proactive in keeping customers informed.
* Were able to delay blog post and docs.
* Got them out in time after the release was available.
### Challenges
* We did not properly take into account how long the release would take.
* We had no process to separate the build from the release.
* Documentation is lacking / not prescriptive enough to accurately describe the entire process.
@@ -55,6 +68,7 @@ Xcode/Mac/iOS were force updated in between the beta to stable time window
* Branch configurations were updated after landing the PR causing multiple purples and several manual retries.
### How can we improve [30 Minutes]
* Build Flutter in advance.
* Should have been done the day before and pushed the morning of.
* Do most of the build and release process in advance; on the day-of, do the tagging / packaging work (<1 hr, and a predictable process).
@@ -74,6 +88,7 @@ Xcode/Mac/iOS were force updated in between the beta to stable time window
* Improve communication.
* Cherry pick owners were not notified of the release times.
* Were not able to resolve issues.
### Action Items
| Status | Action Item | Owner |