@@ -62,45 +62,29 @@ def call_url_with_retry(url: str, max_retries: int = 5, delay: int = 1) -> reque
62
62
63
63
steps = []
64
64
response = call_url_with_retry (RELEASES_URL )
65
- < << << << HEAD
66
- versions_json = response . json ( )
65
+ yaml = YAML ( typ = 'safe' )
66
+ versions_yaml : typing . final = yaml . load ( response . text )
67
67
68
68
# there are situations to manually run CIs with PR change,
69
69
# set MANUAL_TARGET_BRANCH with upstream target branch and run
70
70
manually_set_target_branch : typing .final = os .getenv ("MANUAL_TARGET_BRANCH" )
71
71
target_branch : typing .final = manually_set_target_branch if manually_set_target_branch else os .getenv ("TARGET_BRANCH" )
72
72
print (f"Running with target_branch: { target_branch } " )
73
73
if target_branch == '8.x' :
74
- full_stack_version : typing .final = versions_json ["snapshots" ]["8.future" ]
74
+ full_stack_version : typing .final = versions_yaml ["snapshots" ]["8.future" ]
75
75
steps += generate_unit_and_integration_test_steps (full_stack_version , "true" )
76
76
elif target_branch == 'main' :
77
- full_stack_version : typing .final = versions_json ["snapshots" ][target_branch ]
77
+ full_stack_version : typing .final = versions_yaml ["snapshots" ][target_branch ]
78
78
steps += generate_unit_and_integration_test_steps (full_stack_version , "true" )
79
79
else :
80
80
# generate steps for the version if released
81
- releases = versions_json ["releases" ]
81
+ releases = versions_yaml ["releases" ]
82
82
for release_version in releases :
83
83
if releases [release_version ].startswith (target_branch ):
84
84
steps += generate_unit_and_integration_test_steps (releases [release_version ], "false" )
85
85
break
86
- == == == =
87
- yaml = YAML (typ = 'safe' )
88
- versions_yaml : typing .final = yaml .load (response .text )
89
-
90
- # Use BUILDKITE_SOURCE to figure out PR merge or schedule.
91
- # If PR merge, no need to run builds on all branches, target branch will be good
92
- # - webhook when PR gets merged
93
- # - schedule when daily schedule starts
94
- # - ui when manually kicking job from BK UI
95
- # - manual kick off will be on PR or entire main branch, can be decided with BUILDKITE_BRANCH
96
- bk_source = os .getenv ("BUILDKITE_SOURCE" )
97
- bk_branch = os .getenv ("BUILDKITE_BRANCH" )
98
- steps = generate_steps_for_scheduler (versions_yaml ) if (bk_source == "schedule" or bk_branch == "main" ) \
99
- else generate_steps_for_main_branch (versions_yaml )
100
- >> >> >> > febb207 (Update buildkite script to look for new logstash releases location (#358))
101
-
102
86
# steps for snapshot version
103
- snapshots = versions_json ["snapshots" ]
87
+ snapshots = versions_yaml ["snapshots" ]
104
88
for snapshot_version in snapshots :
105
89
if snapshots [snapshot_version ].startswith (target_branch ):
106
90
steps += generate_unit_and_integration_test_steps (snapshots [snapshot_version ], "false" )
0 commit comments