From 0c67adc8a4d6cbdb59ca0ec1ac48037639f47005 Mon Sep 17 00:00:00 2001 From: Varsha GS Date: Mon, 17 Jun 2024 08:51:50 +0530 Subject: [PATCH] get net-http from ruby-31 task Signed-off-by: Varsha GS --- .tekton/.currency/docs/report.md | 8 ++-- .tekton/.currency/scripts/generate_report.py | 40 ++++++++------------ .tekton/run_unittests.sh | 3 -- 3 files changed, 20 insertions(+), 31 deletions(-) diff --git a/.tekton/.currency/docs/report.md b/.tekton/.currency/docs/report.md index 4fd77d5b..0794c6ca 100644 --- a/.tekton/.currency/docs/report.md +++ b/.tekton/.currency/docs/report.md @@ -3,11 +3,11 @@ | Package name | Support Policy | Beta version | Last Supported Version | Latest version | Up-to-date | Cloud Native | |:---------------|:-----------------|:---------------|:-------------------------|:-----------------|:-------------|:---------------| | Cuba | On demand | No | 4.0.3 | 4.0.3 | Yes | No | -| Rack | 0-day | No | 3.0.11 | 3.0.11 | Yes | No | -| Rails | 30-days | No | 7.1.3.3 | 7.1.3.3 | Yes | No | +| Rack | 0-day | No | 3.1.3 | 3.1.3 | Yes | No | +| Rails | 30-days | No | 7.1.3.4 | 7.1.3.4 | Yes | No | | Rails::API | 30-days | No | 0.4.1 | 0.4.1 | Yes | No | | Rails LTS | On demand | No | 5.2 | 5.2 | Yes | No | -| Roda | 30-days | No | 3.80.0 | 3.80.0 | Yes | No | +| Roda | 30-days | No | 3.81.0 | 3.81.0 | Yes | No | | Sinatra | 30-days | No | 4.0.0 | 4.0.0 | Yes | No | | Excon | 30-days | No | 0.110.0 | 0.110.0 | Yes | Yes | | gRPC | 30-days | No | 1.64.0 | 1.64.0 | Yes | No | @@ -16,4 +16,4 @@ | Dalli | 30-days | No | 3.2.8 | 3.2.8 | Yes | No | | Resque | 30-days | No | 2.6.0 | 2.6.0 | Yes | Yes | | Sidekiq | 30-days | No | 7.2.4 | 7.2.4 | Yes | Yes | -| GraphQL | 30-days | No | 2.3.4 | 2.3.4 | Yes | Yes | \ No newline at end of file +| GraphQL | 30-days | No | 2.3.5 | 2.3.5 | Yes | Yes | \ No newline at end of file diff --git a/.tekton/.currency/scripts/generate_report.py b/.tekton/.currency/scripts/generate_report.py index 19abea83..edc54e74 100644 --- a/.tekton/.currency/scripts/generate_report.py +++ b/.tekton/.currency/scripts/generate_report.py @@ -40,7 +40,7 @@ def get_taskruns(namespace, task_name): def process_taskrun_logs( - taskruns, core_v1_client, namespace, library, tekton_ci_output, check_net_http=False + taskruns, core_v1_client, namespace, library, tekton_ci_output ): for tr in taskruns: pod_name = tr["status"]["podName"] @@ -50,16 +50,13 @@ def process_taskrun_logs( ) if "Installing" not in logs: print( - f"Unable to retrieve container logs from the successful taskrun pod {pod_name} of taskrun {taskrun_name}." + f"Unable to retrieve logs from taskrun pod {pod_name} of taskrun {taskrun_name} for gem {library}." ) continue print( - f"Retrieving container logs from the successful taskrun pod {pod_name} of taskrun {taskrun_name}.." + f"Retrieving logs from taskrun pod {pod_name} of taskrun {taskrun_name} for gem {library}.." ) - if check_net_http: - version_match = re.search("(net-http) \([\w:]* ([\d.]+)\)", logs) - tekton_ci_output += f"{version_match[1]} {version_match[2]}\n" match = re.search(f"Installing ({library} [^\s]+)", logs) tekton_ci_output += f"{match[1]}\n" @@ -74,28 +71,28 @@ def get_tekton_ci_output(): namespace = "default" core_v1_client = client.CoreV1Api() + ruby_33_suffix = "unittest-default-ruby-33-" + ruby_31_suffix = "unittest-default-ruby-31-" + default_libraries_dict = { - "cuba": 1, - "excon": 4, - "graphql": 6, - "grpc": 7, - "rack": 10, - "rest-client": 11, - "roda": 13, - "sinatra": 16, + "cuba": f"{ruby_33_suffix}1", + "excon": f"{ruby_33_suffix}4", + "graphql": f"{ruby_33_suffix}6", + "grpc": f"{ruby_33_suffix}7", + "rack": f"{ruby_33_suffix}10", + "rest-client": f"{ruby_33_suffix}11", + "roda": f"{ruby_33_suffix}13", + "sinatra": f"{ruby_33_suffix}16", + "net-http": f"{ruby_31_suffix}8", } tekton_ci_output = "" task_name = "ruby-tracer-unittest-default-libraries-task" default_taskruns = get_taskruns(namespace, task_name) - is_first_iteration=True - for library, pattern in default_libraries_dict.items(): taskrun_filter = ( - lambda tr: tr["metadata"]["name"].endswith( - f"unittest-default-ruby-33-{pattern}" - ) + lambda tr: tr["metadata"]["name"].endswith(pattern) and tr["status"]["conditions"][0]["type"] == "Succeeded" ) filtered_default_taskruns = filter_taskruns(taskrun_filter, default_taskruns) @@ -106,12 +103,7 @@ def get_tekton_ci_output(): namespace, library, tekton_ci_output, - check_net_http=is_first_iteration ) - - # Set is_first_iteration to False after the first iteration to fetch the net-http version only once - if is_first_iteration: - is_first_iteration = False other_libraries_dict = { "rails": { diff --git a/.tekton/run_unittests.sh b/.tekton/run_unittests.sh index 619a91fd..0fb4c54d 100755 --- a/.tekton/run_unittests.sh +++ b/.tekton/run_unittests.sh @@ -50,9 +50,6 @@ echo "with dependencies in '${BUNDLE_GEMFILE}'" gem update --system > /dev/null echo "Gem version $(gem --version)" -# List the built-in gem version of "net-http" -gem list | grep net-http - # Configure Bundler bundler --version bundle config set path '/tmp/vendor/bundle'