fix: use bloblang syntax highlighting instead of coffeescript#184
fix: use bloblang syntax highlighting instead of coffeescript#184JakeSCahill merged 11 commits intomainfrom
Conversation
✅ Deploy Preview for docs-extensions-and-macros ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis pull request contains a minor version bump and a formatter update. The package version in Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
635bdc9 to
4be95f2
Compare
Changes: - Fixed syntax highlighting: replaced 'coffeescript' with 'bloblang' - Added Parameters section with clean AsciiDoc table format - Fixed HTML entity escaping using triple braces in templates - Extracted summary text as lead-in prose (not embedded as comments) Bloblang change detection in PR summaries: - Added detection of new/removed Bloblang methods and functions - PR summary now includes Writer Action Items section for Bloblang changes - Provides instructions on how to manually add includes to guide pages - Shows counts in total summary and per-release breakdowns This gives writers visibility into Bloblang changes without automatically modifying guide pages, preserving manual control over documentation structure. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
4be95f2 to
9444048
Compare
Removed decorative emojis from: - Main headings (Redpanda Connect Documentation Update) - Multi-release update label - Version headings - Writer Action Items - Detailed Changes - Summary list items - Subsection headings Kept⚠️ only for critical warnings: - Breaking Changes Detected - Missing Descriptions - Removed Connectors - Removed Fields - Changed Default Values Reduced emoji count from 27 to 5 instances. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tools/redpanda-connect/report-delta.js`:
- Around line 167-170: The mapping currently assumes each entry is an object and
accessing m.name/f.name will throw for null/undefined items; update the four
expressions (oldMethods, newMethods, oldFunctions, newFunctions) to guard
against null items by either filtering out falsy entries before mapping or using
optional chaining when accessing the name (e.g. (oldIndex['bloblang-methods'] ||
[]).filter(Boolean).map(m => m.name).filter(Boolean) or .map(m =>
m?.name).filter(Boolean)), so that null/undefined entries cannot cause a crash
during diff generation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d3b86649-9c84-42d0-a5fa-f038cff66822
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (7)
package.jsontools/redpanda-connect/helpers/bloblangExample.jstools/redpanda-connect/helpers/hasOptionalParams.jstools/redpanda-connect/helpers/index.jstools/redpanda-connect/pr-summary-formatter.jstools/redpanda-connect/report-delta.jstools/redpanda-connect/templates/bloblang-function.hbs
✅ Files skipped from review due to trivial changes (2)
- package.json
- tools/redpanda-connect/helpers/hasOptionalParams.js
🚧 Files skipped from review as they are similar to previous changes (1)
- tools/redpanda-connect/helpers/bloblangExample.js
Added ensurePeriod helper that automatically adds a period to descriptions that don't already have terminal punctuation. This ensures consistent formatting even if source data is missing periods. Works alongside the existing bloblangExample helper which ensures lead-ins end with colons. Part of version 4.15.8. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…partials Removed all emojis from PR summary output for cleaner, professional formatting. Added automatic deletion of Bloblang method/function partials when they are removed from the source data. The automation now: - Reads existing partials from the output directory - Compares with current data - Deletes partials for removed methods/functions - Logs deletions to console PR summary already includes Writer Action Items for removed Bloblang methods/functions, telling writers which includes to delete from guide pages. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Adds comprehensive deprecation tracking and reporting for Bloblang methods and functions across templates, delta reports, and PR summaries. Template changes: - Add deprecation warning block to bloblang-function.hbs template - Display warning when status equals "deprecated" - Include description in warning block using ensurePeriod helper - Fix superfluous whitespace (only 1 blank line after title) Delta detection: - Track newly deprecated Bloblang methods and functions in report-delta.js - Compare status field between old and new versions - Add deprecatedBloblangMethods and deprecatedBloblangFunctions arrays - Include counts in summary and details in output PR summary formatting: - Add Bloblang stats to summary section (new, removed, deprecated) - Add Writer Action Items section for Bloblang changes - Include deprecated methods/functions with version information - Add instructions for updating guide pages - Support both single-version and multi-version PR summaries This ensures writers are notified when Bloblang methods or functions are deprecated and can add appropriate notices to documentation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
tools/redpanda-connect/pr-summary-formatter.js (1)
879-955: Consider extracting shared Bloblang instruction rendering.The "Update Bloblang Guide Pages" section (lines 879-955) duplicates the same logic and text as the multi-version equivalent (lines 386-455). If this pattern continues to grow, consider extracting a helper function to reduce duplication.
This is a minor maintainability concern and acceptable to defer.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tools/redpanda-connect/pr-summary-formatter.js` around lines 879 - 955, The Bloblang guide rendering block duplicates the same logic/text used elsewhere (see the multi-version block) — extract a helper (e.g., renderBloblangGuideSection or renderBloblangEntries) that accepts stats and diffData.details and produces the lines array entries for new/removed/deprecated methods/functions and the "How to add includes" footer; replace the current inline block guarded by hasBloblangChanges with a call to that helper and reuse it in the other multi-version location to eliminate duplication (refer to symbols: hasBloblangChanges, stats.newBloblangMethods, stats.removedBloblangFunctions, stats.deprecatedBloblangMethods, diffData.details.newBloblangFunctions, and the lines array).tools/redpanda-connect/generate-rpcn-connector-docs.js (1)
476-490: Consider protecting hand-authored files from deletion.The deletion pass removes all
.adocfiles in Bloblang partials directories that aren't in the current data set. If anyone manually creates a file inbloblang-functions/orbloblang-methods/(e.g., a custom partial or documentation override), it will be silently deleted.If hand-authored files are a realistic scenario, consider adding a whitelist mechanism or a naming convention (e.g., prefix with
_) to exclude certain files from deletion.💡 Example safeguard using a naming convention
for (const file of existingFiles) { + // Skip files starting with underscore (convention for hand-authored) + if (file.startsWith('_')) continue; const name = file.replace('.adoc', ''); if (!currentNames.has(name)) { const filePath = path.join(outRoot, file); fs.unlinkSync(filePath); console.log(`Deleted removed ${folder} partial: ${file}`); } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tools/redpanda-connect/generate-rpcn-connector-docs.js` around lines 476 - 490, The deletion loop removes any .adoc in outRoot not present in currentNames, risking removal of hand-authored files; update the logic in the block that builds existingFiles / the for loop (referencing existingFiles, currentNames, outRoot, folder and fs.unlinkSync) to skip files that follow a safe naming convention (e.g., names starting with '_' or in a whitelist array), or check against a configurable whitelist set before calling fs.unlinkSync, and log skipped files so manual partials are preserved.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tools/redpanda-connect/report-delta.js`:
- Around line 181-184: The Map constructions for oldMethodsMap, newMethodsMap,
oldFunctionsMap and newFunctionsMap can throw if any entry is null/undefined;
update each expression to safely handle missing entries by first falling back to
an empty array then filtering out falsy items (or items without a .name) before
mapping—e.g., replace (oldIndex['bloblang-methods'] || []).map(...) with
(oldIndex['bloblang-methods'] || []).filter(Boolean).map(m => [m.name, m]) or
equivalent guards so .name is only accessed on valid objects.
---
Nitpick comments:
In `@tools/redpanda-connect/generate-rpcn-connector-docs.js`:
- Around line 476-490: The deletion loop removes any .adoc in outRoot not
present in currentNames, risking removal of hand-authored files; update the
logic in the block that builds existingFiles / the for loop (referencing
existingFiles, currentNames, outRoot, folder and fs.unlinkSync) to skip files
that follow a safe naming convention (e.g., names starting with '_' or in a
whitelist array), or check against a configurable whitelist set before calling
fs.unlinkSync, and log skipped files so manual partials are preserved.
In `@tools/redpanda-connect/pr-summary-formatter.js`:
- Around line 879-955: The Bloblang guide rendering block duplicates the same
logic/text used elsewhere (see the multi-version block) — extract a helper
(e.g., renderBloblangGuideSection or renderBloblangEntries) that accepts stats
and diffData.details and produces the lines array entries for
new/removed/deprecated methods/functions and the "How to add includes" footer;
replace the current inline block guarded by hasBloblangChanges with a call to
that helper and reuse it in the other multi-version location to eliminate
duplication (refer to symbols: hasBloblangChanges, stats.newBloblangMethods,
stats.removedBloblangFunctions, stats.deprecatedBloblangMethods,
diffData.details.newBloblangFunctions, and the lines array).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 89c4651e-2c4c-4acd-967c-febca5892575
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (9)
package.jsontools/redpanda-connect/generate-rpcn-connector-docs.jstools/redpanda-connect/helpers/bloblangExample.jstools/redpanda-connect/helpers/ensurePeriod.jstools/redpanda-connect/helpers/hasOptionalParams.jstools/redpanda-connect/helpers/index.jstools/redpanda-connect/pr-summary-formatter.jstools/redpanda-connect/report-delta.jstools/redpanda-connect/templates/bloblang-function.hbs
✅ Files skipped from review due to trivial changes (2)
- package.json
- tools/redpanda-connect/helpers/ensurePeriod.js
🚧 Files skipped from review as they are similar to previous changes (1)
- tools/redpanda-connect/helpers/bloblangExample.js
Updates the bloblang-function.hbs template to ensure descriptions appear after (not inside) deprecation warning blocks. Before: ``` [WARNING] ==== This method is deprecated... Description text here. ==== ``` After: ``` [WARNING] ==== This method is deprecated... ==== Description text here. ``` This makes deprecation notices clearer and keeps descriptions accessible regardless of deprecation status. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updates bloblangExample helper to automatically convert Markdown-style headings in example summaries to AsciiDoc format. Conversions: - ##### Heading -> ==== Heading (H5 -> H4) - #### Heading -> === Heading (H4 -> H3) - ### Heading -> == Heading (H3 -> H2) This fixes "section title out of sequence" build warnings that occur when benthos/connect source data contains Markdown headings in example summary fields. Prevents need for manual fixes when regenerating partials. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ries - Add toSentenceCase helper to convert category names to sentence case - Create templates for methods.adoc and functions.adoc overview pages - Auto-generate overview pages during rpcn-connector-docs generation - Preserve acronyms (SQL, JSON) and product names (GeoIP) in categories - Apply sentence case to category headings in methods.adoc Examples: - 'String Manipulation' -> 'String manipulation' - 'JSON Web Tokens' -> 'JSON web tokens' - 'Object & Array Manipulation' -> 'Object & array manipulation' - 'SQL' -> 'SQL' (preserved) - 'GeoIP' -> 'GeoIP' (preserved)
**Safety improvements:** - report-delta.js: Filter null/undefined entries before accessing .name property to prevent crashes during diff generation (lines 167-170, 181-184) - generate-rpcn-connector-docs.js: Skip hand-authored files (starting with _) in deletion loop to prevent accidental removal (lines 479-490) **Code quality:** - pr-summary-formatter.js: Extract renderBloblangChanges() helper function to eliminate duplication between multi-version and single-version summary rendering (previously duplicated ~70 lines of identical logic) All tests pass (14 suites, 324 tests)
Replace non-standard ^*^ footnote syntax with simple (optional) suffix in parameter names. This is clearer and avoids the complexity of AsciiDoc footnote rendering. Before: | `name`^*^ ^*^ Optional parameter After: | `name` (optional) Benefits: - Simpler, more direct - No footnote rendering issues - Easier to read at a glance - Follows common documentation patterns
- Change TODO markers to AsciiDoc comments (//) in templates - Remove :status: attribute from connector frontmatter (all connectors are stable) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Summary
Fixes Bloblang code blocks to use
bloblangsyntax highlighting instead ofcoffeescript.Changes
bloblangExample.jshelper to use[,bloblang]instead of[,coffeescript]Impact
All future generated Bloblang documentation will use correct syntax highlighting:
Instead of:
Testing
Regenerated Bloblang partials in rp-connect-docs to verify the fix works correctly.
🤖 Generated with Claude Code