Skip to content

Fix empty query when using --excludeExternalTargets with --useCquery #280

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GuillaumeVW
Copy link

Fixes an issue where using --excludeExternalTargets with --useCquery would cause bazel-diff to pass an empty query string to bazel query, resulting in a failure with exit code 2.
The problem was that when external targets are excluded, the code was still trying to execute a query on an empty list, which produced an empty string. Now we check if there are actually any repo targets to query before executing the query, otherwise we just skip it and use an empty list.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@GuillaumeVW GuillaumeVW marked this pull request as ready for review July 17, 2025 20:53
@GuillaumeVW GuillaumeVW force-pushed the fix/empty-query-excludeExternalTargets-cquery branch 2 times, most recently from e311a37 to 6499dc8 Compare July 18, 2025 15:33
@GuillaumeVW GuillaumeVW force-pushed the fix/empty-query-excludeExternalTargets-cquery branch from 6499dc8 to fda7137 Compare July 18, 2025 15:34
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.

2 participants