Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
64a58ff
Consolidate language alias catalog tests
Widthdom Aug 3, 2026
87d8603
Reuse built artifact in MCP smoke task
Widthdom Aug 3, 2026
a307260
Streamline release runner setup and caches
Widthdom Aug 3, 2026
2026608
Consolidate languages catalog coverage
Widthdom Aug 3, 2026
5595ffd
Avoid redundant PR and coverage artifacts
Widthdom Aug 3, 2026
ff0c1e9
Consolidate search language alias fixtures
Widthdom Aug 3, 2026
babd220
Consolidate validate indexed issue fixtures
Widthdom Aug 3, 2026
d7500ae
Consolidate archive validation fixtures
Widthdom Aug 4, 2026
1a4b91c
Reuse archive export across restore contracts
Widthdom Aug 4, 2026
0236f84
Defer reference extractor performance warmup
Widthdom Aug 4, 2026
d1de182
Bound retained dotnet test output
Widthdom Aug 4, 2026
44cf1b9
Scope license policy triggers to validated inputs
Widthdom Aug 4, 2026
667cae0
Consolidate Git metadata lifecycle fixtures
Widthdom Aug 4, 2026
4dd6646
Consolidate production reference coverage fixtures
Widthdom Aug 4, 2026
c0c8349
Consolidate JVM reference extraction fixtures
Widthdom Aug 4, 2026
d1c294c
Consolidate SQL target reference fixtures
Widthdom Aug 4, 2026
b6cd421
Scope NuGet caches to locked restore graphs
Widthdom Aug 4, 2026
2cf772c
Consolidate multi-language reference fixtures
Widthdom Aug 4, 2026
9fdb0d7
Consolidate JSON response budget fixtures
Widthdom Aug 4, 2026
33de003
Isolate database-independent reader tests
Widthdom Aug 4, 2026
de75927
Resolve adversarial review gaps
Widthdom Aug 4, 2026
a9adff3
Sync README status contract fields
Widthdom Aug 4, 2026
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
44 changes: 32 additions & 12 deletions .github/scripts/run-dotnet-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,41 @@ function Invoke-TestRun {
$runArgs += @("--filter", $TestFilter)
}

$capturedOutput = [System.Collections.Generic.List[string]]::new()
[int]$failureLogTailLineLimit = 2000
$retainedOutputTail = [System.Collections.Generic.Queue[string]]::new($failureLogTailLineLimit)
[long]$totalOutputLineCount = 0
$testSessionTimedOut = $false
dotnet @runArgs 2>&1 | ForEach-Object {
$line = [string]$_
$capturedOutput.Add($line)
$totalOutputLineCount++
if ($line.IndexOf("test run timeout", [StringComparison]::OrdinalIgnoreCase) -ge 0) {
$testSessionTimedOut = $true
}
if ($retainedOutputTail.Count -ge $failureLogTailLineLimit) {
[void]$retainedOutputTail.Dequeue()
}
[void]$retainedOutputTail.Enqueue($line)
Write-Host $line
}

$exitCode = $LASTEXITCODE
if ($exitCode -ne 0) {
$logDirectory = Split-Path -Parent $LogPath
New-Item -ItemType Directory -Force -Path $logDirectory | Out-Null
[System.IO.File]::WriteAllLines($LogPath, [string[]]$capturedOutput)
$failureLogLines = [System.Collections.Generic.List[string]]::new($retainedOutputTail.Count + 1)
$omittedOutputLineCount = $totalOutputLineCount - $retainedOutputTail.Count
if ($omittedOutputLineCount -gt 0) {
[void]$failureLogLines.Add(
"[ci] Test output truncated: retained final $($retainedOutputTail.Count) of $totalOutputLineCount lines; $omittedOutputLineCount earlier line(s) were streamed live and omitted from this artifact.")
}
[void]$failureLogLines.AddRange($retainedOutputTail.ToArray())
[System.IO.File]::WriteAllLines($LogPath, [string[]]$failureLogLines)
}

return [int]$exitCode
return [pscustomobject]@{
ExitCode = [int]$exitCode
TestSessionTimedOut = [bool]$testSessionTimedOut
}
}

