Skip to content

Commit

Permalink
get net-http from ruby-31 task
Browse files Browse the repository at this point in the history
Signed-off-by: Varsha GS <[email protected]>
  • Loading branch information
GSVarsha committed Jun 17, 2024
1 parent b0d6e37 commit 0c67adc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 31 deletions.
8 changes: 4 additions & 4 deletions .tekton/.currency/docs/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |
| GraphQL | 30-days | No | 2.3.5 | 2.3.5 | Yes | Yes |
40 changes: 16 additions & 24 deletions .tekton/.currency/scripts/generate_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"
Expand All @@ -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)
Expand All @@ -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": {
Expand Down
3 changes: 0 additions & 3 deletions .tekton/run_unittests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 0c67adc

Please sign in to comment.