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

[cmd] Check for non-existing source components #4203

Merged
merged 1 commit into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading