Skip to content
Open
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
6 changes: 5 additions & 1 deletion codecov_cli/helpers/encoder.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import re

import click

slug_without_subgroups_regex = re.compile(r"[^/\s]+\/[^/\s]+$")
slug_with_subgroups_regex = re.compile(r"[^/\s]+(\/[^/\s]+)+$")
encoded_slug_regex = re.compile(r"[^:\s]+(:::[^:\s]+)*(::::[^:\s]+){1}$")


def encode_slug(slug: str):
if slug_with_subgroups_is_invalid(slug):
raise ValueError("The provided slug is invalid")
raise click.ClickException(
"The provided slug is invalid. Slug must be in the format <owner>/<repo>"
)
owner, repo = slug.rsplit("/", 1)
encoded_owner = ":::".join(owner.split("/"))
encoded_slug = "::::".join([encoded_owner, repo])
Expand Down
1 change: 1 addition & 0 deletions codecov_cli/opentelemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
_SAMPLED_MESSAGES = [
"Token required",
"No JUnit XML reports found",
"The provided slug is invalid",
]
_SAMPLE_RATE = 100
_SKIP_TAG_KEYS = {"branch", "flags", "commit_sha", "env_vars"}
Expand Down
Loading