Skip to content

Fix Fail-Slow / exit-code masking#59

Merged
wpak-ai merged 6 commits into
cppalliance:masterfrom
whisper67265:fix/exit-code-propagation
Jul 16, 2026
Merged

Fix Fail-Slow / exit-code masking#59
wpak-ai merged 6 commits into
cppalliance:masterfrom
whisper67265:fix/exit-code-propagation

Conversation

@whisper67265

@whisper67265 whisper67265 commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Close #56.

Summary by CodeRabbit

  • Bug Fixes
    • Fail fast on repository cloning errors with consistent exit status.
    • Stop translation synchronization/finalization immediately when a translation submodule update fails.
    • Make workflow exit-code precedence deterministic, with Weblate able to override non-zero results.
  • New Features
    • Added a shared local repository_dispatch wrapper used by trigger scripts.
    • Centralized Git bot identity configuration for tagging/pushing.
  • Documentation
    • Updated architecture, endpoint contract, and getting-started/README/changelog to reflect shared dispatch logic and revised exit-code behavior.
  • Refactor
    • Consolidated dispatch orchestration and submodule summary setup; improved submodule/push remote configuration and Boost fetch parameterization; streamlined translation payload triggering.
  • Tests
    • Expanded Bats coverage for clone failures, translation failure handling, and expanded Weblate exit-code precedence.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change centralizes repository-dispatch handling, strengthens translation failure propagation, adds Weblate-aware exit-code composition, consolidates lint binary caching, updates Git configuration, and refreshes related documentation and tests.

Changes

Dispatch and workflow orchestration

