Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 137 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,17 @@ jobs:

- name: Install ripgrep
shell: pwsh
run: choco install ripgrep -y --no-progress
run: |
if ($IsWindows) {
choco install ripgrep -y --no-progress
}
elseif ($IsMacOS) {
brew install ripgrep
}
else {
sudo apt-get update
sudo apt-get install -y ripgrep
}

- name: Install portable pipeline
shell: pwsh
Expand Down Expand Up @@ -151,3 +161,129 @@ jobs:
with:
name: code-intel-pipeline-windows
path: dist/code-intel-pipeline-windows.zip

cross-platform-smoke:
permissions:
contents: read

strategy:
fail-fast: false
matrix:
os:
- windows-latest
- macos-latest
- ubuntu-latest

runs-on: ${{ matrix.os }}

Comment thread
coderabbitai[bot] marked this conversation as resolved.
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Setup Rust
shell: pwsh
run: rustup default stable

- name: Rust format
shell: pwsh
run: cargo fmt -p code-intel -- --check

- name: Rust check
shell: pwsh
run: cargo check

- name: Rust tests
shell: pwsh
run: cargo test -p code-intel

- name: Build Rust CLI
shell: pwsh
run: cargo build -p code-intel --release

- name: PowerShell parser checks
shell: pwsh
run: |
$files = @(
"run-code-intel.ps1",
"Find-CodeIntelProjects.ps1",
"Invoke-GitHubSolutionResearch.ps1",
"test-code-intel-pipeline.ps1",
"test-github-solution-research.ps1",
"test-project-discovery.ps1",
"test-project-management-support.ps1",
"test-skill-development-benchmark.ps1"
)
foreach ($file in $files) {
$tokens = $null
$errs = $null
$null = [System.Management.Automation.Language.Parser]::ParseFile((Resolve-Path $file), [ref]$tokens, [ref]$errs)
if ($errs) {
Write-Host $file
$errs | Select-Object Message,Extent | Format-List
exit 1
}
}

- name: Secret pattern guard
shell: pwsh
run: |
$patterns = @(
"sk-[A-Za-z0-9_-]{20,}",
"ghp_[A-Za-z0-9_]{20,}",
"github_pat_[A-Za-z0-9_]{20,}",
"AKIA[0-9A-Z]{16}"
)
$files = git ls-files
$hits = @()
foreach ($file in $files) {
if ($file -match "^(target/|artifacts/|cache/)" -or $file -match "\.(png|jpg|jpeg|gif|zip|exe)$") {
continue
}
$text = Get-Content -LiteralPath $file -Raw -ErrorAction SilentlyContinue
foreach ($pattern in $patterns) {
if ($text -match $pattern) {
$hits += "$file matches $pattern"
}
}
}
if ($hits.Count -gt 0) {
$hits | ForEach-Object { Write-Host $_ }
throw "Secret-like patterns found."
}

- name: Install ripgrep
shell: pwsh
run: |
if ($IsWindows) {
choco install ripgrep -y --no-progress
}
elseif ($IsMacOS) {
brew install ripgrep
}
else {
sudo apt-get update
sudo apt-get install -y ripgrep
}

- name: Install portable pipeline
shell: pwsh
run: |
$result = ./install-code-intel-pipeline.ps1 -RepoPath . -RepairSkillLinks -Json | ConvertFrom-Json
Add-Content -Path $env:GITHUB_PATH -Value $result.paths.bin

- name: Doctor
shell: pwsh
run: ./check-code-intel-tools.ps1 -RepoPath . -Json

- name: Pipeline smoke
shell: pwsh
run: ./test-code-intel-pipeline.ps1 -RepoPath . -SkipRepowise -AllowGraphMissing -SkipSentruxCheck -SkipSentruxGate -SkipGitHubResearch -Mode normal

- name: Hardcoded path scan
shell: pwsh
run: ./tools/check-hardcoded-paths.ps1
50 changes: 44 additions & 6 deletions Install-SentruxVlangOverlay.ps1
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
#requires -Version 7.2

