Skip to content

fix(autotranslate): surface translation service errors - #22368

Merged
nijel merged 1 commit into
mainfrom
auto-errors
Oct 25, 2026
Merged

nijel merged 1 commit into
mainfrom
auto-errors

Conversation

@nijel

@nijel nijel commented Oct 25, 2026

Copy link
Copy Markdown
Member

Collect provider failures in task and API results and display them in the UI while preserving successful translations and diagnostic permissions. Keep persisted activity summaries independent of the user language.

Fixes #20996

@nijel nijel added this to the 2026.11 milestone Oct 25, 2026
@nijel nijel self-assigned this Oct 25, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T18:00:12.667854Z e6cfec4 New commits
🔒 Security Review ✅ Completed 2026-10-25T13:17:24.946337Z 9fe79d7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread weblate/api/views.py Fixed
@codecov

codecov Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
13228 1 13227 987
View the top 1 failed test(s) by shortest run time
weblate.automation.test_automation.AutomationTest::test_batch_preserves_failure_after_successful_translation
Stack Traces | 0.137s run time
self = <weblate.automation.test_automation.AutomationTest testMethod=test_batch_preserves_failure_after_successful_translation>

    def test_batch_preserves_failure_after_successful_translation(self) -> None:
        auto = BatchAutoTranslate(
            self.component,
            user=None,
            q="state:<translated",
            mode="translate",
            enforce_permissions=False,
        )
        auto.translations = [self.get_translation()] * 2
        with patch(
            "weblate.trans.autotranslate.AutoTranslate.process_mt",
            side_effect=[MachineTranslationError("Service unavailable"), None],
        ) as process:
            message = auto.perform(
                auto_source="mt", engines=[], threshold=80, source_component_ids=None
            )
        self.assertEqual(process.call_count, 2)
>       self.assertEqual(message, "Automatic translation failed: Service unavailable")
E       AssertionError: 'Automatic translation completed with errors, no strings were updated.' != 'Automatic translation failed: Service unavailable'
E       - Automatic translation completed with errors, no strings were updated.
E       + Automatic translation failed: Service unavailable

weblate/automation/test_automation.py:1249: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@nijel
nijel force-pushed the auto-errors branch 2 times, most recently from cc7bf6b to 975d88a Compare October 25, 2026 17:58
Collect provider failures in task and API results and display them in the UI while preserving successful translations and diagnostic permissions. Keep persisted activity summaries independent of the user language.

Fixes #20996
@nijel
nijel enabled auto-merge (rebase) October 25, 2026 18:02
@nijel
nijel merged commit ab697a6 into main Oct 25, 2026
43 of 45 checks passed
@nijel
nijel deleted the auto-errors branch October 25, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

autotranslate reports machinery failures as success, with no way to distinguish "nothing to do" from "engine errored"

2 participants