function Merge-TestFilters {
Expand Down Expand Up @@ -168,19 +188,19 @@ function Get-RetryFilterDecision {
}

$firstLogPath = Join-Path $resultsDirectory "test-output-first.txt"
$firstExitCode = Invoke-TestRun -LogPath $firstLogPath -ResultFileName "test_results_first.trx" -IncludeCoverage $includeCoverage -IncludeCrashDiagnostics $true -TestFilter $BaseFilter
if ($firstExitCode -eq 0) {
$firstRunResult = Invoke-TestRun -LogPath $firstLogPath -ResultFileName "test_results_first.trx" -IncludeCoverage $includeCoverage -IncludeCrashDiagnostics $true -TestFilter $BaseFilter
if ($firstRunResult.ExitCode -eq 0) {
exit 0
}

Write-StepOutput -Name "summarize" -Value "true"

if (Select-String -Path $firstLogPath -SimpleMatch "test run timeout" -Quiet) {
if ($firstRunResult.TestSessionTimedOut) {
Write-Warning "Initial test run hit TestSessionTimeout; skipping flaky retry to keep CI bounded. Inspect uploaded TRX/blame artifacts."
exit $firstExitCode
exit $firstRunResult.ExitCode
}

Write-Warning "Initial test run failed with exit code $firstExitCode. Rerunning once to classify possible flakiness."
Write-Warning "Initial test run failed with exit code $($firstRunResult.ExitCode). Rerunning once to classify possible flakiness."
if ($includeCoverage) {
Write-Host "Skipping XPlat Code Coverage on the flaky-classification retry."
}
Expand All @@ -200,12 +220,12 @@ else {
Write-Host "Focused retry is unavailable ($($retryFilterDecision.reason)); using the $fallbackScope retry fallback."
}
$retryLogPath = Join-Path $resultsDirectory "test-output-retry.txt"
$retryExitCode = Invoke-TestRun -LogPath $retryLogPath -ResultFileName "test_results_retry.trx" -IncludeCoverage $false -IncludeCrashDiagnostics $false -TestFilter $retryFilter
if ($retryExitCode -eq 0) {
$retryRunResult = Invoke-TestRun -LogPath $retryLogPath -ResultFileName "test_results_retry.trx" -IncludeCoverage $false -IncludeCrashDiagnostics $false -TestFilter $retryFilter
if ($retryRunResult.ExitCode -eq 0) {
"Initial test run failed, but the single retry passed. Retry scope: $retryScope. Treat this run as flaky and inspect TRX/blame artifacts." |
Set-Content -Encoding UTF8 -Path (Join-Path $resultsDirectory "flaky-retry.txt")
Write-Warning "Tests passed on retry; uploaded TestResults include flaky-retry.txt."
exit 0
}

exit $retryExitCode
exit $retryRunResult.ExitCode
8 changes: 7 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ jobs:
with:
dotnet-version: 9.0.301
cache: true
cache-dependency-path: '**/packages.lock.json'
cache-dependency-path: |
src/CodeIndex/packages.lock.json
tests/CodeIndex.HookIsolationFixture/packages.lock.json
tests/CodeIndex.Tests/packages.lock.json
tools/CodeIndex.Changelog/packages.lock.json
tools/CodeIndex.PackageNormalize/packages.lock.json
tools/CodeIndex.TestTelemetry/packages.lock.json

- name: Initialize CodeQL
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
~\AppData\Local\NuGet\packages
# Locked restore keeps package inputs honest; avoid evicting the cache for project-only test edits.
# locked restore がパッケージ入力を検証するため、テスト用 project だけの変更ではキャッシュを失効させない。
key: ${{ runner.os }}-dotnet-nuget-${{ hashFiles('**/packages.lock.json', 'global.json') }}
key: ${{ runner.os }}-dotnet-nuget-${{ hashFiles('src/CodeIndex/packages.lock.json', 'tests/CodeIndex.HookIsolationFixture/packages.lock.json', 'tests/CodeIndex.Tests/packages.lock.json', 'tools/CodeIndex.Changelog/packages.lock.json', 'tools/CodeIndex.PackageNormalize/packages.lock.json', 'tools/CodeIndex.TestTelemetry/packages.lock.json') }}

# --locked-mode requires every resolved package to match the committed
# packages.lock.json so an unexpected transitive bump (including silent
Expand Down Expand Up @@ -202,6 +202,7 @@ jobs:
TestResults/**/*.trx
TestResults/**/*.txt
TestResults/**/*.xml
!TestResults/**/coverage.cobertura.xml

- name: Upload diagnostic dumps
if: failure() && steps.test.outcome != 'skipped'
Expand All @@ -218,7 +219,7 @@ jobs:
TestResults/**/*.hangdump

- name: Upload coverage reports
if: always() && matrix.collect_coverage && steps.test.outcome != 'skipped'
if: always() && matrix.collect_coverage && steps.test.outcome != 'skipped' && hashFiles('TestResults/**/coverage.cobertura.xml') != ''
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Coverage-${{ matrix.os }}-${{ matrix.test-framework }}-${{ matrix.test-shard }}
Expand All @@ -228,11 +229,11 @@ jobs:
path: TestResults/**/coverage.cobertura.xml

- name: Publish
if: matrix.primary_lane
if: matrix.primary_lane && github.event_name != 'pull_request'
run: dotnet publish src/CodeIndex/CodeIndex.csproj --configuration Release --no-build --no-restore --output publish

- name: Upload build artifact
if: matrix.primary_lane
if: matrix.primary_lane && github.event_name != 'pull_request'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: CodeIndex
Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/license-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,15 @@ on:
- 'TRADEMARKS.md'
- 'README.md'
- 'USER_GUIDE.md'
- 'DEVELOPER_GUIDE.md'
- 'DISTRIBUTION.md'
- 'docs/NUGET_README.md'
- 'MAINTAINERS.md'
- 'CONTRIBUTING.md'
- 'src/CodeIndex/CodeIndex.csproj'
- 'src/CodeIndex/Cli/ConsoleUi.cs'
- 'install.sh'
- 'install_modules/20-installer.sh'
- 'install_modules/40-uninstall.sh'
- '.github/workflows/release.yml'
- '.github/workflows/license-policy.yml'
- 'tests/CodeIndex.Tests/LicensePolicyTests.cs'
- 'tests/CodeIndex.Tests/InstallScriptTests.cs'
- 'tests/CodeIndex.Tests/ReleaseWorkflowTests.cs'
pull_request:
branches:
- main
Expand All @@ -38,21 +32,15 @@ on:
- 'TRADEMARKS.md'
- 'README.md'
- 'USER_GUIDE.md'
- 'DEVELOPER_GUIDE.md'
- 'DISTRIBUTION.md'
- 'docs/NUGET_README.md'
- 'MAINTAINERS.md'
- 'CONTRIBUTING.md'
- 'src/CodeIndex/CodeIndex.csproj'
- 'src/CodeIndex/Cli/ConsoleUi.cs'
- 'install.sh'
- 'install_modules/20-installer.sh'
- 'install_modules/40-uninstall.sh'
- '.github/workflows/release.yml'
- '.github/workflows/license-policy.yml'
- 'tests/CodeIndex.Tests/LicensePolicyTests.cs'
- 'tests/CodeIndex.Tests/InstallScriptTests.cs'
- 'tests/CodeIndex.Tests/ReleaseWorkflowTests.cs'
workflow_dispatch:

concurrency:
Expand Down Expand Up @@ -125,7 +113,13 @@ jobs:
8.0.413
9.0.301
cache: true
cache-dependency-path: '**/packages.lock.json'
cache-dependency-path: |
src/CodeIndex/packages.lock.json
tests/CodeIndex.HookIsolationFixture/packages.lock.json
tests/CodeIndex.Tests/packages.lock.json
tools/CodeIndex.Changelog/packages.lock.json
tools/CodeIndex.PackageNormalize/packages.lock.json
tools/CodeIndex.TestTelemetry/packages.lock.json

- name: Restore license policy test dependencies
run: dotnet restore tests/CodeIndex.Tests/CodeIndex.Tests.csproj -p:RestoreTargetFrameworks=net8.0 --locked-mode
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/mutation-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,24 @@ jobs:
8.0.413
9.0.301

- name: Cache Stryker tool and NuGet packages
id: mutation-cache
- name: Cache NuGet packages
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.dotnet/tools
~/.nuget/packages
key: ${{ runner.os }}-mutation-stryker-4.14.0-${{ hashFiles('**/packages.lock.json', 'global.json') }}
path: ~/.nuget/packages
key: ${{ runner.os }}-mutation-nuget-${{ hashFiles('src/CodeIndex/packages.lock.json', 'tests/CodeIndex.HookIsolationFixture/packages.lock.json', 'tests/CodeIndex.Tests/packages.lock.json', 'tools/CodeIndex.Changelog/packages.lock.json', 'tools/CodeIndex.PackageNormalize/packages.lock.json', 'tools/CodeIndex.TestTelemetry/packages.lock.json') }}

- name: Cache Stryker tool
id: stryker-cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.dotnet/tools
key: ${{ runner.os }}-mutation-stryker-4.14.0

- name: Restore
run: dotnet restore CodeIndex.sln --locked-mode

- name: Install Stryker.NET
if: steps.mutation-cache.outputs.cache-hit != 'true'
if: steps.stryker-cache.outputs.cache-hit != 'true'
run: dotnet tool update --global dotnet-stryker --version 4.14.0

- name: Run DbWriter mutation tests
Expand Down
51 changes: 35 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
ref: ${{ needs.preflight.outputs.ref }}

- name: Configure Windows test host
if: runner.os == 'Windows'
if: runner.os == 'Windows' && !matrix.cross_compile
shell: pwsh
run: ./.github/scripts/configure-windows-test-host.ps1 -Workspace "${{ github.workspace }}"

Expand All @@ -119,13 +119,24 @@ jobs:
uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
with:
dotnet-version: 9.0.301
- name: Cache NuGet packages

- name: Cache native NuGet packages
if: ${{ !matrix.cross_compile }}
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.nuget/packages
~\AppData\Local\NuGet\packages
key: ${{ runner.os }}-release-nuget-${{ hashFiles('src/CodeIndex/packages.lock.json', 'tests/CodeIndex.HookIsolationFixture/packages.lock.json', 'tests/CodeIndex.Tests/packages.lock.json', 'tools/CodeIndex.Changelog/packages.lock.json', 'tools/CodeIndex.PackageNormalize/packages.lock.json', 'tools/CodeIndex.TestTelemetry/packages.lock.json') }}

- name: Cache cross-compile NuGet packages
if: matrix.cross_compile
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.nuget/packages
~\AppData\Local\NuGet\packages
key: ${{ runner.os }}-release-nuget-${{ hashFiles('**/packages.lock.json', 'global.json') }}
key: ${{ runner.os }}-release-cross-nuget-${{ hashFiles('src/CodeIndex/packages.lock.json') }}

# --locked-mode requires every resolved package to match the committed
# packages.lock.json so an unexpected transitive bump (including silent
Expand Down Expand Up @@ -161,21 +172,25 @@ jobs:
# 依存ツリーと SQLitePCLRaw のネイティブアセットを列挙するので RID 間で
# 内容は同一)。upstream の major 変更で release workflow が黙って壊れない
# よう、安定メジャーをピン留めする。
- name: Cache CycloneDX SBOM tool (linux-x64 only)
if: matrix.rid == 'linux-x64'
id: cyclonedx-tool-cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.dotnet/tools
key: ${{ runner.os }}-cyclonedx-6.2.0

- name: Install CycloneDX SBOM tool (linux-x64 only)
if: matrix.rid == 'linux-x64' && steps.cyclonedx-tool-cache.outputs.cache-hit != 'true'
run: dotnet tool install --global CycloneDX --version 6.2.0

# actions/setup-dotnet does not put $HOME/.dotnet/tools on PATH, including
# after a cache hit, so publish it for every linux-x64 run.
# cache hit 後も actions/setup-dotnet は $HOME/.dotnet/tools を PATH に
# 追加しないため、linux-x64 の各 run で明示的に公開する。
- name: Add CycloneDX SBOM tool to PATH (linux-x64 only)
if: matrix.rid == 'linux-x64'
# actions/setup-dotnet@v4 does not put $HOME/.dotnet/tools on PATH
# automatically, so we append it via $GITHUB_PATH for every subsequent
# step. Without this, the next step would fail with
# "dotnet-CycloneDX: command not found" on GitHub-hosted runners even
# though the tool is installed correctly under $HOME/.dotnet/tools.
# actions/setup-dotnet@v4 は $HOME/.dotnet/tools を自動では PATH に
# 加えないため、$GITHUB_PATH 経由で明示的に追加して後続 step から
# `dotnet-CycloneDX` を直接呼べるようにする。これを忘れると、ツール
# 自体は $HOME/.dotnet/tools に正しくインストールされていても、次の
# step が `command not found` で落ちる。
run: |
dotnet tool install --global CycloneDX --version 6.2.0
echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH"
run: echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH"

- name: Generate CycloneDX SBOM (linux-x64 only)
if: matrix.rid == 'linux-x64'
Expand Down Expand Up @@ -821,6 +836,10 @@ jobs:
dotnet-version: |
8.0.413
9.0.301
cache: true
cache-dependency-path: |
src/CodeIndex/packages.lock.json
tools/CodeIndex.PackageNormalize/packages.lock.json

- name: Extract version from tag
id: version
Expand Down
Loading
Loading