We have a number of "in_container" scripts written in Bash, They are doing a number of houseekeeping stuff but since we already have Python 3.7+ inside the CI image, we could modularise them more and make them run from external and simplify entrypoint_ci (for example separate script for tests).
if github_actions:
        console.print(f"::group::{group_name[:200]}[/]", markup=False)
    console.print(group_name, markup=False)
    try:
        yield
    finally:
        if github_actions:
            console.print("::endgroup::")
def run_command(cmd, github_actions: bool, **kwargs) -> subprocess.CompletedProcess:
    with ci_group(
        f"Running command: {' '.join([shlex.quote(arg) for arg in cmd])}", github_actions=github_actions
    ):
        result = subprocess.run(cmd, **kwargs)
    if result.returncode != 0 and github_actions:
        console.print(f"[red]Command failed: {' '.join([shlex.quote(entry) for entry in cmd])}[/]")
        console.print("[red]Please unfold the above group and to investigate the issue[/]")
    return result
def get_provider_name(package_name: str) -> str:
    return ".".join(package_name.split("-")[0].replace("apache_airflow_providers_", "").split("_"))
def get_airflow_version_from_package(package_name: str) -> str:
    return ".".join(Path(package_name).name.split("-")[1].split(".")[0:3])
def find_airflow_package(extension: str) -> str | None: