-
Notifications
You must be signed in to change notification settings - Fork 393
Add a Companion skill to the RBA Summary Scrip #2579
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
Draft
Shane Ferrell (Shanefe)
wants to merge
4
commits into
main
Choose a base branch
from
Create_RBA_Skill
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
|
|
||
| # TODO: Split the reusable skill-package composition and validation into a common build function | ||
| # when a second troubleshooting skill adopts this workflow. Keep RBA-specific link and heading | ||
| # transformations in an RBA adapter instead of adding product-specific branches to the common function. | ||
| function New-RbaTroubleshootingSkillFile { | ||
| [CmdletBinding(SupportsShouldProcess = $true)] | ||
| param( | ||
| [Parameter(Mandatory)] | ||
| [string]$SkillPath, | ||
|
|
||
| [Parameter(Mandatory)] | ||
| [string]$TsgRulesPath, | ||
|
|
||
| [Parameter(Mandatory)] | ||
| [string]$RulesPath, | ||
|
|
||
| [Parameter(Mandatory)] | ||
| [string]$ManifestPath, | ||
|
|
||
| [Parameter(Mandatory)] | ||
| [string]$DestinationPath | ||
| ) | ||
|
|
||
| foreach ($requiredPath in @($SkillPath, $TsgRulesPath, $RulesPath, $ManifestPath)) { | ||
| if (-not (Test-Path -Path $requiredPath -PathType Leaf)) { | ||
| throw "Required RBA troubleshooting skill source is missing: $requiredPath" | ||
| } | ||
| } | ||
|
|
||
| $manifest = Get-Content -Path $ManifestPath -Raw | ConvertFrom-Json | ||
| $skillContent = Get-Content -Path $SkillPath -Raw | ||
| $tsgRulesContent = Get-Content -Path $TsgRulesPath -Raw | ||
| $rulesContent = Get-Content -Path $RulesPath -Raw | ||
| $skillContent = $skillContent.Replace( | ||
| "[TSG-Rules.md](TSG-Rules.md)", | ||
| "the TSG core rules included in this file") | ||
| $skillContent = $skillContent.Replace( | ||
| "Validate each finding against [RBA-Rules.md](RBA-Rules.md)", | ||
| "Validate each finding against the RBA finding rules included in this file") | ||
| $skillContent = $skillContent.Replace( | ||
| "[RBA-Rules.md](RBA-Rules.md)", | ||
| "the RBA finding rules included in this file") | ||
| $tsgRulesContent = $tsgRulesContent.Replace("# EXO TSG core rules", "## TSG core rules") | ||
| $rulesContent = $rulesContent.Replace("# EXO RBA finding rules", "## RBA finding rules") | ||
|
|
||
| $packageMetadata = @" | ||
|
|
||
| ## Package metadata | ||
|
|
||
| - Collection: $($manifest.displayCollection) | ||
| - Skill ID: ``$($manifest.id)`` | ||
| - Skill version: ``$($manifest.version)`` | ||
| - TSG rules version: ``$($manifest.tsgRulesVersion)`` | ||
| - Supported report schemas: ``$($manifest.reportSchemaVersions -join "``, ``")`` | ||
| - Canonical download: $($manifest.downloadUrl) | ||
|
|
||
| "@ | ||
|
|
||
| $sectionSeparator = [Environment]::NewLine + [Environment]::NewLine | ||
| $combinedContent = @( | ||
| $skillContent.Trim() | ||
| $packageMetadata.Trim() | ||
| $tsgRulesContent.Trim() | ||
| $rulesContent.Trim() | ||
| ) -join $sectionSeparator | ||
|
|
||
| if ($PSCmdlet.ShouldProcess($DestinationPath, "Create RBA troubleshooting skill file")) { | ||
| Set-Content -Path $DestinationPath -Value ($combinedContent + [Environment]::NewLine) -Encoding utf8 | ||
| } | ||
| } | ||
|
|
||
| function New-PrototypeSkillFiles { | ||
| [CmdletBinding(SupportsShouldProcess = $true)] | ||
| param( | ||
| [Parameter(Mandatory)] | ||
| [System.IO.DirectoryInfo]$RepoRoot, | ||
|
|
||
| [Parameter(Mandatory)] | ||
| [string]$DestinationFolder | ||
| ) | ||
|
|
||
| $destinationPath = Join-Path -Path $DestinationFolder -ChildPath "EXO-RBA-Troubleshooting-SKILL.md" | ||
| if ($PSCmdlet.ShouldProcess($destinationPath, "Create prototype troubleshooting skill files")) { | ||
| $rbaSkillSource = Join-Path -Path $RepoRoot -ChildPath "Calendar\RBA\exo-rba-troubleshooting" | ||
| New-RbaTroubleshootingSkillFile ` | ||
| -SkillPath (Join-Path -Path $rbaSkillSource -ChildPath "SKILL.md") ` | ||
| -TsgRulesPath (Join-Path -Path $rbaSkillSource -ChildPath "TSG-Rules.md") ` | ||
| -RulesPath (Join-Path -Path $rbaSkillSource -ChildPath "RBA-Rules.md") ` | ||
| -ManifestPath (Join-Path -Path $rbaSkillSource -ChildPath "manifest.json") ` | ||
| -DestinationPath $destinationPath -Confirm:$false | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,7 @@ FYDIBOHF | |
| GCDO | ||
| github | ||
| globalsequence | ||
| Goid | ||
| Hashtable | ||
| HHMM | ||
| HKCR | ||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.