feedback
feedback copied to clipboard
CLI searches for other files to upload, even if the -f param is supplied
What product do you want to improve? CLI
Is your feature request related to a problem? Please describe.
➜ laravel-stripe-app-gh git:(feature/cli-example) ✗ ./codecov --verbose do-upload -t db0d3d08-279c-4659-9ad3-4225a24bc46b -C 6c093328b2730bc10c5b10f45a3e6559f2a2dee2 -f dir\ with\ spacee/cover.xml
info - 2024-01-26 12:16:58,794 -- ci service found: local
debug - 2024-01-26 12:16:58,795 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
debug - 2024-01-26 12:16:58,795 -- Loading config from codecov.yml
debug - 2024-01-26 12:16:58,994 -- Starting upload processing --- {"commit_sha": "6c093328b2730bc10c5b10f45a3e6559f2a2dee2", "report_code": "default", "build_code": null, "build_url": null, "job_code": null, "env_vars": {}, "flags": [], "name": null, "network_root_folder": "/Users/vladk/laravel-stripe-app-gh", "coverage_files_search_root_folder": "/Users/vladk/laravel-stripe-app-gh", "coverage_files_search_exclude_folders": [], "coverage_files_search_explicitly_listed_files": ["dir with spacee/cover.xml"], "plugin_names": ["xcode", "gcov", "pycoverage"], "token": "d******************", "branch": "feature/cli-example", "slug": "codecov-enterprise/laravel-app", "pull_request_number": null, "git_service": "github", "enterprise_url": null, "disable_search": false, "disable_file_fixes": false, "handle_no_reports_found": false}
debug - 2024-01-26 12:16:58,996 -- Selected preparation plugins --- {"selected_plugins": ["<class 'codecov_cli.plugins.xcode.XcodePlugin'>", "<class 'codecov_cli.plugins.gcov.GcovPlugin'>", "<class 'codecov_cli.plugins.pycoverage.Pycoverage'>"]}
debug - 2024-01-26 12:16:58,996 -- Running preparation plugin: <class 'codecov_cli.plugins.xcode.XcodePlugin'>
debug - 2024-01-26 12:16:58,997 -- Running xcode plugin...
debug - 2024-01-26 12:16:59,003 -- DerivedData folder: /Users/vladk/Library/Developer/Xcode/DerivedData
warning - 2024-01-26 12:16:59,004 -- No swift data found.
debug - 2024-01-26 12:16:59,005 -- Running preparation plugin: <class 'codecov_cli.plugins.gcov.GcovPlugin'>
debug - 2024-01-26 12:16:59,005 -- Running gcov plugin...
warning - 2024-01-26 12:17:00,820 -- No gcov data found.
debug - 2024-01-26 12:17:00,820 -- Running preparation plugin: <class 'codecov_cli.plugins.pycoverage.Pycoverage'>
warning - 2024-01-26 12:17:01,799 -- No coverage data found to transform
debug - 2024-01-26 12:17:01,799 -- Collecting relevant files
info - 2024-01-26 12:17:01,915 -- Found 2 coverage files to upload
info - 2024-01-26 12:17:01,915 -- > /Users/vladk/laravel-stripe-app-gh/coverage/coverage-final.json
info - 2024-01-26 12:17:01,915 -- > /Users/vladk/laravel-stripe-app-gh/dir with spacee/cover.xml
Describe the solution you'd like Note above, I've supplied a specific file to upload, using the -f param of the CLI. However in the debug output it found another file to upload:
info - 2024-01-26 12:17:01,915 -- Found 2 coverage files to upload
info - 2024-01-26 12:17:01,915 -- > /Users/vladk/laravel-stripe-app-gh/coverage/coverage-final.json
info - 2024-01-26 12:17:01,915 -- > /Users/vladk/laravel-stripe-app-gh/dir with spacee/cover.xml
This may be confusing and concerning to a customer, because either uploading or calculating additional coverage reports, than those specified, can lead to problems.
This can be handled by disabling search https://github.com/codecov/codecov-cli/blob/be85cc87c732d608063c281059502af0c58db2a7/codecov_cli/commands/upload.py#L64-L68
I've just been through a support request as a result of this issue (help gratefully received from @drazisil-codecov).
My two cents is it's counterintuitive to require search to be disabled when specifying a path to a file.
There may be circumstances requiring a search while specifying a file path, but my intuition is that would be the exception, not the norm. Therefore, following the Principle of least astonishment, I think search should be disabled when specifying a path to a file unless explicitly enabled.
@vlad-ko I think this has been fixed now. Going to close out, let me know if that's not the case.