Skip to content

Commit

Permalink
Merge pull request #4203 from bruntib/missing_source_components
Browse files Browse the repository at this point in the history
[cmd] Check for non-existing source components
  • Loading branch information
dkrupp authored May 15, 2024
2 parents f7807ae + 45f31f3 commit d827fc4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions web/client/codechecker_client/cmd_line_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,23 @@ def check_run_names(client, check_names):
return run_info


def check_existing_source_components(
client,
source_components: List[str]
):
missing_source_components = []

for source_component in source_components:
if not client.getSourceComponents([source_component]):
missing_source_components.append(source_component)

if missing_source_components:
LOG.error(
"The following source components don't exist: %s",
', '.join(missing_source_components))
sys.exit(1)


def check_deprecated_arg_usage(args):
if 'detected_at' in args:
LOG.warning('"--detected-at" option has been deprecated. Use '
Expand Down Expand Up @@ -667,6 +684,9 @@ def handle_list_results(args):

client = setup_client(args.product_url)

if 'component' in args:
check_existing_source_components(client, args.component)

run_filter = ttypes.RunFilter(names=args.names)

run_data = get_run_data(client, run_filter)
Expand Down Expand Up @@ -1312,6 +1332,9 @@ def handle_diff_results(args):
args.product_url)
raise sexit

if 'component' in args:
check_existing_source_components(client, args.component)

print_steps = 'print_steps' in args
report_hashes = []
if (basename_local_dirs or basename_baseline_files) and \
Expand Down Expand Up @@ -1410,6 +1433,9 @@ def checker_count(checker_dict, key):

client = setup_client(args.product_url)

if 'component' in args:
check_existing_source_components(client, args.component)

run_ids = None
if 'all_results' not in args:
run_filter = ttypes.RunFilter(names=args.names)
Expand Down

0 comments on commit d827fc4

Please sign in to comment.