Skip to content

Commit 9aa21cc

Browse files
clayburnmumrah
authored andcommitted
KAFKA-18454 Publish build scans to develocity.apache.org (#18539)
This patch includes some maintenance updates for Develocity. * Publish build scans to develocity.apache.org * Update Develocity Gradle plugin to to 3.19 * Use `DEVELOCITY_ACCESS_KEY` to authenticate to `develocity.apache.org` Reviewers: Chia-Ping Tsai <[email protected]>, David Arthur <[email protected]>
1 parent 8d5bd25 commit 9aa21cc

File tree

5 files changed

+23
-26
lines changed

5 files changed

+23
-26
lines changed

.github/scripts/develocity_reports.py

+16-19
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def get_build_info(self, build_ids: List[str], project: str, test_type: str, que
314314

315315
# Remove already found builds from the search list
316316
build_ids = [bid for bid in build_ids if bid not in builds]
317-
317+
318318
if not build_ids:
319319
logger.info("All builds found in cache")
320320
return builds
@@ -733,7 +733,7 @@ def print_summary(problematic_tests: Dict[str, Dict], flaky_regressions: Dict[st
733733

734734
# Combine and sort all test cases by failure rate
735735
all_problem_cases = []
736-
736+
737737
# Process problematic quarantined tests
738738
if len(problematic_tests) > 0:
739739
print(f"Found {len(problematic_tests)} tests that have been quarantined for a while and are still flaky.")
@@ -742,15 +742,15 @@ def print_summary(problematic_tests: Dict[str, Dict], flaky_regressions: Dict[st
742742
total_runs = test_case.outcome_distribution.total
743743
method_name = test_case.name.split('.')[-1]
744744
if total_runs > 0:
745-
failure_rate = (test_case.outcome_distribution.failed +
745+
failure_rate = (test_case.outcome_distribution.failed +
746746
test_case.outcome_distribution.flaky) / total_runs
747747
all_problem_cases.append({
748748
'class': full_class_name,
749749
'method': method_name,
750750
'failure_rate': failure_rate,
751751
'total_runs': total_runs
752752
})
753-
753+
754754
# Process flaky regressions
755755
if len(flaky_regressions) > 0:
756756
print(f"Found {len(flaky_regressions)} tests that have started recently failing.")
@@ -763,8 +763,8 @@ def print_summary(problematic_tests: Dict[str, Dict], flaky_regressions: Dict[st
763763
})
764764

765765
# Sort by failure rate descending
766-
sorted_cases = sorted(all_problem_cases,
767-
key=lambda x: x['failure_rate'],
766+
sorted_cases = sorted(all_problem_cases,
767+
key=lambda x: x['failure_rate'],
768768
reverse=True)
769769

770770
# Group by class
@@ -790,15 +790,12 @@ def main():
790790
token = None
791791
if os.environ.get("DEVELOCITY_ACCESS_TOKEN"):
792792
token = os.environ.get("DEVELOCITY_ACCESS_TOKEN")
793-
elif os.environ.get("GE_ACCESS_TOKEN"):
794-
# Special case for when we run in GHA
795-
token = os.environ.get("GE_ACCESS_TOKEN").removeprefix("ge.apache.org=")
796793
else:
797794
print("No auth token was specified. You must set DEVELOCITY_ACCESS_TOKEN to your personal access token.")
798795
exit(1)
799796

800797
# Configuration
801-
BASE_URL = "https://ge.apache.org"
798+
BASE_URL = "https://develocity.apache.org"
802799
PROJECT = "kafka"
803800
QUARANTINE_THRESHOLD_DAYS = 7
804801
MIN_FAILURE_RATE = 0.1
@@ -862,7 +859,7 @@ def main():
862859
print(f"\nRecent Executions (last {len(details['recent_executions'])} runs):")
863860
for entry in sorted(details['recent_executions'], key=lambda x: x.timestamp)[-5:]:
864861
print(f" {entry.timestamp.strftime('%Y-%m-%d %H:%M')} - {entry.outcome}")
865-
862+
866863
# Print Cleared Tests
867864
print("\n## Cleared Tests (Ready for Unquarantine)")
868865
if not cleared_tests:
@@ -881,19 +878,19 @@ def main():
881878
print(f"\nRecent Executions (last {len(details['recent_executions'])} runs):")
882879
for entry in sorted(details['recent_executions'], key=lambda x: x.timestamp):
883880
print(f" {entry.timestamp.strftime('%Y-%m-%d %H:%M')} - {entry.outcome}")
884-
881+
885882
# Print Defective Tests
886883
print("\n## High-Priority Quarantined Tests")
887884
if not problematic_tests:
888885
print("No high-priority quarantined tests found.")
889886
else:
890887
print("These are tests which have been quarantined for several days and need attention.")
891888
sorted_tests = sorted(
892-
problematic_tests.items(),
889+
problematic_tests.items(),
893890
key=lambda x: (x[1]['failure_rate'], x[1]['days_quarantined']),
894891
reverse=True
895892
)
896-
893+
897894
print(f"\nFound {len(sorted_tests)} high-priority quarantined test classes:")
898895
for full_class_name, details in sorted_tests:
899896
class_result = details['container_result']
@@ -916,21 +913,21 @@ def main():
916913
key=lambda x: (x.outcome_distribution.failed + x.outcome_distribution.flaky) / x.outcome_distribution.total if x.outcome_distribution.total > 0 else 0,
917914
reverse=True
918915
)
919-
916+
920917
for test_method in sorted_methods:
921918
total_runs = test_method.outcome_distribution.total
922919
if total_runs > 0:
923920
failure_rate = (test_method.outcome_distribution.failed + test_method.outcome_distribution.flaky) / total_runs
924-
921+
925922
# Extract the method name from the full test name
926923
method_name = test_method.name.split('.')[-1]
927-
924+
928925
print(f"\n{method_name}")
929926
print(f" Failure Rate: {failure_rate:.2%}")
930927
print(f" Runs: {total_runs:3d} | Failed: {test_method.outcome_distribution.failed:3d} | "
931928
f"Flaky: {test_method.outcome_distribution.flaky:3d} | "
932929
f"Passed: {test_method.outcome_distribution.passed:3d}")
933-
930+
934931
# Show test method timeline
935932
if test_method.timeline:
936933
print(f"\n Recent Executions (last {min(3, len(test_method.timeline))} of {len(test_method.timeline)} runs):")
@@ -939,7 +936,7 @@ def main():
939936
for entry in sorted(test_method.timeline, key=lambda x: x.timestamp)[-3:]:
940937
date_str = entry.timestamp.strftime('%Y-%m-%d %H:%M')
941938
print(f" {date_str:<17} {entry.outcome:<10} {entry.build_id}")
942-
939+
943940
except Exception as e:
944941
logger.exception("Error occurred during report generation")
945942
print(f"Error occurred: {str(e)}")

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
java-version: 23
104104
gradle-cache-read-only: ${{ !inputs.is-trunk }}
105105
gradle-cache-write-only: ${{ inputs.is-trunk }}
106-
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
106+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
107107
- name: Compile and validate
108108
env:
109109
SCAN_ARG: ${{ inputs.is-public-fork && '--no-scan' || '--scan' }}
@@ -168,7 +168,7 @@ jobs:
168168
java-version: ${{ matrix.java }}
169169
gradle-cache-read-only: ${{ !inputs.is-trunk }}
170170
gradle-cache-write-only: ${{ inputs.is-trunk }}
171-
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
171+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
172172

173173
# If the load-catalog job failed, we won't be able to download the artifact. Since we don't want this to fail
174174
# the overall workflow, so we'll continue here without a test catalog.

.github/workflows/ci-complete.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ run-name: Build Scans for ${{ github.event.workflow_run.display_title}}
3030
#
3131
# This "workflow_run" triggered workflow is run in a privileged context and so does have access to
3232
# the repository secrets. Here we can download the build scan files produced by a PR and publish
33-
# them to ge.apache.org.
33+
# them to develocity.apache.org.
3434
#
3535
# If we need to do things like comment on, label, or otherwise modify PRs from public forks. This
3636
# workflow is the place to do it. PR number is ${{ github.event.workflow_run.pull_requests[0].number }}
@@ -59,7 +59,7 @@ jobs:
5959
uses: ./.github/actions/setup-gradle
6060
with:
6161
java-version: ${{ matrix.java }}
62-
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
62+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
6363
- name: Download build scan archive
6464
id: download-build-scan
6565
uses: actions/download-artifact@v4

.github/workflows/deflake.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
with:
5151
java-version: ${{ inputs.java-version }}
5252
gradle-cache-read-only: true
53-
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
53+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
5454
- name: Test
5555
timeout-minutes: 60
5656
id: junit-test

settings.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
// limitations under the License.
1515

1616
plugins {
17-
id 'com.gradle.develocity' version '3.17.6'
17+
id 'com.gradle.develocity' version '3.19'
1818
id 'com.gradle.common-custom-user-data-gradle-plugin' version '2.0.2'
1919
}
2020

2121
def isGithubActions = System.getenv('GITHUB_ACTIONS') != null
2222
def currentJvm = JavaVersion.current()
2323

2424
develocity {
25-
server = "https://ge.apache.org"
25+
server = "https://develocity.apache.org"
2626
projectId = "kafka"
2727
buildScan {
2828
uploadInBackground = !isGithubActions

0 commit comments

Comments
 (0)