Skip to content

Commit 4f0f820

Browse files
authored
Update Perf Gradle compatibility test to fix failure, and add a way to create an issue. (#8029)
1 parent d40d90b commit 4f0f820

2 files changed

Lines changed: 29 additions & 3 deletions

File tree

.github/workflows/perf-gradle-compatibility-tests.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,30 @@ jobs:
3030
./gradlew \
3131
:firebase-perf-gradle:functionalTest --tests \
3232
"com.google.firebase.perf.plugin.transform.InstrumentationApiCompatTest.gradleBuildRunsInstrumentationForAllVariants_latestGradleAndAgp"
33+
create-issue-on-failure:
34+
needs: performance-plugin
35+
if: failure()
36+
runs-on: ubuntu-latest
37+
permissions:
38+
issues: write
39+
steps:
40+
- name: Create issue
41+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
42+
with:
43+
script: |
44+
const issueTitle = 'Perf Gradle Compatibility test failed';
45+
46+
const { data: searchResults } = await github.rest.search.issuesAndPullRequests({
47+
q: `is:issue is:open repo:${context.repo.owner}/${context.repo.repo} in:title "${issueTitle}"`,
48+
});
49+
50+
if (searchResults.total_count === 0) {
51+
await github.rest.issues.create({
52+
owner: context.repo.owner,
53+
repo: context.repo.repo,
54+
title: issueTitle,
55+
body: `https://github.com/firebase/firebase-android-sdk/actions/workflows/perf-gradle-compatibility-tests.yml`
56+
assignees: ['tejasd'],
57+
labels: ['bug', 'automated']
58+
})
59+
}

firebase-perf-gradle/src/functionalTest/java/com/google/firebase/perf/plugin/transform/InstrumentationApiCompatTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public class InstrumentationApiCompatTest {
5252
private static final String GRADLE_RELEASES_URL =
5353
"https://api.github.com/repos/gradle/gradle/releases/latest";
5454
// Latest verified versions. Update these as new versions are released and verified.
55-
private static final String VERIFIED_AGP_VERSION = "9.2.0-alpha05";
56-
private static final String VERIFIED_GRADLE_VERSION = "9.5.0-milestone-5";
55+
private static final String VERIFIED_AGP_VERSION = "9.2.0-alpha08";
56+
private static final String VERIFIED_GRADLE_VERSION = "9.4.1";
5757
private final OkHttpClient client = new OkHttpClient();
5858

5959
@RegisterExtension public GradleBuildProject gradleBuildProject = new GradleBuildProject();
@@ -130,7 +130,6 @@ private String latestGradleVersion() {
130130
JsonObject releaseObject = JsonParser.parseString(response.body().string()).getAsJsonObject();
131131
return releaseObject.get("name").getAsString();
132132
} catch (Exception e) {
133-
// Catch all exceptions (IO, XML parsing, etc.) and wrap them
134133
throw new RuntimeException(
135134
"Failed to fetch or parse latest Gradle version: " + e.getMessage(), e);
136135
}

0 commit comments

Comments
 (0)