From d94014cdbd7b9126b82425ea9737b82ce61beef0 Mon Sep 17 00:00:00 2001 From: Charlie Collett Date: Fri, 30 Aug 2024 14:11:21 -0700 Subject: [PATCH] Increase capturing --- summary.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/summary.py b/summary.py index 3140754..3f68e00 100644 --- a/summary.py +++ b/summary.py @@ -37,6 +37,8 @@ def get_job_logs(job_id): # Function to analyze logs for environment and issue information +import re + def analyze_logs(log_content): os_id = None version_id = None @@ -45,12 +47,12 @@ def analyze_logs(log_content): python_version = None issues_found = False - # Simplified patterns to match the log format - id_pattern = re.compile(r'.*ID: (.+)') - version_id_pattern = re.compile(r'.*VERSION_ID: (.+)') - version_codename_pattern = re.compile(r'.*VERSION_CODENAME: (.+)') - full_version_pattern = re.compile(r'.*FULL VERSION: (.+)') - python_version_pattern = re.compile(r'.*LANGUAGE VERSION: (.+)') + # Updated patterns to match the log format + id_pattern = re.compile(r'.*ENV_OUTPUT_ID: (.+)') + version_id_pattern = re.compile(r'.*ENV_OUTPUT_VERSION_ID: (.+)') + version_codename_pattern = re.compile(r'.*ENV_OUTPUT_VERSION_CODENAME: (.+)') + full_version_pattern = re.compile(r'.*ENV_OUTPUT_FULL_VERSION: (.+)') + python_version_pattern = re.compile(r'.*ENV_OUTPUT_LANGUAGE_VERSION: (.+)') # Patterns to capture possible errors error_patterns = [ @@ -61,7 +63,7 @@ def analyze_logs(log_content): re.compile(r'.*critical.*', re.IGNORECASE), ] - # Flag to only start capturing after seeing the environment start marker + # Flag to start capturing after seeing the environment start marker in_environment_output = False log_lines = log_content.splitlines()