-
Notifications
You must be signed in to change notification settings - Fork 255
sync the whole resource provider directory in azure-sdk-for-net #5807
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,8 +20,12 @@ function AddSparseCheckoutPath([string]$subDirectory) { | |
|
|
||
| function CopySpecToProjectIfNeeded([string]$specCloneRoot, [string]$mainSpecDir, [string]$dest, [string[]]$specAdditionalSubDirectories) { | ||
| $source = "$specCloneRoot/$mainSpecDir" | ||
| Copy-Item -Path $source -Destination $dest -Recurse -Force | ||
| Write-Host "Copying spec from $source to $dest" | ||
| # $mainSpecDir is the PR folder, we just need to copy its subfolders which include the typespec project folder | ||
| Get-ChildItem –Path "$source" -Exclude @("data-plane", "resource-manager")| | ||
| Foreach-Object { | ||
| Copy-Item -Path $_.FullName -Destination $dest -Recurse -Force | ||
| } | ||
|
|
||
| foreach ($additionalDir in $specAdditionalSubDirectories) { | ||
|
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. Now that we are copying the entire rp folder do we even need additional directories any longer?
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. Yes. We will copying entire rp folder. The dependency usually be defined via |
||
| $source = "$specCloneRoot/$additionalDir" | ||
|
|
@@ -93,7 +97,15 @@ $configuration = Get-Content -Path $typespecConfigurationFile -Raw | ConvertFrom | |
| $pieces = $typespecConfigurationFile.Path.Replace("\","/").Split("/") | ||
| $projectName = $pieces[$pieces.Count - 2] | ||
|
|
||
| $specSubDirectory = $configuration["directory"] | ||
| # clone the whole RP directory which is the parent of $configuration["directory"] | ||
| if ($configuration["directory"] -match "^[^/\\]+[\\/]+[^/\\]+") | ||
|
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. What kind of pattern is this supposed to match?
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. Should we just walk up the parents until we hit the "specification" folder?
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. Yes. It will get the top-level directory under
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. This regex doesn't say to me that it is looking for specification folder. What do we expect the values of |
||
| { | ||
| $specSubDirectory = $Matches[0] | ||
| } | ||
| else | ||
| { | ||
| throw "The directory in $typespecConfigurationFile is not expected" | ||
| } | ||
|
|
||
| if ( $configuration["repo"] -and $configuration["commit"]) { | ||
| $specCloneDir = GetSpecCloneDir $projectName | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can also sync these folders there isn't any real value in excluding them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @weshaggard
data-planeandresource-manageris useless for generating SDK from typespec, and it is huge, so we skip to copy them to our template folder.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know they have specs but are they really that big? Do we have any real data that says they make it take too much time? It just feels like if we can eliminate this special case it might make things easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we decide to exclude them after all, I think adding a comment explaining why is that would be worthwhile. Would be nice if it would say how big is the slowdown.