-
Notifications
You must be signed in to change notification settings - Fork 81
Delete dead code, sanitaze submodule URLs before cloning #6408
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| using System.Text.RegularExpressions; | ||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
| using Maestro.Common; | ||
| using Microsoft.DotNet.DarcLib.Helpers; | ||
| using Microsoft.DotNet.DarcLib.Models.VirtualMonoRepo; | ||
| using Microsoft.Extensions.Logging; | ||
|
|
@@ -626,6 +627,14 @@ private async Task<List<VmrIngestionPatch>> GetPatchesForSubmoduleChange( | |
| CancellationToken cancellationToken) | ||
| { | ||
| var checkoutCommit = change.Before == Constants.EmptyGitObject ? change.After : change.Before; | ||
|
|
||
| if (!GitRepoUrlUtils.IsValidRemoteRepoUri(change.Url)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand the URI validation. We can have submodules from wherever?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean submodules don't have to be in GitHub or AzDo?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessarily. We used to have one from Google from whatever address. But also how does this fix the issue that we'd send the token from the parent repo to the submodule when getting it? Isn't that what the issue was about?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dkurepa so I guess this one can go in? |
||
| { | ||
| throw new DarcException( | ||
| $"Submodule '{change.Name}' has an invalid or disallowed URL '{change.Url}'. " + | ||
| "Only https URLs hosted on GitHub or Azure DevOps are allowed."); | ||
| } | ||
|
dkurepa marked this conversation as resolved.
|
||
|
|
||
| var clonePath = await _cloneManager.PrepareCloneAsync(change.Url, checkoutCommit, resetToRemote: false, cancellationToken); | ||
|
|
||
| // We are only interested in filters specific to submodule's path | ||
|
|
||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.