Test harness.#21
Conversation
|
Warning Review limit reached
More reviews will be available in 58 minutes and 26 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughInline translation workflow helpers are extracted from ChangesTranslation Logic Extraction + Dev Toolchain + Tests
Sequence Diagram(s)sequenceDiagram
participant Workflow as start-translation.yml
participant TranslationSh as translation.sh
participant LibSh as lib.sh
participant GH as gh CLI
Workflow->>TranslationSh: source translation.sh
Workflow->>TranslationSh: process_one_submodule(sub_name)
TranslationSh->>GH: gh repo view (verify mirror exists)
GH-->>TranslationSh: exit 0 / 1
TranslationSh->>GH: gh api libraries.json (get doc_paths)
GH-->>TranslationSh: JSON payload
TranslationSh->>TranslationSh: sync_repo_master(dest_repo, sub_clone)
loop each lang_code
TranslationSh->>TranslationSh: process_local_branch(dest_repo, sub_name, lang_code)
TranslationSh->>LibSh: has_open_translation_pr(org, repo, lang_code)
LibSh->>GH: gh pr list --base local-{lang_code}
GH-->>LibSh: JSON pr list
LibSh-->>TranslationSh: 0 (open PR) / 1 (none) / 2 (API failure)
alt open PR exists
TranslationSh-->>Workflow: skip lang_code
else branch exists
TranslationSh->>TranslationSh: update_local_merge_from_master
else branch missing
TranslationSh->>TranslationSh: ensure_local_branch_in_repo
end
end
TranslationSh-->>Workflow: add_or_update[lang_code] populated
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai, full review. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== PR Details ==="
gh pr view 21 --repo cppalliance/boost-docs-translation --json title,body,baseRefName,headRefName,files,labels,state
echo ""
echo "=== PR Diff ==="
gh pr diff 21 --repo cppalliance/boost-docs-translationLength of output: 40127
Review SummaryThis PR cleanly extracts the inline functions from 🔴 Security —
|
|
@coderabbitai, please check all your reviews have been resolved |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== My (coderabbitai) review comments on PR `#21` ==="
gh api repos/cppalliance/boost-docs-translation/pulls/21/comments \
--jq '.[] | select(.user.login == "coderabbitai[bot]") | {id: .id, path: .path, line: .line, body: (.body | .[0:200]), created_at: .created_at}'
echo ""
echo "=== PR Review threads (resolved status) ==="
gh api graphql -f query='
{
repository(owner: "cppalliance", name: "boost-docs-translation") {
pullRequest(number: 21) {
reviewThreads(first: 50) {
nodes {
isResolved
isOutdated
comments(first: 1) {
nodes {
author { login }
body
createdAt
}
}
}
}
}
}
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.comments.nodes[0].author.login == "coderabbitai[bot]") | {isResolved: .isResolved, isOutdated: .isOutdated, body: (.comments.nodes[0].body | .[0:300])}'
echo ""
echo "=== Current scripts/lint.sh content ==="
gh api repos/cppalliance/boost-docs-translation/contents/scripts/lint.sh \
--jq '.content' | base64 -d
echo ""
echo "=== Current translation.sh content ==="
gh api repos/cppalliance/boost-docs-translation/contents/translation.sh \
--jq '.content' | base64 -d 2>/dev/null || echo "FILE NOT FOUND AT ROOT"
echo ""
echo "=== Current .gitignore content ==="
gh api repos/cppalliance/boost-docs-translation/contents/.gitignore \
--jq '.content' | base64 -dLength of output: 1928 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== PR Files ==="
gh pr view 21 --repo cppalliance/boost-docs-translation --json files --jq '.files[].path'
echo ""
echo "=== Current PR Diff (key files) ==="
gh pr diff 21 --repo cppalliance/boost-docs-translationLength of output: 40339
All review comments have been addressed. The PR looks good to go! 🐇 |
|
@coderabbitai, Is henry0816191's review valid? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Formal PR Reviews on `#21` ==="
gh api repos/cppalliance/boost-docs-translation/pulls/21/reviews \
--jq '.[] | {id: .id, user: .user.login, state: .state, submitted_at: .submitted_at, body: (.body | .[0:500])}'Length of output: 437
All five were addressed and confirmed resolved. The PR is in good shape. 🐇 |
|
Tip For best results, initiate chat on the files or code changes.
All 5 issues raised in that review were real and actionable, and all 5 have since been resolved in the PR:
The PR is in good shape and ready to merge. 🐇 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.github/workflows/lint.yml (1)
29-33: Remove distro bats to enforce pinned version in CI.The apt-get install of bats allows
command -v batsinscripts/test.shto succeed, bypassing the pinnedv1.11.1version that the script downloads as fallback. This creates CI version drift. Remove the install step to ensure the workflow always uses the pinned version.Suggested change
- - name: Install bats - run: sudo apt-get update && sudo apt-get install -y bats - - name: Run tests run: make test🤖 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 @.github/workflows/lint.yml around lines 29 - 33, Remove the "Install bats" step that runs "sudo apt-get update && sudo apt-get install -y bats" from the workflow. This step allows the system-installed bats to be found, which bypasses the pinned v1.11.1 version that scripts/test.sh downloads as a fallback. Removing this step will ensure the workflow consistently uses the pinned version instead of creating CI version drift from different distro versions.
🤖 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 `@scripts/test.sh`:
- Around line 14-31: The git clone command in the bats-core download section
uses a mutable tag reference (v1.11.1) which can be retargeted, creating a
supply-chain security risk. Replace the tag-based approach by pinning to a
specific commit SHA instead. Modify the git clone invocation to use the commit
hash b640ec3cf2c7c9cfc9e6351479261186f76eeec8 rather than the --branch parameter
with the version tag, ensuring the downloaded tooling is immutably pinned to a
specific commit.
In `@tests/helpers/common.bash`:
- Around line 29-35: The run_fn function always re-enables errexit with set -e
at the end, regardless of whether the caller had errexit enabled or disabled. To
preserve the caller's errexit state, capture the current state of the errexit
option before executing set +e, and then restore the original state at the end
of run_fn instead of always running set -e. This prevents leaking shell-option
state to the caller.
In `@tests/helpers/git_fixtures.bash`:
- Around line 23-31: The create_bare_remote_with_clone() function initializes a
working repository that may use a non-master default branch based on system
configuration, but then unconditionally pushes to the master branch, causing
failures on systems with different defaults. After the git init "$work" command,
explicitly checkout and create the master branch using git checkout -b master
before the initial commit, ensuring the working directory is on the master
branch when the git push -u origin master command executes on line 31.
---
Nitpick comments:
In @.github/workflows/lint.yml:
- Around line 29-33: Remove the "Install bats" step that runs "sudo apt-get
update && sudo apt-get install -y bats" from the workflow. This step allows the
system-installed bats to be found, which bypasses the pinned v1.11.1 version
that scripts/test.sh downloads as a fallback. Removing this step will ensure the
workflow consistently uses the pinned version instead of creating CI version
drift from different distro versions.
🪄 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: 08a16f9b-4ffe-47a7-8618-c98bc171c87d
📒 Files selected for processing (21)
.githooks/pre-commit.github/workflows/assets/lib.sh.github/workflows/assets/translation.sh.github/workflows/lint.yml.github/workflows/start-translation.yml.gitignoreMakefileREADME.mdscripts/install-git-hooks.shscripts/lint.shscripts/pre-commit.shscripts/test.shtests/helpers/common.bashtests/helpers/fixtures/libraries-empty.jsontests/helpers/fixtures/libraries-multi.jsontests/helpers/fixtures/libraries-single.jsontests/helpers/git_fixtures.bashtests/helpers/mock_gh.bashtests/test_lib.batstests/test_merge_guard.batstests/test_process_submodule.bats
Close #19.
Summary
Adds a bats test suite for
start-translationworkflow logic, with mockghand git fixtures so destructive mirror operations can be tested safely without hitting real GitHub.start-translation.ymlintotranslation.shmake lint,make test, andmake check; optional pre-commit hooktestjob inlint.ymlTest plan
make testpassesmake lintpassesSummary by CodeRabbit
New Features
Documentation
Tests