diff --git a/libcodechecker/analyze/store_handler.py b/libcodechecker/analyze/store_handler.py index a2e54746f3..b8889512af 100644 --- a/libcodechecker/analyze/store_handler.py +++ b/libcodechecker/analyze/store_handler.py @@ -27,7 +27,6 @@ def metadata_info(metadata_file): check_commands = [] check_durations = [] - skip_handlers = [] with open(metadata_file, 'r') as metadata: metadata_dict = json.load(metadata) @@ -38,19 +37,8 @@ def metadata_info(metadata_file): check_durations.append( float(metadata_dict['timestamps']['end'] - metadata_dict['timestamps']['begin'])) - if 'skip_data' in metadata_dict: - # Save previously stored skip data for sending to the - # database, to ensure skipped headers are actually - # skipped --- 'analyze' can't do this. - handle, path = tempfile.mkstemp() - with os.fdopen(handle, 'w') as tmpf: - tmpf.write('\n'.join(metadata_dict['skip_data'])) - skip_handlers.append( - skiplist_handler.SkipListHandler(path)) - os.remove(path) - - return check_commands, check_durations, skip_handlers + return check_commands, check_durations def collect_paths_events(report, file_ids, files): @@ -401,28 +389,6 @@ def addReport(storage_session, str(ex)) -def addSkipPath(storage_session, run_id, paths): - """ - """ - try: - session = storage_session.get_transaction(run_id) - - count = session.query(SkipPath) \ - .filter(SkipPath.run_id == run_id) \ - .delete() - LOG.debug('SkipPath: ' + str(count) + ' removed item.') - - skipPathList = [] - for path, comment in paths.items(): - skipPath = SkipPath(run_id, path, comment) - skipPathList.append(skipPath) - session.bulk_save_objects(skipPathList) - return True - except Exception as ex: - LOG.error(str(ex)) - return False - - def addFileContent(session, filepath, content, encoding): """ Add the necessary file contents. If the file is already stored in the diff --git a/libcodechecker/libhandlers/analyze.py b/libcodechecker/libhandlers/analyze.py index bc76bb4171..9143e9e805 100644 --- a/libcodechecker/libhandlers/analyze.py +++ b/libcodechecker/libhandlers/analyze.py @@ -386,13 +386,6 @@ def main(args): if 'name' in args: metadata['name'] = args.name - if 'skipfile' in args: - # Skip information needs to be saved because reports in a header - # can only be skipped by the report-server used in 'store' later - # on if this information is persisted. - with open(args.skipfile, 'r') as skipfile: - metadata['skip_data'] = [l.strip() for l in skipfile.readlines()] - # Update metadata dictionary with old values. metadata_file = os.path.join(args.output_path, 'metadata.json') if os.path.exists(metadata_file): diff --git a/libcodechecker/server/client_db_access_handler.py b/libcodechecker/server/client_db_access_handler.py index ff188064c7..9ce062195b 100644 --- a/libcodechecker/server/client_db_access_handler.py +++ b/libcodechecker/server/client_db_access_handler.py @@ -1096,32 +1096,6 @@ def getCheckerConfigs(self, run_id): finally: session.close() - @timeit - def getSkipPaths(self, run_id): - self.__require_access() - try: - session = self.__Session() - - suppressed_paths = session.query(SkipPath) \ - .filter(SkipPath.run_id == run_id) \ - .all() - - results = [] - for sp in suppressed_paths: - encoded_path = sp.path - encoded_comment = sp.comment - results.append(SkipPathData(encoded_path, encoded_comment)) - - return results - - except sqlalchemy.exc.SQLAlchemyError as alchemy_ex: - msg = str(alchemy_ex) - LOG.error(msg) - raise shared.ttypes.RequestFailed(shared.ttypes.ErrorCode.DATABASE, - msg) - finally: - session.close() - @timeit def getSourceFileData(self, fileId, fileContent, encoding): """ @@ -1596,7 +1570,7 @@ def massStoreRun(self, name, version, b64zip, force): with open(content_hash_file) as chash_file: filename2hash = json.load(chash_file) - check_commands, check_durations, skip_handlers = \ + check_commands, check_durations = \ store_handler.metadata_info(metadata_file) if len(check_commands) == 0: @@ -1653,8 +1627,6 @@ def massStoreRun(self, name, version, b64zip, force): with codecs.open(source_file_name, 'r', 'UTF-8', 'replace') as source_file: file_content = source_file.read() - # TODO: we may not use the file content in the end - # depending on skippaths. file_content = codecs.encode(file_content, 'utf-8') file_path_to_id[file_name] = \ @@ -1672,13 +1644,6 @@ def massStoreRun(self, name, version, b64zip, force): session = self.__storage_session.get_transaction(run_id) - # Handle skip list. - for skip_handler in skip_handlers: - if not store_handler.addSkipPath(self.__storage_session, - run_id, - skip_handler.get_skiplist()): - LOG.debug("Adding skip path failed!") - # Processing PList files. _, _, report_files = next(os.walk(report_dir), ([], [], [])) for f in report_files: diff --git a/libcodechecker/server/run_db_model.py b/libcodechecker/server/run_db_model.py index 087f8c001b..551b4e74a9 100644 --- a/libcodechecker/server/run_db_model.py +++ b/libcodechecker/server/run_db_model.py @@ -221,24 +221,6 @@ def __init__(self, run_id, bug_id, file_id, checker_message, checker_id, self.column = column -class SkipPath(Base): - __tablename__ = 'skip_paths' - - id = Column(Integer, autoincrement=True, primary_key=True) - path = Column(String) - run_id = Column(Integer, - ForeignKey('runs.id', deferrable=True, - initially="DEFERRED", - ondelete='CASCADE'), - nullable=False) - comment = Column(Binary) - - def __init__(self, run_id, path, comment): - self.path = path - self.run_id = run_id - self.comment = comment - - class Comment(Base): __tablename__ = 'comments'