-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fixed #12664 - donate-cpu-server.py: omit outdated results from diff reports #6349
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ | |
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/ | ||
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic | ||
# changes) | ||
SERVER_VERSION = "1.3.48" | ||
SERVER_VERSION = "1.3.49" | ||
|
||
OLD_VERSION = '2.14.0' | ||
|
||
|
@@ -422,7 +422,7 @@ def diffReport(resultsPath: str) -> str: | |
for messageId in data['sums']: | ||
sums = data['sums'][messageId] | ||
if OLD_VERSION not in sums: | ||
continue | ||
break | ||
if messageId not in out: | ||
out[messageId] = [0, 0] | ||
out[messageId][0] += sums[OLD_VERSION] | ||
|
@@ -490,9 +490,12 @@ def diffMessageIdReport(resultPath: str, messageId: str) -> str: | |
if not os.path.isfile(filename): | ||
continue | ||
with open(filename, 'rt') as f: | ||
diff_stats = f.read() | ||
if messageId not in diff_stats: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This always checked the whole string for the occurrence. This might speed up things a bit if there was a lot of findings - unless it is offset by the added JSON loading. |
||
diff_stats = json.loads(f.read()) | ||
if messageId not in diff_stats['sums']: | ||
continue | ||
if OLD_VERSION not in diff_stats['sums'][messageId]: | ||
continue | ||
|
||
url = None | ||
diff = False | ||
for line in open(filename[:-5], 'rt'): | ||
|
@@ -518,11 +521,14 @@ def diffMessageIdTodayReport(resultPath: str, messageId: str) -> str: | |
if not os.path.isfile(filename): | ||
continue | ||
with open(filename, 'rt') as f: | ||
diff_stats = f.read() | ||
if messageId not in diff_stats: | ||
diff_stats = json.loads(f.read()) | ||
if messageId not in diff_stats['sums']: | ||
continue | ||
if OLD_VERSION not in diff_stats['sums'][messageId]: | ||
continue | ||
if today not in diff_stats: | ||
if today not in diff_stats["date"]: | ||
continue | ||
|
||
url = None | ||
diff = False | ||
firstLine = True | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just bail out on the first occurrence of an old version because if one entry is outdated all of them are.