Skip to content

draft: Allow for custom ORD document extensions#402

Draft
mlakov wants to merge 1 commit intomainfrom
draft/enable-custom-ord-extensions
Draft

draft: Allow for custom ORD document extensions#402
mlakov wants to merge 1 commit intomainfrom
draft/enable-custom-ord-extensions

Conversation

@mlakov
Copy link
Copy Markdown
Contributor

@mlakov mlakov commented Mar 30, 2026

Allow Custom ORD Document Extensions via Event-Based Registration

New Feature

✨ Introduces support for dynamically registering custom ORD document extensions at runtime via a CDS event mechanism (ord.extension.publish), in addition to the existing file-based custom ORD content approach.

Changes

  • lib/extend-ord-with-custom.js: Exported getCustomORDContent and compareAndHandleCustomORDContentWithExistingContent individually from the module. Added a // TODO - To be deleted comment marking extendCustomORDContentIfExists for future removal.

  • lib/ord.js: Updated the main ORD document builder to accept an optional extensions array as a second parameter. Replaced the single extendCustomORDContentIfExists call with an iteration over all provided extensions (plus the file-based custom ORD content), applying compareAndHandleCustomORDContentWithExistingContent for each.

  • lib/services/ord-service.js: Added a constructor to OpenResourceDiscoveryService that initializes an extensions map and registers a listener for the ord.extension.publish CDS event. Incoming extensions are stored by ID, and when serving the ORD document, all registered extensions are passed to the ord() builder as an array.

  • 🔄 Regenerate and Update Summary

📬 Subscribe to the Hyperspace PR Bot DL to get the latest announcements and pilot features!

PR Bot Information

Version: 1.19.9 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • LLM: anthropic--claude-4.6-sonnet
  • Event Trigger: pull_request.edited
  • Correlation ID: 8251b270-2c3f-11f1-9367-315d92ec01eb
  • Summary Prompt: Default Prompt
  • File Content Strategy: Full file content
  • Output Template: Default Template

@mlakov mlakov requested a review from zongqichen March 30, 2026 13:47
@mlakov mlakov added the run-e2e Trigger e2e test pipeline label Mar 30, 2026
@mlakov mlakov requested a review from f-nie March 30, 2026 13:47
Copy link
Copy Markdown
Contributor

@hyperspace-insights hyperspace-insights bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR introduces a mechanism for programmatic ORD document extensions via a cds event system. A few substantive issues were found and flagged: the typeof "array" dead-code guard in the type check, the duplicate id argument passed to the logger, and most importantly the extension application order (file-based content always overrides caller-supplied extensions, which is likely backwards). Additionally, repeated init() calls will accumulate duplicate event listeners.

PR Bot Information

Version: 1.19.9 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • Event Trigger: pull_request.opened
  • Correlation ID: 007ed570-2c3f-11f1-8dc5-5fc7111fc1fb
  • Agent Instructions:
  • File Content Strategy: Full file content
  • LLM: anthropic--claude-4.6-sonnet

@mlakov
Copy link
Copy Markdown
Contributor Author

mlakov commented Mar 30, 2026

Counter proposal for: #399

@mlakov mlakov requested a review from swennemers March 30, 2026 13:48
@mlakov mlakov force-pushed the draft/enable-custom-ord-extensions branch 2 times, most recently from 81b6b07 to f839869 Compare March 30, 2026 14:13
@mlakov mlakov force-pushed the draft/enable-custom-ord-extensions branch 2 times, most recently from 605cb00 to b864c04 Compare March 30, 2026 14:28
@mlakov mlakov force-pushed the draft/enable-custom-ord-extensions branch from b864c04 to 2e56b7c Compare March 30, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-e2e Trigger e2e test pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants