Repository navigation
V5.0.13/prepare refactoring #62
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
8 commits
Select commit
Hold shift + click to select a range
9ea6c52
📚 refresh docs publishing pipeline
aicia-bot ae2b9fb
💬 clarify contributing test guidance
aicia-bot 7dd110c
✅ add configured options verification across DI tests
aicia-bot d778519
✅ cover automatic dispatcher and handler discovery
aicia-bot e388f2c
✅ cover assembly context filtering and traversal
aicia-bot 5cb8a31
✅ cover JSON converter guards and cloud event discovery
aicia-bot ed22f3b
💬 update changelog for v5.0.13
aicia-bot 6cea8c8
🔧 swap test coverage to coverlet with hang dump diagnostics
aicia-bot 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Local outputs and bookkeeping are not inputs to the container's DocFX build. | ||
| wwwroot/ | ||
| obj/ | ||
| bin/ | ||
| *.ps1 |
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 |
|---|---|---|
| @@ -1,4 +1,136 @@ | ||
| $version = minver -i -t v -v w | ||
| docfx metadata docfx.json | ||
| docker buildx build -t savvyio-docfx:$version --platform linux/arm64,linux/amd64 --load -f Dockerfile.docfx . | ||
| get-childItem -recurse -path api -include *.yml, .manifest | remove-item | ||
| [CmdletBinding()] | ||
| param() | ||
|
|
||
| $ErrorActionPreference = 'Stop' | ||
|
|
||
| function Assert-CommandSucceeded([string] $Command) { | ||
| if ($LASTEXITCODE -ne 0) { throw "$Command failed with exit code $LASTEXITCODE." } | ||
| } | ||
|
|
||
| Push-Location -LiteralPath $PSScriptRoot | ||
| try { | ||
| $docfxRoot = $PSScriptRoot | ||
| $sourceRoot = [System.IO.Path]::GetFullPath((Join-Path $docfxRoot '..\src')) | ||
| $docfxConfig = Get-Content -LiteralPath (Join-Path $docfxRoot 'docfx.json') -Raw | ConvertFrom-Json | ||
| $version = minver -i -t v -v w | ||
| Assert-CommandSucceeded 'minver' | ||
|
|
||
| $metadataProjectPatterns = @( | ||
| foreach ($metadata in $docfxConfig.metadata) { | ||
| foreach ($source in $metadata.src) { | ||
| $metadataSourceRoot = if ($source.src) { | ||
| [System.IO.Path]::GetFullPath((Join-Path $docfxRoot $source.src)) | ||
| } else { | ||
| $docfxRoot | ||
| } | ||
|
|
||
| foreach ($file in $source.files) { | ||
| (Join-Path $metadataSourceRoot $file).Replace('/', [System.IO.Path]::DirectorySeparatorChar) | ||
| } | ||
| } | ||
| } | ||
| ) | ||
| $sourceProjects = @(Get-ChildItem -LiteralPath $sourceRoot -Recurse -File -Filter '*.csproj') | ||
| $metadataProjects = @( | ||
| $sourceProjects | | ||
| Where-Object { | ||
| $projectPath = $_.FullName | ||
| foreach ($pattern in $metadataProjectPatterns) { | ||
| if ($projectPath -like $pattern) { | ||
| return $true | ||
| } | ||
| } | ||
|
|
||
| return $false | ||
| } | ||
| ) | ||
| $sourceProjectsHaveRestoreAssets = $sourceProjects.Count -gt 0 | ||
| foreach ($project in $sourceProjects) { | ||
| $restoreAssetsPath = Join-Path $project.DirectoryName 'obj\project.assets.json' | ||
| if (-not (Test-Path -LiteralPath $restoreAssetsPath -PathType Leaf)) { | ||
| $sourceProjectsHaveRestoreAssets = $false | ||
| break | ||
| } | ||
| } | ||
|
|
||
| $useNoRestore = $metadataProjects.Count -gt 0 -and $sourceProjectsHaveRestoreAssets | ||
| $restoreInputNames = @('Directory.Build.props', 'Directory.Build.targets', 'Directory.Packages.props', 'NuGet.Config', 'nuget.config', 'global.json') | ||
|
|
||
| foreach ($project in $sourceProjects) { | ||
| $restoreAssetsPath = Join-Path $project.DirectoryName 'obj\project.assets.json' | ||
| if (-not (Test-Path -LiteralPath $restoreAssetsPath -PathType Leaf)) { | ||
| $useNoRestore = $false | ||
| break | ||
| } | ||
|
|
||
| $restoreAssetsLastWriteTime = (Get-Item -LiteralPath $restoreAssetsPath).LastWriteTimeUtc | ||
| $restoreInputPaths = [System.Collections.Generic.List[string]]::new() | ||
| $restoreInputPaths.Add($project.FullName) | ||
|
|
||
| $inputDirectory = $project.DirectoryName | ||
| while ($inputDirectory) { | ||
| foreach ($name in $restoreInputNames) { | ||
| $restoreInputPath = Join-Path $inputDirectory $name | ||
| if (Test-Path -LiteralPath $restoreInputPath -PathType Leaf) { | ||
| $restoreInputPaths.Add($restoreInputPath) | ||
| } | ||
| } | ||
|
|
||
| $parentDirectory = Split-Path -Parent $inputDirectory | ||
| if (-not $parentDirectory -or $parentDirectory -eq $inputDirectory) { | ||
| break | ||
| } | ||
|
|
||
| $inputDirectory = $parentDirectory | ||
| } | ||
|
|
||
| $lockFilePath = Join-Path $project.DirectoryName 'packages.lock.json' | ||
| if (Test-Path -LiteralPath $lockFilePath -PathType Leaf) { | ||
| $restoreInputPaths.Add($lockFilePath) | ||
| } | ||
|
|
||
| if ($env:APPDATA) { | ||
| $userNuGetConfigPath = Join-Path $env:APPDATA 'NuGet\NuGet.Config' | ||
| if (Test-Path -LiteralPath $userNuGetConfigPath -PathType Leaf) { | ||
| $restoreInputPaths.Add($userNuGetConfigPath) | ||
| } | ||
| } | ||
|
|
||
| foreach ($restoreInputPath in $restoreInputPaths | Sort-Object -Unique) { | ||
| if ((Get-Item -LiteralPath $restoreInputPath).LastWriteTimeUtc -gt $restoreAssetsLastWriteTime) { | ||
| $useNoRestore = $false | ||
| break | ||
| } | ||
| } | ||
|
|
||
| if (-not $useNoRestore) { | ||
| break | ||
| } | ||
| } | ||
|
|
||
| if (-not $useNoRestore) { | ||
| # Restore the source graph once so DocFX does not restore every project separately. | ||
| $restoreSolution = Join-Path ([System.IO.Path]::GetTempPath()) ("savvyio-docfx-{0}.slnx" -f [Guid]::NewGuid()) | ||
| try { | ||
| $projectsXml = foreach ($project in $sourceProjects) { | ||
| ' <Project Path="{0}" />' -f [Security.SecurityElement]::Escape($project.FullName) | ||
| } | ||
| @('<Solution>') + $projectsXml + @('</Solution>') | Set-Content -LiteralPath $restoreSolution -Encoding utf8 | ||
| dotnet restore $restoreSolution --verbosity quiet | ||
| Assert-CommandSucceeded 'dotnet restore' | ||
| } finally { | ||
| if (Test-Path -LiteralPath $restoreSolution) { Remove-Item -LiteralPath $restoreSolution } | ||
| } | ||
| } | ||
|
|
||
| # Keep all metadata groups in one process; DocFX carries resolver state across groups. | ||
| docfx metadata docfx.json --noRestore | ||
| Assert-CommandSucceeded 'docfx metadata' | ||
|
|
||
| docker buildx build -t savvyio-docfx:$version --platform linux/arm64,linux/amd64 --load -f Dockerfile.docfx . | ||
| Assert-CommandSucceeded 'docker buildx build' | ||
|
|
||
| Get-ChildItem -Recurse -Path api -Include *.yml, .manifest | Remove-Item | ||
| } finally { | ||
| Pop-Location | ||
| } |
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 |
|---|---|---|
| @@ -1,17 +1,16 @@ | ||
| ARG NGINX_VERSION=1.31-alpine | ||
| ARG NGINX_VERSION=1.31-alpine | ||
|
|
||
| FROM --platform=$BUILDPLATFORM nginx:${NGINX_VERSION} AS base | ||
| FROM --platform=$BUILDPLATFORM dhi.io/nginx:${NGINX_VERSION} AS base | ||
| RUN rm -rf /usr/share/nginx/html/* | ||
|
|
||
| FROM --platform=$BUILDPLATFORM codebeltnet/docfx:2.78.5 AS build | ||
| FROM --platform=$BUILDPLATFORM codebeltnet/docfx:2 AS build | ||
|
|
||
| ADD [".", "docfx"] | ||
|
|
||
| RUN cd docfx; \ | ||
| docfx build | ||
|
|
||
| FROM nginx:${NGINX_VERSION} AS final | ||
| FROM dhi.io/nginx:${NGINX_VERSION} AS final | ||
| WORKDIR /usr/share/nginx/html | ||
| COPY --from=build /build/docfx/wwwroot /usr/share/nginx/html | ||
|
|
||
| ENTRYPOINT ["nginx", "-g", "daemon off;"] | ||
| COPY nginx.conf /etc/nginx/conf.d/default.conf |
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,31 @@ | ||
| server { | ||
| listen 8080; | ||
| server_name _; | ||
| # The ingress terminates TLS; keep redirects from exposing this container port. | ||
| absolute_redirect off; | ||
|
|
||
| root /usr/share/nginx/html; | ||
| index index.html; | ||
|
|
||
| # DocFX fingerprints these generated dependencies in their filenames. They can be | ||
| # cached permanently because changed content is published under a different URL. | ||
| location ~ "^/public/.+-[A-Z0-9]{8}(?:-[A-Z0-9]{8})?(?:\.min)?\.(?:(?:css|js)(?:\.map)?|woff2?)$" { | ||
| try_files $uri =404; | ||
| add_header Cache-Control "public, max-age=31536000, immutable" always; | ||
| add_header Vary "Accept-Encoding" always; | ||
| } | ||
|
|
||
| # Pages, navigation data, images, and DocFX entry assets keep stable URLs. Do not | ||
| # retain them across deployments, and ignore validators cached under an old policy. | ||
| location / { | ||
| # Nginx derives ETags from modification time and file size. Those values can be | ||
| # reused by files copied from different image layers, producing a false 304. | ||
| etag off; | ||
| if_modified_since off; | ||
| try_files $uri $uri/ =404; | ||
| add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0" always; | ||
| add_header Expires "0" always; | ||
| add_header Pragma "no-cache" always; | ||
| add_header Vary "Accept-Encoding" always; | ||
| } | ||
| } |
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.