@@ -31,7 +31,7 @@ def get_upstream_version(dependency, last_supported_version):
3131 last_supported_version_release_date = "Not found"
3232 if dependency in SPEC_MAP :
3333 # webscrape info from official website
34- version_pattern = "(\d+\.\d+\.?\d*)"
34+ version_pattern = r "(\d+\.\d+\.?\d*)"
3535 latest_version_release_date = ""
3636
3737 url = SPEC_MAP [dependency ]
@@ -181,17 +181,17 @@ def process_taskrun_logs(
181181 f"Retrieving container logs from the successful taskrun pod { pod_name } of taskrun { taskrun_name } .."
182182 )
183183 if task_name == "python-tracer-unittest-gevent-starlette-task" :
184- match = re .search ("Successfully installed .* (starlette-[^\s]+)" , logs )
185- tekton_ci_output += f"{ match [1 ]} \n "
186- elif task_name == "python-tracer-unittest-googlecloud-task" :
187- match = re .search (
188- "Successfully installed .* (google-cloud-storage-[^\s]+)" , logs
189- )
184+ match = re .search (r"Successfully installed .*(gevent-[^\s]+) .* (starlette-[^\s]+)" , logs )
185+ tekton_ci_output += f"{ match [1 ]} \n { match [2 ]} \n "
186+ elif task_name == "python-tracer-unittest-kafka-task" :
187+ match = re .search (r"Successfully installed .*(confluent-kafka-[^\s]+) .* (kafka-python-ng-[^\s]+)" , logs )
188+ tekton_ci_output += f"{ match [1 ]} \n { match [2 ]} \n "
189+ elif task_name == "python-tracer-unittest-cassandra-task" :
190+ match = re .search (r"Successfully installed .*(cassandra-driver-[^\s]+)" , logs )
190191 tekton_ci_output += f"{ match [1 ]} \n "
191192 elif task_name == "python-tracer-unittest-default-task" :
192- for line in logs .splitlines ():
193- if "Successfully installed" in line :
194- tekton_ci_output += line
193+ lines = re .findall (r"^Successfully installed .*" , logs , re .M )
194+ tekton_ci_output += "\n " .join (lines )
195195 break
196196 else :
197197 print (
@@ -202,36 +202,39 @@ def process_taskrun_logs(
202202
203203def get_tekton_ci_output ():
204204 """Get the latest successful scheduled tekton pipeline output"""
205+ # # To run locally
205206 # config.load_kube_config()
207+
208+ ## To run inside the tekton kubernetes cluster
206209 config .load_incluster_config ()
207210
208211 namespace = "default"
209212 core_v1_client = client .CoreV1Api ()
210213
211- task_name = "python-tracer-unittest-gevent-starlette-task"
212214 taskrun_filter = lambda tr : tr ["status" ]["conditions" ][0 ]["type" ] == "Succeeded" # noqa: E731
215+
216+ task_name = "python-tracer-unittest-gevent-starlette-task"
213217 starlette_taskruns = get_taskruns (namespace , task_name , taskrun_filter )
214218
215219 tekton_ci_output = process_taskrun_logs (
216220 starlette_taskruns , core_v1_client , namespace , task_name , ""
217221 )
218222
219- task_name = "python-tracer-unittest-googlecloud-task"
220- taskrun_filter = ( # noqa: E731
221- lambda tr : tr ["metadata" ]["name" ].endswith ("unittest-googlecloud-0" )
222- and tr ["status" ]["conditions" ][0 ]["type" ] == "Succeeded"
223+ task_name = "python-tracer-unittest-kafka-task"
224+ kafka_taskruns = get_taskruns (namespace , task_name , taskrun_filter )
225+
226+ tekton_ci_output = process_taskrun_logs (
227+ kafka_taskruns , core_v1_client , namespace , task_name , tekton_ci_output
223228 )
224- googlecloud_taskruns = get_taskruns (namespace , task_name , taskrun_filter )
229+
230+ task_name = "python-tracer-unittest-cassandra-task"
231+ cassandra_taskruns = get_taskruns (namespace , task_name , taskrun_filter )
225232
226233 tekton_ci_output = process_taskrun_logs (
227- googlecloud_taskruns , core_v1_client , namespace , task_name , tekton_ci_output
234+ cassandra_taskruns , core_v1_client , namespace , task_name , tekton_ci_output
228235 )
229236
230237 task_name = "python-tracer-unittest-default-task"
231- taskrun_filter = ( # noqa: E731
232- lambda tr : tr ["metadata" ]["name" ].endswith ("unittest-default-3" )
233- and tr ["status" ]["conditions" ][0 ]["type" ] == "Succeeded"
234- )
235238 default_taskruns = get_taskruns (namespace , task_name , taskrun_filter )
236239
237240 tekton_ci_output = process_taskrun_logs (
0 commit comments