diff --git a/.ci.yaml b/.ci.yaml index cda5706b72f2..714e25471f34 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -7,9 +7,9 @@ # * https://github.com/flutter/cocoon/blob/main/CI_YAML.md enabled_branches: - main - - release-go_router-\d+\.\d+\.\d+ - - release-cupertino_ui-\d+\.\d+\.\d+ - - release-material_ui-\d+\.\d+\.\d+ + - release-go_router-\d+\.\d+\.\d+(?:-[\w.]+)?(?:\+[\w.]+)? + - release-cupertino_ui-\d+\.\d+\.\d+(?:-[\w.]+)?(?:\+[\w.]+)? + - release-material_ui-\d+\.\d+\.\d+(?:-[\w.]+)?(?:\+[\w.]+)? platform_properties: linux: diff --git a/script/tool/lib/src/validators/repo_info_validator.dart b/script/tool/lib/src/validators/repo_info_validator.dart index b31f54d54170..d18bbf0174af 100644 --- a/script/tool/lib/src/validators/repo_info_validator.dart +++ b/script/tool/lib/src/validators/repo_info_validator.dart @@ -403,18 +403,20 @@ class RepoInfoValidator { final enabledBranches = yaml['enabled_branches'] as YamlList?; final bool hasBranchPattern = enabledBranches != null && - enabledBranches.contains(r'release-' + packageName + r'-\d+\.\d+\.\d+'); + enabledBranches.contains( + r'release-' + packageName + r'-\d+\.\d+\.\d+(?:-[\w.]+)?(?:\+[\w.]+)?', + ); if (isBatchRelease && !hasBranchPattern) { printError( - '${_indentation}Missing release branch pattern release-$packageName-\\d+\\.\\d+\\.\\d+ ' + '${_indentation}Missing release branch pattern release-$packageName-\\d+\\.\\d+\\.\\d+(?:-[\\w.]+)?(?:\\+[\\w.]+)? ' 'in enabled_branches in .ci.yaml\n' '${_indentation}See https://github.com/flutter/flutter/blob/master/docs/ecosystem/release/README.md#batch-release', ); errors.add('Unexpected branch handling in .ci.yaml'); } else if (!isBatchRelease && hasBranchPattern) { printError( - '${_indentation}Unexpected release branch pattern release-$packageName-\\d+\\.\\d+\\.\\d+ ' + '${_indentation}Unexpected release branch pattern release-$packageName-\\d+\\.\\d+\\.\\d+(?:-[\\w.]+)?(?:\\+[\\w.]+)? ' 'in enabled_branches in .ci.yaml', ); errors.add('Unexpected branch handling in .ci.yaml'); diff --git a/script/tool/test/validate_command_repo_info_test.dart b/script/tool/test/validate_command_repo_info_test.dart index bcb59f03b94c..931d0a3503e7 100644 --- a/script/tool/test/validate_command_repo_info_test.dart +++ b/script/tool/test/validate_command_repo_info_test.dart @@ -696,7 +696,7 @@ release: root.childFile('.ci.yaml').writeAsStringSync(r''' enabled_branches: - main - - release-a_package-\d+\.\d+\.\d+ + - release-a_package-\d+\.\d+\.\d+(?:-[\w.]+)?(?:\+[\w.]+)? '''); } } @@ -991,7 +991,7 @@ enabled_branches: output, contains( contains( - r'Missing release branch pattern release-a_package-\d+\.\d+\.\d+ in enabled_branches in .ci.yaml', + r'Missing release branch pattern release-a_package-\d+\.\d+\.\d+(?:-[\w.]+)?(?:\+[\w.]+)? in enabled_branches in .ci.yaml', ), ), ); @@ -1006,7 +1006,7 @@ enabled_branches: root.childFile('.ci.yaml').writeAsStringSync(r''' enabled_branches: - main - - release-a_package-\d+\.\d+\.\d+ + - release-a_package-\d+\.\d+\.\d+(?:-[\w.]+)?(?:\+[\w.]+)? '''); Error? commandError; @@ -1023,7 +1023,7 @@ enabled_branches: output, contains( contains( - r'Unexpected release branch pattern release-a_package-\d+\.\d+\.\d+ in enabled_branches in .ci.yaml', + r'Unexpected release branch pattern release-a_package-\d+\.\d+\.\d+(?:-[\w.]+)?(?:\+[\w.]+)? in enabled_branches in .ci.yaml', ), ), );