Skip to content

Implement cached schema & variant materialized views for luminork #6938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jhelwig
Copy link
Contributor

@jhelwig jhelwig commented Aug 14, 2025

Summary

This PR implements materialized views (MVs) for cached access to schema and variant data from uninstalled packages, enabling efficient schema information retrieval without requiring full package installation.

  • Add trait-based function collection system - HasUniqueId trait provides unified function ID access across all function spec types, eliminating repetitive patterns while maintaining zero-allocation semantics through Option<&str> returns

  • Implement cached schema MV infrastructure - Uses the MV building pattern established by the change set MVs with deployment MV discovery system providing direct key lookup in content-addressable store vs O(nm) traversal through layers

  • Update Luminork API endpoints - Maintain current behavior of looking up from the graph first, but instead of 404ing if the schema/variant isn't found, check to see if there is an MV. If there is one, return it. If there isn't one, check to see if there should be one by consulting the cached_modules table. If there should be one, return a 202 and trigger a build. If not, return a 404.

  • Add parallel MV building - JoinSet task scheduling in edda-server with function collection system providing error handling for variant data assembly

Test plan

  • Unit tests cover all HasUniqueId trait implementations for each function type including edge cases for invalid UUIDs and error propagation paths
  • Integration tests validate cached schema variant MV assembly including error handling for non-existent schema variants
  • Manual testing of Luminork API endpoints through Swagger UI confirms MV-first lookups with DAL fallbacks work correctly

Copy link

github-actions bot commented Aug 14, 2025

Dependency Review

✅ No vulnerabilities or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link

Total: 0 new asset(s), 0 changed asset(s)

1 similar comment
Copy link

Total: 0 new asset(s), 0 changed asset(s)

@jhelwig jhelwig force-pushed the jhelwig/eng-3182-get-access-to-installed-uninstalled-schema-variants-in branch from e230398 to 2d896dc Compare August 14, 2025 22:30
Copy link

Total: 0 new asset(s), 0 changed asset(s)

1 similar comment
Copy link

Total: 0 new asset(s), 0 changed asset(s)

@jhelwig jhelwig force-pushed the jhelwig/eng-3182-get-access-to-installed-uninstalled-schema-variants-in branch from 918d1e5 to 8439563 Compare August 18, 2025 19:13
Copy link

Total: 0 new asset(s), 0 changed asset(s)

@jhelwig jhelwig force-pushed the jhelwig/eng-3182-get-access-to-installed-uninstalled-schema-variants-in branch from 8439563 to c943635 Compare August 19, 2025 16:08
Copy link

Total: 0 new asset(s), 0 changed asset(s)

@jhelwig jhelwig force-pushed the jhelwig/eng-3182-get-access-to-installed-uninstalled-schema-variants-in branch from c943635 to 93b793f Compare August 19, 2025 16:27
Copy link

Total: 0 new asset(s), 0 changed asset(s)

@jhelwig jhelwig changed the title Jhelwig/eng-3182-get-access-to-installed-uninstalled-schema-variants-in Implement cached schema & variant materialized views for luminork Aug 19, 2025
@jhelwig jhelwig force-pushed the jhelwig/eng-3182-get-access-to-installed-uninstalled-schema-variants-in branch from 93b793f to a6eed41 Compare August 19, 2025 18:00
Copy link

Total: 0 new asset(s), 0 changed asset(s)

…ions

Add HasUniqueId trait providing unified function ID access across all function
spec types. This eliminates repetitive implementation patterns while maintaining
zero-allocation semantics through Option<&str> returns.

The trait enables consistent function collection logic with shared error handling
for invalid function IDs, stable materialized view output through deterministic
ordering, and deduplication of collected function identifiers.

Management functions always return Some() while other function types delegate to
their unique_id fields. Both spec/ and pkg/ module implementations follow the
same patterns for consistency.

Testing covers all trait implementations with direct unit tests for each function
type including edge cases for invalid UUIDs and error propagation paths.
@jhelwig jhelwig force-pushed the jhelwig/eng-3182-get-access-to-installed-uninstalled-schema-variants-in branch from a6eed41 to 692f01f Compare August 19, 2025 20:10
Copy link

Total: 0 new asset(s), 0 changed asset(s)

@jhelwig jhelwig force-pushed the jhelwig/eng-3182-get-access-to-installed-uninstalled-schema-variants-in branch from 692f01f to 4b14d0a Compare August 19, 2025 20:31
Copy link

Total: 0 new asset(s), 0 changed asset(s)

@jhelwig jhelwig force-pushed the jhelwig/eng-3182-get-access-to-installed-uninstalled-schema-variants-in branch from 4b14d0a to 6973e41 Compare August 19, 2025 20:36
Copy link

Total: 0 new asset(s), 0 changed asset(s)

This change establishes the foundation for materialized views (MVs) that
provide cached access to schema and variant data from uninstalled packages.
The implementation uses the MV building pattern established by the change set
MVs and supports graceful fallback chains in API endpoints.

Key components:
- CachedSchema and CachedDefaultVariant MV types for schema metadata access
- Deployment MV discovery system with direct key lookup in content-
  addressable store vs O(nm) traversal through layers
- JoinSet task scheduling for parallel MV building in edda-server
- Luminork API endpoints updated with MV-first lookups and DAL fallbacks
- Function collection system with error handling for variant data assembly

The MV system enables efficient access to schema information without
requiring full package installation, supporting API integrations and MCP
servers.
@jhelwig jhelwig force-pushed the jhelwig/eng-3182-get-access-to-installed-uninstalled-schema-variants-in branch from 6973e41 to 0cdc002 Compare August 19, 2025 20:44
Copy link

Total: 0 new asset(s), 0 changed asset(s)

@jhelwig jhelwig marked this pull request as ready for review August 19, 2025 20:49
@stack72
Copy link
Contributor

stack72 commented Aug 20, 2025

@jhelwig on the luminork side this is great!

Copy link
Contributor

@fnichol fnichol left a comment

Choose a reason for hiding this comment

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

Live code reviewed and looks great!

@jhelwig jhelwig added this pull request to the merge queue Aug 20, 2025
Merged via the queue into main with commit dc856d2 Aug 20, 2025
11 checks passed
@jhelwig jhelwig deleted the jhelwig/eng-3182-get-access-to-installed-uninstalled-schema-variants-in branch August 20, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants