Skip to content

Commit b099bf0

Browse files
Reverts "Use dartpad's main channel for master/main docs (flutter#144329)" (flutter#144429)
Reverts flutter#144329 Initiated by: goderbauer Reason for reverting: broke postsubmit doc generation. Original PR Author: goderbauer Reviewed By: {devoncarew, HansMuller, gspencergoog} This change reverts the following previous change: Original Description: Dartpad doesn't have a "master" channel anymore, it got renamed to "main". Sadly, specifying "master" is now falling back to "stable" which breaks some of our examples in the docs that require a more current Flutter version, e.g. https://main-api.flutter.dev/flutter/material/TextButton-class.html
1 parent 1349c59 commit b099bf0

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

dev/bots/docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function generate_docs() {
116116
# Install and activate the snippets tool, which resides in the
117117
# assets-for-api-docs repo:
118118
# https://github.com/flutter/assets-for-api-docs/tree/master/packages/snippets
119-
"$DART" pub global activate snippets 0.4.2
119+
"$DART" pub global activate snippets 0.4.0
120120

121121
# This script generates a unified doc set, and creates
122122
# a custom index.html, placing everything into DOC_DIR.

dev/snippets/config/skeletons/dartpad-sample.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</p>
1414
</div>
1515
<iframe class="snippet-dartpad"
16-
src="https://dartpad.dev/embed-flutter.html?split=60&amp;run=true&amp;sample_id={{id}}&amp;channel={{channel}}">
16+
src="https://dartpad.dev/embed-flutter.html?split=60&amp;run=true&amp;sample_id={{id}}&amp;sample_channel={{channel}}&amp;channel={{channel}}">
1717
</iframe>
1818
</div>
1919
{@end-inject-html}

dev/tools/create_api_docs.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,13 +742,14 @@ class DartdocGenerator {
742742

743743
// Check a "dartpad" example, any one will do, and check for the correct URL
744744
// arguments.
745-
// Just use "main" for any branch other than the LUCI_BRANCH.
745+
// Just use "master" for any branch other than the LUCI_BRANCH.
746746
final String? luciBranch = platform.environment['LUCI_BRANCH']?.trim();
747-
final String expectedBranch = luciBranch != null && luciBranch.isNotEmpty ? luciBranch : 'main';
747+
final String expectedBranch = luciBranch != null && luciBranch.isNotEmpty ? luciBranch : 'master';
748748
final List<String> argumentRegExps = <String>[
749749
r'split=\d+',
750750
r'run=true',
751751
r'sample_id=widgets\.Listener\.\d+',
752+
'sample_channel=$expectedBranch',
752753
'channel=$expectedBranch',
753754
];
754755
for (final String argumentRegExp in argumentRegExps) {

dev/tools/test/create_api_docs_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ void main() {
441441
</code>
442442
</pre>
443443
''');
444-
const String queryParams = 'split=1&run=true&sample_id=widgets.Listener.123&channel=main';
444+
const String queryParams = 'split=1&run=true&sample_id=widgets.Listener.123&sample_channel=master&channel=master';
445445
widgetsDir.childFile('Listener-class.html').writeAsStringSync('''
446446
<iframe class="snippet-dartpad" src="https://dartpad.dev/embed-flutter.html?$queryParams">
447447
</iframe>

0 commit comments

Comments
 (0)