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

Skip reports at store #1566

Merged
merged 1 commit into from
May 11, 2018
Merged

Conversation

gyorb
Copy link
Contributor

@gyorb gyorb commented May 10, 2018

The skip file content was not used at store.
If the same report directory is used without a skip file
and with a skip file the reports which should be skipped are
stored even if a skip file was used for the second analysis.

This change stores the skip file content in the metadata.json so
the store in the server can use this information to skip the
required reports.

Changes in the tests were required to create this use case.

This solution still sends all the reports and files to the
server and it does report skipping there.
It can be improved later where we do more fine grained file detection.
Right now the problematic files are mainly the header files
which can belong to multiple reports (paths) and if the
header file is skipped at the client side of the store
the server will not be able to show the missing file when viewing the report.

#948

@gyorb gyorb added this to the release 6.7 milestone May 10, 2018
@gyorb gyorb force-pushed the dev-skip-at-store branch from 7265f6a to b74d5e4 Compare May 10, 2018 13:38
@@ -92,7 +92,11 @@ def __get_skip_handler(args):
try:
if args.skipfile:
LOG.debug_analyzer("Creating skiplist handler.")
return skiplist_handler.SkipListHandler(args.skipfile)
skip_handler = None
Copy link
Contributor

Choose a reason for hiding this comment

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

It can be written shorter:

with open(args.skipfile) as skip_file:
    return skiplist_handler.SkipListHandler(skip_file.read())

Please also add a documentation for this function.

if line.strip() != '']
self.__skip_file_lines = [line.strip() for line
in skip_file.splitlines()
if line.strip() != '']
Copy link
Contributor

Choose a reason for hiding this comment

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

To check if a string is empty the following syntax is better: if line.strip()

for line in skip_file
if line.strip() != '']
self.__skip_file_lines = [line.strip() for line
in skip_file.splitlines()
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename this variable to skip_file_content and modify the description of the __init__ function too.

store_handler.metadata_info(metadata_file)

skiphandler = skiplist_handler.SkipListHandler("")
Copy link
Contributor

Choose a reason for hiding this comment

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

It is not an elegant way to pass an empty string. Instead of this we can handle the case when no parameter is given for this function.

skip_handler = SkipListHandler(args.skipfile)
with open(skip_file, 'r') as skip_file:
skip_content = skip_file.read()
skip_handler = SkipListHandler(skip_file.read())
Copy link
Contributor

Choose a reason for hiding this comment

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

File read twice unnecessarily.

@gyorb gyorb force-pushed the dev-skip-at-store branch from b74d5e4 to 03965a0 Compare May 10, 2018 16:04
@gyorb gyorb requested review from csordasmarton and bruntib May 10, 2018 16:05
@gyorb gyorb force-pushed the dev-skip-at-store branch from 03965a0 to 29e70e6 Compare May 11, 2018 06:35
The skip file content was not used at store.
If the same report directory is used without a skip file
and with a skip file the reports which should be skipped are
stored even if a skip file was used for the second analysis.

This change stores the skip file content in the metadata.json so
the store in the server can use this information to skip the
required reports.

Changes in the tests were required to create this use case.

This solution still sends all the reports and files to the
server and it does report skipping there.
It can be improved later where we do more fine grained file detection.
Right now the problematic files are mainly the header files
which can belong to multiple reports (paths) and if the
header file is skipped at the client side of the store
the server will not be able to show the missing file when viewing the report.
@gyorb gyorb force-pushed the dev-skip-at-store branch from 29e70e6 to 6fe0fde Compare May 11, 2018 06:36
@csordasmarton csordasmarton merged commit eb7af9f into Ericsson:master May 11, 2018
@gyorb gyorb deleted the dev-skip-at-store branch April 11, 2019 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants