From 0ea984d31d4b4477db4eec03920f3c19441467ef Mon Sep 17 00:00:00 2001 From: Matt Linville Date: Fri, 5 Dec 2025 08:05:57 -0800 Subject: [PATCH 1/5] Improve MDX validation triggering Currently, the script can hang indefinitely if there are no mdx files and prevent the PR from merging. This improves the mdx detection and exits much earlier and cleanly if the test is irrelevant. --- .github/workflows/validate-mdx.yml | 2 ++ .../mdx-validation/validate-mdx-mintlify.sh | 23 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate-mdx.yml b/.github/workflows/validate-mdx.yml index 673ecea0dc..a2c39957dc 100644 --- a/.github/workflows/validate-mdx.yml +++ b/.github/workflows/validate-mdx.yml @@ -9,6 +9,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 + with: + fetch-depth: 0 - uses: actions/setup-node@v6 with: node-version: '20' diff --git a/scripts/mdx-validation/validate-mdx-mintlify.sh b/scripts/mdx-validation/validate-mdx-mintlify.sh index ebaef91ba9..d909f23413 100755 --- a/scripts/mdx-validation/validate-mdx-mintlify.sh +++ b/scripts/mdx-validation/validate-mdx-mintlify.sh @@ -18,6 +18,28 @@ cleanup() { # Trap to ensure cleanup trap cleanup EXIT INT TERM +# Check if there are any MDX files in the changeset +if [ -n "$GITHUB_BASE_REF" ]; then + # In a PR context, check changed files + echo "Checking for changed MDX files in PR..." + + # Get the list of changed files + CHANGED_MDX=$(git diff --name-only "origin/$GITHUB_BASE_REF"...HEAD -- '*.mdx' 2>/dev/null | grep -E '\.mdx$' || true) + + if [ -z "$CHANGED_MDX" ]; then + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "NO MDX FILES CHANGED" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "No MDX files found in this PR. Skipping validation." + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + exit 0 + fi + + echo "Found changed MDX files:" + echo "$CHANGED_MDX" | sed 's/^/ /' + echo "" +fi + echo "Starting Mintlify validation..." echo "" echo "Running: mint dev --no-open (will run for ${PARSE_TIME}s to parse all files)" @@ -54,4 +76,3 @@ else echo "No parsing errors detected by Mintlify" exit 0 fi - From 6fb29b164d99e205c7df2d7a700ce6272ecc9c78 Mon Sep 17 00:00:00 2001 From: Matt Linville Date: Fri, 5 Dec 2025 08:16:30 -0800 Subject: [PATCH 2/5] Add broken-links check to validate-mdx script - WIth the previous commit to improve the MDX file detection, we can fix the problem of the remote Mintlify link-rot test not working in forks by adding mint broken-links to the end of the MDX validation script. Then we can make the MDX validation script mandatory. --- .../mdx-validation/validate-mdx-mintlify.sh | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/scripts/mdx-validation/validate-mdx-mintlify.sh b/scripts/mdx-validation/validate-mdx-mintlify.sh index d909f23413..363a50bce9 100755 --- a/scripts/mdx-validation/validate-mdx-mintlify.sh +++ b/scripts/mdx-validation/validate-mdx-mintlify.sh @@ -69,10 +69,36 @@ if grep -q "parsing error" "$LOGFILE"; then echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" exit 1 -else +fi + +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "✅ MINTLIFY PARSING VALIDATION PASSED" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "No parsing errors detected by Mintlify" +echo "" + +# Run broken links check +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "CHECKING FOR BROKEN LINKS" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "Running: mint broken-links" +echo "" + +if mint broken-links; then + echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "✅ MINTLIFY VALIDATION PASSED" + echo "✅ ALL VALIDATION CHECKS PASSED" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "No parsing errors detected by Mintlify" + echo "- No parsing errors" + echo "- No broken links" exit 0 +else + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "❌ BROKEN LINKS DETECTED" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "Please fix the broken links shown above." + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "" + exit 1 fi From 68a7ba9045f20b67979f34a5e0295be676ca1556 Mon Sep 17 00:00:00 2001 From: Matt Linville Date: Fri, 5 Dec 2025 11:50:14 -0800 Subject: [PATCH 3/5] Fix script bugs --- .../mdx-validation/validate-mdx-mintlify.sh | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/scripts/mdx-validation/validate-mdx-mintlify.sh b/scripts/mdx-validation/validate-mdx-mintlify.sh index 363a50bce9..77966d12a5 100755 --- a/scripts/mdx-validation/validate-mdx-mintlify.sh +++ b/scripts/mdx-validation/validate-mdx-mintlify.sh @@ -46,7 +46,19 @@ echo "Running: mint dev --no-open (will run for ${PARSE_TIME}s to parse all file echo "" # Run mint dev with tee to force output writing, timeout after PARSE_TIME seconds -timeout --preserve-status ${PARSE_TIME}s mint dev --no-open 2>&1 | tee "$LOGFILE" > /dev/null || true +# Use timeout if available (Linux), otherwise use gtimeout (macOS with coreutils), or perl as fallback +if command -v timeout > /dev/null 2>&1; then + timeout --preserve-status ${PARSE_TIME}s mint dev --no-open 2>&1 | tee "$LOGFILE" > /dev/null || true +elif command -v gtimeout > /dev/null 2>&1; then + gtimeout --preserve-status ${PARSE_TIME}s mint dev --no-open 2>&1 | tee "$LOGFILE" > /dev/null || true +else + # Fallback: run mint dev in background and kill after PARSE_TIME + mint dev --no-open 2>&1 | tee "$LOGFILE" > /dev/null & + PID=$! + sleep ${PARSE_TIME} + kill "$PID" 2>/dev/null || true + wait "$PID" 2>/dev/null || true +fi echo "" echo "✓ Mintlify finished parsing" @@ -84,15 +96,11 @@ echo "━━━━━━━━━━━━━━━━━━━━━━━━ echo "Running: mint broken-links" echo "" -if mint broken-links; then - echo "" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "✅ ALL VALIDATION CHECKS PASSED" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "- No parsing errors" - echo "- No broken links" - exit 0 -else +LINKS_OUTPUT=$(mint broken-links 2>&1) +echo "$LINKS_OUTPUT" + +# Check if broken links were found (mint broken-links exits 0 even when it finds broken links) +if echo "$LINKS_OUTPUT" | grep -q "found.*broken links"; then echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "❌ BROKEN LINKS DETECTED" @@ -102,3 +110,11 @@ else echo "" exit 1 fi + +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "✅ ALL VALIDATION CHECKS PASSED" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "- No parsing errors" +echo "- No broken links" +exit 0 From 0c4547a2f0b8059ce584a08f6b5283a0eb1197b4 Mon Sep 17 00:00:00 2001 From: Matt Linville Date: Fri, 5 Dec 2025 14:24:47 -0800 Subject: [PATCH 4/5] Fix broken-links failure detection --- scripts/mdx-validation/validate-mdx-mintlify.sh | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/scripts/mdx-validation/validate-mdx-mintlify.sh b/scripts/mdx-validation/validate-mdx-mintlify.sh index 77966d12a5..3da0ca629f 100755 --- a/scripts/mdx-validation/validate-mdx-mintlify.sh +++ b/scripts/mdx-validation/validate-mdx-mintlify.sh @@ -96,20 +96,8 @@ echo "━━━━━━━━━━━━━━━━━━━━━━━━ echo "Running: mint broken-links" echo "" -LINKS_OUTPUT=$(mint broken-links 2>&1) -echo "$LINKS_OUTPUT" - -# Check if broken links were found (mint broken-links exits 0 even when it finds broken links) -if echo "$LINKS_OUTPUT" | grep -q "found.*broken links"; then - echo "" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "❌ BROKEN LINKS DETECTED" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "Please fix the broken links shown above." - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "" - exit 1 -fi +# Run mint broken-links - it will exit with non-zero if broken links are found +mint broken-links echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" From d111d99c10a9e26bffd5c7cdb9b696b653ac3a57 Mon Sep 17 00:00:00 2001 From: mdlinville <7674613+mdlinville@users.noreply.github.com> Date: Mon, 5 Jan 2026 09:42:51 +0000 Subject: [PATCH 5/5] chore: Update Training API documentation --- training/api-reference.mdx | 23 +++++++++ training/api-reference/openapi.json | 73 +++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/training/api-reference.mdx b/training/api-reference.mdx index 046e63d671..2a2fafb93d 100644 --- a/training/api-reference.mdx +++ b/training/api-reference.mdx @@ -33,6 +33,29 @@ https://api.training.wandb.ai/v1 ### models +- **[POST /v1/preview/models](https://docs.wandb.ai/training/api-reference/models/create-model-v1-preview-models)** - Create Model +- **[DELETE /v1/preview/models/{model_id}](https://docs.wandb.ai/training/api-reference/models/delete-model-v1-preview-models--model-id-)** - Delete Model +- **[DELETE /v1/preview/models/{model_id}/checkpoints](https://docs.wandb.ai/training/api-reference/models/delete-model-checkpoints-v1-preview-models--model-id--checkpoints)** - Delete Model Checkpoints +- **[GET /v1/preview/models/{model_id}/checkpoints](https://docs.wandb.ai/training/api-reference/models/list-model-checkpoints-v1-preview-models--model-id--checkpoints)** - List Model Checkpoints +- **[POST /v1/preview/models/{model_id}/log](https://docs.wandb.ai/training/api-reference/models/log-v1-preview-models--model-id--log)** - Log + +### training-jobs + +- **[POST /v1/preview/training-jobs](https://docs.wandb.ai/training/api-reference/training-jobs/create-training-job-v1-preview-training-jobs)** - Create Training Job +- **[GET /v1/preview/training-jobs/{training_job_id}](https://docs.wandb.ai/training/api-reference/training-jobs/get-training-job-v1-preview-training-jobs--training-job-id-)** - Get Training Job +- **[GET /v1/preview/training-jobs/{training_job_id}/events](https://docs.wandb.ai/training/api-reference/training-jobs/get-training-job-events-v1-preview-training-jobs--training-job-id--events)** - Get Training Job Events + +### Uncategorized + +- **[GET /v1/health](https://docs.wandb.ai/training/api-reference/uncategorized/health-check-v1-health)** - Health Check +- **[GET /v1/system-check](https://docs.wandb.ai/training/api-reference/uncategorized/system-check-v1-system-check)** - System Check +### chat-completions + +- **[POST /v1/chat/completions](https://docs.wandb.ai/training/api-reference/chat-completions/create-chat-completion-v1-chat-completions)** - Create Chat Completion +- **[POST /v1/chat/completions/](https://docs.wandb.ai/training/api-reference/chat-completions/create-chat-completion-v1-chat-completions-)** - Create Chat Completion + +### models + - **[POST /v1/preview/models](https://docs.wandb.ai/training/api-reference/models/create-model-v1-preview-models)** - Create Model - **[DELETE /v1/preview/models/{model_id}/checkpoints](https://docs.wandb.ai/training/api-reference/models/delete-model-checkpoints-v1-preview-models--model-id--checkpoints)** - Delete Model Checkpoints - **[GET /v1/preview/models/{model_id}/checkpoints](https://docs.wandb.ai/training/api-reference/models/list-model-checkpoints-v1-preview-models--model-id--checkpoints)** - List Model Checkpoints diff --git a/training/api-reference/openapi.json b/training/api-reference/openapi.json index 73a07e7963..c3c7dcc644 100644 --- a/training/api-reference/openapi.json +++ b/training/api-reference/openapi.json @@ -290,6 +290,54 @@ } } }, + "/v1/preview/models/{model_id}": { + "delete": { + "tags": [ + "models" + ], + "summary": "Delete Model", + "description": "Delete a model, all its checkpoints, artifacts, and the associated W&B run.", + "operationId": "delete_model_v1_preview_models__model_id__delete", + "security": [ + { + "HTTPBearer": [] + } + ], + "parameters": [ + { + "name": "model_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Model Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteModelResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, "/v1/preview/models/{model_id}/log": { "post": { "tags": [ @@ -2676,6 +2724,31 @@ "title": "DeleteCheckpointsResponse", "description": "Schema for delete checkpoints response." }, + "DeleteModelResponse": { + "properties": { + "model_id": { + "type": "string", + "format": "uuid", + "title": "Model Id" + }, + "deleted_checkpoints": { + "type": "integer", + "title": "Deleted Checkpoints" + }, + "deleted_run": { + "type": "boolean", + "title": "Deleted Run" + } + }, + "type": "object", + "required": [ + "model_id", + "deleted_checkpoints", + "deleted_run" + ], + "title": "DeleteModelResponse", + "description": "Schema for delete model response." + }, "ExperimentalTrainingConfig": { "properties": { "learning_rate": {