Skip to content

Variable renaming - #26

Merged
mernst merged 2 commits into
mainfrom
naming
Jan 13, 2026
Merged

mernst merged 2 commits into
mainfrom
naming

Conversation

@mernst

@mernst mernst commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented Jan 12, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The pull request updates git-clone-related functionality and its corresponding test suite. The main script changes include updating the usage message argument name from REPO to REPO_NAME, refining a comment about cloning, implementing retry logic with a 180-second sleep on initial timeout, and changing the output prefix to use the script name. The test file replaces all references to the goaldir temporary directory with a new resultdir variable, adds additional CI-related variable unsets, and prepends "error:" to diagnostic messages. Both files undergo minor refactoring to align variable naming and messaging conventions while preserving overall control flow.

🚥 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.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@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

Caution

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

⚠️ Outside diff range comments (1)
git-clone-related (1)

159-167: Consider documenting the 180-second sleep rationale.

The retry logic is sound, but the 180-second sleep between retries is substantial. While the comment mentions JDK clone times, adding a brief inline comment explaining why 180 seconds specifically was chosen (e.g., observed clone times, network recovery window) would help future maintainers.

🤖 Fix all issues with AI agents
In @git-clone-related:
- Line 170: The echo line uses $0 which can vary by invocation; change it to a
stable script name by using basename "$0" (or a hardcoded string) in the echo so
the output consistently begins with "git-clone-related:"; update the line that
currently echoes "$0: ${DESTINATION} is at $(cd \"${DESTINATION}\" && git
rev-parse HEAD)" to use basename "$0" (or the literal script name) while keeping
the DESTINATION and git rev-parse subshell intact.
📜 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 16e5815 and f07075d.

📒 Files selected for processing (2)
  • git-clone-related
  • tests/git-clone-related-test/test-git-clone-related.sh
🧰 Additional context used
🪛 GitHub Actions: Run Small test
git-clone-related

[error] 1-1: Test failed during 'make test' due to repository URL mismatch: expected 'https://github.com/mernst/git-clone-related-test-repo2.git' but got 'https://github.com/plume-lib/git-clone-related-test-repo2.git'. This caused the test script to exit with code 2.

🔇 Additional comments (6)
git-clone-related (2)

60-60: LGTM!

The usage message now correctly reflects the parameter name REPO_NAME as defined on line 24, improving consistency between documentation and code.


158-158: LGTM!

Minor grammar improvement: "not enough to clone a branch of the JDK" reads more naturally.

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

27-28: LGTM!

The rename from goaldir to resultdir is clearer—it describes where the result of git-clone-related ends up, avoiding confusion with GOAL_REPO/GOAL_BRANCH which describe the expected values.


40-46: LGTM!

Consistent use of $resultdir throughout the clone, query, and cleanup logic.


48-56: LGTM!

Prepending error: to diagnostic messages improves log readability and makes failures easier to grep/filter in CI output.


33-38: Verify which GitHub Actions variables ci-info examines before adding more unsets.

The test correctly unsets CI variables to prevent test pollution. However, the claim about missing GITHUB_REF, GITHUB_BASE_REF, GITHUB_REPOSITORY, and GITHUB_EVENT_NAME unsets cannot be verified without examining the ci-info script from the plume-scripts repository. Check the plume-scripts documentation or source code to confirm which GitHub Actions variables ci-info actually reads, then add unsets only for those that are actually examined.

Comment thread git-clone-related
fi
echo "git-clone-related: ${DESTINATION} is at $(cd "${DESTINATION}" && git rev-parse HEAD)"

echo "$0: ${DESTINATION} is at $(cd "${DESTINATION}" && git rev-parse HEAD)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Using $0 may produce inconsistent output paths.

$0 will display the actual invocation path (e.g., ./git-clone-related, ../git-scripts/git-clone-related, or an absolute path) rather than the consistent git-clone-related: prefix. This could make log parsing or grepping for this script's output less predictable.

If consistent output is preferred, consider using basename "$0":

-echo "$0: ${DESTINATION} is at $(cd "${DESTINATION}" && git rev-parse HEAD)"
+echo "$(basename "$0"): ${DESTINATION} is at $(cd "${DESTINATION}" && git rev-parse HEAD)"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
echo "$0: ${DESTINATION} is at $(cd "${DESTINATION}" && git rev-parse HEAD)"
echo "$(basename "$0"): ${DESTINATION} is at $(cd "${DESTINATION}" && git rev-parse HEAD)"
🤖 Prompt for AI Agents
In @git-clone-related at line 170, The echo line uses $0 which can vary by
invocation; change it to a stable script name by using basename "$0" (or a
hardcoded string) in the echo so the output consistently begins with
"git-clone-related:"; update the line that currently echoes "$0: ${DESTINATION}
is at $(cd \"${DESTINATION}\" && git rev-parse HEAD)" to use basename "$0" (or
the literal script name) while keeping the DESTINATION and git rev-parse
subshell intact.

@mernst
mernst merged commit ea90769 into main Jan 13, 2026
5 checks passed
@mernst
mernst deleted the naming branch January 13, 2026 00:58
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.

1 participant