Skip to content

Commit

Permalink
Merge pull request #265 from sustainable-computing-io/addDateValidation
Browse files Browse the repository at this point in the history
[CI] add date validation before create new github issue to avoid dupl…
  • Loading branch information
rootfs authored Sep 26, 2024
2 parents dc76fe5 + 8b44f32 commit 51171e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion util/stress_regression_check.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import os
import requests
import datetime
import re
from openai import OpenAI
from github import Github

github_token = os.getenv("GITHUB_TOKEN")
repo_name = "sustainable-computing-io/kepler-metal-ci"

today = datetime.datetime.now().strftime('%Y-%m-%d')
lastIssueDate = "2024-07-31"

# URLs of the reports
url = "https://sustainable-computing-io.github.io/kepler-metal-ci/kepler-stress-test-metrics.html"
Expand Down Expand Up @@ -65,7 +67,13 @@ def main():
print("Analyzing the result...")
regression_detected = False
if "Significant Regression Detected".lower() in result.lower():
regression_detected = True
match = re.search(r"\d{4}-\d{2}-\d{2}", result.lower())
if match:
print("find date:", match.group())
if lastIssueDate == match.group():
print("lastIssueDate is match date in report skip.")
else:
regression_detected = True

# Create GitHub issue if regression detected
if regression_detected:
Expand Down

0 comments on commit 51171e0

Please sign in to comment.