Skip to content

Commit 6d04cb3

Browse files
authored
[friction] add auto-baseline updating (#8917)
Fixes: #8916 --- Review the contribution guidelines below: - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. - [x] I've included the required information in the description above. - [x] My up-to-date information is in the `AUTHORS` file. - [x] I've updated `CHANGELOG.md` if appropriate. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide](../CONTRIBUTING.md) and the [Flutter organization contributor guide]([https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Dart contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Java and Kotlin contributions should strive to follow Java and Kotlin best practices ([discussion](#8098)). </details>
1 parent 70da7a0 commit 6d04cb3

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

tool/github.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ elif [ "VERIFY_BOT" = "$BOT" ] ; then
135135

136136
if [ $EXIT_STATUS -ne 0 ]; then
137137
echo -e "${RED}${BOLD}Build failed: New verification issues were detected.${NC}"
138+
echo -e "${YELLOW}To update the baselines with these new issues, run:${NC}"
139+
echo -e "${YELLOW} ./tool/update_baselines.sh${NC}"
140+
echo -e "${YELLOW}from the repository root and commit the changes.${NC}"
138141
exit 1
139142
fi
140143

tool/update_baselines.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
# Copyright 2026 The Chromium Authors. All rights reserved.
4+
# Use of this source code is governed by a BSD-style license that can be
5+
# found in the LICENSE file.
6+
7+
if [ ! -f "build.gradle.kts" ]; then
8+
echo "Error: This script must be run from the repository root directory."
9+
exit 1
10+
fi
11+
12+
RED='\033[0;31m'
13+
GREEN='\033[0;32m'
14+
YELLOW='\033[1;33m'
15+
BOLD='\033[1m'
16+
NC='\033[0m' # None (Reset)
17+
18+
echo -e "${BOLD}Running plugin verification...${NC}"
19+
20+
rm -rf build/reports/pluginVerifier
21+
22+
VERSIONS=$(ls tool/baseline)
23+
24+
if [ -z "$VERSIONS" ]; then
25+
echo -e "${YELLOW}Warning: No baseline directories found in tool/baseline.${NC}"
26+
exit 0
27+
fi
28+
29+
echo -e "${BOLD}Found versions to update: $VERSIONS${NC}"
30+
31+
for version in $VERSIONS; do
32+
echo -e "${BOLD}Verifying version $version...${NC}"
33+
./gradlew verifyPlugin -PsingleIdeVersion=$version --no-configuration-cache --no-daemon || true
34+
35+
echo -e "${BOLD}Processing baseline for $version...${NC}"
36+
BASELINE="tool/baseline/$version/verifier-baseline.txt"
37+
REPORT=$(find build/reports/pluginVerifier -path "*-$version.*/report.md" | head -n 1)
38+
39+
if [ -f "$REPORT" ]; then
40+
echo "Extracting issues from $REPORT"
41+
mkdir -p "$(dirname "$BASELINE")"
42+
grep "^*" "$REPORT" | sort > "$BASELINE"
43+
echo -e "${GREEN}Updated baseline at $BASELINE${NC}"
44+
else
45+
echo -e "${YELLOW}Warning: Report does not exist for version $version. Skipping.${NC}"
46+
fi
47+
done
48+
49+
echo -e "${BOLD}Done updating baselines.${NC}"

0 commit comments

Comments
 (0)