Ignore absolute paths after stripping work dir

After stripping the work dir there should not be any absolute path
left that can be related to the repo. Thus filter them so they don't
produce mapping warnings in zuul.

Change-Id: Iadeac9b1faea63aa6009e2cfbc215853695abbe6
This commit is contained in:
Tobias Henkel 2020-04-02 16:56:54 +02:00
parent 7df5e55ebc
commit 92bb7ff535
No known key found for this signature in database
GPG Key ID: 03750DEC158E5FA2

@ -111,6 +111,11 @@ def extract_file_comments(tox_output, tox_envlist):
if file_path.startswith(cwd):
file_path = file_path[len(cwd):]
# After stripping we don't allow absolute paths anymore since they
# cannot be linked to a file in the repo in zuul.
if file_path.startswith('/'):
continue
ret.setdefault(file_path, [])
if tox_envlist:
message = "{envlist}: {message}".format(