Skip to content

Commit 6f17c99

Browse files
authored
fix(ci): remove generated artifacts from repo, fix MCPB 404 race condition (#181) (#182)
* fix(ci): remove generated artifacts from repo, fix MCPB 404 race condition - Remove docs/TOOLS.md from git tracking (generated at build time) - Remove TOOLS.md generation from semantic-release exec/git plugins - Replace release:published trigger with workflow_run in docs.yml - Add build + generate steps before docs:build (TOOLS.md + inject-tool-refs) - Add inject-tool-refs.ts script for auto-syncing curated docs action tables - Add @Autogen:tool markers to curated docs (ci-cd, code-review, project-management, repository) - Fix TOOLS.md link in docs/tools/index.md (local /TOOLS instead of GitHub URL) - Add "Full API Reference" link to VitePress sidebar Closes #181 * feat(docs): enable sitemap.xml generation in VitePress * feat(docs): SEO metadata with OG/Twitter tags, frontmatter, robots.txt - titleTemplate and transformHead() in VitePress config for per-page OG/Twitter meta - robots.txt with sitemap reference - title/description frontmatter on all 72 documentation pages * test(cli): inject-tool-refs unit tests with 98% line hit - Export extractActions, generateActionsTable, findMarkers, processFile - 45 tests covering oneOf/enum schemas, markers, file processing, main() * fix(cli): inject-tool-refs robustness improvements - Remove depth limit on project root discovery (traverse to FS root) - Simplify NODE_ENV guard (remove redundant undefined check) - Accept optional content param in processFile to avoid double reads - Escape pipe chars in action descriptions for valid markdown tables * fix(cli): escape backslash in markdown tables, use URL constructor for OG urls - Escape backslash before pipe in generateActionsTable (CodeQL alert) - Use new URL() for robust og:url construction in transformHead * refactor(docs): use hostname constant in sitemap config
1 parent 37f9c29 commit 6f17c99

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1791
-2969
lines changed

.github/workflows/docs.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ on:
88
- 'package.json'
99
- 'yarn.lock'
1010
- '.github/workflows/docs.yml'
11-
release:
12-
types: [published]
11+
workflow_run:
12+
workflows: ["CI/CD Pipeline"]
13+
types: [completed]
14+
branches: [main]
1315
workflow_dispatch:
1416

1517
permissions:
@@ -24,6 +26,9 @@ concurrency:
2426
jobs:
2527
build:
2628
runs-on: ubuntu-latest
29+
if: >
30+
github.event_name != 'workflow_run' ||
31+
github.event.workflow_run.conclusion == 'success'
2732
steps:
2833
- uses: actions/checkout@v4
2934
with:
@@ -39,6 +44,14 @@ jobs:
3944
- name: Install dependencies
4045
run: yarn install --immutable
4146

47+
- name: Build project
48+
run: yarn build
49+
50+
- name: Generate dynamic documentation
51+
run: |
52+
yarn list-tools --export --toc > docs/TOOLS.md
53+
yarn inject-tool-refs
54+
4255
- name: Download latest MCPB bundle
4356
run: |
4457
mkdir -p docs/public/downloads

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ scripts/
3838

3939
/generated/prisma
4040

41+
# Generated documentation (built in CI)
42+
docs/TOOLS.md
43+
4144
# VitePress
4245
docs/.vitepress/dist
4346
docs/.vitepress/cache

.releaserc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@
5858
[
5959
"@semantic-release/exec",
6060
{
61-
"prepareCmd": "mkdir -p docs && echo ${nextRelease.version} > .semantic-release-version && yarn list-tools --export --toc > docs/TOOLS.md"
61+
"prepareCmd": "echo ${nextRelease.version} > .semantic-release-version"
6262
}
6363
],
6464
[
6565
"@semantic-release/git",
6666
{
67-
"assets": ["CHANGELOG.md", "package.json", "docs/TOOLS.md"],
67+
"assets": ["CHANGELOG.md", "package.json"],
6868
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
6969
}
7070
],

docs/.vitepress/config.mts

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
1-
import { defineConfig } from "vitepress";
1+
import { defineConfig, type HeadConfig } from "vitepress";
22

33
const base = (process.env.DOCS_BASE as `/${string}/` | undefined) ?? "/gitlab-mcp/";
4+
const hostname = "https://gitlab-mcp.sw.foundation";
45

56
export default defineConfig({
67
title: "GitLab MCP",
8+
titleTemplate: "%s | GitLab MCP",
79
description: "Model Context Protocol server for GitLab API",
810
base,
911

12+
transformHead({ pageData }) {
13+
const head: HeadConfig[] = [];
14+
const title = pageData.title || "GitLab MCP";
15+
const description = pageData.description || "Model Context Protocol server for GitLab API";
16+
const cleanPath = pageData.relativePath.replace(/(?:index)?\.md$/, "");
17+
const url = new URL(cleanPath, `${hostname}${base}`).href;
18+
19+
head.push(["meta", { property: "og:title", content: title }]);
20+
head.push(["meta", { property: "og:description", content: description }]);
21+
head.push(["meta", { property: "og:url", content: url }]);
22+
head.push(["meta", { name: "twitter:card", content: "summary_large_image" }]);
23+
head.push(["meta", { name: "twitter:title", content: title }]);
24+
head.push(["meta", { name: "twitter:description", content: description }]);
25+
26+
return head;
27+
},
28+
1029
// MCPB bundle is downloaded from GitHub releases during docs build.
1130
// Until first .mcpb release exists, the link is a dead link — safe to ignore.
1231
ignoreDeadLinks: [/\/downloads\/.+\.mcpb$/],
1332

33+
sitemap: {
34+
hostname,
35+
},
36+
1437
head: [
1538
["link", { rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
1639
["link", { rel: "icon", type: "image/png", sizes: "32x32", href: "/favicon-32x32.png" }],
@@ -130,7 +153,10 @@ export default defineConfig({
130153
"/tools/": [
131154
{
132155
text: "Tool Reference",
133-
items: [{ text: "Overview", link: "/tools/" }],
156+
items: [
157+
{ text: "Overview", link: "/tools/" },
158+
{ text: "Full API Reference", link: "/TOOLS" },
159+
],
134160
},
135161
{
136162
text: "By Use-Case",

0 commit comments

Comments
 (0)