about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-06-21 13:07:44 +0200
committerRalf Jung <post@ralfj.de>2019-06-21 13:26:46 +0200
commita8b2b1c7b38fadfeb5a2ff64193c4a735df4a5d0 (patch)
treecec2a362d77a986963029f2337e9f1a8e36ce0c4
parentdbec74ffa7982de8e066a93969ce70a891d7908b (diff)
downloadrust-a8b2b1c7b38fadfeb5a2ff64193c4a735df4a5d0.tar.gz
rust-a8b2b1c7b38fadfeb5a2ff64193c4a735df4a5d0.zip
publish_toolstate: don't use 'new' from inside the loop
-rwxr-xr-xsrc/tools/publish_toolstate.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tools/publish_toolstate.py b/src/tools/publish_toolstate.py
index 9e7c18b7f56..97df3cfda00 100755
--- a/src/tools/publish_toolstate.py
+++ b/src/tools/publish_toolstate.py
@@ -135,13 +135,13 @@ def update_latest(
         for status in latest:
             tool = status['tool']
             changed = False
-            create_issue = False
+            create_issue_for_status = None # set to the status that caused the issue
 
             for os, s in current_status.items():
                 old = status[os]
                 new = s.get(tool, old)
                 status[os] = new
-                if new > old:
+                if new > old: # comparing the strings, but they are ordered appropriately!
                     # things got fixed or at least the status quo improved
                     changed = True
                     message += '🎉 {} on {}: {} → {} (cc {}, @rust-lang/infra).\n' \
@@ -156,12 +156,12 @@ def update_latest(
                     # Most tools only create issues for build failures.
                     # Other failures can be spurious.
                     if new == 'build-fail' or (tool == 'miri' and new == 'test-fail'):
-                        create_issue = True
+                        create_issue_for_status = new
 
-            if create_issue:
+            if create_issue_for_status is not None:
                 try:
                     issue(
-                        tool, new, MAINTAINERS.get(tool, ''),
+                        tool, create_issue_for_status, MAINTAINERS.get(tool, ''),
                         relevant_pr_number, relevant_pr_user, pr_reviewer,
                     )
                 except IOError as e: