From c57ebcac804ec45765bd39aee9cca50f9f36f48e Mon Sep 17 00:00:00 2001 From: konard Date: Wed, 10 Sep 2025 18:44:59 +0300 Subject: [PATCH 1/4] Initial commit with task details for issue #36 Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: https://github.com/linksplatform/Interfaces/issues/36 --- CLAUDE.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..1b1d5816 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,5 @@ +Issue to solve: https://github.com/linksplatform/Interfaces/issues/36 +Your prepared branch: issue-36-682afee2 +Your prepared working directory: /tmp/gh-issue-solver-1757519095487 + +Proceed. \ No newline at end of file From 7cfd6db61b2a1e5ba0ed832183bdb03c68d3cb03 Mon Sep 17 00:00:00 2001 From: konard Date: Wed, 10 Sep 2025 18:45:16 +0300 Subject: [PATCH 2/4] Remove CLAUDE.md - PR created successfully --- CLAUDE.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index 1b1d5816..00000000 --- a/CLAUDE.md +++ /dev/null @@ -1,5 +0,0 @@ -Issue to solve: https://github.com/linksplatform/Interfaces/issues/36 -Your prepared branch: issue-36-682afee2 -Your prepared working directory: /tmp/gh-issue-solver-1757519095487 - -Proceed. \ No newline at end of file From bfe39e1672769bec28f3bed0e733acbbff12103b Mon Sep 17 00:00:00 2001 From: konard Date: Wed, 10 Sep 2025 18:51:37 +0300 Subject: [PATCH 3/4] Fix DocFX warnings in documentation generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update TargetFramework from netstandard2.0 to net8 to match project files - Replace $REPOSITORY_NAME template variable with 'Interfaces' - Configure proper file inclusion for README.md from parent directory - Add DocFX configuration files (docfx.json, filter.yml, toc.yml) Fixes #36 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- csharp/docfx.json | 43 +++++++++++++++++++++++++++++++++++++++++++ csharp/filter.yml | 5 +++++ csharp/toc.yml | 5 +++++ 3 files changed, 53 insertions(+) create mode 100644 csharp/docfx.json create mode 100644 csharp/filter.yml create mode 100644 csharp/toc.yml diff --git a/csharp/docfx.json b/csharp/docfx.json new file mode 100644 index 00000000..4b7b3b29 --- /dev/null +++ b/csharp/docfx.json @@ -0,0 +1,43 @@ +{ + "metadata": [ + { + "src": [ + { + "files": [ "**/*.sln" ], + "exclude": [ "**/bin/**", "**/obj/**" ], + "src": "" + } + ], + "dest": "obj/api", + "filter": "filter.yml", + "properties": { "TargetFramework": "net8" } + } + ], + "build": { + "content": [ + { + "files": [ "**/*.yml" ], + "src": "obj/api", + "dest": "api" + }, + { + "files": [ "*.md", "toc.yml" ] + }, + { + "files": [ "README.md" ], + "src": ".." + } + ], + "globalMetadata": { + "_appTitle": "LinksPlatform's Platform.Interfaces Library", + "_enableSearch": true, + "_gitContribute": { + "branch": "master" + }, + "_gitUrlPattern": "github" + }, + "markdownEngineName": "markdig", + "dest": "_site", + "xrefService": [ "https://xref.docs.microsoft.com/query?uid={uid}" ] + } +} diff --git a/csharp/filter.yml b/csharp/filter.yml new file mode 100644 index 00000000..16d2086d --- /dev/null +++ b/csharp/filter.yml @@ -0,0 +1,5 @@ +apiRules: +- exclude: + uidRegex: (Tests|Benchmarks)(\.[A-Za-z]+)?$ +- exclude: + uidRegex: CSharpToCppTranslator$ diff --git a/csharp/toc.yml b/csharp/toc.yml new file mode 100644 index 00000000..1ebe5315 --- /dev/null +++ b/csharp/toc.yml @@ -0,0 +1,5 @@ +- name: Home + href: README.md +- name: API Documentation + href: obj/api/ + homepage: api/Platform.Interfaces.html From bffc298c237e89f341b1f2b17fa81d4cd854ad65 Mon Sep 17 00:00:00 2001 From: konard Date: Thu, 24 Sep 2026 20:16:09 +0000 Subject: [PATCH 4/4] Validate generated DocFX API pages in C# workflow --- .../scripts/csharp-workflow-policy.test.mjs | 9 ++++ .github/scripts/validate-csharp-docs.sh | 18 ++++++++ .github/scripts/validate-csharp-docs.test.mjs | 46 +++++++++++++++++++ .github/workflows/csharp.yml | 4 +- 4 files changed, 75 insertions(+), 2 deletions(-) create mode 100755 .github/scripts/validate-csharp-docs.sh create mode 100644 .github/scripts/validate-csharp-docs.test.mjs diff --git a/.github/scripts/csharp-workflow-policy.test.mjs b/.github/scripts/csharp-workflow-policy.test.mjs index 1a9837f6..d7388ba7 100755 --- a/.github/scripts/csharp-workflow-policy.test.mjs +++ b/.github/scripts/csharp-workflow-policy.test.mjs @@ -135,6 +135,15 @@ test("builds PDF and API documentation in parallel before publishing both", () = ); }); +test("validates generated API pages before upload and after download", () => { + const documentation = jobs.get("buildDocumentation"); + const publisher = jobs.get("publishDocumentation"); + + assert.match(documentation, /docfx" docfx\.json --warningsAsErrors/); + assert.match(documentation, /validate-csharp-docs\.sh _site/); + assert.match(publisher, /validate-csharp-docs\.sh _site/); +}); + test("aggregates every job result so skipped dependents cannot hide failures", () => { const gate = jobs.get("pipelineStatus"); assert.ok(gate, "pipelineStatus job should exist"); diff --git a/.github/scripts/validate-csharp-docs.sh b/.github/scripts/validate-csharp-docs.sh new file mode 100755 index 00000000..1043036e --- /dev/null +++ b/.github/scripts/validate-csharp-docs.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -euo pipefail + +site=${1:?Usage: validate-csharp-docs.sh SITE_DIRECTORY} + +for file in \ + index.html \ + api/Platform.Interfaces.html \ + api/Platform.Interfaces.IFactory-1.html \ + xrefmap.yml; do + if [[ ! -s "$site/$file" ]]; then + echo "Documentation site is missing $site/$file." >&2 + exit 1 + fi +done + +echo "Validated DocFX home page, API pages, and cross-reference map." diff --git a/.github/scripts/validate-csharp-docs.test.mjs b/.github/scripts/validate-csharp-docs.test.mjs new file mode 100644 index 00000000..c8b54e54 --- /dev/null +++ b/.github/scripts/validate-csharp-docs.test.mjs @@ -0,0 +1,46 @@ +#!/usr/bin/env node + +import assert from "node:assert/strict"; +import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { spawnSync } from "node:child_process"; +import test from "node:test"; + +const validator = new URL("./validate-csharp-docs.sh", import.meta.url).pathname; + +const withSite = (files, check) => { + const site = mkdtempSync(join(tmpdir(), "csharp-docs-")); + try { + for (const file of files) { + const path = join(site, file); + mkdirSync(join(path, ".."), { recursive: true }); + writeFileSync(path, "generated content"); + } + check(spawnSync("bash", [validator, site], { encoding: "utf8" })); + } finally { + rmSync(site, { recursive: true, force: true }); + } +}; + +const requiredFiles = [ + "index.html", + "api/Platform.Interfaces.html", + "api/Platform.Interfaces.IFactory-1.html", + "xrefmap.yml", +]; + +test("accepts a complete DocFX site", () => { + withSite(requiredFiles, ({ status, stderr }) => { + assert.equal(status, 0, stderr); + }); +}); + +for (const missingFile of requiredFiles) { + test(`rejects a site missing ${missingFile}`, () => { + withSite(requiredFiles.filter((file) => file !== missingFile), ({ status, stderr }) => { + assert.notEqual(status, 0); + assert.ok(stderr.includes(missingFile), stderr); + }); + }); +} diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 887c2737..7f745764 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -230,7 +230,7 @@ jobs: cp _site/README.html _site/index.html - name: Validate documentation output - run: test -s _site/index.html + run: ../.github/scripts/validate-csharp-docs.sh _site - name: Upload documentation site timeout-minutes: 5 @@ -263,7 +263,7 @@ jobs: - name: Validate documentation site run: | - test -s _site/index.html + ../.github/scripts/validate-csharp-docs.sh _site test -s _site/Platform.Interfaces.pdf - name: Publish documentation to gh-pages