Repository navigation
Conversation
There was a problem hiding this comment.
🤖 AI code review
This PR aligns the HTTPS failure path of _run_clone_command_silent in both sagemaker-train and sagemaker-core with sagemaker.core.git_utils._run_clone_command: it redacts credentials from the URL via the existing _redact_credentials_from_url helper, reconstructs a CalledProcessError with the sanitized command, logs the safe URL, and re-raises from None. The SSH path is correctly left unchanged, consistent with prior git_utils work (PR #5811/#5812). New unit tests cover sanitized-failure, plain-URL, and success cases in both modules. The change is correct, well-scoped, and adequately tested; I found no issues.
Reviewed commit b8cb194. Automated review; verify before acting.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Training Recipes clone helper
_run_clone_command_silentexists in two places (sagemaker-trainandsagemaker-coremodules). Its HTTPS failure handling has drifted fromsagemaker.core.git_utils._run_clone_command. This change brings both copies in line withgit_utils, so a failed recipe clone produces the same URL formatting and exception shape everywhere in the SDK.Changes
sagemaker-train/src/sagemaker/train/utils.pyandsagemaker-core/src/sagemaker/core/modules/utils.py:sagemaker.core.git_utilswhen reporting an HTTPS clone failure.CalledProcessErrorbuilt from the formatted URL (from None). This matchesgit_utils._run_clone_commandand keeps tracebacks to a single, clean exception.Testing
sagemaker-train/tests/unit/train/test_utils_clone.pyandsagemaker-core/tests/unit/modules/test_utils_clone.py, which cover:git clone,GIT_TERMINAL_PROMPT=0still set)sagemaker-trainrecipe tests,sagemaker-coretests/unit/modules, andtests/unit/test_git_utils.py.blackandflake8are clean on the changed files.