codecov / codecov-action

GitHub Action that uploads coverage to Codecov :open_umbrella:
https://www.codecov.io
MIT License
1.48k stars 208 forks source link

slash in `flag` is not escape? result in 400 error #199

Closed hanxiao closed 3 years ago

hanxiao commented 3 years ago

the slash in flags=integration/encode_driver_batching,core,ci,3.7 is not escaped as shown in the log:

==> Gzipping contents
        40K /tmp/codecov.X8ywSv.gz
==> Uploading reports
    url: https://codecov.io
    query: branch=hub-push-fix&commit=065dbb38b4e13045fac7c857bbdc5a1c11704744&build=473107127&build_url=http%3A%2F%2Fgithub.com%2Fjina-ai%2Fjina%2Factions%2Fruns%2F473107127&name=integration%2Fencode_driver_batching-codecov&tag=&slug=jina-ai%2Fjina&service=github-actions&flags=integration/encode_driver_batching,core,ci,3.7&pr=1631&job=CI&cmd_args=n,F,Q,f
->  Pinging Codecov
https://codecov.io/upload/v4?package=github-action-20201231-23d4836&token=secret&branch=hub-push-fix&commit=065dbb38b4e13045fac7c857bbdc5a1c11704744&build=473107127&build_url=http%3A%2F%2Fgithub.com%2Fjina-ai%2Fjina%2Factions%2Fruns%2F473107127&name=integration%2Fencode_driver_batching-codecov&tag=&slug=jina-ai%2Fjina&service=github-actions&flags=integration/encode_driver_batching,core,ci,3.7&pr=1631&job=CI&cmd_args=n,F,Q,f

this results in a long HTML followed by 400:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="Code coverage done right. Highly integrated with GitHub, Bitbucket and GitLab.">
<meta name="author" content="@codecov">
<meta name="keywords" content="code, coverage, analysis, testing, development, qa, analyzer">

...

400
thomasrockhu commented 3 years ago

Unfortunately, we do not support / or the url-encoded version on the backend. Flags must be of form ^[\w\.\-\,]+$