codecov-cli 10.0.0__tar.gz → 10.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. {codecov-cli-10.0.0/codecov_cli.egg-info → codecov-cli-10.0.1}/PKG-INFO +1 -1
  2. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/commands/base_picking.py +17 -14
  3. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/commands/commit.py +23 -20
  4. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/commands/create_report_result.py +14 -11
  5. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/commands/empty_upload.py +14 -11
  6. codecov-cli-10.0.1/codecov_cli/commands/get_report_results.py +52 -0
  7. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/commands/labelanalysis.py +137 -134
  8. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/commands/process_test_results.py +20 -17
  9. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/commands/report.py +27 -24
  10. codecov-cli-10.0.1/codecov_cli/commands/send_notifications.py +46 -0
  11. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/commands/staticanalysis.py +25 -22
  12. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/commands/upload.py +54 -51
  13. codecov-cli-10.0.1/codecov_cli/commands/upload_coverage.py +180 -0
  14. codecov-cli-10.0.0/codecov_cli/commands/upload_coverage.py → codecov-cli-10.0.1/codecov_cli/commands/upload_process.py +10 -62
  15. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/main.py +2 -2
  16. codecov-cli-10.0.1/codecov_cli/opentelemetry.py +24 -0
  17. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/plugins/compress_pycoverage_contexts.py +36 -37
  18. codecov-cli-10.0.1/codecov_cli/plugins/gcov.py +69 -0
  19. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/plugins/pycoverage.py +19 -20
  20. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/plugins/xcode.py +26 -27
  21. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/upload/file_finder.py +35 -32
  22. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/upload/legacy_upload_sender.py +36 -37
  23. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/upload/upload_collector.py +30 -31
  24. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/upload/upload_sender.py +10 -13
  25. {codecov-cli-10.0.0 → codecov-cli-10.0.1/codecov_cli.egg-info}/PKG-INFO +1 -1
  26. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli.egg-info/requires.txt +1 -1
  27. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/setup.py +2 -2
  28. codecov-cli-10.0.0/codecov_cli/commands/get_report_results.py +0 -49
  29. codecov-cli-10.0.0/codecov_cli/commands/send_notifications.py +0 -43
  30. codecov-cli-10.0.0/codecov_cli/commands/upload_process.py +0 -125
  31. codecov-cli-10.0.0/codecov_cli/opentelemetry.py +0 -32
  32. codecov-cli-10.0.0/codecov_cli/plugins/gcov.py +0 -70
  33. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/LICENSE +0 -0
  34. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/MANIFEST.in +0 -0
  35. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/README.md +0 -0
  36. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/__init__.py +0 -0
  37. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/commands/__init__.py +0 -0
  38. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/fallbacks.py +0 -0
  39. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/__init__.py +0 -0
  40. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/args.py +0 -0
  41. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/__init__.py +0 -0
  42. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/appveyor_ci.py +0 -0
  43. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/azure_pipelines.py +0 -0
  44. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/base.py +0 -0
  45. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/bitbucket_ci.py +0 -0
  46. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/bitrise_ci.py +0 -0
  47. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/buildkite.py +0 -0
  48. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/circleci.py +0 -0
  49. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/cirrus_ci.py +0 -0
  50. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/cloudbuild.py +0 -0
  51. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/codebuild.py +0 -0
  52. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/droneci.py +0 -0
  53. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/github_actions.py +0 -0
  54. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/gitlab_ci.py +0 -0
  55. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/heroku.py +0 -0
  56. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/jenkins.py +0 -0
  57. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/local.py +0 -0
  58. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/teamcity.py +0 -0
  59. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/travis_ci.py +0 -0
  60. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/ci_adapters/woodpeckerci.py +0 -0
  61. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/config.py +0 -0
  62. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/encoder.py +0 -0
  63. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/folder_searcher.py +0 -0
  64. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/git.py +0 -0
  65. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/git_services/__init__.py +0 -0
  66. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/git_services/github.py +0 -0
  67. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/logging_utils.py +0 -0
  68. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/options.py +0 -0
  69. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/request.py +0 -0
  70. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/validators.py +0 -0
  71. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/helpers/versioning_systems.py +0 -0
  72. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/plugins/__init__.py +0 -0
  73. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/plugins/types.py +0 -0
  74. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/runners/__init__.py +0 -0
  75. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/runners/dan_runner.py +0 -0
  76. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/runners/pytest_standard_runner.py +0 -0
  77. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/runners/types.py +0 -0
  78. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/__init__.py +0 -0
  79. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/commit/__init__.py +0 -0
  80. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/commit/base_picking.py +0 -0
  81. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/empty_upload/__init__.py +0 -0
  82. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/report/__init__.py +0 -0
  83. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/staticanalysis/__init__.py +0 -0
  84. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/staticanalysis/analyzers/__init__.py +0 -0
  85. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/staticanalysis/analyzers/general.py +0 -0
  86. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/staticanalysis/analyzers/javascript_es6/__init__.py +0 -0
  87. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/staticanalysis/analyzers/javascript_es6/node_wrappers.py +0 -0
  88. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/staticanalysis/analyzers/python/__init__.py +0 -0
  89. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/staticanalysis/analyzers/python/node_wrappers.py +0 -0
  90. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/staticanalysis/exceptions.py +0 -0
  91. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/staticanalysis/finders.py +0 -0
  92. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/staticanalysis/types.py +0 -0
  93. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/upload/__init__.py +0 -0
  94. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/upload/network_finder.py +0 -0
  95. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/upload_completion/__init__.py +0 -0
  96. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/services/upload_coverage/__init__.py +0 -0
  97. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli/types.py +0 -0
  98. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli.egg-info/SOURCES.txt +0 -0
  99. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli.egg-info/dependency_links.txt +0 -0
  100. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli.egg-info/entry_points.txt +0 -0
  101. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/codecov_cli.egg-info/top_level.txt +0 -0
  102. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/languages/languages.c +0 -0
  103. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/languages/treesitterjavascript/src/parser.c +0 -0
  104. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/languages/treesitterjavascript/src/scanner.c +0 -0
  105. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/languages/treesitterjavascript/src/tree_sitter/parser.h +0 -0
  106. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/languages/treesitterpython/src/parser.c +0 -0
  107. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/languages/treesitterpython/src/scanner.cc +0 -0
  108. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/languages/treesitterpython/src/tree_sitter/parser.h +0 -0
  109. {codecov-cli-10.0.0 → codecov-cli-10.0.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: codecov-cli
3
- Version: 10.0.0
3
+ Version: 10.0.1
4
4
  Summary: Codecov Command Line Interface
5
5
  Author: Codecov
6
6
  Author-email: support@codecov.io
@@ -2,6 +2,7 @@ import logging
2
2
  import typing
3
3
 
4
4
  import click
5
+ import sentry_sdk
5
6
 
6
7
  from codecov_cli.fallbacks import CodecovOption, FallbackFieldEnum
7
8
  from codecov_cli.helpers.args import get_cli_args
@@ -54,19 +55,21 @@ def pr_base_picking(
54
55
  token: typing.Optional[str],
55
56
  service: typing.Optional[str],
56
57
  ):
57
- enterprise_url = ctx.obj.get("enterprise_url")
58
- args = get_cli_args(ctx)
59
- logger.debug(
60
- "Starting base picking process",
61
- extra=dict(
62
- extra_log_attributes=args,
63
- ),
64
- )
58
+ with sentry_sdk.start_transaction(op="task", name="Base Picking"):
59
+ with sentry_sdk.start_span(name="base_picking"):
60
+ enterprise_url = ctx.obj.get("enterprise_url")
61
+ args = get_cli_args(ctx)
62
+ logger.debug(
63
+ "Starting base picking process",
64
+ extra=dict(
65
+ extra_log_attributes=args,
66
+ ),
67
+ )
65
68
 
66
- if slug_without_subgroups_is_invalid(slug):
67
- logger.error(
68
- "Slug is invalid. Slug should be in the form of owner_username/repo_name"
69
- )
70
- return
69
+ if slug_without_subgroups_is_invalid(slug):
70
+ logger.error(
71
+ "Slug is invalid. Slug should be in the form of owner_username/repo_name"
72
+ )
73
+ return
71
74
 
72
- base_picking_logic(base_sha, pr, slug, token, service, enterprise_url, args)
75
+ base_picking_logic(base_sha, pr, slug, token, service, enterprise_url, args)
@@ -2,6 +2,7 @@ import logging
2
2
  import typing
3
3
 
4
4
  import click
5
+ import sentry_sdk
5
6
 
6
7
  from codecov_cli.fallbacks import CodecovOption, FallbackFieldEnum
7
8
  from codecov_cli.helpers.args import get_cli_args
@@ -47,23 +48,25 @@ def create_commit(
47
48
  git_service: typing.Optional[str],
48
49
  fail_on_error: bool,
49
50
  ):
50
- enterprise_url = ctx.obj.get("enterprise_url")
51
- args = get_cli_args(ctx)
52
- logger.debug(
53
- "Starting create commit process",
54
- extra=dict(
55
- extra_log_attributes=args,
56
- ),
57
- )
58
- create_commit_logic(
59
- commit_sha,
60
- parent_sha,
61
- pull_request_number,
62
- branch,
63
- slug,
64
- token,
65
- git_service,
66
- enterprise_url,
67
- fail_on_error,
68
- args,
69
- )
51
+ with sentry_sdk.start_transaction(op="task", name="Create Commit"):
52
+ with sentry_sdk.start_span(name="create_commit"):
53
+ enterprise_url = ctx.obj.get("enterprise_url")
54
+ args = get_cli_args(ctx)
55
+ logger.debug(
56
+ "Starting create commit process",
57
+ extra=dict(
58
+ extra_log_attributes=args,
59
+ ),
60
+ )
61
+ create_commit_logic(
62
+ commit_sha,
63
+ parent_sha,
64
+ pull_request_number,
65
+ branch,
66
+ slug,
67
+ token,
68
+ git_service,
69
+ enterprise_url,
70
+ fail_on_error,
71
+ args,
72
+ )
@@ -1,6 +1,7 @@
1
1
  import logging
2
2
 
3
3
  import click
4
+ import sentry_sdk
4
5
 
5
6
  from codecov_cli.helpers.args import get_cli_args
6
7
  from codecov_cli.helpers.options import global_options
@@ -25,14 +26,16 @@ def create_report_results(
25
26
  token: str,
26
27
  fail_on_error: bool,
27
28
  ):
28
- enterprise_url = ctx.obj.get("enterprise_url")
29
- args = get_cli_args(ctx)
30
- logger.debug(
31
- "Creating report results",
32
- extra=dict(
33
- extra_log_attributes=args,
34
- ),
35
- )
36
- create_report_results_logic(
37
- commit_sha, code, slug, git_service, token, enterprise_url, fail_on_error, args
38
- )
29
+ with sentry_sdk.start_transaction(op="task", name="Create Report Result"):
30
+ with sentry_sdk.start_span(name="create_report_result"):
31
+ enterprise_url = ctx.obj.get("enterprise_url")
32
+ args = get_cli_args(ctx)
33
+ logger.debug(
34
+ "Creating report results",
35
+ extra=dict(
36
+ extra_log_attributes=args,
37
+ ),
38
+ )
39
+ create_report_results_logic(
40
+ commit_sha, code, slug, git_service, token, enterprise_url, fail_on_error, args
41
+ )
@@ -2,6 +2,7 @@ import logging
2
2
  import typing
3
3
 
4
4
  import click
5
+ import sentry_sdk
5
6
 
6
7
  from codecov_cli.fallbacks import CodecovOption, FallbackFieldEnum
7
8
  from codecov_cli.helpers.args import get_cli_args
@@ -26,14 +27,16 @@ def empty_upload(
26
27
  git_service: typing.Optional[str],
27
28
  fail_on_error: typing.Optional[bool],
28
29
  ):
29
- enterprise_url = ctx.obj.get("enterprise_url")
30
- args = get_cli_args(ctx)
31
- logger.debug(
32
- "Starting empty upload process",
33
- extra=dict(
34
- extra_log_attributes=args,
35
- ),
36
- )
37
- return empty_upload_logic(
38
- commit_sha, slug, token, git_service, enterprise_url, fail_on_error, force, args
39
- )
30
+ with sentry_sdk.start_transaction(op="task", name="Empty Upload"):
31
+ with sentry_sdk.start_span(name="empty_upload"):
32
+ enterprise_url = ctx.obj.get("enterprise_url")
33
+ args = get_cli_args(ctx)
34
+ logger.debug(
35
+ "Starting empty upload process",
36
+ extra=dict(
37
+ extra_log_attributes=args,
38
+ ),
39
+ )
40
+ return empty_upload_logic(
41
+ commit_sha, slug, token, git_service, enterprise_url, fail_on_error, force, args
42
+ )
@@ -0,0 +1,52 @@
1
+ import logging
2
+
3
+ import click
4
+ import sentry_sdk
5
+
6
+ from codecov_cli.fallbacks import CodecovOption, FallbackFieldEnum
7
+ from codecov_cli.helpers.args import get_cli_args
8
+ from codecov_cli.helpers.encoder import encode_slug
9
+ from codecov_cli.helpers.git import GitService
10
+ from codecov_cli.helpers.options import global_options
11
+ from codecov_cli.services.report import send_reports_result_get_request
12
+ from codecov_cli.types import CommandContext
13
+
14
+
15
+ logger = logging.getLogger("codecovcli")
16
+
17
+
18
+ @click.command()
19
+ @click.option(
20
+ "--code", help="The code of the report. If unsure, leave default", default="default"
21
+ )
22
+ @global_options
23
+ @click.pass_context
24
+ def get_report_results(
25
+ ctx: CommandContext,
26
+ commit_sha: str,
27
+ code: str,
28
+ slug: str,
29
+ git_service: str,
30
+ token: str,
31
+ fail_on_error: bool,
32
+ ):
33
+ with sentry_sdk.start_transaction(op="task", name="Get Report Results"):
34
+ with sentry_sdk.start_span(name="get_report_results"):
35
+ enterprise_url = ctx.obj.get("enterprise_url")
36
+ args = get_cli_args(ctx)
37
+ logger.debug(
38
+ "Getting report results",
39
+ extra=dict(
40
+ extra_log_attributes=args,
41
+ ),
42
+ )
43
+ encoded_slug = encode_slug(slug)
44
+ send_reports_result_get_request(
45
+ commit_sha=commit_sha,
46
+ report_code=code,
47
+ encoded_slug=encoded_slug,
48
+ service=git_service,
49
+ token=token,
50
+ enterprise_url=enterprise_url,
51
+ fail_on_error=fail_on_error,
52
+ )
@@ -6,6 +6,7 @@ from typing import Dict, List, Optional
6
6
 
7
7
  import click
8
8
  import requests
9
+ import sentry_sdk
9
10
 
10
11
  from codecov_cli.fallbacks import CodecovOption, FallbackFieldEnum
11
12
  from codecov_cli.helpers import request
@@ -89,149 +90,151 @@ def label_analysis(
89
90
  dry_run_format: str,
90
91
  runner_params: List[str],
91
92
  ):
92
- enterprise_url = ctx.obj.get("enterprise_url")
93
- args = get_cli_args(ctx)
94
- logger.debug(
95
- "Starting label analysis",
96
- extra=dict(
97
- extra_log_attributes=args,
98
- ),
99
- )
100
- if head_commit_sha == base_commit_sha:
101
- logger.error(
102
- "Base and head sha can't be the same",
103
- extra=dict(
104
- extra_log_attributes=dict(
105
- head_commit_sha=head_commit_sha,
106
- base_commit_sha=base_commit_sha,
93
+ with sentry_sdk.start_transaction(op="task", name="Label Analysis"):
94
+ with sentry_sdk.start_span(name="labelanalysis"):
95
+ enterprise_url = ctx.obj.get("enterprise_url")
96
+ args = get_cli_args(ctx)
97
+ logger.debug(
98
+ "Starting label analysis",
99
+ extra=dict(
100
+ extra_log_attributes=args,
101
+ ),
102
+ )
103
+ if head_commit_sha == base_commit_sha:
104
+ logger.error(
105
+ "Base and head sha can't be the same",
106
+ extra=dict(
107
+ extra_log_attributes=dict(
108
+ head_commit_sha=head_commit_sha,
109
+ base_commit_sha=base_commit_sha,
110
+ )
111
+ ),
112
+ )
113
+ raise click.ClickException(
114
+ click.style("Unable to run label analysis", fg="red")
107
115
  )
108
- ),
109
- )
110
- raise click.ClickException(
111
- click.style("Unable to run label analysis", fg="red")
112
- )
113
-
114
- codecov_yaml = ctx.obj["codecov_yaml"] or {}
115
- cli_config = codecov_yaml.get("cli", {})
116
- # Raises error if no runner is found
117
- parsed_runner_params = _parse_runner_params(runner_params)
118
- runner = get_runner(cli_config, runner_name, parsed_runner_params)
119
- logger.debug(
120
- f"Selected runner: {runner}",
121
- extra=dict(extra_log_attributes=dict(config=runner.params)),
122
- )
123
116
 
124
- upload_url = enterprise_url or CODECOV_API_URL
125
- url = f"{upload_url}/labels/labels-analysis"
126
- token_header = f"Repotoken {token}"
127
- payload = {
128
- "base_commit": base_commit_sha,
129
- "head_commit": head_commit_sha,
130
- "requested_labels": None,
131
- }
132
- # Send the initial label analysis request without labels
133
- # Because labels might take a long time to collect
134
- eid = _send_labelanalysis_request(payload, url, token_header)
117
+ codecov_yaml = ctx.obj["codecov_yaml"] or {}
118
+ cli_config = codecov_yaml.get("cli", {})
119
+ # Raises error if no runner is found
120
+ parsed_runner_params = _parse_runner_params(runner_params)
121
+ runner = get_runner(cli_config, runner_name, parsed_runner_params)
122
+ logger.debug(
123
+ f"Selected runner: {runner}",
124
+ extra=dict(extra_log_attributes=dict(config=runner.params)),
125
+ )
135
126
 
136
- logger.info("Collecting labels...")
137
- requested_labels = runner.collect_tests()
138
- logger.info(f"Collected {len(requested_labels)} test labels")
139
- logger.debug(
140
- "Labels collected",
141
- extra=dict(extra_log_attributes=dict(labels_collected=requested_labels)),
142
- )
143
- payload["requested_labels"] = requested_labels
127
+ upload_url = enterprise_url or CODECOV_API_URL
128
+ url = f"{upload_url}/labels/labels-analysis"
129
+ token_header = f"Repotoken {token}"
130
+ payload = {
131
+ "base_commit": base_commit_sha,
132
+ "head_commit": head_commit_sha,
133
+ "requested_labels": None,
134
+ }
135
+ # Send the initial label analysis request without labels
136
+ # Because labels might take a long time to collect
137
+ eid = _send_labelanalysis_request(payload, url, token_header)
144
138
 
145
- if eid:
146
- # Initial request with no labels was successful
147
- # Now we PATCH the labels in
148
- patch_url = f"{upload_url}/labels/labels-analysis/{eid}"
149
- _patch_labels(payload, patch_url, token_header)
150
- else:
151
- # Initial request with no labels failed
152
- # Retry it
153
- eid = _send_labelanalysis_request(payload, url, token_header)
154
- if eid is None:
155
- _fallback_to_collected_labels(
156
- requested_labels,
157
- runner,
158
- dry_run=dry_run,
159
- dry_run_format=dry_run_format,
160
- fallback_reason="codecov_unavailable",
139
+ logger.info("Collecting labels...")
140
+ requested_labels = runner.collect_tests()
141
+ logger.info(f"Collected {len(requested_labels)} test labels")
142
+ logger.debug(
143
+ "Labels collected",
144
+ extra=dict(extra_log_attributes=dict(labels_collected=requested_labels)),
161
145
  )
162
- return
146
+ payload["requested_labels"] = requested_labels
163
147
 
164
- has_result = False
165
- logger.info("Waiting for list of tests to run...")
166
- start_wait = time.monotonic()
167
- time.sleep(1)
168
- while not has_result:
169
- resp_data = request.get(
170
- f"{upload_url}/labels/labels-analysis/{eid}",
171
- headers={"Authorization": token_header},
172
- )
173
- resp_json = resp_data.json()
174
- if resp_json["state"] == "finished":
175
- logger.info(
176
- "Received list of tests from Codecov",
177
- extra=dict(
178
- extra_log_attributes=dict(
179
- processing_errors=resp_json.get("errors", [])
180
- )
181
- ),
182
- )
183
- request_result = _potentially_calculate_absent_labels(
184
- resp_json["result"], requested_labels
185
- )
186
- if not dry_run:
187
- runner.process_labelanalysis_result(request_result)
148
+ if eid:
149
+ # Initial request with no labels was successful
150
+ # Now we PATCH the labels in
151
+ patch_url = f"{upload_url}/labels/labels-analysis/{eid}"
152
+ _patch_labels(payload, patch_url, token_header)
188
153
  else:
189
- _dry_run_output(
190
- LabelAnalysisRequestResult(request_result),
191
- runner,
192
- dry_run_format,
193
- # It's possible that the task had processing errors and fallback to all tests
194
- # Even though it's marked as FINISHED (not ERROR) it's not a true success
195
- fallback_reason=(
196
- "test_list_processing_errors"
197
- if resp_json.get("errors", None)
198
- else None
199
- ),
154
+ # Initial request with no labels failed
155
+ # Retry it
156
+ eid = _send_labelanalysis_request(payload, url, token_header)
157
+ if eid is None:
158
+ _fallback_to_collected_labels(
159
+ requested_labels,
160
+ runner,
161
+ dry_run=dry_run,
162
+ dry_run_format=dry_run_format,
163
+ fallback_reason="codecov_unavailable",
164
+ )
165
+ return
166
+
167
+ has_result = False
168
+ logger.info("Waiting for list of tests to run...")
169
+ start_wait = time.monotonic()
170
+ time.sleep(1)
171
+ while not has_result:
172
+ resp_data = request.get(
173
+ f"{upload_url}/labels/labels-analysis/{eid}",
174
+ headers={"Authorization": token_header},
200
175
  )
201
- return
202
- if resp_json["state"] == "error":
203
- logger.error(
204
- "Request had problems calculating",
205
- extra=dict(
206
- extra_log_attributes=dict(
207
- base_commit=resp_json["base_commit"],
208
- head_commit=resp_json["head_commit"],
209
- external_id=resp_json["external_id"],
176
+ resp_json = resp_data.json()
177
+ if resp_json["state"] == "finished":
178
+ logger.info(
179
+ "Received list of tests from Codecov",
180
+ extra=dict(
181
+ extra_log_attributes=dict(
182
+ processing_errors=resp_json.get("errors", [])
183
+ )
184
+ ),
210
185
  )
211
- ),
212
- )
213
- _fallback_to_collected_labels(
214
- collected_labels=requested_labels,
215
- runner=runner,
216
- dry_run=dry_run,
217
- dry_run_format=dry_run_format,
218
- fallback_reason="test_list_processing_failed",
219
- )
220
- return
221
- if max_wait_time and (time.monotonic() - start_wait) > max_wait_time:
222
- logger.error(
223
- f"Exceeded max waiting time of {max_wait_time} seconds. Running all tests.",
224
- )
225
- _fallback_to_collected_labels(
226
- collected_labels=requested_labels,
227
- runner=runner,
228
- dry_run=dry_run,
229
- dry_run_format=dry_run_format,
230
- fallback_reason="max_wait_time_exceeded",
231
- )
232
- return
233
- logger.info("Waiting more time for result...")
234
- time.sleep(5)
186
+ request_result = _potentially_calculate_absent_labels(
187
+ resp_json["result"], requested_labels
188
+ )
189
+ if not dry_run:
190
+ runner.process_labelanalysis_result(request_result)
191
+ else:
192
+ _dry_run_output(
193
+ LabelAnalysisRequestResult(request_result),
194
+ runner,
195
+ dry_run_format,
196
+ # It's possible that the task had processing errors and fallback to all tests
197
+ # Even though it's marked as FINISHED (not ERROR) it's not a true success
198
+ fallback_reason=(
199
+ "test_list_processing_errors"
200
+ if resp_json.get("errors", None)
201
+ else None
202
+ ),
203
+ )
204
+ return
205
+ if resp_json["state"] == "error":
206
+ logger.error(
207
+ "Request had problems calculating",
208
+ extra=dict(
209
+ extra_log_attributes=dict(
210
+ base_commit=resp_json["base_commit"],
211
+ head_commit=resp_json["head_commit"],
212
+ external_id=resp_json["external_id"],
213
+ )
214
+ ),
215
+ )
216
+ _fallback_to_collected_labels(
217
+ collected_labels=requested_labels,
218
+ runner=runner,
219
+ dry_run=dry_run,
220
+ dry_run_format=dry_run_format,
221
+ fallback_reason="test_list_processing_failed",
222
+ )
223
+ return
224
+ if max_wait_time and (time.monotonic() - start_wait) > max_wait_time:
225
+ logger.error(
226
+ f"Exceeded max waiting time of {max_wait_time} seconds. Running all tests.",
227
+ )
228
+ _fallback_to_collected_labels(
229
+ collected_labels=requested_labels,
230
+ runner=runner,
231
+ dry_run=dry_run,
232
+ dry_run_format=dry_run_format,
233
+ fallback_reason="max_wait_time_exceeded",
234
+ )
235
+ return
236
+ logger.info("Waiting more time for result...")
237
+ time.sleep(5)
235
238
 
236
239
 
237
240
  def _parse_runner_params(runner_params: List[str]) -> Dict[str, str]:
@@ -6,6 +6,7 @@ from dataclasses import dataclass
6
6
  from typing import Any, Dict, List, Optional
7
7
 
8
8
  import click
9
+ import sentry_sdk
9
10
  from test_results_parser import (
10
11
  Outcome,
11
12
  ParserError,
@@ -99,29 +100,31 @@ def process_test_results(
99
100
  disable_search=None,
100
101
  github_token=None,
101
102
  ):
102
- file_finder = select_file_finder(
103
- dir, exclude_folders, files, disable_search, report_type="test_results"
104
- )
103
+ with sentry_sdk.start_transaction(op="task", name="Process Test Results"):
104
+ with sentry_sdk.start_span(name="process_test_results"):
105
+ file_finder = select_file_finder(
106
+ dir, exclude_folders, files, disable_search, report_type="test_results"
107
+ )
105
108
 
106
- upload_collection_results: List[UploadCollectionResultFile] = (
107
- file_finder.find_files()
108
- )
109
- if len(upload_collection_results) == 0:
110
- raise click.ClickException(
111
- "No JUnit XML files were found. Make sure to specify them using the --file option."
112
- )
109
+ upload_collection_results: List[UploadCollectionResultFile] = (
110
+ file_finder.find_files()
111
+ )
112
+ if len(upload_collection_results) == 0:
113
+ raise click.ClickException(
114
+ "No JUnit XML files were found. Make sure to specify them using the --file option."
115
+ )
113
116
 
114
- payload: TestResultsNotificationPayload = generate_message_payload(
115
- upload_collection_results
116
- )
117
+ payload: TestResultsNotificationPayload = generate_message_payload(
118
+ upload_collection_results
119
+ )
117
120
 
118
- message: str = f"{build_message(payload)} {CODECOV_SEARCH_MARKER}"
121
+ message: str = f"{build_message(payload)} {CODECOV_SEARCH_MARKER}"
119
122
 
120
- args: Dict[str, str] = get_cli_args(ctx)
123
+ args: Dict[str, str] = get_cli_args(ctx)
121
124
 
122
- maybe_write_to_github_action(message, github_token, args)
125
+ maybe_write_to_github_action(message, github_token, args)
123
126
 
124
- click.echo(message)
127
+ click.echo(message)
125
128
 
126
129
 
127
130
  def maybe_write_to_github_action(
@@ -1,6 +1,7 @@
1
1
  import logging
2
2
 
3
3
  import click
4
+ import sentry_sdk
4
5
 
5
6
  from codecov_cli.fallbacks import CodecovOption, FallbackFieldEnum
6
7
  from codecov_cli.helpers.args import get_cli_args
@@ -36,27 +37,29 @@ def create_report(
36
37
  fail_on_error: bool,
37
38
  pull_request_number: int,
38
39
  ):
39
- enterprise_url = ctx.obj.get("enterprise_url")
40
- args = get_cli_args(ctx)
41
- logger.debug(
42
- "Starting create report process",
43
- extra=dict(
44
- extra_log_attributes=args,
45
- ),
46
- )
47
- res = create_report_logic(
48
- commit_sha,
49
- code,
50
- slug,
51
- git_service,
52
- token,
53
- enterprise_url,
54
- pull_request_number,
55
- fail_on_error,
56
- args,
57
- )
58
- if not res.error:
59
- logger.info(
60
- "Finished creating report successfully",
61
- extra=dict(extra_log_attributes=dict(response=res.text)),
62
- )
40
+ with sentry_sdk.start_transaction(op="task", name="Create Report"):
41
+ with sentry_sdk.start_span(name="create_report"):
42
+ enterprise_url = ctx.obj.get("enterprise_url")
43
+ args = get_cli_args(ctx)
44
+ logger.debug(
45
+ "Starting create report process",
46
+ extra=dict(
47
+ extra_log_attributes=args,
48
+ ),
49
+ )
50
+ res = create_report_logic(
51
+ commit_sha,
52
+ code,
53
+ slug,
54
+ git_service,
55
+ token,
56
+ enterprise_url,
57
+ pull_request_number,
58
+ fail_on_error,
59
+ args,
60
+ )
61
+ if not res.error:
62
+ logger.info(
63
+ "Finished creating report successfully",
64
+ extra=dict(extra_log_attributes=dict(response=res.text)),
65
+ )