Commit 3352dea9 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

fix: turn single job template inheritance rule into warning (for make)

parent 94fdb1d8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -498,7 +498,7 @@ def _check_inheritance(tpl_body: dict[str, Any]) -> int:
        if is_single_job_tpl and base_job is not None:
            job_err_count += 1
            print(
                f"  {AnsiColors.RED} single job template: job '{name}' inherits another job{AnsiColors.RESET}"
                f"  {AnsiColors.YELLOW} single job template: job '{name}' inherits another job{AnsiColors.RESET}"
            )
        if not is_single_job_tpl and not name.startswith(".") and base_job is None:
            job_err_count += 1
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ def test_check_inheritance_single_job_with_inheritance(capfd: pytest.CaptureFixt
    res = checker._check_inheritance(tpl_body=tpl_body)
    out, err = capfd.readouterr()
    assert out == (
        "  \x1b[0;31m✕ single job template: job 'prefix-job1' inherits another job\x1b[0m\n"
        "  \x1b[0;33m⚠ single job template: job 'prefix-job1' inherits another job\x1b[0m\n"
        "  \x1b[0;33m⚠ job 'prefix-job1' inherits from '.base-job' which is not defined in current template\x1b[0m\n"
    )