[CmdletBinding()]
param(
[string]$PluginRoot = (Join-Path $env:USERPROFILE ".sentrux\plugins"),
[string]$PluginRoot = "",
[ValidateSet("auto", "windows", "macos", "linux")]
[string]$Platform = "auto",
[switch]$NoReadOnlyLock,
[switch]$SkipValidate
)

Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"

$overlayRoot = Join-Path $PSScriptRoot "overlays\sentrux\vlang"
$platformModule = Join-Path (Join-Path $PSScriptRoot "tools") "code-intel-platform.psm1"
Import-Module $platformModule -Force
$effectivePlatform = Get-CodeIntelPlatform -Platform $Platform

if ([string]::IsNullOrWhiteSpace($PluginRoot)) {
$PluginRoot = Join-Path (Join-Path (Get-CodeIntelHomeDirectory) ".sentrux") "plugins"
}

$overlayRoot = Join-Path (Join-Path (Join-Path $PSScriptRoot "overlays") "sentrux") "vlang"
$targetRoot = Join-Path $PluginRoot "vlang"
$grammarName = switch ($effectivePlatform) {
"windows" { "windows-x86_64.dll" }
"macos" { "darwin-arm64.dylib" }
"linux" { "linux-x86_64.so" }
}
$requiredFiles = @(
"plugin.toml",
"queries\tags.scm",
"grammars\windows-x86_64.dll"
(Join-Path "queries" "tags.scm"),
(Join-Path "grammars" $grammarName)
)

function Test-SameOverlayFile {
Expand Down Expand Up @@ -50,6 +67,16 @@ function Test-SameOverlayFile {
foreach ($relativePath in $requiredFiles) {
$sourcePath = Join-Path $overlayRoot $relativePath
if (-not (Test-Path -LiteralPath $sourcePath -PathType Leaf)) {
if ($relativePath -like (Join-Path "grammars" "*")) {
[pscustomobject][ordered]@{
status = "manual_required"
plugin = "vlang"
platform = $effectivePlatform
missing = $sourcePath
message = "No vlang grammar artifact is bundled for this platform; skipping overlay install."
} | ConvertTo-Json -Depth 4
return
}
throw "Overlay file missing: $sourcePath"
}
}
Expand All @@ -70,7 +97,12 @@ New-Item -ItemType Directory -Force -Path (Join-Path $targetRoot "grammars") | O
foreach ($relativePath in $requiredFiles) {
$targetPath = Join-Path $targetRoot $relativePath
if (Test-Path -LiteralPath $targetPath) {
& attrib -R $targetPath
if ($effectivePlatform -eq "windows" -and (Get-Command attrib -ErrorAction SilentlyContinue)) {
& attrib -R $targetPath
}
else {
(Get-Item -LiteralPath $targetPath).IsReadOnly = $false
}
}
}

Expand All @@ -86,7 +118,12 @@ foreach ($relativePath in $requiredFiles) {
if (-not $NoReadOnlyLock) {
foreach ($relativePath in $requiredFiles) {
$targetPath = Join-Path $targetRoot $relativePath
& attrib +R $targetPath
if ($effectivePlatform -eq "windows" -and (Get-Command attrib -ErrorAction SilentlyContinue)) {
& attrib +R $targetPath
}
else {
(Get-Item -LiteralPath $targetPath).IsReadOnly = $true
}
}
}

Expand All @@ -103,6 +140,7 @@ if (-not $SkipValidate) {
[pscustomobject][ordered]@{
status = "installed"
plugin = "vlang"
platform = $effectivePlatform
target = $targetRoot
backup = if (Test-Path -LiteralPath $backupPath) { $backupPath } else { $null }
readOnlyLock = -not $NoReadOnlyLock
Expand Down
2 changes: 2 additions & 0 deletions Invoke-CodeNexusLite.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#requires -Version 7.2

param(
[Parameter(Mandatory = $true)]
[string]$RepoPath,
Expand Down
Loading
Loading