Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "languages/treesitterpython"]
path = languages/treesitterpython
path = codecov-cli/languages/treesitterpython
url = git@github.com:tree-sitter/tree-sitter-python.git
[submodule "languages/treesitterjavascript"]
path = languages/treesitterjavascript
path = codecov-cli/languages/treesitterjavascript
url = git@github.com:tree-sitter/tree-sitter-javascript.git
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added prevent-cli/README.md
Empty file.
41 changes: 41 additions & 0 deletions prevent-cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[project]
name = "prevent-cli"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
authors = [
{ name = "joseph-sentry", email = "joseph.sawaya@sentry.io" }
]
requires-python = ">=3.12"
dependencies = [
"click==8.*",
"codecov-cli>=10.3.0",
"httpx==0.27.*",
"ijson==3.*",
"pyyaml==6.*",
"regex",
"responses==0.21.*",
"sentry-sdk>=2.20.0",
"test-results-parser==0.5.4",
"tree-sitter==0.20.*",
"wrapt>=1.17.2",
]



[project.scripts]
prevent = "prevent_cli.main:run"
preventcli = "prevent_cli.main:run"

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
package-dir = {"" = "src"}
packages = ["prevent_cli"]

[tool.uv.sources]
codecov-cli = {path = "../codecov-cli"}


Empty file.
83 changes: 83 additions & 0 deletions prevent-cli/src/prevent_cli/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import logging
import pathlib
import typing

import click

from codecov_cli import __version__
from codecov_cli.opentelemetry import init_telem
from codecov_cli.commands.base_picking import pr_base_picking
from codecov_cli.commands.commit import create_commit
from codecov_cli.commands.create_report_result import create_report_results
from codecov_cli.commands.empty_upload import empty_upload
from codecov_cli.commands.get_report_results import get_report_results
from codecov_cli.commands.process_test_results import process_test_results
from codecov_cli.commands.report import create_report
from codecov_cli.commands.send_notifications import send_notifications
from codecov_cli.commands.upload import do_upload
from codecov_cli.commands.upload_coverage import upload_coverage
from codecov_cli.commands.upload_process import upload_process
from codecov_cli.helpers.ci_adapters import get_ci_adapter, get_ci_providers_list
from codecov_cli.helpers.config import load_cli_config
from codecov_cli.helpers.logging_utils import configure_logger
from codecov_cli.helpers.versioning_systems import get_versioning_system

logger = logging.getLogger("codecovcli")


@click.group()
@click.option(
"--auto-load-params-from",
type=click.Choice(
[provider.get_service_name() for provider in get_ci_providers_list()],
case_sensitive=False,
),
)
@click.option(
"--enterprise-url", "--url", "-u", help="Change the upload host (Enterprise use)"
)
@click.option("-v", "--verbose", "verbose", help="Use verbose logging", is_flag=True)
@click.option(
"--disable-telem", help="Disable sending telemetry data to Codecov", is_flag=True
)
@click.pass_context
@click.version_option(__version__, prog_name="codecovcli")
def cli(
ctx: click.Context,
auto_load_params_from: typing.Optional[str],
codecov_yml_path: pathlib.Path,
enterprise_url: str,
verbose: bool = False,
disable_telem: bool = False,
):
ctx.obj["cli_args"] = ctx.params
ctx.obj["cli_args"]["version"] = f"cli-{__version__}"
configure_logger(logger, log_level=(logging.DEBUG if verbose else logging.INFO))
ctx.help_option_names = ["-h", "--help"]
ctx.obj["ci_adapter"] = get_ci_adapter(auto_load_params_from)
ctx.obj["versioning_system"] = get_versioning_system()
ctx.obj["enterprise_url"] = enterprise_url
ctx.obj["disable_telem"] = disable_telem

init_telem(ctx.obj)


cli.add_command(do_upload)
cli.add_command(create_commit)
cli.add_command(create_report)
cli.add_command(create_report_results)
cli.add_command(get_report_results)
cli.add_command(pr_base_picking)
cli.add_command(empty_upload)
cli.add_command(upload_coverage)
cli.add_command(upload_process)
cli.add_command(send_notifications)
cli.add_command(process_test_results)


def run():
cli(obj={})


if __name__ == "__main__":
run()
436 changes: 436 additions & 0 deletions prevent-cli/uv.lock

Large diffs are not rendered by default.

Loading