From 5bcdd937c46daa3565b723f17c8d06b322a24063 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Mon, 3 Nov 2025 15:51:08 -0700 Subject: [PATCH] ceph-dev-pipeline: Mark several vars as Fields When variables are defined using 'def' at the top level of a Jenkinsfile, they are added to the scope local to the generated pipeline function. When they are defined as Fields, they are instead marked as instance variables of the encompassing class. As a result, they do not increase the size of the function, avoiding the MethodTooLargeException. A tradeoff is that their values reset if a pipeline run is restarted midway, but that's not a feature we are using. Signed-off-by: Zack Cerza --- ceph-dev-pipeline/build/Jenkinsfile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ceph-dev-pipeline/build/Jenkinsfile b/ceph-dev-pipeline/build/Jenkinsfile index 151bdbef..7a11ba36 100644 --- a/ceph-dev-pipeline/build/Jenkinsfile +++ b/ceph-dev-pipeline/build/Jenkinsfile @@ -1,16 +1,18 @@ -ceph_build_repo = "https://github.com/ceph/ceph-build" -ceph_build_branch = "main" -base_node_label = "gigantic" -ubuntu_releases = [ +import groovy.transform.Field + +@Field String ceph_build_repo = "https://github.com/ceph/ceph-build" +@Field String ceph_build_branch = "main" +@Field String base_node_label = "gigantic" +@Field Map ubuntu_releases = [ "noble": "24.04", "jammy": "22.04", "focal": "20.04", ] -debian_releases = [ +@Field Map debian_releases = [ "bookworm": "12", "bullseye": "11", ] -build_matrix = [:] +@Field Map build_matrix = [:] def get_os_info(dist) { def os = [ @@ -38,7 +40,7 @@ def get_os_info(dist) { return os } -ceph_release_spec_template = ''' +@Field String ceph_release_spec_template = ''' Name: ceph-release Version: 1 Release: 0%{?dist} @@ -92,7 +94,7 @@ install -pm 644 %{SOURCE0} \ * Mon Apr 28 2025 Zack Cerza 1-1 ''' -ceph_release_repo_template = ''' +@Field String ceph_release_repo_template = ''' [Ceph] name=Ceph packages for \\$basearch baseurl=${repo_base_url}/\\$basearch -- 2.39.5