Skip to content

Commit 7fa3eaa

Browse files
authored
Merge branch 'main' into codewizard-logo
Signed-off-by: Peter Jausovec <peterj@users.noreply.github.com>
2 parents 6d86cef + b034a22 commit 7fa3eaa

115 files changed

Lines changed: 10388 additions & 4977 deletions

File tree

Some content is hidden

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

.github/workflows/update-ref-docs.yaml

Lines changed: 102 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ jobs:
4141

4242
- name: Verify API directory exists
4343
run: |
44-
if [ ! -d "$GITHUB_WORKSPACE/kagent/go/controller/api/v1alpha2" ]; then
45-
echo "Error: API directory not found at $GITHUB_WORKSPACE/kagent/go/controller/api/v1alpha2"
46-
ls -la "$GITHUB_WORKSPACE/kagent/go/controller/api/"
44+
if [ ! -d "$GITHUB_WORKSPACE/kagent/go/api/v1alpha2" ]; then
45+
echo "Error: API directory not found at $GITHUB_WORKSPACE/kagent/go/api/v1alpha2"
46+
ls -la "$GITHUB_WORKSPACE/kagent/go/api/"
4747
exit 1
4848
fi
4949
echo "API directory found and verified"
@@ -75,7 +75,7 @@ jobs:
7575
7676
# Generate API docs
7777
go run github.com/elastic/crd-ref-docs@v0.1.0 \
78-
--source-path="$GITHUB_WORKSPACE/kagent/go/controller/api/v1alpha2/" \
78+
--source-path="$GITHUB_WORKSPACE/kagent/go/api/v1alpha2/" \
7979
--renderer=markdown \
8080
--output-path ./ \
8181
--config=crd-ref-docs-config.yaml
@@ -91,13 +91,13 @@ jobs:
9191
9292
# Create index file with frontmatter
9393
echo '---' > src/app/docs/kagent/resources/api-ref/page.mdx
94-
echo 'title: "API Reference"' >> src/app/docs/kagent/resources/api-ref/page.mdx
95-
echo 'sectionOrder: 1' >> src/app/docs/kagent/resources/api-ref/page.mdx
94+
echo 'title: "API docs"' >> src/app/docs/kagent/resources/api-ref/page.mdx
95+
echo 'pageOrder: 1' >> src/app/docs/kagent/resources/api-ref/page.mdx
9696
echo 'description: "kagent API reference documentation"' >> src/app/docs/kagent/resources/api-ref/page.mdx
9797
echo '---' >> src/app/docs/kagent/resources/api-ref/page.mdx
9898
echo '' >> src/app/docs/kagent/resources/api-ref/page.mdx
9999
echo 'export const metadata = {' >> src/app/docs/kagent/resources/api-ref/page.mdx
100-
echo ' title: "API Reference",' >> src/app/docs/kagent/resources/api-ref/page.mdx
100+
echo ' title: "API docs",' >> src/app/docs/kagent/resources/api-ref/page.mdx
101101
echo ' description: "kagent API reference documentation",' >> src/app/docs/kagent/resources/api-ref/page.mdx
102102
echo ' author: "kagent.dev"' >> src/app/docs/kagent/resources/api-ref/page.mdx
103103
echo '};' >> src/app/docs/kagent/resources/api-ref/page.mdx
@@ -107,13 +107,28 @@ jobs:
107107
# Remove temporary file
108108
rm -f "./out.md"
109109
110+
# Fix problematic angle brackets in the generated MDX file
111+
# Convert literal angle brackets to HTML entities to prevent MDX parsing errors
112+
# But preserve legitimate HTML tags like <br />, <kagent-controller-ip>, etc.
113+
echo "Fixing problematic angle brackets in generated MDX..."
114+
115+
# First, temporarily replace legitimate HTML tags with placeholders
116+
sed -i 's/<br \/>/__BR_TAG__/g' "src/app/docs/kagent/resources/api-ref/page.mdx"
117+
118+
# Convert remaining angle brackets to HTML entities
119+
sed -i 's/</\&lt;/g' "src/app/docs/kagent/resources/api-ref/page.mdx"
120+
sed -i 's/>/\&gt;/g' "src/app/docs/kagent/resources/api-ref/page.mdx"
121+
122+
# Restore legitimate HTML tags
123+
sed -i 's/__BR_TAG__/<br \/>/g' "src/app/docs/kagent/resources/api-ref/page.mdx"
124+
110125
# Verify the output file was created
111126
if [ ! -f "src/app/docs/kagent/resources/api-ref/page.mdx" ]; then
112127
echo "Error: Failed to create API docs page"
113128
exit 1
114129
fi
115130
116-
echo "API docs generated successfully"
131+
echo "API docs generated and processed successfully"
117132
118133
- name: Generate Helm Chart Reference
119134
run: |
@@ -135,22 +150,94 @@ jobs:
135150

136151
echo "Processing kagent Helm chart..."
137152

153+
echo "Chart directory contents:"
154+
ls -la "$GITHUB_WORKSPACE/kagent/helm/kagent/"
155+
156+
# Generate Chart.yaml from template for helm-docs to work
157+
echo "Generating Chart.yaml from template..."
158+
cd "$GITHUB_WORKSPACE/kagent/helm/kagent"
159+
160+
# Get the version from git or use a default
161+
VERSION=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.5.5")
162+
echo "Using version: $VERSION"
163+
164+
# Copy template and substitute version
165+
cp Chart-template.yaml Chart.yaml
166+
sed -i "s/\${VERSION}/$VERSION/g" Chart.yaml
167+
168+
echo "Generated Chart.yaml contents:"
169+
cat Chart.yaml
170+
171+
# Go back to website directory
172+
cd "$GITHUB_WORKSPACE/website"
173+
174+
echo "Chart.yaml contents:"
175+
cat "$GITHUB_WORKSPACE/kagent/helm/kagent/Chart.yaml" || echo "Chart.yaml not found!"
176+
177+
echo "Values.yaml contents (first 20 lines):"
178+
head -20 "$GITHUB_WORKSPACE/kagent/helm/kagent/values.yaml" || echo "values.yaml not found!"
179+
180+
# Generate the helm documentation
181+
echo "Running helm-docs..."
182+
183+
# Debug: Show all available paths
184+
echo "Available paths:"
185+
echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE"
186+
echo "Current directory: $PWD"
187+
echo "kagent repo path: $GITHUB_WORKSPACE/kagent"
188+
echo "kagent helm path: $GITHUB_WORKSPACE/kagent/helm"
189+
echo "kagent chart path: $GITHUB_WORKSPACE/kagent/helm/kagent"
190+
191+
# List all helm directories to see what's available
192+
echo "All helm directories:"
193+
find "$GITHUB_WORKSPACE/kagent/helm" -name "Chart.yaml" -type f 2>/dev/null | head -10
194+
195+
# Check if the specific chart directory exists and what's in it
196+
echo "Checking chart directory:"
197+
if [ -d "$GITHUB_WORKSPACE/kagent/helm/kagent" ]; then
198+
echo "Chart directory exists"
199+
ls -la "$GITHUB_WORKSPACE/kagent/helm/kagent/"
200+
echo "Chart.yaml exists: $([ -f "$GITHUB_WORKSPACE/kagent/helm/kagent/Chart.yaml" ] && echo "YES" || echo "NO")"
201+
echo "Values.yaml exists: $([ -f "$GITHUB_WORKSPACE/kagent/helm/kagent/values.yaml" ] && echo "YES" || echo "NO")"
202+
else
203+
echo "Chart directory does NOT exist"
204+
fi
205+
138206
# Generate the helm documentation
139207
go run github.com/norwoodj/helm-docs/cmd/helm-docs@v1.14.2 \
140208
--chart-search-root "$GITHUB_WORKSPACE/kagent/helm/kagent" \
141209
--dry-run > "src/app/docs/kagent/resources/helm/temp.mdx"
210+
211+
# Go back to website directory
212+
cd "$GITHUB_WORKSPACE/website"
213+
214+
echo "Generated helm-docs output (first 50 lines):"
215+
head -50 "src/app/docs/kagent/resources/helm/temp.mdx"
216+
217+
echo "Generated helm-docs output (last 50 lines):"
218+
tail -50 "src/app/docs/kagent/resources/helm/temp.mdx"
219+
220+
echo "Total lines generated:"
221+
wc -l "src/app/docs/kagent/resources/helm/temp.mdx"
142222

143223
# Remove badge line and following empty line
144224
# (might be replaced by helm docs template in the future)
145225
sed -i '/!\[Version:/,/^$/d' "src/app/docs/kagent/resources/helm/temp.mdx"
146226

147-
# Remove backticks from the Default column in the table
148-
sed -i 's/| `\([^`]*\)` |/| \1 |/g' "src/app/docs/kagent/resources/helm/temp.mdx"
227+
# Wrap the KMCP version placeholder in inline code so it shows literally in MDX
228+
python - <<'PY'
229+
from pathlib import Path
230+
231+
path = Path("src/app/docs/kagent/resources/helm/temp.mdx")
232+
text = path.read_text()
233+
text = text.replace("${KMCP_VERSION}", "`" + "${KMCP_VERSION}" + "`")
234+
path.write_text(text)
235+
PY
149236

150237
# Add frontmatter
151238
echo '---' > "src/app/docs/kagent/resources/helm/page.mdx"
152239
echo 'title: "Helm Chart Configuration"' >> "src/app/docs/kagent/resources/helm/page.mdx"
153-
echo 'sectionOrder: 2' >> "src/app/docs/kagent/resources/helm/page.mdx"
240+
echo 'pageOrder: 2' >> "src/app/docs/kagent/resources/helm/page.mdx"
154241
echo 'description: "kagent Helm chart configuration reference"' >> "src/app/docs/kagent/resources/helm/page.mdx"
155242
echo '---' >> "src/app/docs/kagent/resources/helm/page.mdx"
156243
echo '' >> "src/app/docs/kagent/resources/helm/page.mdx"
@@ -170,6 +257,9 @@ jobs:
170257
echo "=== Debug: After creating index file ==="
171258
echo "Content directory structure:"
172259
ls -la src/app/docs/kagent/resources/helm/
260+
261+
echo "Final generated file contents (first 50 lines):"
262+
head -50 "src/app/docs/kagent/resources/helm/page.mdx"
173263

174264
- name: Create Pull Request
175265
uses: peter-evans/create-pull-request@v6
@@ -182,7 +272,7 @@ jobs:
182272
body: |
183273
Automated API and kagent Helm chart documentation update based on the latest commit [`${{ env.KAGENT_COMMIT }}`](https://github.com/${{ github.repository_owner }}/kagent/commit/${{ env.KAGENT_COMMIT }}) to `main` in the **kagent** repository.
184274
185-
This PR was automatically generated by the [**Update Reference documentation** workflow](https://github.com/kagent-dev/website/actions/workflows/update-ref-docs.yaml).
275+
This PR was automatically generated by the [**Update Reference documentation** workflow](https://github.com/${{ github.repository_owner }}/website/actions/workflows/update-ref-docs.yaml).
186276
branch: api-gen-update
187277
branch-suffix: timestamp
188278
delete-branch: true

CONTRIBUTION.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Thank you for your interest in contributing to Kagent! This document provides gu
99
- [Style Guide](#style-guide)
1010
- [Documentation](#documentation)
1111
- [Testing](#testing)
12+
- [Contributing Blog Posts](#contributing-blog-posts)
1213
- [Community](#community)
1314
- [License](#license)
1415
- [Questions and Help](#questions-and-help)
@@ -74,7 +75,18 @@ By participating in this project, you agree to abide by our [Code of Conduct](CO
7475

7576
7. Once approved, a maintainer will merge your PR
7677

77-
## Adding a new blog post
78+
## Contributing Blog Posts
79+
80+
The kagent website includes a blog section where we post about kagent. If you'd like to submit a blog post to [kagent.dev](https://kagent.dev), make sure your article meets the guidelines below. If you have any questions or you'd like to discuss your ideas, please send us a meessage on our [Discord server](https://bit.ly/kagentdiscord).
81+
82+
### Blog post guidelines
83+
84+
- Posts should be about the kagent project and valuable to our community
85+
- Posts should focus on the open source kagent project and not vendor specific projects or products
86+
- Any submitted blog posts must be original content and not a copy of existing blog posts
87+
88+
### Writing a new blog post on kagent
89+
7890
1. Create your blog post in `src/blogContent` folder. You can copy an existing blog post and modify it.
7991
2. Make sure you add the following metadata at the top of your blog post - update the title, published date, description, author, and authorIds accordingly.
8092

@@ -112,6 +124,10 @@ If you need to add a new author, you can do that in the [authors.ts file](https:
112124

113125
4. All images can be added to the public/images folder.
114126

127+
### Adding an existing blog post
128+
129+
To add an existing blog post, you can add a new entry into the `external-blog-posts.yaml` file. Same guidelines as above apply.
130+
115131
## Style Guide
116132

117133
- Follow the existing code style

open-next.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ const config = {
99
converter: "edge",
1010
tagCache: "dummy",
1111
queue: "dummy",
12+
proxyExternalRequest: "fetch",
1213
},
1314
},
14-
15+
edgeExternals: ["node:crypto"],
1516
middleware: {
1617
external: true,
1718
override: {
1819
wrapper: "cloudflare-edge",
1920
converter: "edge",
2021
proxyExternalRequest: "fetch",
22+
incrementalCache: "dummy",
23+
tagCache: "dummy",
24+
queue: "dummy",
2125
},
2226
},
2327
};

0 commit comments

Comments
 (0)