Skip to content

Commit c1401cf

Browse files
feat: Clarify upload queueing logging and process completion logging (#110)
Closes #74 The language was confusing for users so I: - modified the "Upload" process wording - removed the word "Process" that came before the process description for all of the processes as it seemed a bit redundant For reference, the existing options we have for `process_desc` are "Upload" -> "Upload queued for processing" "Empty Upload" "Commit creating" "Base picking" "Report creating" "Report results creating" "Getting report results" "Upload Completion" "Posting test results comment".
1 parent 168db7b commit c1401cf

11 files changed

Lines changed: 31 additions & 28 deletions

File tree

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ lint:
2323
make lint.install
2424
make lint.run
2525

26+
test:
27+
cd codecov-cli && uv run pytest
28+
2629
command_dump:
2730
cd prevent-cli && uv run command_dump.py
2831

codecov-cli/codecov_cli/helpers/request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def log_warnings_and_errors_if_any(
152152
sending_result: RequestResult, process_desc: str, fail_on_error: bool = False
153153
):
154154
logger.info(
155-
f"Process {process_desc} complete",
155+
f"{process_desc} complete",
156156
)
157157
logger.debug(
158158
f"{process_desc} result",

codecov-cli/codecov_cli/services/upload/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,5 +165,5 @@ def do_upload_logic(
165165
status_code=200,
166166
text="Data NOT sent to Codecov because of dry-run option",
167167
)
168-
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
168+
log_warnings_and_errors_if_any(sending_result, "Upload queued for processing", fail_on_error)
169169
return sending_result

codecov-cli/codecov_cli/services/upload/upload_sender.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def send_upload_data(
117117
resp_json_obj = json.loads(resp_from_codecov.text)
118118
if resp_json_obj.get("url"):
119119
logger.info(
120-
f"Your upload is now processing. When finished, results will be available at: {resp_json_obj.get('url')}"
120+
f"Your upload is now queued for processing. When finished, results will be available at: {resp_json_obj.get('url')}"
121121
)
122122
logger.debug(
123123
"Upload request to Codecov complete.",

codecov-cli/tests/commands/test_invoke_upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_upload_raise_Z_option(mocker):
4040
result = runner.invoke(cli, ["do-upload", "--fail-on-error"], obj={})
4141
upload_sender.assert_called()
4242
upload_collector.assert_called()
43-
assert ("error", "Upload failed: Unauthorized") in parse_outstreams_into_log_lines(
43+
assert ("error", "Upload queued for processing failed: Unauthorized") in parse_outstreams_into_log_lines(
4444
result.output
4545
)
4646
assert str(result) == "<Result SystemExit(1)>"

codecov-cli/tests/services/commit/test_commit_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_commit_command_with_warnings(mocker):
3131

3232
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
3333
assert out_bytes == [
34-
("info", "Process Commit creating complete"),
34+
("info", "Commit creating complete"),
3535
("info", "Commit creating process had 1 warning"),
3636
("warning", "Warning 1: somewarningmessage"),
3737
]
@@ -81,7 +81,7 @@ def test_commit_command_with_error(mocker):
8181
assert out_bytes == [
8282
(
8383
"info",
84-
"Process Commit creating complete",
84+
"Commit creating complete",
8585
),
8686
("error", "Commit creating failed: Permission denied"),
8787
]

codecov-cli/tests/services/empty_upload/test_empty_upload.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_empty_upload_with_warnings(mocker):
3434
)
3535
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
3636
assert out_bytes == [
37-
("info", "Process Empty Upload complete"),
37+
("info", "Empty Upload complete"),
3838
("info", "Empty Upload process had 1 warning"),
3939
("warning", "Warning 1: somewarningmessage"),
4040
]
@@ -71,7 +71,7 @@ def test_empty_upload_with_error(mocker):
7171

7272
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
7373
assert out_bytes == [
74-
("info", "Process Empty Upload complete"),
74+
("info", "Empty Upload complete"),
7575
("error", "Empty Upload failed: Permission denied"),
7676
]
7777
assert res == mock_send_commit_data.return_value
@@ -97,7 +97,7 @@ def test_empty_upload_200(mocker):
9797
)
9898
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
9999
assert out_bytes == [
100-
("info", "Process Empty Upload complete"),
100+
("info", "Empty Upload complete"),
101101
("info", "All changed files are ignored. Triggering passing notifications."),
102102
("info", "Non ignored files []"),
103103
]
@@ -142,7 +142,7 @@ def test_empty_upload_force(mocker):
142142
)
143143
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
144144
assert out_bytes == [
145-
("info", "Process Empty Upload complete"),
145+
("info", "Empty Upload complete"),
146146
("info", "Force option was enabled. Triggering passing notifications."),
147147
("info", "Non ignored files []"),
148148
]
@@ -170,7 +170,7 @@ def test_empty_upload_no_token(mocker):
170170

171171
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
172172
assert out_bytes == [
173-
("info", "Process Empty Upload complete"),
173+
("info", "Empty Upload complete"),
174174
("info", "All changed files are ignored. Triggering passing notifications."),
175175
("info", "Non ignored files []"),
176176
]

codecov-cli/tests/services/report/test_report_results.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_report_results_command_with_warnings(mocker):
3636

3737
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
3838
assert out_bytes == [
39-
("info", "Process Report results creating complete"),
39+
("info", "Report results creating complete"),
4040
("info", "Report results creating process had 1 warning"),
4141
("warning", "Warning 1: somewarningmessage"),
4242
]
@@ -81,7 +81,7 @@ def test_report_results_command_with_error(mocker):
8181

8282
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
8383
assert out_bytes == [
84-
("info", "Process Report results creating complete"),
84+
("info", "Report results creating complete"),
8585
("error", "Report results creating failed: Permission denied"),
8686
]
8787
assert res == mock_send_reports_result_request.return_value

codecov-cli/tests/services/report/test_report_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_create_report_command_with_warnings(mocker):
8787

8888
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
8989
assert out_bytes == [
90-
("info", "Process Report creating complete"),
90+
("info", "Report creating complete"),
9191
("info", "Report creating process had 1 warning"),
9292
("warning", "Warning 1: somewarningmessage"),
9393
]
@@ -130,7 +130,7 @@ def test_create_report_command_with_error(mocker):
130130

131131
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
132132
assert out_bytes == [
133-
("info", "Process Report creating complete"),
133+
("info", "Report creating complete"),
134134
("error", "Report creating failed: Permission denied"),
135135
]
136136
assert res == RequestResult(

codecov-cli/tests/services/upload/test_upload_service.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ def test_do_upload_logic_happy_path_legacy_uploader(mocker):
8080
)
8181
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
8282
assert out_bytes == [
83-
("info", "Process Upload complete"),
84-
("info", "Upload process had 1 warning"),
83+
("info", "Upload queued for processing complete"),
84+
("info", "Upload queued for processing process had 1 warning"),
8585
("warning", "Warning 1: somewarningmessage"),
8686
]
8787

@@ -195,8 +195,8 @@ def test_do_upload_logic_happy_path(mocker):
195195
)
196196
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
197197
assert out_bytes == [
198-
("info", "Process Upload complete"),
199-
("info", "Upload process had 1 warning"),
198+
("info", "Upload queued for processing complete"),
199+
("info", "Upload queued for processing process had 1 warning"),
200200
("warning", "Warning 1: somewarningmessage"),
201201
]
202202

@@ -333,7 +333,7 @@ def test_do_upload_logic_dry_run(mocker):
333333
)
334334
assert out_bytes == [
335335
("info", "dry-run option activated. NOT sending data to Codecov."),
336-
("info", "Process Upload complete"),
336+
("info", "Upload queued for processing complete"),
337337
]
338338
assert res == RequestResult(
339339
error=None,
@@ -399,10 +399,10 @@ def test_do_upload_logic_verbose(mocker, use_verbose_option):
399399
"Selected uploader to use: <class 'codecov_cli.services.upload.legacy_upload_sender.LegacyUploadSender'>",
400400
),
401401
("info", "dry-run option activated. NOT sending data to Codecov."),
402-
("info", "Process Upload complete"),
402+
("info", "Upload queued for processing complete"),
403403
(
404404
"debug",
405-
'Upload result --- {"result": "RequestResult(error=None, warnings=None, status_code=200, text=\'Data NOT sent to Codecov because of dry-run option\')"}',
405+
'Upload queued for processing result --- {"result": "RequestResult(error=None, warnings=None, status_code=200, text=\'Data NOT sent to Codecov because of dry-run option\')"}',
406406
),
407407
]
408408
assert res == RequestResult(
@@ -671,8 +671,8 @@ def test_do_upload_logic_happy_path_test_results(mocker):
671671
)
672672
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
673673
assert out_bytes == [
674-
("info", "Process Upload complete"),
675-
("info", "Upload process had 1 warning"),
674+
("info", "Upload queued for processing complete"),
675+
("info", "Upload queued for processing process had 1 warning"),
676676
("warning", "Warning 1: somewarningmessage"),
677677
]
678678

0 commit comments

Comments
 (0)