Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit f18f2d5

Browse files
Th/create default name (#421)
* fix: add some logs and test * fix: verbose * fix: maybe get more data * fix: add name to fallbacks * fix: default to build_code * fix: update the option * fix: cleanup * fix: cleanup again * fix: last cleanup
1 parent aa5aa3f commit f18f2d5

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ jobs:
8080
- name: Dogfooding codecov-cli
8181
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
8282
run: |
83-
codecovcli do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
84-
codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
83+
codecovcli -v do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
84+
codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
8585
8686
static-analysis:
8787
runs-on: ubuntu-latest

codecov_cli/commands/upload.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ def _turn_env_vars_into_dict(ctx, params, value):
9898
"-n",
9999
"--name",
100100
help="Custom defined name of the upload. Visible in Codecov UI",
101+
cls=CodecovOption,
102+
fallback_field=FallbackFieldEnum.build_code,
101103
),
102104
click.option(
103105
"-B",

codecov_cli/fallbacks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66

77
class FallbackFieldEnum(Enum):
8-
commit_sha = auto()
9-
build_url = auto()
8+
branch = auto()
109
build_code = auto()
10+
build_url = auto()
11+
commit_sha = auto()
12+
git_service = auto()
1113
job_code = auto()
1214
pull_request_number = auto()
13-
slug = auto()
14-
branch = auto()
1515
service = auto()
16-
git_service = auto()
16+
slug = auto()
1717

1818

1919
class CodecovOption(click.Option):

0 commit comments

Comments
 (0)