Disambiguate process_one_submodule and pin actions/checkout by SHA#40
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe PR extracts add-submodule mirror creation into a new helper script, renames the translation helper to ChangesSubmodule helper split and sync rename
Checkout pinning and Dependabot
Sequence Diagram(s)sequenceDiagram
participant add_one_submodule
participant gh
participant git
participant GitHub_repo
add_one_submodule->>gh: repo create
add_one_submodule->>git: clone / prune / commit / push
add_one_submodule->>gh: api PATCH default_branch
gh->>GitHub_repo: create/update mirror repo
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/add-submodules.yml (1)
125-131: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPreserve the fatal return-code contract for create/push failures.
This loop only treats
rc == 2as fatal, but.github/workflows/assets/add_submodules.sh:67currently returns the raw status fromcreate_new_repo_and_push. If that helper fails with status1, it is handled as a skip here instead of failing the workflow.🐛 Proposed fix in the helper
- create_new_repo_and_push "$MODULE_ORG" "$sub_name" "$sub_clone" "$org_repo_url" "$libs_ref" + create_new_repo_and_push "$MODULE_ORG" "$sub_name" "$sub_clone" "$org_repo_url" "$libs_ref" || return 2🤖 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/add-submodules.yml around lines 125 - 131, The submodule creation flow in add_submodules is only treating rc == 2 as fatal, but add_submodules.sh’s create_new_repo_and_push path can return a raw 1 and get misclassified as a skip. Update the helper so create_new_repo_and_push maps create/push failures to the agreed fatal status used by the workflow loop, and keep the contract aligned with add_one_submodule and record_submodule_fatal so any create/push error increments the fatal count instead of being ignored.
🧹 Nitpick comments (1)
tests/helpers/mock_gh.bash (1)
34-36: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRecord PATCH calls instead of auto-succeeding them.
This makes the new
set_default_branch()path effectively untestable:create_new_repo_and_push()can stop issuing the PATCH, or send the wrong repo/branch, and the suite still passes. Capture the PATCH arguments (and ideally gate the exit code behind aMOCK_GH_PATCH_EXITvariable) so the success-path test can assert the default-branch update.Proposed change
api) if [[ "${1:-}" == "--method" && "${2:-}" == "PATCH" ]]; then - exit 0 + export MOCK_GH_LAST_PATCH="${*:3}" + exit "${MOCK_GH_PATCH_EXIT:-0}" fi🤖 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/helpers/mock_gh.bash` around lines 34 - 36, The PATCH handling in mock_gh.bash currently auto-succeeds, which hides whether set_default_branch() is actually being called correctly from create_new_repo_and_push(). Update the gh mock’s PATCH branch to record the incoming arguments (repo/branch details) instead of immediately exiting 0, and optionally make the exit behavior configurable through a MOCK_GH_PATCH_EXIT variable so tests can still force success. Then adjust the success-path assertions to verify the default-branch update was issued with the expected repository and branch values.
🤖 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.
Outside diff comments:
In @.github/workflows/add-submodules.yml:
- Around line 125-131: The submodule creation flow in add_submodules is only
treating rc == 2 as fatal, but add_submodules.sh’s create_new_repo_and_push path
can return a raw 1 and get misclassified as a skip. Update the helper so
create_new_repo_and_push maps create/push failures to the agreed fatal status
used by the workflow loop, and keep the contract aligned with add_one_submodule
and record_submodule_fatal so any create/push error increments the fatal count
instead of being ignored.
---
Nitpick comments:
In `@tests/helpers/mock_gh.bash`:
- Around line 34-36: The PATCH handling in mock_gh.bash currently auto-succeeds,
which hides whether set_default_branch() is actually being called correctly from
create_new_repo_and_push(). Update the gh mock’s PATCH branch to record the
incoming arguments (repo/branch details) instead of immediately exiting 0, and
optionally make the exit behavior configurable through a MOCK_GH_PATCH_EXIT
variable so tests can still force success. Then adjust the success-path
assertions to verify the default-branch update was issued with the expected
repository and branch values.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 916a448c-fad0-4010-b1e4-dc0bd510453a
📒 Files selected for processing (8)
.github/workflows/add-submodules.yml.github/workflows/assets/add_submodules.shscripts/lint.shtests/helpers/common.bashtests/helpers/git_fixtures.bashtests/helpers/mock_gh.bashtests/test_add_one_submodule.batstests/test_sync_one_submodule.bats
💤 Files with no reviewable changes (1)
- tests/test_sync_one_submodule.bats
✅ Files skipped from review due to trivial changes (1)
- scripts/lint.sh
Close #33, close #35.
Summary by CodeRabbit
New Features
Bug Fixes
actions/checkoutversions for more consistent CI behavior.Chores / Tests