-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Docs onboarding v2 #36383
Merged
Merged
Docs onboarding v2 #36383
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
607b96e
Add v2 docs onboarding for Java
danieljurek d969df7
Add onboarding logic for onboarding v2
danieljurek d383cad
Set skipPublishDocMs for packages that are skipped in Language-Settin…
danieljurek 1994c01
Ignore errors removing path that doesn't exist (ensure that test runs…
danieljurek 869a7d9
Revert "Set skipPublishDocMs for packages that are skipped in Languag…
danieljurek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#$SetDocsPackageOnboarding = "Set-${Language}-DocsPackageOnboarding" | ||
function Set-java-DocsPackageOnboarding($moniker, $metadata, $docRepoLocation, $packageSourceOverride) { | ||
|
||
# Do not write onboarding information for legacy moniker | ||
# TODO: remove this once legacy moniker is properly configured | ||
if ($moniker -eq 'legacy') { | ||
return | ||
} | ||
|
||
$packageJsonPath = Join-Path $docRepoLocation "package.json" | ||
$onboardingInfo = Get-Content $packageJsonPath | ConvertFrom-Json | ||
|
||
$monikerOutputPath = "docs-ref-autogen" | ||
if ($moniker -ne 'latest') { | ||
$monikerOutputPath = "$moniker/docs-ref-autogen" | ||
} | ||
$monikerIndex = -1 | ||
for($i = 0; $i -lt $onboardingInfo.Count; $i++) { | ||
if ($onboardingInfo[$i].output_path -eq $monikerOutputPath) { | ||
$monikerIndex = $i | ||
break | ||
} | ||
} | ||
|
||
if ($monikerIndex -eq -1) { | ||
Write-Error "No appropriate index for moniker $moniker" | ||
} | ||
|
||
$onboardedPackages = @() | ||
foreach ($package in $metadata) { | ||
$packageInfo = [ordered]@{ | ||
packageArtifactId = $package.Name | ||
packageGroupId = $package.Group | ||
packageVersion = $package.Version | ||
|
||
# packageDownloadUrl is required by docs build and other values are | ||
# rejected. This is a temporary workaround until the docs build | ||
# supports more package stores. | ||
packageDownloadUrl = 'https://repo1.maven.org/maven2' | ||
} | ||
|
||
# Add items from 'DocsCiConfigProperties' into onboarding info. If a | ||
# property already exists, it will be overwritten. | ||
if ($package.ContainsKey('DocsCiConfigProperties')) { | ||
foreach ($key in $package['DocsCiConfigProperties'].Keys) { | ||
$packageInfo[$key] = $package['DocsCiConfigProperties'][$key] | ||
} | ||
} | ||
|
||
$onboardedPackages += $packageInfo | ||
} | ||
|
||
$onboardingInfo[$monikerIndex].packages = $onboardedPackages | ||
|
||
Set-Content -Path $packageJsonPath -Value (ConvertTo-Json -InputObject $onboardingInfo -Depth 100) | ||
} | ||
|
||
#$GetDocsPackagesAlreadyOnboarded = "Get-${Language}-DocsPackagesAlreadyOnboarded" | ||
function Get-java-DocsPackagesAlreadyOnboarded($docRepoLocation, $moniker) { | ||
return Get-java-OnboardedDocsMsPackagesForMoniker $docRepoLocation $moniker | ||
} | ||
|
||
# $GetPackageIdentity = "Get-${Language}-PackageIdentity" | ||
function Get-java-PackageIdentity($package) { | ||
return "$($package['Group']):$($package['Name'])" | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Import-Module Pester | ||
|
||
BeforeAll { | ||
. $PSScriptRoot/../Docs-Onboarding.ps1 | ||
} | ||
|
||
Describe 'Get-java-PackageIdentity' { | ||
It 'should return the package identity' { | ||
$package = [ordered]@{ | ||
Name = 'packageName' | ||
Group = 'packageGroup' | ||
} | ||
|
||
$packageIdentity = Get-java-PackageIdentity $package | ||
$packageIdentity | Should -Be 'packageGroup:packageName' | ||
} | ||
} |
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.
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.
When do you plan to use the new script you are adding to common in Azure/azure-sdk-tools#6632?