3333
3434LANGUAGE_BINDING = ["java" , "python" , "nodejs" , "go" , "c" , "cpp" ]
3535
36- BIN = []
37-
3836INTEGRATIONS = ["object_store" ]
3937
4038
@@ -92,8 +90,6 @@ class Hint:
9290 binding_c : bool = field (default = False , init = False )
9391 # Is binding cpp affected?
9492 binding_cpp : bool = field (default = False , init = False )
95- # Is bin ofs affected?
96- bin_ofs : bool = field (default = False , init = False )
9793 # Is integration object_store affected ?
9894 integration_object_store : bool = field (default = False , init = False )
9995
@@ -109,6 +105,17 @@ def calculate_hint(changed_files: list[str]) -> Hint:
109105 # Remove all files that end with `.md`
110106 changed_files = [f for f in changed_files if not f .endswith (".md" )]
111107
108+ def mark_service_affected (service : str ) -> None :
109+ hint .core = True
110+ for language in LANGUAGE_BINDING :
111+ setattr (hint , f"binding_{ language } " , True )
112+ for integration in INTEGRATIONS :
113+ setattr (hint , f"integration_{ integration } " , True )
114+
115+ hint .services .add (service )
116+ hint .services .add (service .replace ("-" , "_" ))
117+ hint .services .add (service .replace ("_" , "-" ))
118+
112119 for p in changed_files :
113120 # workflow behavior tests affected
114121 if p == ".github/workflows/test_behavior.yml" :
@@ -128,11 +135,6 @@ def calculate_hint(changed_files: list[str]) -> Hint:
128135 setattr (hint , f"binding_{ language } " , True )
129136 hint .all_service = True
130137
131- for bin in BIN :
132- if p == f".github/workflows/test_behavior_bin_{ bin } .yml" :
133- setattr (hint , f"bin_{ bin } " , True )
134- hint .all_service = True
135-
136138 for integration in INTEGRATIONS :
137139 if p == f".github/workflows/test_behavior_integration_{ integration } .yml" :
138140 setattr (hint , f"integration_{ integration } " , True )
@@ -145,7 +147,10 @@ def calculate_hint(changed_files: list[str]) -> Hint:
145147 and not p .startswith ("core/edge/" )
146148 and not p .startswith ("core/fuzz/" )
147149 and not p .startswith ("core/src/services/" )
150+ and not p .startswith ("core/core/src/services/" )
151+ and not p .startswith ("core/services/" )
148152 and not p .startswith ("core/src/docs/" )
153+ and not p .startswith ("core/core/src/docs/" )
149154 ):
150155 hint .core = True
151156 hint .binding_java = True
@@ -154,7 +159,6 @@ def calculate_hint(changed_files: list[str]) -> Hint:
154159 hint .binding_go = True
155160 hint .binding_c = True
156161 hint .binding_cpp = True
157- hint .bin_ofs = True
158162 for integration in INTEGRATIONS :
159163 setattr (hint , f"integration_{ integration } " , True )
160164 hint .all_service = True
@@ -181,12 +185,6 @@ def calculate_hint(changed_files: list[str]) -> Hint:
181185 hint .binding_go = True
182186 hint .all_service = True
183187
184- # bin affected
185- for bin in BIN :
186- if p .startswith (f"bin/{ bin } " ):
187- setattr (hint , f"bin_{ bin } " , True )
188- hint .all_service = True
189-
190188 # integration affected
191189 for integration in INTEGRATIONS :
192190 if p .startswith (f"integrations/{ integration } " ):
@@ -196,38 +194,27 @@ def calculate_hint(changed_files: list[str]) -> Hint:
196194 # core service affected
197195 match = re .search (r"core/src/services/([^/]+)/" , p )
198196 if match :
199- hint .core = True
200- for language in LANGUAGE_BINDING :
201- setattr (hint , f"binding_{ language } " , True )
202- for bin in BIN :
203- setattr (hint , f"bin_{ bin } " , True )
204- for integration in INTEGRATIONS :
205- setattr (hint , f"integration_{ integration } " , True )
206- hint .services .add (match .group (1 ))
197+ mark_service_affected (match .group (1 ))
198+
199+ # service crate affected
200+ match = re .search (r"core/services/([^/]+)/" , p )
201+ if match :
202+ mark_service_affected (match .group (1 ))
203+
204+ # opendal-core internal service affected
205+ match = re .search (r"core/core/src/services/([^/]+)/" , p )
206+ if match :
207+ mark_service_affected (match .group (1 ))
207208
208209 # core test affected
209210 match = re .search (r".github/services/([^/]+)/" , p )
210211 if match :
211- hint .core = True
212- for language in LANGUAGE_BINDING :
213- setattr (hint , f"binding_{ language } " , True )
214- for bin in BIN :
215- setattr (hint , f"bin_{ bin } " , True )
216- for integration in INTEGRATIONS :
217- setattr (hint , f"integration_{ integration } " , True )
218- hint .services .add (match .group (1 ))
212+ mark_service_affected (match .group (1 ))
219213
220214 # fixture affected
221215 match = re .search (r"fixtures/([^/]+)/" , p )
222216 if match :
223- hint .core = True
224- for language in LANGUAGE_BINDING :
225- setattr (hint , f"binding_{ language } " , True )
226- for bin in BIN :
227- setattr (hint , f"bin_{ bin } " , True )
228- for integration in INTEGRATIONS :
229- setattr (hint , f"integration_{ integration } " , True )
230- hint .services .add (match .group (1 ))
217+ mark_service_affected (match .group (1 ))
231218
232219 return hint
233220
@@ -300,29 +287,6 @@ def generate_language_binding_cases(
300287 return cases
301288
302289
303- def generate_bin_cases (
304- cases : list [dict [str , str ]], hint : Hint , bin : str
305- ) -> list [dict [str , str ]]:
306- # Return empty if this bin is False
307- if not getattr (hint , f"bin_{ bin } " ):
308- return []
309-
310- cases = unique_cases (cases )
311-
312- if bin == "ofs" :
313- supported_services = ["fs" , "s3" ]
314- cases = [v for v in cases if v ["service" ] in supported_services ]
315-
316- # Return all services if all_service is True
317- if hint .all_service :
318- return cases
319-
320- # Filter all cases that not shown up in changed files
321- cases = [v for v in cases if v ["service" ] in hint .services ]
322-
323- return cases
324-
325-
326290def generate_integration_cases (
327291 cases : list [dict [str , str ]], hint : Hint , integration : str
328292) -> list [dict [str , str ]]:
@@ -401,14 +365,6 @@ def plan(changed_files: list[str]) -> dict[str, Any]:
401365 }
402366 )
403367
404- for bin in BIN :
405- jobs [f"bin_{ bin } " ] = []
406- jobs ["components" ][f"bin_{ bin } " ] = False
407- bin_cases = generate_bin_cases (cases , hint , bin )
408- if len (bin_cases ) > 0 :
409- jobs ["components" ][f"bin_{ bin } " ] = True
410- jobs [f"bin_{ bin } " ].append ({"os" : "ubuntu-latest" , "cases" : bin_cases })
411-
412368 for integration in INTEGRATIONS :
413369 jobs [f"integration_{ integration } " ] = []
414370 jobs ["components" ][f"integration_{ integration } " ] = False
0 commit comments