finos / legend-studio

Legend Studio
https://legend.finos.org
Apache License 2.0
89 stars 114 forks source link

Improve handling of changing const/param/derivation types #3414

Closed travisstebbins closed 2 months ago

travisstebbins commented 2 months ago

Summary

Improve how we handle when a user changes the type of a constant/parameter/derivation. This PR implements new behavior such that if a user changes the type of a constant/parameter/derivation, if the value is used in the filter or post-filter panels and is no longer compatible, we show it as an error. This ensures users can't change the types of these values and accidentally create an invalid query.

How did you test this change?

Changing const type: ChangingConstType

Changing param type: ChangingParamType

Changing derivation type when used as post-filter condition left value: DerivationLeftSide

Changing derivation type when used as post-filter condition right value: DerivationRightSide

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: a7f1ae7a99de08814eff5df0a5283ce9bfe6e615

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 23 packages | Name | Type | | --------------------------------------------- | ----- | | @finos/legend-query-builder | Patch | | @finos/legend-application-query | Patch | | @finos/legend-application-studio | Patch | | @finos/legend-extension-dsl-data-quality | Patch | | @finos/legend-extension-dsl-data-space-studio | Patch | | @finos/legend-extension-dsl-data-space | Patch | | @finos/legend-extension-dsl-service | Patch | | @finos/legend-application-query-bootstrap | Patch | | @finos/legend-application-studio-bootstrap | Patch | | @finos/legend-extension-assortment | Patch | | @finos/legend-extension-dsl-diagram | Patch | | @finos/legend-extension-dsl-persistence | Patch | | @finos/legend-extension-dsl-text | Patch | | @finos/legend-extension-store-flat-data | Patch | | @finos/legend-extension-store-relational | Patch | | @finos/legend-extension-store-service-store | Patch | | @finos/legend-vscode-extension-dependencies | Patch | | @finos/legend-application-query-deployment | Patch | | @finos/legend-application-studio-deployment | Patch | | @finos/legend-application-pure-ide | Patch | | @finos/legend-application-pure-ide-deployment | Patch | | @finos/legend-application-repl-deployment | Patch | | @finos/legend-server-showcase-deployment | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 46.29%. Comparing base (507ce41) to head (a7f1ae7). Report is 4 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3414 +/- ## ========================================== - Coverage 46.32% 46.29% -0.04% ========================================== Files 2097 2097 Lines 361149 361185 +36 Branches 10747 10750 +3 ========================================== - Hits 167312 167206 -106 - Misses 193400 193543 +143 + Partials 437 436 -1 ``` | [Files](https://app.codecov.io/gh/finos/legend-studio/pull/3414?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos) | Coverage Δ | | |---|---|---| | [...ts/fetch-structure/QueryBuilderPostFilterPanel.tsx](https://app.codecov.io/gh/finos/legend-studio/pull/3414?src=pr&el=tree&filepath=packages%2Flegend-query-builder%2Fsrc%2Fcomponents%2Ffetch-structure%2FQueryBuilderPostFilterPanel.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos#diff-cGFja2FnZXMvbGVnZW5kLXF1ZXJ5LWJ1aWxkZXIvc3JjL2NvbXBvbmVudHMvZmV0Y2gtc3RydWN0dXJlL1F1ZXJ5QnVpbGRlclBvc3RGaWx0ZXJQYW5lbC50c3g=) | `84.29% <100.00%> (+0.28%)` | :arrow_up: | | [...omponents/fetch-structure/QueryBuilderTDSPanel.tsx](https://app.codecov.io/gh/finos/legend-studio/pull/3414?src=pr&el=tree&filepath=packages%2Flegend-query-builder%2Fsrc%2Fcomponents%2Ffetch-structure%2FQueryBuilderTDSPanel.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos#diff-cGFja2FnZXMvbGVnZW5kLXF1ZXJ5LWJ1aWxkZXIvc3JjL2NvbXBvbmVudHMvZmV0Y2gtc3RydWN0dXJlL1F1ZXJ5QnVpbGRlclREU1BhbmVsLnRzeA==) | `74.71% <100.00%> (+0.65%)` | :arrow_up: | | [.../src/components/filter/QueryBuilderFilterPanel.tsx](https://app.codecov.io/gh/finos/legend-studio/pull/3414?src=pr&el=tree&filepath=packages%2Flegend-query-builder%2Fsrc%2Fcomponents%2Ffilter%2FQueryBuilderFilterPanel.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos#diff-cGFja2FnZXMvbGVnZW5kLXF1ZXJ5LWJ1aWxkZXIvc3JjL2NvbXBvbmVudHMvZmlsdGVyL1F1ZXJ5QnVpbGRlckZpbHRlclBhbmVsLnRzeA==) | `89.94% <100.00%> (+0.04%)` | :arrow_up: | | [...src/stores/QueryBuilderValueSpecificationHelper.ts](https://app.codecov.io/gh/finos/legend-studio/pull/3414?src=pr&el=tree&filepath=packages%2Flegend-query-builder%2Fsrc%2Fstores%2FQueryBuilderValueSpecificationHelper.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos#diff-cGFja2FnZXMvbGVnZW5kLXF1ZXJ5LWJ1aWxkZXIvc3JjL3N0b3Jlcy9RdWVyeUJ1aWxkZXJWYWx1ZVNwZWNpZmljYXRpb25IZWxwZXIudHM=) | `85.00% <100.00%> (+0.03%)` | :arrow_up: | | [...ure/tds/post-filter/QueryBuilderPostFilterState.ts](https://app.codecov.io/gh/finos/legend-studio/pull/3414?src=pr&el=tree&filepath=packages%2Flegend-query-builder%2Fsrc%2Fstores%2Ffetch-structure%2Ftds%2Fpost-filter%2FQueryBuilderPostFilterState.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos#diff-cGFja2FnZXMvbGVnZW5kLXF1ZXJ5LWJ1aWxkZXIvc3JjL3N0b3Jlcy9mZXRjaC1zdHJ1Y3R1cmUvdGRzL3Bvc3QtZmlsdGVyL1F1ZXJ5QnVpbGRlclBvc3RGaWx0ZXJTdGF0ZS50cw==) | `78.07% <100.00%> (+0.59%)` | :arrow_up: | | [...ilder/src/stores/filter/QueryBuilderFilterState.ts](https://app.codecov.io/gh/finos/legend-studio/pull/3414?src=pr&el=tree&filepath=packages%2Flegend-query-builder%2Fsrc%2Fstores%2Ffilter%2FQueryBuilderFilterState.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos#diff-cGFja2FnZXMvbGVnZW5kLXF1ZXJ5LWJ1aWxkZXIvc3JjL3N0b3Jlcy9maWx0ZXIvUXVlcnlCdWlsZGVyRmlsdGVyU3RhdGUudHM=) | `89.53% <100.00%> (+0.06%)` | :arrow_up: | ... and [84 files with indirect coverage changes](https://app.codecov.io/gh/finos/legend-studio/pull/3414/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos)