Skip to content
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

feat: add lazy loading for feature cases #570

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

danielfbm
Copy link
Contributor

@danielfbm danielfbm commented Apr 8, 2024

This adds a new LazyFeatureCaseBuilder type that allows lazily loading feature cases only when needed. This avoids creating all feature cases upfront when defining the module.

A new GetFeatureCase method on moduleCase allows retrieving a lazy feature case builder by name.

The FeatureCaseBuilder interface is introduced with Labels() to get labels on feature cases. lazyFeatureCaseBuilder implements this to look up the real feature case labels only when Labels() is called.

additionalAssertions on testPoint now accepts FeatureCaseBuilder instead of *featureCase directly.

before the change:

image

after:

image

Changes

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • spec PR link included
  • Follows the commit message standard
  • Meets the contributing guidelines (including
    functionality, content, code)
  • Test cases with documentation and functionality works as expected using current and related github repos (MUST deploy and check)
  • Release notes block below has been filled in or deleted (only if no user facing changes)

Release Notes

nanjingfm
nanjingfm previously approved these changes Apr 8, 2024
This adds a new LazyFeatureCaseBuilder type that allows lazily loading feature cases only when needed. This avoids creating all feature cases upfront when defining the module.

A new GetFeatureCase method on moduleCase allows retrieving a lazy feature case builder by name.

The FeatureCaseBuilder interface is introduced with Labels() to get labels on feature cases. lazyFeatureCaseBuilder implements this to look up the real feature case labels only when Labels() is called.

additionalAssertions on testPoint now accepts FeatureCaseBuilder instead of *featureCase directly.
@danielfbm danielfbm merged commit c106678 into main Apr 8, 2024
1 of 2 checks passed
@danielfbm danielfbm deleted the feat/adding-lazy-featurecase branch April 8, 2024 08:39
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants