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

-f absolute path fails on windows uploader v0.1.15 with: "No paths matched existing files!" #590

Open
ben-spiller opened this issue Jan 19, 2022 · 6 comments · Fixed by #593
Assignees
Labels
bug Something isn't working question Further information is requested windows

Comments

@ben-spiller
Copy link

ben-spiller commented Jan 19, 2022

Describe the bug
After switching from the v1 to the latest v2 uploader, my Linux upload job works but my identical Windows upload fails with the output below. I've turned on verbose logging to get insight into what is happening but it seems verbose logging doesn't mention it. If nothing else, please add to the verbose logging enough info to see why a file was ignored.

I am explicitly specifying the filename with -f D:/a/xpybuild/xpybuild/tests/__coverage_python.win-py3.10/coverage.xml - but although that file definitely exists, I get the No paths matched existing files! error.

I also tried specifying the same filename with a relative path -f tests/__coverage_python.win-py3.10/coverage.xml and that works.
If I instead use a directory search with an absolute path -s D:/a/xpybuild/xpybuild/tests/__coverage_python.win-py3.10 it works.
And as mentioned, using the absolute -f path on linux works.

To Reproduce
I'm using GitHub Actions, it seems to be the uploader that has the issue.
Using v0.1.15 uploader, execute a command line: D:\a\_actions\codecov\codecov-action\v2.1.0\dist\codecov.exe -n win-py3.10 -Q github-action-2.1.0 -Z -s D:/a/xpybuild/xpybuild/tests/__coverage_python.win-py3.10 -v

Expected behavior
It should upload the file given I specified, given that it exists. Also given this works on linux it should work the same on Windows.

If not, it should give an error message describing why the file I specified was ignored. Given there is no documentation on what patterns are excluded, verbose logging is especially important to help people debug this kind of thing.

Additional context

Run codecov/codecov-action@v2.1.0
  with:
    fail_ci_if_error: true
    verbose: true
    name: win-py3.10
    files: D:/a/xpybuild/xpybuild/tests/__coverage_python.win-py3.10/coverage.xml
  env:
    pythonLocation: C:\hostedtoolcache\windows\Python\3.10.1\x64
==> windows OS detected
uploader.codecov.io/latest/windows/codecov.exe.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (43fa86a6c5ce325daf8eb0c523db858f036afa492ac45a7dd59c41989cc1eb12  codecov.exe)
==> Running version latest
==> Running version v0.1.9
D:\a\_actions\codecov\codecov-action\v2.1.0\dist\codecov.exe -n win-py3.10 -Q github-action-2.1.0 -Z -f D:/a/xpybuild/xpybuild/tests/__coverage_python.win-py3.10/coverage.xml -v
[2022-01-19T18:16:06.485Z] ['verbose'] Start of uploader: 1642616166485...
[2022-01-19T18:16:06.486Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/

  Codecov report uploader 0.1.15
[2022-01-19T18:16:06.531Z] ['info'] => Project root located at: D:/a/xpybuild/xpybuild
[2022-01-19T18:16:06.533Z] ['info'] -> No token specified or token is empty
[2022-01-19T18:16:06.533Z] ['verbose'] Start of network processing...
[2022-01-19T18:16:06.533Z] ['verbose'] Searching for files in D:/a/xpybuild/xpybuild
[2022-01-19T18:16:06.574Z] ['info'] Searching for coverage files...
[2022-01-19T18:16:06.644Z] ['verbose'] Preparing to clean the following coverage paths: D:/a/xpybuild/xpybuild/tests/__coverage_python.win-py3.10/coverage.xml
[2022-01-19T18:16:06.645Z] ['error'] There was an error running the uploader: Error while cleaning paths. No paths matched existing files!
[2022-01-19T18:16:06.646Z] ['verbose'] The error stack is: Error: Error while cleaning paths. No paths matched existing files!
    at cleanCoverageFilePaths (C:\snapshot\project\dist\src\helpers\files.js)
    at main (C:\snapshot\project\dist\src\index.js)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-01-19T18:16:06.646Z] ['verbose'] End of uploader: 161 milliseconds
Error: Codecov: Failed to properly upload: The process 'D:\a\_actions\codecov\codecov-action\v2.1.0\dist\codecov.exe' failed with exit code 4294967295`

https://github.com/xpybuild/xpybuild/runs/4872059624?check_suite_focus=true (as you see I've been hacking around trying to get it working on this branch)

@drazisil-codecov
Copy link
Contributor

drazisil-codecov commented Jan 20, 2022

It's supposed to already skip the blocklist.

uploader/src/index.ts

Lines 194 to 209 in 08140be

// If args.file was passed, emit warning for 'filtered' filess
if (requestedPaths.length > 0) {
if (coverageFilePathsAfterFilter.length !== requestedPaths.length) {
info('Warning: Some files passed via the -f flag would normally be excluded from search.')
info('If Codecov encounters issues processing your reports, please review https://docs.codecov.com/docs/supported-report-formats')
}
} else {
// Overwrite coverageFilePaths with coverageFilePathsAfterFilter
info('Warning: Some files located via search were excluded from upload.')
info('If Codecov did not locate your files, please review https://docs.codecov.com/docs/supported-report-formats')
coverageFilePaths = coverageFilePathsAfterFilter
}
}

However, it doesn't look like you are getting those logs. 🤔 Do you get them on the Linux one?

(goes to do some tests)

@drazisil-codecov
Copy link
Contributor

Confirmed that 08140be does not display the new logging on Windows. 👎

@drazisil-codecov drazisil-codecov self-assigned this Jan 20, 2022
@drazisil-codecov drazisil-codecov added bug Something isn't working windows labels Jan 20, 2022
@drazisil-codecov drazisil-codecov linked a pull request Jan 21, 2022 that will close this issue
@mitchell-codecov
Copy link
Contributor

@ben-spiller, it looks like your Windows slashes are backwards. Could you try running the uploader with them swapped?

@drazisil-codecov drazisil-codecov removed their assignment Jan 26, 2022
@drazisil-codecov drazisil-codecov added the question Further information is requested label Jan 26, 2022
@ben-spiller
Copy link
Author

It's not easy to switch to backslashes in my environment actually - and from the comments it looks like you're able to repro this failure mode in your environment anyway? If not let me know and I'll try and find some time to try it.

If the problem was caused by the slash direction, then why would the relative path "tests/__coverage_python.win-py3.10/coverage.xml" work?

Either way, the action should be able to cope with both slash directions - as workflows need to be designed to be cross-platform, we don't want people to have to create separate workflows for windows and linux just to avoid slash problems. And we definitely would benefit from need more detailed logging in verbose mode to help debug these kinds of issues.

@ben-spiller
Copy link
Author

Any updates on this - I think you said you can already reproduce it without more info from me? ("Confirmed that 08140be does not display the new logging on Windows.")

If think it's the forward slashes on windows causing the problem, the action could just normalize them for the current OS? Would be great to have a robust action in place for this, rather than requiring end-user workarounds. Thanks

@mitchell-codecov
Copy link
Contributor

I'll bring this up with the team, @ben-spiller. There is certainly a lot of value in handling slashes of both directions.

I've opened up codecov/codecov-action#638 to track the issue in the codecov/codecov-action repository.

@drazisil-codecov drazisil-codecov self-assigned this Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants