Skip to content

Commit

Permalink
Th/create default name (#421)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
thomasrockhu-codecov authored Apr 17, 2024
1 parent aa5aa3f commit f18f2d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
- name: Dogfooding codecov-cli
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
run: |
codecovcli do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
codecovcli -v do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
static-analysis:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions codecov_cli/commands/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def _turn_env_vars_into_dict(ctx, params, value):
"-n",
"--name",
help="Custom defined name of the upload. Visible in Codecov UI",
cls=CodecovOption,
fallback_field=FallbackFieldEnum.build_code,
),
click.option(
"-B",
Expand Down
10 changes: 5 additions & 5 deletions codecov_cli/fallbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@


class FallbackFieldEnum(Enum):
commit_sha = auto()
build_url = auto()
branch = auto()
build_code = auto()
build_url = auto()
commit_sha = auto()
git_service = auto()
job_code = auto()
pull_request_number = auto()
slug = auto()
branch = auto()
service = auto()
git_service = auto()
slug = auto()


class CodecovOption(click.Option):
Expand Down

0 comments on commit f18f2d5

Please sign in to comment.