Skip to content

fix: sanitize git clone repo input url #5234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 11, 2025
Merged

fix: sanitize git clone repo input url #5234

merged 4 commits into from
Jul 11, 2025

Conversation

sage-maker
Copy link
Collaborator

@sage-maker sage-maker commented Jul 10, 2025

Issue #, if available:

Description of changes:

Testing done:

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

  • I have read the CONTRIBUTING doc
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change.
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)
  • If adding any dependency in requirements.txt files, I have spell checked and ensured they exist in PyPi

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sage-maker sage-maker requested a review from a team as a code owner July 10, 2025 22:25
@sage-maker sage-maker requested a review from nargokul July 10, 2025 22:25
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

Attention: Patch coverage is 97.05882% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.08%. Comparing base (d408594) to head (ad08cb4).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/sagemaker/git_utils.py 97.05% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5234      +/-   ##
==========================================
- Coverage   86.08%   86.08%   -0.01%     
==========================================
  Files         449      449              
  Lines       43623    43656      +33     
==========================================
+ Hits        37555    37580      +25     
- Misses       6068     6076       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sage-maker sage-maker merged commit ed143b7 into master Jul 11, 2025
13 of 14 checks passed
@sage-maker sage-maker deleted the fix/git-sanitize branch July 11, 2025 17:50
import six
from six.moves import urllib


def _sanitize_git_url(repo_url):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any sanitization happening here or is this just validation ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It shouldn't fix anything on the user's behalf so I think validation is a better word

HollowTube pushed a commit to HollowTube/sagemaker-python-sdk that referenced this pull request Jul 15, 2025
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.

3 participants