-
Notifications
You must be signed in to change notification settings - Fork 3
Integrate provider orchestration surfaces #7
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
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3d7fc0a
Internalize provider orchestration surfaces
lunnynight 20ac7d9
Fix install script CI failure from stale defaults and demoted crate refs
f25e3e1
Fix install script doctor step still forcing RequireRepowise=true on CI
3cb6bde
Pass -RequireRepowise:\False to Doctor step in CI
c107fd7
Pass -RequireRepowise through from -SkipRepowise in pipeline smoke test
3271fc2
Merge PR #5 provider orchestration integration
1e28c58
Fix CI install without provider secrets
1ea50fa
Pass provider requirement flags to install doctor
b45caaa
Align CI smoke doctor with skipped Repowise
5f4d05c
Remove local paths from orchestration docs
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
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,187 @@ | ||
| param( | ||
| [ValidateSet("Validate", "List", "Plan")] | ||
| [string]$Action = "Validate", | ||
|
|
||
| [string]$Capability = "", | ||
| [string]$RepoPath = "", | ||
|
|
||
| [ValidateSet("lite", "normal", "full")] | ||
| [string]$Mode = "normal", | ||
|
|
||
| [string]$Manifest = "", | ||
| [switch]$Json | ||
| ) | ||
|
|
||
| Set-StrictMode -Version Latest | ||
| $ErrorActionPreference = "Stop" | ||
|
|
||
| $root = Split-Path -Parent $PSCommandPath | ||
| if ([string]::IsNullOrWhiteSpace($Manifest)) { | ||
| $Manifest = Join-Path $root "orchestration\integrations.json" | ||
| } | ||
|
|
||
| function Get-JsonProperty { | ||
| param( | ||
| [object]$Object, | ||
| [string]$Name | ||
| ) | ||
|
|
||
| if ($null -eq $Object) { return $null } | ||
| $prop = $Object.PSObject.Properties[$Name] | ||
| if ($null -eq $prop) { return $null } | ||
| return $prop.Value | ||
| } | ||
|
Comment on lines
+23
to
+33
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. In PowerShell, accessing properties dynamically using |
||
|
|
||
| function ConvertTo-Array { | ||
| param([object]$Value) | ||
|
|
||
| if ($null -eq $Value) { return @() } | ||
| if ($Value -is [System.Array]) { return @($Value) } | ||
| return @($Value) | ||
| } | ||
|
|
||
| function Expand-CommandTemplate { | ||
| param( | ||
| [string]$Template, | ||
| [string]$RepoPath, | ||
| [string]$Mode | ||
| ) | ||
|
|
||
| $expanded = $Template.Replace("<mode>", $Mode) | ||
| if (-not [string]::IsNullOrWhiteSpace($RepoPath)) { | ||
| $expanded = $expanded.Replace("<repo-path>", $RepoPath) | ||
| } | ||
| return $expanded | ||
| } | ||
|
|
||
| if (-not (Test-Path -LiteralPath $Manifest -PathType Leaf)) { | ||
| throw "Orchestration manifest missing: $Manifest" | ||
| } | ||
|
|
||
| $manifestData = Get-Content -LiteralPath $Manifest -Raw | ConvertFrom-Json | ||
| $stages = ConvertTo-Array (Get-JsonProperty $manifestData "stages") | ||
| $integrations = ConvertTo-Array (Get-JsonProperty $manifestData "integrations") | ||
|
|
||
| $errors = New-Object System.Collections.Generic.List[string] | ||
| $stageIds = @{} | ||
| foreach ($stage in $stages) { | ||
| $id = [string](Get-JsonProperty $stage "id") | ||
| if ([string]::IsNullOrWhiteSpace($id)) { | ||
| $errors.Add("stage id is empty") | ||
| continue | ||
| } | ||
| if ($stageIds.ContainsKey($id)) { | ||
| $errors.Add("duplicate stage id: $id") | ||
| } | ||
| else { | ||
| $stageIds[$id] = $stage | ||
| } | ||
| } | ||
|
|
||
| $integrationIds = @{} | ||
| foreach ($integration in $integrations) { | ||
| $id = [string](Get-JsonProperty $integration "id") | ||
| $stage = [string](Get-JsonProperty $integration "stage") | ||
| $entrypoint = [string](Get-JsonProperty $integration "entrypoint") | ||
| $capabilities = ConvertTo-Array (Get-JsonProperty $integration "capabilities") | ||
|
|
||
| if ([string]::IsNullOrWhiteSpace($id)) { | ||
| $errors.Add("integration id is empty") | ||
| continue | ||
| } | ||
| if ($integrationIds.ContainsKey($id)) { | ||
| $errors.Add("duplicate integration id: $id") | ||
| } | ||
| else { | ||
| $integrationIds[$id] = $integration | ||
| } | ||
| if (-not $stageIds.ContainsKey($stage)) { | ||
| $errors.Add("integration $id references unknown stage: $stage") | ||
| } | ||
| if ([string]::IsNullOrWhiteSpace($entrypoint)) { | ||
| $errors.Add("integration $id has no entrypoint") | ||
| } | ||
| elseif ($entrypoint -like "*.ps1" -or $entrypoint -like "*.py" -or $entrypoint -like "*.toml" -or $entrypoint -like "*.rs") { | ||
| $candidate = Join-Path $root $entrypoint | ||
| if (-not (Test-Path -LiteralPath $candidate -PathType Leaf)) { | ||
| $errors.Add("integration $id entrypoint missing: $entrypoint") | ||
| } | ||
| } | ||
| if ($capabilities.Count -eq 0) { | ||
| $errors.Add("integration $id exposes no capabilities") | ||
| } | ||
| } | ||
|
|
||
| $stageOrder = @{} | ||
| foreach ($stage in $stages) { | ||
| $stageOrder[[string](Get-JsonProperty $stage "id")] = [int](Get-JsonProperty $stage "order") | ||
| } | ||
|
|
||
| $selected = @($integrations | Where-Object { | ||
| if ([string]::IsNullOrWhiteSpace($Capability)) { return $true } | ||
| $caps = ConvertTo-Array (Get-JsonProperty $_ "capabilities") | ||
| return ($caps -contains $Capability) -or ([string](Get-JsonProperty $_ "id") -eq $Capability) -or ([string](Get-JsonProperty $_ "stage") -eq $Capability) | ||
| } | Sort-Object @{ Expression = { $stageOrder[[string](Get-JsonProperty $_ "stage")] } }, @{ Expression = { [string](Get-JsonProperty $_ "id") } }) | ||
|
|
||
| $plan = @($selected | ForEach-Object { | ||
| $commands = Get-JsonProperty $_ "commands" | ||
| $expandedCommands = [ordered]@{} | ||
| if ($null -ne $commands) { | ||
| foreach ($command in $commands.PSObject.Properties) { | ||
| $expandedCommands[$command.Name] = Expand-CommandTemplate ([string]$command.Value) $RepoPath $Mode | ||
| } | ||
| } | ||
|
|
||
| [pscustomobject][ordered]@{ | ||
| id = [string](Get-JsonProperty $_ "id") | ||
| stage = [string](Get-JsonProperty $_ "stage") | ||
| kind = [string](Get-JsonProperty $_ "kind") | ||
| required = [bool](Get-JsonProperty $_ "required") | ||
| entrypoint = [string](Get-JsonProperty $_ "entrypoint") | ||
| capabilities = @(ConvertTo-Array (Get-JsonProperty $_ "capabilities")) | ||
| commands = $expandedCommands | ||
| artifactContract = @(ConvertTo-Array (Get-JsonProperty $_ "artifactContract")) | ||
| extensionPoint = [string](Get-JsonProperty $_ "extensionPoint") | ||
| } | ||
| }) | ||
|
|
||
| $result = [pscustomobject][ordered]@{ | ||
| ok = $errors.Count -eq 0 | ||
| action = $Action | ||
| manifest = $Manifest | ||
| policy = Get-JsonProperty $manifestData "policy" | ||
| errors = @($errors) | ||
| stages = @($stages | Sort-Object @{ Expression = { [int](Get-JsonProperty $_ "order") } }) | ||
| integrations = if ($Action -eq "Validate") { @() } else { $plan } | ||
| plan = if ($Action -eq "Plan") { $plan } else { @() } | ||
| } | ||
|
|
||
| if ($Json) { | ||
| $result | ConvertTo-Json -Depth 12 | ||
| } | ||
| else { | ||
| if (-not $result.ok) { | ||
| Write-Host "Code Intel orchestration: FAILED" | ||
| foreach ($errorText in $errors) { Write-Host "- $errorText" } | ||
| } | ||
| elseif ($Action -eq "Validate") { | ||
| Write-Host "Code Intel orchestration: OK" | ||
| Write-Host "Manifest: $Manifest" | ||
| Write-Host "Stages: $($stages.Count)" | ||
| Write-Host "Integrations: $($integrations.Count)" | ||
| } | ||
| else { | ||
| Write-Host "Code Intel orchestration: $Action" | ||
| foreach ($item in $plan) { | ||
| Write-Host "$($item.stage): $($item.id) [$($item.kind)] entry=$($item.entrypoint)" | ||
| if ($Action -eq "Plan") { | ||
| foreach ($command in $item.commands.GetEnumerator()) { | ||
| Write-Host " $($command.Key): $($command.Value)" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if (-not $result.ok) { exit 1 } | ||
| exit 0 | ||
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
Oops, something went wrong.
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.
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.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Root resolution diverges from the Rust orchestrator for custom
-Manifestpaths.$rootis always the script's own directory (Line 18), and is reused for resolving entrypoint paths even when-Manifestpoints elsewhere (Line 105). The Rust engine (orchestration.rs::root_for_manifest) instead derives the root from the manifest's own location (parent, or grandparent when the parent directory is namedorchestration). With a custom-Manifest, this script will validate entrypoints against the wrong root, producing results that disagree withcode-intel.exe orchestratefor the same manifest.🔧 Proposed fix to mirror Rust's root_for_manifest
$root = Split-Path -Parent $PSCommandPath if ([string]::IsNullOrWhiteSpace($Manifest)) { $Manifest = Join-Path $root "orchestration\integrations.json" +} else { + $manifestParent = Split-Path -Parent $Manifest + if ((Split-Path -Leaf $manifestParent) -eq "orchestration") { + $root = Split-Path -Parent $manifestParent + } else { + $root = $manifestParent + } }Also applies to: 104-109
🤖 Prompt for AI Agents