fix: read Gitea repo-variable data field; fail closed on unknown nightly status
CI / validate (pull_request) Failing after 1m4s
CI / auto-merge (pull_request) Skipped

get_repo_variable read the value field, but Gitea returns the payload in
data — every read returned None, so the nightly gate always treated real
status as bootstrap-allow (run 5800 recorded passed while integration
tests failed). Unknown non-empty statuses also allowed deploys; they now
block (fail closed).

Also backfills correct bg/de/pl/ru/zh translations across the catalog and
removes stray nested keys polluting every entry.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Emil Simeonov
2026-09-17 11:33:57 +02:00
co-authored by Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent e0ae1cc378
commit b5138ec65b
6 changed files with 1921 additions and 2849 deletions
+6
View File
@@ -923,6 +923,12 @@ class TestGiteaClientActions:
)
def test_get_repo_variable_returns_value(self) -> None:
client = GiteaClient("https://git.example.com", "tok", "owner", "repo")
client._session.request = MagicMock(return_value=_mock_response({"data": "v0.28.1"}))
result = client.get_repo_variable("PRODUCTION_DEPLOY_TAG")
assert result == "v0.28.1"
def test_get_repo_variable_falls_back_to_value(self) -> None:
client = GiteaClient("https://git.example.com", "tok", "owner", "repo")
client._session.request = MagicMock(return_value=_mock_response({"value": "v0.28.1"}))
result = client.get_repo_variable("PRODUCTION_DEPLOY_TAG")
+11
View File
@@ -71,6 +71,17 @@ class TestCli:
assert result.exit_code != 0
assert "blocked" in result.output.lower()
@patch("devx.ci.nightly_gate.GiteaClient")
@patch("devx.ci.nightly_gate.get_ci_token")
def test_check_unknown_status_blocks_deploy(self, mock_token: MagicMock, mock_client_cls: MagicMock) -> None:
mock_token.return_value = "fake-token"
mock_client = mock_client_cls.return_value
mock_client.get_repo_variable.return_value = "garbage-value"
runner = CliRunner()
result = runner.invoke(cli, ["--repo", "oblachno/infra", "--action", "check"])
assert result.exit_code != 0
assert "fail closed" in result.output.lower()
@patch("devx.ci.nightly_gate.GiteaClient")
@patch("devx.ci.nightly_gate.get_ci_token")
def test_set_passed(self, mock_token: MagicMock, mock_client_cls: MagicMock) -> None: