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

Commit d4d5b40

Browse files
authored
Merge pull request #111 from codecov/dana/add-options-names
add more option names to commit and report commands
2 parents b714d0e + 7a174a6 commit d4d5b40

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

codecov_cli/commands/commit.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313

1414
@click.command()
1515
@click.option(
16+
"-C",
17+
"--sha",
1618
"--commit-sha",
19+
"commit_sha",
1720
help="Commit SHA (with 40 chars)",
1821
cls=CodecovOption,
1922
fallback_field=FallbackFieldEnum.commit_sha,
@@ -24,8 +27,11 @@
2427
help="SHA (with 40 chars) of what should be the parent of this commit",
2528
)
2629
@click.option(
30+
"-P",
2731
"--pr",
28-
help="Pull Request id to associate commit with",
32+
"--pull-request-number",
33+
"pull_request_number",
34+
help="Specify the pull request number mannually. Used to override pre-existing CI environment variables",
2935
cls=CodecovOption,
3036
fallback_field=FallbackFieldEnum.pull_request_number,
3137
)
@@ -37,7 +43,9 @@
3743
fallback_field=FallbackFieldEnum.branch,
3844
)
3945
@click.option(
46+
"-r",
4047
"--slug",
48+
"slug",
4149
cls=CodecovOption,
4250
fallback_field=FallbackFieldEnum.slug,
4351
help="owner/repo slug used instead of the private repo token in Self-hosted",
@@ -61,7 +69,7 @@ def create_commit(
6169
ctx,
6270
commit_sha: str,
6371
parent_sha: typing.Optional[str],
64-
pr: typing.Optional[int],
72+
pull_request_number: typing.Optional[int],
6573
branch: typing.Optional[str],
6674
slug: typing.Optional[str],
6775
token: typing.Optional[uuid.UUID],
@@ -73,12 +81,14 @@ def create_commit(
7381
extra_log_attributes=dict(
7482
commit_sha=commit_sha,
7583
parent_sha=parent_sha,
76-
pr=pr,
84+
pr=pull_request_number,
7785
branch=branch,
7886
slug=slug,
7987
token=token,
8088
service=git_service,
8189
)
8290
),
8391
)
84-
create_commit_logic(commit_sha, parent_sha, pr, branch, slug, token, git_service)
92+
create_commit_logic(
93+
commit_sha, parent_sha, pull_request_number, branch, slug, token, git_service
94+
)

codecov_cli/commands/report.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212

1313
@click.command()
1414
@click.option(
15+
"-C",
16+
"--sha",
1517
"--commit-sha",
18+
"commit_sha",
1619
help="Commit SHA (with 40 chars)",
1720
cls=CodecovOption,
1821
fallback_field=FallbackFieldEnum.commit_sha,
@@ -22,12 +25,13 @@
2225
"--code", help="The code of the report. If unsure, leave default", default="default"
2326
)
2427
@click.option(
28+
"-r",
2529
"--slug",
30+
"slug",
2631
cls=CodecovOption,
2732
fallback_field=FallbackFieldEnum.slug,
2833
help="owner/repo slug used instead of the private repo token in Self-hosted",
2934
envvar="CODECOV_SLUG",
30-
required=True,
3135
)
3236
@click.option(
3337
"--git-service",

0 commit comments

Comments
 (0)