Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2280)

Unified Diff: dashboard/dashboard/start_try_job.py

Issue 2481773002: [Dashboard] Fix regex for complex story names (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dashboard/dashboard/start_try_job_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/start_try_job.py
diff --git a/dashboard/dashboard/start_try_job.py b/dashboard/dashboard/start_try_job.py
index 92fce20a6be9d80514c1eaac68ad1c3ab2485010..e70cad5c392502b1acc4d9a4ba2d0d1a5eadc9bd 100644
--- a/dashboard/dashboard/start_try_job.py
+++ b/dashboard/dashboard/start_try_job.py
@@ -265,9 +265,11 @@ def _PrefillInfo(test_path):
story_name = story_name[len('after_'):]
# During import, some chars in story names got replaced by "_" so they
# could be safely included in the test_path. At this point we don't know
- # what the original characters were, so we pass a regex where each
- # underscore is replaced back with a match-any-character dot.
- info['story_filter'] = re.sub(r'\\_', '.', re.escape(story_name))
+ # what the original characters were. Additionally, some special characters
+ # and argument quoting are not interpreted correctly, e.g. by bisect
+ # scripts (crbug.com/662472). We thus keep only a small set of "safe chars"
+ # and replace all others with match-any-character regex dots.
+ info['story_filter'] = re.sub(r'[^a-zA-Z0-9]', '.', story_name)
else:
info['story_filter'] = ''
« no previous file with comments | « no previous file | dashboard/dashboard/start_try_job_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698