From c478519cf6aeb505564addad6836f9a92657bbe1 Mon Sep 17 00:00:00 2001 From: David Antoon Date: Wed, 28 Jan 2026 03:23:53 +0200 Subject: [PATCH] feat: streamline release workflow by updating release body preparation and removing outdated changelog updates --- .github/workflows/publish-release.yml | 109 ++++++++++++++------------ CHANGELOG.md | 53 ------------- docs/vectoriadb/updates.mdx | 75 +----------------- scripts/update-docs-changelog.mjs | 75 ------------------ 4 files changed, 61 insertions(+), 251 deletions(-) delete mode 100644 CHANGELOG.md delete mode 100755 scripts/update-docs-changelog.mjs diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 725ccde..e428ad7 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -172,7 +172,6 @@ jobs: script: | const fs = require('fs'); const diff = fs.readFileSync('/tmp/diff.txt', 'utf8'); - const existingUpdates = fs.readFileSync('docs/vectoriadb/updates.mdx', 'utf8'); const releaseDate = new Date().toISOString().split('T')[0]; const version = process.env.VERSION; const versionNum = version.replace('v', ''); @@ -231,51 +230,18 @@ jobs: core.setOutput('changelog', result.changelog); core.setOutput('has_card_mdx', result.cardMdx ? 'true' : 'false'); - - name: Update CHANGELOG.md - if: ${{ inputs.dry_run != true && inputs.release_type == 'stable' && steps.ai_changelog.outputs.changelog }} - run: | - node -e " - const fs = require('fs'); - const changelog = fs.readFileSync('CHANGELOG.md', 'utf8'); - const newEntry = process.env.CHANGELOG_ENTRY; - const lines = changelog.split('\n'); - const unreleasedIdx = lines.findIndex(l => l.startsWith('## [Unreleased]')); - let insertIdx = unreleasedIdx + 1; - while (insertIdx < lines.length && !lines[insertIdx].match(/^## \[\d/)) insertIdx++; - if (lines[insertIdx - 1].trim() !== '') { lines.splice(insertIdx, 0, ''); insertIdx++; } - lines.splice(insertIdx, 0, newEntry); - fs.writeFileSync('CHANGELOG.md', lines.join('\n')); - " - env: - CHANGELOG_ENTRY: ${{ steps.ai_changelog.outputs.changelog }} - - - name: Update updates.mdx - if: ${{ inputs.dry_run != true && inputs.release_type == 'stable' && steps.ai_changelog.outputs.has_card_mdx == 'true' }} - run: | - node scripts/update-docs-changelog.mjs \ - --version "v${{ steps.version.outputs.version }}" \ - --version-minor "${{ steps.context.outputs.release_line }}" \ - --card-mdx-file "/tmp/card-mdx.txt" - - name: Update package version if: ${{ inputs.dry_run != true }} run: | npx nx release version "${{ steps.version.outputs.version }}" \ --projects=vectoriadb --git-tag=false --git-commit=false - - name: Commit version bump and docs + - name: Commit version bump if: ${{ inputs.dry_run != true }} run: | if [ -n "$(git status --porcelain)" ]; then git add -A - git commit -m "$(cat <<'EOF' - chore(release): v${{ steps.version.outputs.version }} - - - Bump version to ${{ steps.version.outputs.version }} - - Update CHANGELOG.md - - Update docs/vectoriadb/updates.mdx - EOF - )" + git commit -m "chore(release): v${{ steps.version.outputs.version }}" git push origin HEAD fi @@ -315,6 +281,60 @@ jobs: echo "Created and pushed tag: $TAG" + - name: Prepare release body + id: release_body + env: + CHANGELOG: ${{ steps.ai_changelog.outputs.changelog }} + run: | + VERSION="${{ steps.version.outputs.version }}" + RELEASE_TYPE="${{ steps.version.outputs.release_type }}" + RELEASE_LINE="${{ steps.context.outputs.release_line }}" + BRANCH="${{ steps.context.outputs.branch }}" + IS_PRERELEASE="${{ steps.version.outputs.is_prerelease }}" + + # Start building the release body + { + echo "## Release v${VERSION}" + echo "" + echo "**Release type:** ${RELEASE_TYPE}" + echo "**Release line:** ${RELEASE_LINE}.x" + echo "**Branch:** ${BRANCH}" + } > /tmp/release-body.md + + # Add AI-generated changelog if available + if [ -f /tmp/card-mdx.txt ] && [ -s /tmp/card-mdx.txt ] && [ -n "$CHANGELOG" ]; then + echo "" >> /tmp/release-body.md + echo "$CHANGELOG" >> /tmp/release-body.md + fi + + # Add installation section + { + echo "" + echo "### Installation" + echo "" + echo '```bash' + echo "npm install vectoriadb@${VERSION}" + echo '```' + } >> /tmp/release-body.md + + # Add pre-release note if applicable + if [ "$IS_PRERELEASE" = "true" ]; then + echo "" >> /tmp/release-body.md + echo "> **Note:** This is a pre-release version." >> /tmp/release-body.md + fi + + # Add Card MDX as hidden comment for docs sync (only for stable releases) + # NOTE: Content is sanitized to prevent --> from breaking the HTML comment. + # Consumer must reverse: replace "-->" with "-->" after extraction. + if [ -f /tmp/card-mdx.txt ] && [ -s /tmp/card-mdx.txt ]; then + echo "" >> /tmp/release-body.md + echo "/--\>/g' /tmp/card-mdx.txt >> /tmp/release-body.md + echo "CARD_MDX_END" >> /tmp/release-body.md + echo "-->" >> /tmp/release-body.md + fi + - name: Create GitHub Release if: ${{ inputs.dry_run != true }} uses: softprops/action-gh-release@v2 @@ -322,21 +342,8 @@ jobs: tag_name: v${{ steps.version.outputs.version }} name: v${{ steps.version.outputs.version }} prerelease: ${{ steps.version.outputs.is_prerelease }} - generate_release_notes: true - body: | - ## Release v${{ steps.version.outputs.version }} - - **Release type:** ${{ steps.version.outputs.release_type }} - **Release line:** ${{ steps.context.outputs.release_line }}.x - **Branch:** ${{ steps.context.outputs.branch }} - - ### Installation - - ```bash - npm install vectoriadb@${{ steps.version.outputs.version }} - ``` - - ${{ steps.version.outputs.is_prerelease == 'true' && '> **Note:** This is a pre-release version.' || '' }} + generate_release_notes: false + body_path: /tmp/release-body.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 5bdd78d..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,53 +0,0 @@ -# Changelog - -All notable changes to VectoriaDB will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -## [2.1.2] - 2026-01-28 -### Added -- Added 'Updates' section under 'Get Started' in the Documentation dropdown. -- Added icons for 'Documentation' and 'API Reference' dropdowns. - -### Changed -- Consolidated entries under 'Alternatives' and 'Use Cases' groups into single lines for clarity. - -### Fixed -- Adjusted the presentation of groups and pages to improve navigability and reduce clutter. -## [2.1.0] - 2026-01-27 - -## [2.0.2] - 2026-01-07 - -### Fixed - -- Regex vulnerability detection now trims analyzed patterns to 500 characters and evaluates them through bounded helper regexes to avoid the analyzer triggering ReDoS. -- Redis namespace sanitization bounds the namespace prior to regex processing and swaps in precompiled `SAFE_PATTERNS` to strip control characters and unsafe symbols deterministically. - -### Security - -- Hardened both the regex analyzer and namespace sanitizer so untrusted input can no longer leverage those code paths for ReDoS attacks. - -## [2.0.0] - 2025-12-12 - -### Added - -- Added EmbeddingService.setTransformersModule() and clearTransformersModule() to allow injecting custom transformer pipelines (primarily for testing). - -### Changed - -- Transformer embeddings now lazy-load @huggingface/transformers and emit a ConfigurationError with installation guidance when the package is not installed. -- @huggingface/transformers is now distributed as an optional peer dependency and must be added explicitly when using transformer embeddings. - -## [1.0.0] - 2025-11-30 - -### Added - -- Initial release -- In-memory vector database for semantic search -- Cosine similarity and Euclidean distance metrics -- Namespace support for multi-tenant use cases -- Configurable embedding dimensions -- Efficient nearest neighbor search diff --git a/docs/vectoriadb/updates.mdx b/docs/vectoriadb/updates.mdx index ef04932..321a3d7 100644 --- a/docs/vectoriadb/updates.mdx +++ b/docs/vectoriadb/updates.mdx @@ -1,76 +1,7 @@ --- -title: 'Updates' +title: "Updates" description: "Changelog and release history for VectoriaDB" -slug: 'updates' -icon: 'sparkles' -mode: 'center' +icon: "clock-rotate-left" --- - - - **Feature** – Enhanced documentation layout. - - Added updates section and icons for better user guidance. - - - - - - - **ReDoS Vulnerability Fixes** – Hardened regex analyzer and namespace sanitizer against ReDoS attacks. - - Regex vulnerability detection now trims analyzed patterns to 500 characters - - Redis namespace sanitization bounds input prior to regex processing - - Precompiled `SAFE_PATTERNS` used for deterministic string operations - - - If you're using v2.0.0 or v2.0.1, upgrade to v2.0.2 immediately to patch security vulnerabilities. - - - - - - - ```bash - npm install @huggingface/transformers - ``` - - - - **Initial Release** – Production-ready in-memory vector database for semantic search. - - - **In-Memory Vector Database**: Fast semantic search using cosine similarity - - **Offline Embeddings**: Local embedding generation via transformers.js - - **Type-Safe Metadata**: TypeScript generics for compile-time safety - - **HNSW Indexing**: Sub-millisecond queries for large datasets - - **Storage Adapters**: File, Redis, and Memory adapters for persistence - - **Namespace Support**: Multi-tenant isolation - - **Operational Guardrails**: Rate limits, batch validation, document size limits - - **Typed Error Classes**: Machine-readable error codes for programmatic handling - - - -## GitHub Releases - -For detailed release notes and download links, see the [GitHub Releases](https://github.com/agentfront/vectoriadb/releases) page. - -## Related - - - - Get started with VectoriaDB - - - Common migration questions - - +{/* This file is auto-generated by docs sync from GitHub releases */} diff --git a/scripts/update-docs-changelog.mjs b/scripts/update-docs-changelog.mjs deleted file mode 100755 index 9cd98db..0000000 --- a/scripts/update-docs-changelog.mjs +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env node -/** - * Updates docs/vectoriadb/updates.mdx with a new Card component for a release. - * - * Usage: - * node scripts/update-docs-changelog.mjs --version "v2.0.3" --version-minor "2.0" --card-mdx-file "/tmp/card.mdx" - * - * The card-mdx-file should contain a single ... component. - */ - -import fs from 'fs'; -import { parseArgs } from 'util'; - -const { values } = parseArgs({ - options: { - version: { type: 'string' }, - 'version-minor': { type: 'string' }, - 'card-mdx-file': { type: 'string' }, - }, -}); - -if (!values.version || !values['version-minor'] || !values['card-mdx-file']) { - console.error( - 'Usage: update-docs-changelog.mjs --version --version-minor --card-mdx-file ' - ); - process.exit(1); -} - -// Read card MDX from file to avoid shell escaping issues -const cardMdx = fs.readFileSync(values['card-mdx-file'], 'utf8').trim(); - -if (!cardMdx.includes(' component'); - process.exit(1); -} - -const updatesPath = 'docs/vectoriadb/updates.mdx'; -const content = fs.readFileSync(updatesPath, 'utf8'); - -// Find existing Update block for this minor version or create new one -const versionLabel = `v${values['version-minor']}.x`; -const updateBlockRegex = new RegExp(`]*>([\\s\\S]*?)`, 'm'); - -const match = content.match(updateBlockRegex); -let newContent; - -if (match) { - // Add new Card to existing Update block (insert after opening tag) - const existingBlock = match[0]; - const openTagEnd = existingBlock.indexOf('>') + 1; - const newBlock = existingBlock.slice(0, openTagEnd) + '\n ' + cardMdx + '\n' + existingBlock.slice(openTagEnd); - newContent = content.replace(existingBlock, newBlock); -} else { - // Create new Update block after frontmatter - const frontmatterEndMatch = content.match(/^---[\s\S]*?---/); - if (!frontmatterEndMatch) { - console.error('Could not find frontmatter in updates.mdx'); - process.exit(1); - } - - const frontmatterEnd = frontmatterEndMatch.index + frontmatterEndMatch[0].length; - const currentDate = new Date(); - const monthYear = currentDate.toLocaleDateString('en-US', { month: 'long', year: 'numeric' }); - - const newUpdateBlock = ` - - - ${cardMdx} - -`; - newContent = content.slice(0, frontmatterEnd) + newUpdateBlock + content.slice(frontmatterEnd); -} - -fs.writeFileSync(updatesPath, newContent); -console.log(`Updated ${updatesPath} for ${values.version}`);