Skip to content

Conversation

@mernst
Copy link
Contributor

@mernst mernst commented Jan 13, 2026

Merge after #30.

@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

Replaces the echo command that printed the current directory from using command substitution $(pwd) to variable expansion ${PWD}. Updates the test script: renames PLUME_SCRIPTS to GIT_SCRIPTS, creates and cleans startdir/resultdir with explicit tmpdir usage, unsets several CI-related environment variables, adds "About to run"/"Done" diagnostic lines around the git-clone-related invocation, runs the script from startdir with $ARGS and resultdir, strengthens error messages to include the resultdir, and ensures final cleanup of startdir and resultdir.

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aba4b8e and e4d43dc.

📒 Files selected for processing (1)
  • git-clone-related
🔇 Additional comments (1)
git-clone-related (1)

98-98: LGTM! Efficient and consistent diagnostic improvement.

The change from $(pwd) to ${PWD} is appropriate for this diagnostic message. It's more efficient (avoids spawning a subshell) and consistent with other diagnostic messages in this script (lines 141, 146).


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.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @git-clone-related:
- Around line 169-175: The debug echo after calling git-find-branch contains a
typo "= >" instead of "=>"; update the echo that prints the result of invoking
"${SCRIPT_DIR}/git-find-branch" so the message uses "=>" (no space) like the
other debug lines, keeping the same variables (SCRIPTNAME, REPO_URL,
CI_BRANCH_NAME, FALLBACK_BRANCH) and the REPO_BRANCH expansion.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b2d9fde and d90355d.

📒 Files selected for processing (3)
  • git-clone-related
  • git-find-branch
  • tests/git-clone-related-test/test-git-clone-related.sh
🔇 Additional comments (10)
git-find-branch (1)

3-3: LGTM!

Minor formatting cleanup in the usage comment. The BRANCH... format follows standard Unix conventions for indicating variadic arguments.

tests/git-clone-related-test/test-git-clone-related.sh (4)

3-10: LGTM!

Documentation comments are clear and accurately describe the test script's expected arguments.


27-30: LGTM!

Good improvements:

  • Renaming PLUME_SCRIPTS to GIT_SCRIPTS better reflects the repository context.
  • Using separate startdir and resultdir clearly distinguishes the source clone from the destination.
  • The mktemp with fallback handles both GNU and BSD variants correctly.

41-48: LGTM!

The diagnostic output (About to run / Done) will be valuable for debugging test failures. The git commands correctly reference resultdir to inspect the cloned repository.


50-62: LGTM!

Good improvements to error handling and cleanup:

  • Including resultdir in error messages provides more context for debugging failures.
  • The cleanup correctly removes both temporary directories.
  • The comment explaining why cleanup comes after failure exits is helpful documentation.
git-clone-related (5)

59-64: LGTM!

Good refactoring to use SCRIPTNAME for the usage message. This ensures the error message stays accurate if the script is ever renamed.


93-98: LGTM!

Consistent SCRIPTNAME prefix in debug messages improves traceability when multiple scripts are involved.


112-127: LGTM!

The PLUME_SCRIPTS discovery logic is well-structured:

  • Checks multiple known locations before falling back to cloning.
  • Validates CI_INFO existence before proceeding.
  • The guard against missing PLUME_SCRIPTS is appropriate.

129-148: LGTM!

Capturing ci-info output into a variable before eval is a good improvement for debugging:

  • Allows inspection of the output before execution.
  • The ---- start/end ---- markers clearly delimit the output.
  • The comment about set -v doubling is helpful documentation.

177-189: LGTM!

The clone command logging and final status output are improved:

  • About to run message helps trace execution.
  • Consistent SCRIPTNAME prefix in error and status messages.
  • The existing retry logic with timeout is preserved.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/git-clone-related-test/test-git-clone-related.sh (1)

35-39: Consider unsetting additional GitHub Actions variables.

GitHub Actions also sets GITHUB_REF and GITHUB_BASE_REF, which ci-info might examine. If tests run in GitHub Actions, these could interfere with test isolation.

Suggested additions
 unset GITHUB_HEAD_REF
+unset GITHUB_REF
+unset GITHUB_BASE_REF
🤖 Fix all issues with AI agents
In @git-clone-related:
- Around line 173-175: The debug echo in the git-find-branch block contains a
typo "`= >`" that should be the arrow "`=>`"; update the echo command that
references SCRIPTNAME, REPO_URL, CI_BRANCH_NAME, FALLBACK_BRANCH and REPO_BRANCH
to replace the stray space between "=" and ">" so the output reads "=>"
(consistent with the other debug line) and retains the same variable expansions
and conditional FALLBACK_BRANCH expansion.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d90355d and 721d093.

📒 Files selected for processing (3)
  • git-clone-related
  • git-find-fork
  • tests/git-clone-related-test/test-git-clone-related.sh
🔇 Additional comments (8)
git-find-fork (1)

12-17: LGTM!

The dynamic SCRIPT_NAME variable ensures error messages remain accurate if the script is renamed or invoked via a symlink. The -- after basename correctly handles edge cases with script names starting with dashes.

git-clone-related (4)

59-64: LGTM!

The SCRIPTNAME variable is correctly derived and used in the usage message for consistency across the script.


112-121: Verify loop priority behavior is intentional.

The loop assigns PLUME_SCRIPTS without breaking, so if multiple directories exist, the last match wins (../.plume-scripts has highest priority). If first-match priority is intended, add a break after the assignment.

If first-match priority is intended
   for dir in "../plume-scripts" ".plume-scripts" "../.plume-scripts"; do
     if [ -d "${SCRIPT_DIR}/${dir}" ]; then
       PLUME_SCRIPTS="${SCRIPT_DIR}/${dir}"
+      break
     fi
   done

135-148: Good approach for debugging CI issues.

Capturing the ci-info output before eval enables inspection and troubleshooting. The debug block correctly shows the output that will be evaluated.


177-190: LGTM!

The clone command logging, retry logic, and final status message are well-structured with consistent SCRIPTNAME prefixing.

tests/git-clone-related-test/test-git-clone-related.sh (3)

27-30: LGTM!

The temp directory creation with fallback handles both GNU coreutils (Linux) and BSD mktemp (macOS). Pre-cleanup with rm -rf ensures a fresh start even if previous test runs left artifacts.


41-44: LGTM!

The diagnostic logging mirrors the pattern introduced in git-clone-related and will help debug test failures.


60-62: LGTM!

Correct placement of cleanup after the failure exits preserves artifacts for debugging failed tests while ensuring successful runs clean up after themselves.

@mernst mernst changed the title Add diagnostics Improvements related to directories Jan 13, 2026
@mernst mernst merged commit 4e2fe10 into main Jan 13, 2026
5 checks passed
@mernst mernst deleted the regression branch January 13, 2026 16:22
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.

2 participants