Skip to content

types

EnvVars

Bases: BaseModel

Class to store the values of the environment variables.

Attributes:

Name Type Description
ci_env bool

...

github_token str

...

server_url str

...

run_id str

...

run_number str

...

run_url str

...

git_branch str

...

git_sha str

...

triggered_by str

...

triggered_by_email str

...

triggered_by_user str

...

Source code in m/log/ci_tools/types.py
class EnvVars(BaseModel):
    """Class to store the values of the environment variables."""

    # pylint: disable=too-many-instance-attributes
    ci_env: bool = False
    github_token: str = ''
    server_url: str = ''
    run_id: str = ''
    run_number: str = ''
    run_url: str = ''
    git_branch: str = ''
    git_sha: str = ''
    triggered_by: str = ''
    triggered_by_email: str = ''
    triggered_by_user: str = ''

Message

Bases: BaseModel

Parameters needed to deliver a warning or error message.

Attributes:

Name Type Description
msg str

message to display

title str | None

custom title

file str | None

filename

line str | None

line number, starting at 1

end_line str | None

end line number

col str | None

column number, starting at 1

end_col str | None

end column number

Source code in m/log/ci_tools/types.py
class Message(BaseModel):
    """Parameters needed to deliver a warning or error message."""

    msg: str = Field(description='message to display')
    title: str | None = Field(default=None, description='custom title')
    file: str | None = Field(  # noqa: WPS110 - required by Github
        default=None,
        description='filename',
    )
    line: str | None = Field(
        default=None,
        description='line number, starting at 1',
    )
    end_line: str | None = Field(default=None, description='end line number')
    col: str | None = Field(
        default=None,
        description='column number, starting at 1',
    )
    end_col: str | None = Field(default=None, description='end column number')

    model_config = ConfigDict(arbitrary_types_allowed=True)

ProviderModule dataclass

Container to store functions from the providers.

Source code in m/log/ci_tools/types.py
@dataclass
class ProviderModule:
    """Container to store functions from the providers."""

    ci: bool
    env_vars: Callable[[], OneOf[Issue, EnvVars]]
    formatter: Callable[
        [logging.Formatter, logging.LogRecord, bool, bool],
        str,
    ]