From 812c700b879296e3a382266ed3ecfb163e828961 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Mon, 15 Jun 2020 14:11:04 -0400 Subject: [PATCH 1/8] update README (#280) --- README.md | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 9d3a8451..ab54a802 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Codecov Global Python Uploader ![PyPI](https://img.shields.io/pypi/v/codecov) [![codecov.io](https://codecov.io/github/codecov/codecov-python/coverage.svg?branch=master)](https://codecov.io/github/codecov/codecov-python) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) ======= -| [https://codecov.io/][1] | [@codecov][2] | [hello@codecov.io][3] | -| ------------------------ | ------------- | --------------------- | +| [https://codecov.io/][1] | [https://community.codecov.io/][2] | [@codecov][3] | [hello@codecov.io][4] | +| ------------------------ | ---------------------------------- | ------------- | --------------------- | Find coverage reports for all the [languages below](#languages), gather them and submit them to Codecov. @@ -75,34 +75,36 @@ after_success: ## CI Providers | Company | Supported | Token Required | -| --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | -| [Travis CI](https://travis-ci.org/) | Yes [![Build Status](https://secure.travis-ci.org/codecov/codecov-python.svg?branch=master)](https://travis-ci.org/codecov/codecov-python) | Private only | -| [CircleCI](https://circleci.com/) | Yes | Private only | -| [Codeship](https://codeship.com/) | Yes | Public & Private | -| [Jenkins](https://jenkins-ci.org/) | Yes | Public & Private | -| [Semaphore](https://semaphoreci.com/) | Yes | Public & Private | -| [Drone.io](https://drone.io/) | Yes | Public & Private | -| [AppVeyor](https://www.appveyor.com/) | Yes [![Build status](https://ci.appveyor.com/api/projects/status/sw18lsj7786bw806/branch/master?svg=true)](https://ci.appveyor.com/project/stevepeak/codecov-python/branch/master) | Private only | -| [Wercker](http://wercker.com/) | Yes | Public & Private | -| [Magnum CI](https://magnum-ci.com/) | Yes | Public & Private | -| [Shippable](https://www.shippable.com/) | Yes | Public & Private | -| [Gitlab CI](https://about.gitlab.com/gitlab-ci/) | Yes | Public & Private | -| Git / Mercurial | Yes (as a fallback) | Public & Private | -| [Buildbot](https://buildbot.net/) | `coming soon` [buildbot/buildbot#1671](https://github.com/buildbot/buildbot/pull/1671) | | -| [Bamboo](https://www.atlassian.com/software/bamboo) | `coming soon` | | -| [Solano Labs](https://www.solanolabs.com/) | `coming soon` | | +| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | +| [AppVeyor](https://www.appveyor.com/) | Yes [![Build status](https://ci.appveyor.com/api/projects/status/sw18lsj7786bw806/branch/master?svg=true)](https://ci.appveyor.com/project/stevepeak/codecov-python/branch/master) | Private only | +| [Bamboo](https://www.atlassian.com/software/bamboo) | `coming soon` | | +| [Buildbot](https://buildbot.net/) | `coming soon` [buildbot/buildbot#1671](https://github.com/buildbot/buildbot/pull/1671) | | +| [CircleCI](https://circleci.com/) | Yes | Private only | +| [Codeship](https://codeship.com/) | Yes | Public & Private | +| [Drone.io](https://drone.io/) | Yes | Public & Private | +| [GitHub Actions](https://github.com/features/actions) | Yes [![Build status](https://github.com/codecov/codecov-python/workflows/Python%20package/badge.svg?branch=master)](https://github.com/codecov/codecov-python/actions?query=workflow%3A%22Python+package%22) | Public & Private | +| [Gitlab CI](https://about.gitlab.com/gitlab-ci/) | Yes | Public & Private | +| [Jenkins](https://jenkins-ci.org/) | Yes | Public & Private | +| [Magnum CI](https://magnum-ci.com/) | Yes | Public & Private | +| [Semaphore](https://semaphoreci.com/) | Yes | Public & Private | +| [Shippable](https://www.shippable.com/) | Yes | Public & Private | +| [Solano Labs](https://www.solanolabs.com/) | `coming soon` | | +| [Travis CI](https://travis-ci.org/) | Yes [![Build Status](https://secure.travis-ci.org/codecov/codecov-python.svg?branch=master)](https://travis-ci.org/codecov/codecov-python) | Private only | +| [Wercker](http://wercker.com/) | Yes | Public & Private | +| Git / Mercurial | Yes (as a fallback) | Public & Private | ## Troubleshooting -If you're seeing an **HTTP 400 error when uploading reports to S3**, make sure you've updated to at least version 2.1.3. +If you're seeing an **HTTP 400 error when uploading reports to S3**, make sure you've updated to at least version 2.1.3. [1]: https://codecov.io/ -[2]: https://twitter.com/codecov -[3]: mailto:hello@codecov.io +[2]: https://community.codecov.io/ +[3]: https://twitter.com/codecov +[4]: mailto:hello@codecov.io ## Copyright -> Copyright 2014-2019 codecov +> Copyright 2014-2020 codecov From fd8600750731191d965683d87b1cda3011743377 Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Mon, 22 Jun 2020 08:02:36 -0700 Subject: [PATCH 2/8] Added ability to specify the number of upload attempts via command line. (#276) * Added ability to specify the number of upload attempts via command line. * Update codecov/__init__.py * Update codecov/__init__.py * Update codecov/__init__.py * Update codecov/__init__.py Co-authored-by: Thomas Hu Co-authored-by: Thomas Hu --- codecov/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/codecov/__init__.py b/codecov/__init__.py index 3308d1b9..3886db7d 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -407,6 +407,12 @@ def main(*argv, **kwargs): help="Specify a custom pr number, provided automatically for supported CI companies", ) advanced.add_argument("--tag", default=None, help="Git tag") + advanced.add_argument( + "--tries", + default=3, + type=int, + help="Specify the total number of attempts to make when uploading coverage report", + ) enterprise = parser.add_argument_group( "======================== Enterprise ========================" @@ -1108,6 +1114,7 @@ def main(*argv, **kwargs): res = retry_upload( "%s/upload/v4?%s" % (codecov.url, urlargs), requests.post, + retries=codecov.tries, break_codes=(200, 400, 406), verify=codecov.cacert, headers={ @@ -1128,6 +1135,7 @@ def main(*argv, **kwargs): s3 = retry_upload( upload_url, requests.put, + retries=codecov.tries, verify=codecov.cacert, data=reports_gzip, headers={ @@ -1149,6 +1157,7 @@ def main(*argv, **kwargs): res = retry_upload( "%s/upload/v2?%s" % (codecov.url, urlargs), requests.post, + retries=codecov.tries, verify=codecov.cacert, data=reports_gzip, headers={ From c057a1b9ff1ceba57cc42e1e6ed38e53dc56414f Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 15 Jul 2020 04:59:04 +0200 Subject: [PATCH 3/8] Add support for CODECOV_FLAGS (#285) --- codecov/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov/__init__.py b/codecov/__init__.py index 3886db7d..be62793d 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -331,7 +331,7 @@ def main(*argv, **kwargs): "--flags", "-F", nargs="*", - default=None, + default=os.getenv("CODECOV_FLAGS"), help="Flag these uploaded files with custom labels", ) basics.add_argument( From 066706eb2fab6c0fbe7c8f35d9b4bf405bf5db9f Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Wed, 15 Jul 2020 22:11:17 -0400 Subject: [PATCH 4/8] Bump to 2.1.8 (#287) --- CHANGELOG.md | 5 +++++ codecov/__version__.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81db7d77..e77e6c84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### `2.1.8` + +- [#285](https://github.com/codecov/codecov-python/pull/285)Add support for CODECOV_FLAGS +- [#276](https://github.com/codecov/codecov-python/pull/276)Add ability to specify number of upload retries + ### `2.1.7` - [#279](https://github.com/codecov/codecov-python/pull/279) Fix pinned coverage version diff --git a/codecov/__version__.py b/codecov/__version__.py index 2661eb1e..8e0b8295 100644 --- a/codecov/__version__.py +++ b/codecov/__version__.py @@ -5,4 +5,4 @@ __license__ = "Apache 2.0" __title__ = "codecov" __url__ = "https://github.com/codecov/codecov-python" -__version__ = "2.1.7" +__version__ = "2.1.8" From 971d76185855d5ebbc5e0c86eef543110292fca1 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Wed, 19 Aug 2020 22:26:49 -0400 Subject: [PATCH 5/8] Remove token restrictions --- README.md | 12 +++++++----- codecov/__init__.py | 9 --------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index ab54a802..600b86e3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ -Codecov Global Python Uploader ![PyPI](https://img.shields.io/pypi/v/codecov) [![codecov.io](https://codecov.io/github/codecov/codecov-python/coverage.svg?branch=master)](https://codecov.io/github/codecov/codecov-python) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) +Codecov Global Python Uploader +[![codecov.io](https://codecov.io/github/codecov/codecov-python/coverage.svg?branch=master)](https://codecov.io/github/codecov/codecov-python) +![PyPI](https://img.shields.io/pypi/v/codecov) +[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) ======= -| [https://codecov.io/][1] | [https://community.codecov.io/][2] | [@codecov][3] | [hello@codecov.io][4] | -| ------------------------ | ---------------------------------- | ------------- | --------------------- | +| [Support][1] | [Documentation][2] | [Community Boards][3] | [Twitter][4] | +| ------------ | ------------------ | --------------------- | ------------ | Find coverage reports for all the [languages below](#languages), gather them and submit them to Codecov. @@ -100,10 +103,9 @@ If you're seeing an **HTTP 400 error when uploading reports to S3**, make sure y -[1]: https://codecov.io/ +[1]: https://codecov.io/support/ [2]: https://community.codecov.io/ [3]: https://twitter.com/codecov -[4]: mailto:hello@codecov.io ## Copyright diff --git a/codecov/__init__.py b/codecov/__init__.py index be62793d..e9645540 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -953,8 +953,6 @@ def main(*argv, **kwargs): if _slug: query["slug"] = _slug.groups()[1] - assert query.get("job") or query.get("token"), "Missing repository upload token" - # Processing gcov # --------------- if "gcov" in codecov.disable: @@ -1189,13 +1187,6 @@ def main(*argv, **kwargs): "Tip: See all example repositories: https://github.com/codecov?query=example" ) - write("Support channels:", "green") - write( - " Email: hello@codecov.io\n" - " IRC: #codecov\n" - " Gitter: https://gitter.im/codecov/support\n" - " Twitter: @codecov\n" - ) sys.exit(1 if codecov.required else 0) else: From f5acc6756cfd3de0263267fbd595f2b1d9d198cc Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Wed, 19 Aug 2020 22:28:19 -0400 Subject: [PATCH 6/8] Update version to 2.1.9 --- CHANGELOG.md | 4 ++++ codecov/__version__.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e77e6c84..b825c4bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### `2.1.9` + +- []()Remove token restriction as it is changed server-side + ### `2.1.8` - [#285](https://github.com/codecov/codecov-python/pull/285)Add support for CODECOV_FLAGS diff --git a/codecov/__version__.py b/codecov/__version__.py index 8e0b8295..26010cbb 100644 --- a/codecov/__version__.py +++ b/codecov/__version__.py @@ -5,4 +5,4 @@ __license__ = "Apache 2.0" __title__ = "codecov" __url__ = "https://github.com/codecov/codecov-python" -__version__ = "2.1.8" +__version__ = "2.1.9" From 58ab458f8f4c4fcc520b6caf1479b9ff9a06dfdc Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Wed, 19 Aug 2020 22:30:16 -0400 Subject: [PATCH 7/8] Fix tests --- tests/test.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tests/test.py b/tests/test.py index de4af8e8..39ca23a9 100644 --- a/tests/test.py +++ b/tests/test.py @@ -294,18 +294,6 @@ def test_send_error(self): else: raise Exception("400 never raised") - @data((dict(commit="sha"), "Missing repository upload token"),) - def test_require_branch(self, dd): - (kwargs, reason) = dd - # this is so we dont get branch for local git - self.set_env(JENKINS_URL="hello") - try: - self.run_cli(**kwargs) - except AssertionError as e: - self.assertEqual(str(e), reason) - else: - raise Exception("Did not raise AssertionError") - @unittest.skipIf( os.getenv("CI") == "True" and os.getenv("APPVEYOR") == "True", "Skip AppVeyor CI test", From b5b130d5dfd71ec8829a456092442ca00730523a Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Thu, 20 Aug 2020 00:05:27 -0400 Subject: [PATCH 8/8] force