Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] add date validation before create new github issue to avoid dupl… #265

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the issue date remain constant? Wouldn't this change

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a long term goal, I am not sure if we can ref https://github.com/sustainable-computing-io/kepler-metal-ci/pull/265/files#diff-0028b6356c8200f2409c83d6d3a1a35bd5025c9aed8872595981bf0db3d7abcaR8 to make it as an environment value?
for short term, just hard code to reduce duplicate issue open as #267


# 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
Loading