Repository navigation
fix: Carry enum options into every catalog style listing - #2256
Merged
Merged
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
🟢 Coverage 100.00% diff coverage · -0.02% coverage variation
Metric Results Coverage variation ✅ -0.02% coverage variation (-1.00%) Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (7828c69) 19609 18921 96.49% Head commit (df5bd99) 19636 (+27) 18944 (+23) 96.48% (-0.02%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#2256) 3 3 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
DaveSkender
marked this pull request as ready for review
September 24, 2026 03:02
Contributor
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2230.
Enum parameters reached consumers with
DataType: "enum"and noEnumOptions, so a catalog-driven UI couldn't offer a select or validate a value.AddEnumParameterdid fillEnumOptions, but only on each indicator's Common listing. Every style listing is built from that base through theCatalogListingBuilder(IndicatorListing)copy constructor, which rebuilt each parameter field by field and leftEnumOptionsout.Catalog.Get()returns only style listings, so every enum parameter a consumer could see hadEnumOptions: null, both in-process and fromToJson().Changes
with, so it can't drop a property added later, andEnumOptionsgets its own dictionary per copy. Results have no mutable members, so inherited listings share them.Tests
EveryEnumParameterListsItsValues(library,Catalog.Binding.Tests.cs) takes each parameter's type from the bound method signature, not from the catalog's ownDataType. Any parameter the method takes as an enum must be catalogued asenum, withEnumOptionsequal to that enum's members. On main it reports every enum parameter in the catalog.InheritedListingCopiesEveryMember(library) checks that an inherited listing's parameters and results are equivalent to its base, and that it doesn't share its options dictionary.tests/PublicApi/Catalog.EnumOptions.Tests.csreads the options the way a consumer does: from each style listing and from the JSON export.EnumOptionsin the copy fails all four new tests.InheritedListingCopiesEveryMember.typethroughAddParameter<BetaType>failsEveryEnumParameterListsItsValues, naming the listing.srcis covered by the library suite, both branches of theEnumOptionscopy included.Decision record
EnumOptionsto the field-by-field list. It fixes this property and leaves the same trap for the next one.withexpression.