From 6ebb48f9e89208c04aef4a12be47f11c51122104 Mon Sep 17 00:00:00 2001 From: emil Date: Mon, 22 Jun 2026 16:08:27 +0000 Subject: [PATCH] DEVX-1: fix: fix post-merge job failures (configure-repo, badges, notify-failure) --- .gitea/workflows/post-merge.yml | 2 +- src/devx/ci/push_badges.py | 4 ++-- src/devx/gitea_cli.py | 2 +- tests/unit/test_release.py | 10 ++++++++++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/post-merge.yml b/.gitea/workflows/post-merge.yml index 4d61351..389948c 100644 --- a/.gitea/workflows/post-merge.yml +++ b/.gitea/workflows/post-merge.yml @@ -219,7 +219,7 @@ jobs: env: REPO_TOKEN: ${{ secrets.REPO_TOKEN }} PYTHONPATH: src - run: python3 -m devx.tools.configure_repo + run: python3 -m devx.tools.configure_repo --repo devx --owner oblachno-oss - name: Notify on failure if: failure() env: diff --git a/src/devx/ci/push_badges.py b/src/devx/ci/push_badges.py index 8bdefb7..0e56819 100644 --- a/src/devx/ci/push_badges.py +++ b/src/devx/ci/push_badges.py @@ -60,8 +60,8 @@ def fetch_latest_master(branch: str = "master") -> None: def generate_badges(output_dir: str) -> None: - """Generate badge SVG files using generate_badges.py.""" - _run([sys.executable, "scripts/generate_badges.py", "--output-dir", output_dir]) + """Generate badge SVG files using devx.tools.generate_badges.""" + _run([sys.executable, "-m", "devx.tools.generate_badges", "--output-dir", output_dir]) badges = list(Path(output_dir).glob("*.svg")) if not badges: raise click.ClickException("No badge SVG files generated") diff --git a/src/devx/gitea_cli.py b/src/devx/gitea_cli.py index 974e445..ddab09c 100644 --- a/src/devx/gitea_cli.py +++ b/src/devx/gitea_cli.py @@ -125,7 +125,7 @@ class TeaCLI: Returns: The created issue as a dict (parsed from tea JSON output). """ - args = ["issues", "create", "--title", title, "--body", body, *self._repo_arg(repo)] + args = ["issues", "create", "--title", title, "--description", body, *self._repo_arg(repo)] output = self._run(args, json_output=False) # tea issues create doesn't output JSON; extract issue number from output # Format: "Created issue #42: " diff --git a/tests/unit/test_release.py b/tests/unit/test_release.py index 906708b..4debdeb 100644 --- a/tests/unit/test_release.py +++ b/tests/unit/test_release.py @@ -283,6 +283,16 @@ class TestRunTests: with pytest.raises(click.ClickException, match="Tests failed"): run_tests() + @patch("devx.ci.release.run_cmd") + def test_tests_fail_stdout_fallback(self, mock_run_cmd: MagicMock) -> None: + """When stderr is empty, test output from stdout is used in the error message.""" + mock_run_cmd.side_effect = [ + MagicMock(returncode=0, stdout="", stderr=""), # lint passes + MagicMock(returncode=1, stdout="test failure on stdout", stderr=""), # tests fail, stderr empty + ] + with pytest.raises(click.ClickException, match="test failure on stdout"): + run_tests() + class TestMain: @patch.dict("os.environ", {})