Skip to content

feat(calm-hub): decorator resource and endpoint to get decorators#2212

Open
harveymmaunders wants to merge 7 commits intofinos:mainfrom
harveymmaunders:feat/decorator-storage
Open

feat(calm-hub): decorator resource and endpoint to get decorators#2212
harveymmaunders wants to merge 7 commits intofinos:mainfrom
harveymmaunders:feat/decorator-storage

Conversation

@harveymmaunders
Copy link
Contributor

@harveymmaunders harveymmaunders commented Mar 5, 2026

Description

  • Update the mongo seed script to include decorators
  • Add endpoint to get all decorator IDs for a namespace
  • Endpoint will be able to filter by decorator type (e.g. deployment) and target (e.g. /calm/namespaces/finos/architectures/1/versions/1-0-0)
  • Three separate PRs will be raised for: (also detailed in Add Decorator Storage and Management to CALM Hub #2168)
  • GET: Getting decorator by ID
  • POST: Create a decorator
  • Put: Update a decorator

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Code style/formatting changes
  • ♻️ Refactoring (no functional changes)
  • ⚡ Performance improvements
  • ✅ Test additions or updates
  • 🔧 Chore (maintenance, dependencies, CI, etc.)

Affected Components

  • CLI (cli/)
  • Schema (calm/)
  • CALM AI (calm-ai/)
  • CALM Hub (calm-hub/)
  • CALM Hub UI (calm-hub-ui/)
  • CALM Server (calm-server/)
  • CALM Widgets (calm-widgets/)
  • Documentation (docs/)
  • Shared (shared/)
  • VS Code Extension (calm-plugins/vscode/)
  • Dependencies
  • CI/CD

Commit Message Format ✅

Testing

  • I have tested my changes locally
  • I have added/updated unit tests
  • All existing tests pass

Checklist

  • My commits follow the conventional commit format
  • I have updated documentation if necessary
  • I have added tests for my changes (if applicable)
  • My changes follow the project's coding standards

Adds initial seed data for decorators collection in MongoDB, including deployment decorators for finos and workshop namespaces.

Refs finos#2168
Add DecoratorResource with GET /calm/namespaces/{namespace}/decorators endpoint to retrieve decorator IDs for a given namespace.

Includes:
- DecoratorStore interface for data access abstraction
- MongoDecoratorStore implementation with MongoDB support
- NitriteDecoratorStore implementation for standalone mode
- DecoratorStoreProducer for database mode selection
- Full test coverage for all components
- Updated NitriteDBConfig to initialize decorators collection

Returns list of integer decorator IDs per namespace following the same pattern as patterns, architectures, and flows. Decorators use decoratorId as primary identifier with unique-id preserved in nested decorator object.

Refs finos#2168
@github-actions github-actions bot added the calm-hub The Calm Hub Product label Mar 5, 2026
@harveymmaunders harveymmaunders marked this pull request as draft March 5, 2026 09:52
Implement query parameter support for filtering decorators by target
path and decorator type in both MongoDB and Nitrite storage backends.

- Add target and type query parameters to /decorators endpoint
- Implement filtering logic in storage layer
- Add input sanitization for query parameters

Refs finos#2168
@harveymmaunders harveymmaunders changed the title Feat/decorator storage feat(calm-hub): decorator resource and endpoint to get decorators Mar 5, 2026
harveymmaunders and others added 2 commits March 5, 2026 10:27
Move query parameter validation from custom methods to Jakarta Bean
Validation annotations (@SiZe, @pattern). Refactor decorator store
implementations into smaller, more maintainable methods.

- Replace sanitizeQueryParam with @pattern validation
- Add QUERY_PARAM_NO_WHITESPACE_REGEX constant (^[A-Za-z0-9_/-]+$)
- Break down getDecoratorsForNamespace into focused methods
- Update tests for new validation behavior

Refs finos#2168
@harveymmaunders
Copy link
Contributor Author

image image image image

@harveymmaunders harveymmaunders marked this pull request as ready for review March 5, 2026 11:18
"unique-id": "finos-architecture-1-deployment",
"type": "deployment",
"target": [
"/calm/namespaces/finos/architectures/1/versions/1-0-0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not entirely sure how I feel about this target reference. We can include architecture id, but how do differ between pattersn / architectures and also the version>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

However, this is currently how MongoDB and CALM Hub have been setup. This follows the rest of how CALM Hub works and when this is changed, it will be updated along with the rest #1853.

@rocketstack-matt rocketstack-matt mentioned this pull request Mar 5, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

calm-hub The Calm Hub Product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant