Skip to content

Commit 8e1f89b

Browse files
authored
Merge branch 'master' into web-avif-prefer-animation
2 parents d0cd36b + d9b77d2 commit 8e1f89b

465 files changed

Lines changed: 18250 additions & 6151 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/flutter-cherry-pick/SKILL.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Trigger this skill by providing a merged PR number or URL and optionally the tar
7676
- If conflicts were encountered and resolved in Phase 3, gather the documentation of those conflicts.
7777
3. **Draft the Template:**
7878
- Fill in the retrieved template fields using LLM reasoning based on the issue and original PR context.
79+
- Replace `<ORIGINAL_PR_NUMBER>` with the actual original PR number so the cherry-pick PR links to the original PR.
7980
- If conflicts were resolved, clearly document them in the PR description (e.g., in the "Description" or "Changelog" section), explaining what was resolved and how.
8081
- Keep the Markdown structure of the template intact.
8182
- **CRITICAL:** Remove any instructional text or guidelines within the sections (e.g., "What is the impact...", "Explain this cherry pick...") when replacing them with your responses. Do NOT remove explanations around checkboxes or selection items (e.g., "What is the risk level...", "Are you confident...").

‎.agents/skills/flutter-cherry-pick/scripts/flutter_cp.dart‎

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,56 @@ class CherryPickHelper {
8888
]);
8989
}
9090

91+
/// Whether the original PR's merge commit contains the `cp-trigger.yml`
92+
/// workflow.
93+
///
94+
/// Adding a `cp:` label runs `cp-trigger.yml` from the PR's merge commit, so
95+
/// for PRs merged before that workflow existed, adding the label does nothing.
96+
Future<bool> hasCpTrigger() async {
97+
final String sha = switch (originalPrData) {
98+
{'mergeCommit': {'oid': final String oid}} => oid,
99+
_ => throw StateError('Could not find merge commit SHA in PR data'),
100+
};
101+
final ProcessResult result = await runCmd([
102+
'gh',
103+
'api',
104+
'repos/flutter/flutter/contents/.github/workflows/cp-trigger.yml?ref=$sha',
105+
'--silent',
106+
], allowFailure: true);
107+
return result.exitCode == 0;
108+
}
109+
110+
/// Runs the `easy-cp.yml` workflow directly via `workflow_dispatch`.
111+
///
112+
/// This is the fallback for PRs merged before `cp-trigger.yml` existed.
113+
/// Requires write access to flutter/flutter.
114+
Future<void> dispatchWorkflow() async {
115+
_info('Running easy-cp.yml for PR #$pr to $channel via workflow_dispatch...');
116+
await runCmd([
117+
'gh',
118+
'workflow',
119+
'run',
120+
'easy-cp.yml',
121+
'-R',
122+
'flutter/flutter',
123+
'-f',
124+
'pr_number=$pr',
125+
'-f',
126+
'channel=$channel',
127+
]);
128+
}
129+
130+
/// Starts the automated cherry-pick, by adding the `cp:` label or, for PRs
131+
/// merged before `cp-trigger.yml` existed, by dispatching `easy-cp.yml`.
132+
Future<void> triggerAutomatedCp() async {
133+
if (await hasCpTrigger()) {
134+
await addLabel();
135+
} else {
136+
_info('PR #$pr was merged before cp-trigger.yml existed; adding a label would do nothing.');
137+
await dispatchWorkflow();
138+
}
139+
}
140+
91141
/// Dynamically retrieves the release candidate branch name for the target channel.
92142
///
93143
/// Reads the version file `bin/internal/release-candidate-branch.version` from
@@ -172,7 +222,9 @@ class CherryPickHelper {
172222
/// the original PR number or title in its title.
173223
Future<int?> pollForPr(String candidateBranch) async {
174224
_info('Polling for automated cherry-pick PR targeting $candidateBranch...');
175-
const attempts = 8;
225+
// The automated cherry-pick runs as two chained workflows (cp-trigger.yml,
226+
// then easy-cp.yml), which usually takes 1-2 minutes.
227+
const attempts = 12;
176228
for (var i = 0; i < attempts; i++) {
177229
await Future<void>.delayed(const Duration(seconds: 15));
178230
_info('Polling attempt ${i + 1}/$attempts...');
@@ -379,7 +431,7 @@ void main(List<String> arguments) async {
379431
final String candidateBranch = await helper.getCandidateBranch();
380432

381433
if (action == 'start') {
382-
await helper.addLabel();
434+
await helper.triggerAutomatedCp();
383435
// Wait a bit before polling to let GitHub Actions trigger
384436
await Future<void>.delayed(const Duration(seconds: 5));
385437
final int? cpPr = await helper.pollForPr(candidateBranch);

‎.autoroller-preupload.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ cd "$REPO_PATH"
2727
gclient sync -D
2828

2929
# This calls `gn gen`.
30-
"$GN" --runtime-mode profile --no-goma --no-rbe --enable-minimal-linux
30+
"$GN" --runtime-mode profile --no-rbe --enable-minimal-linux
3131
ninja -C "$PROFILE_PATH" licenses_cpp
3232
"$LICENSE_CPP" \
3333
--working_dir="$WORKING_DIR" \

0 commit comments

Comments
 (0)