Layer / File(s) Summary
Shared repository dispatch flow
scripts/trigger-*.sh, scripts/trigger-dispatch-common.sh
Repository resolution, token handling, JSON construction, curl validation, and dispatch posting are shared by both trigger scripts.
Translation failure and exit-code composition
.github/workflows/assets/lib.sh, .github/workflows/assets/submodule_ops.sh, .github/workflows/assets/translation.sh, .github/workflows/start-translation.yml, .github/workflows/sync-translation.yml, tests/*
Fatal submodule failures stop processing, Weblate status participates in centralized exit-code selection, and related Bats coverage is added.
Repository and bot configuration
.github/workflows/assets/add_submodules.sh, .github/workflows/assets/submodule_ops.sh, .github/workflows/assets/create-tag.yml, .github/workflows/sync-translation.yml
Repository pushes reset and track the target origin, Boost lookups use the configured organization, and workflows use shared bot identity configuration.

Tooling and documentation

Layer / File(s) Summary
Cached lint binaries
scripts/lint.sh
ShellCheck and actionlint installation share cache, checksum, download, and archive-extraction logic.
Documentation and release descriptions
README.md, docs/*, CHANGELOG.md, .github/workflows/assets/README.md, scripts/install-git-hooks.sh
Documentation reflects shared dispatch wiring, repository settings, exit-code behavior, bot identity, command syntax, and hook output.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related PRs

Suggested reviewers: henry0816191, wpak-ai

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR also includes unrelated dispatch-script, documentation, linting, and tag-creation refactors beyond issue #56. Move the unrelated script, doc, and tooling refactors into a separate PR focused on exit-code propagation.
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing fail-slow behavior and exit-code masking.
Linked Issues check ✅ Passed The PR implements the requested clone, submodule, Weblate, and start-local exit-code handling changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
tests/test_submodule_ops.bats (1)

128-157: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add coverage for fatal finalization status 2.

The changed submodule path can provide finalize_rc=2, but these tests use 3 and never define whether status 2 should be collapsed or propagated. Add an explicit combine_batch_and_finalize_rc 2 0 assertion matching the documented contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_submodule_ops.bats` around lines 128 - 157, Add a test for
combine_batch_and_finalize_rc with submodule_fatal set to 2, finalize_rc set to
2, and weblate_rc set to 0; assert the returned status matches the documented
contract for fatal finalization status 2.
tests/test_lib.bats (1)

200-212: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Pin the fatal return contract in both tests.

Both tests currently accept any non-zero status, so they would miss regressions that return a different code.

  • tests/test_lib.bats#L200-L212: assert clone_repo returns exactly 2.
  • tests/test_translations_submodule.bats#L103-L127: assert exactly 2 and verify later submodules are not processed after the first fatal update.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_lib.bats` around lines 200 - 212, Update the failure assertion in
tests/test_lib.bats lines 200-212 to require clone_repo returns exactly status
2. In tests/test_translations_submodule.bats lines 103-127, assert the fatal
update returns exactly 2 and verify that subsequent submodules are not processed
after the first fatal update.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/ARCHITECTURE.md`:
- Around line 207-220: Update the start-local entry in the “Workflow job exit”
table to use the actual finalization variable, rc, in the
combine_batch_and_finalize_rc invocation. Keep the documented weblate_rc
argument and the existing description of the three-source collapse logic
unchanged.

---

Nitpick comments:
In `@tests/test_lib.bats`:
- Around line 200-212: Update the failure assertion in tests/test_lib.bats lines
200-212 to require clone_repo returns exactly status 2. In
tests/test_translations_submodule.bats lines 103-127, assert the fatal update
returns exactly 2 and verify that subsequent submodules are not processed after
the first fatal update.

In `@tests/test_submodule_ops.bats`:
- Around line 128-157: Add a test for combine_batch_and_finalize_rc with
submodule_fatal set to 2, finalize_rc set to 2, and weblate_rc set to 0; assert
the returned status matches the documented contract for fatal finalization
status 2.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e659084a-c016-478f-b46e-844bd8cfdaa3

📥 Commits

Reviewing files that changed from the base of the PR and between db330b6 and ddefedf.

📒 Files selected for processing (7)
  • .github/workflows/assets/lib.sh
  • .github/workflows/assets/submodule_ops.sh
  • .github/workflows/start-translation.yml
  • docs/ARCHITECTURE.md
  • tests/test_lib.bats
  • tests/test_submodule_ops.bats
  • tests/test_translations_submodule.bats

Comment thread docs/ARCHITECTURE.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/ARCHITECTURE.md`:
- Around line 168-177: Update the architecture diagram’s finalization flow
around FTL and CB so finalization status routes directly into the combiner,
independently of the Weblate path. Preserve the existing FTL-to-TW-to-CB flow
for successful finalization while showing that CB can also receive FTL outcomes
when Weblate is skipped after failure.

In `@scripts/lint.sh`:
- Around line 35-53: Update the extraction flow guarded by the extract_dir check
to validate that the expected inner binary exists, rather than treating any
existing directory as complete. Ensure failed gzip and xz extractions remove the
partial extract_dir before exiting, so subsequent invocations reverify and retry
extraction; keep the final copy in place only after successful validation.

In `@scripts/trigger-dispatch-common.sh`:
- Around line 31-39: Update the repository resolution flow around
infer_repo_from_git so it attempts git-origin inference before checking
DEFAULT_REPO. Preserve the existing GITHUB_REPOSITORY override first, and retain
DEFAULT_REPO only as the fallback when inference produces no repository.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a6c9ed22-1825-4ad0-8b4d-ebf5979b40fe

📥 Commits

Reviewing files that changed from the base of the PR and between 823e4c1 and 4d53612.

📒 Files selected for processing (19)
  • .github/workflows/assets/README.md
  • .github/workflows/assets/add_submodules.sh
  • .github/workflows/assets/create-tag.yml
  • .github/workflows/assets/lib.sh
  • .github/workflows/assets/submodule_ops.sh
  • .github/workflows/assets/translation.sh
  • .github/workflows/start-translation.yml
  • .github/workflows/sync-translation.yml
  • CHANGELOG.md
  • README.md
  • docs/ARCHITECTURE.md
  • docs/GETTING-STARTED.md
  • docs/endpoint-contract.md
  • scripts/install-git-hooks.sh
  • scripts/lint.sh
  • scripts/trigger-add-submodules.sh
  • scripts/trigger-dispatch-common.sh
  • scripts/trigger-start-translation.sh
  • tests/helpers/common.bash
💤 Files with no reviewable changes (3)
  • .github/workflows/assets/add_submodules.sh
  • .github/workflows/assets/translation.sh
  • .github/workflows/assets/lib.sh

Comment thread docs/ARCHITECTURE.md
Comment thread scripts/lint.sh Outdated
Comment thread scripts/trigger-dispatch-common.sh Outdated
@whisper67265

Copy link
Copy Markdown
Collaborator Author

@coderabbitai, review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

@whisper67265, I’ll review the changes.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@henry0816191 henry0816191 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In CHANGELOG.md, add a ### Fixed (or ### Changed) bullet under [Unreleased] summarizing fail-fast clone/finalize and the three-source exit-code combiner.

@whisper67265
whisper67265 requested a review from wpak-ai July 16, 2026 19:02
@wpak-ai
wpak-ai merged commit 19cf076 into cppalliance:master Jul 16, 2026
4 checks passed
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.

Fix Fail-Slow / exit-code masking

3 participants