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

fix(compiler): add strictness to booleans in definition #4157

Merged
merged 1 commit into from Mar 3, 2022

Conversation

zpencerq
Copy link
Contributor

@zpencerq zpencerq commented Mar 1, 2022

Check List

  • Tests has been run in packages where changes made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Description of Changes Made (if issue reference is not provided)

Updates schema definitions to be strict on all boolean fields. This aligns with the schema defined in cubejs-client-core. Previously it was valid to pass along the string "false" to fields like shown in the cube measure definition, this would be reflected in API responses to clients. As a result, the client library wouldn't effectively filter on just measure.isVisible due of truthiness semantics in JS.

This is a bit of a blind change across the board so some review of the other boolean fields should be done before merging.

@zpencerq zpencerq requested a review from a team as a code owner March 1, 2022 21:16
@github-actions github-actions bot added the pr:community Contribution from Cube.js community members. label Mar 1, 2022
@codecov
Copy link

codecov bot commented Mar 1, 2022

Codecov Report

Merging #4157 (efd1fda) into master (ee496b3) will decrease coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4157      +/-   ##
==========================================
- Coverage   58.82%   58.77%   -0.05%     
==========================================
  Files         133      133              
  Lines       10846    10846              
  Branches     2558     2558              
==========================================
- Hits         6380     6375       -5     
- Misses       4186     4191       +5     
  Partials      280      280              
Flag Coverage Δ
cube-backend 58.77% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...bejs-schema-compiler/src/compiler/CubeValidator.js 97.52% <ø> (ø)
...es/cubejs-schema-compiler/src/adapter/BaseQuery.js 64.19% <0.00%> (-0.42%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 61a9fab...efd1fda. Read the comment docs.

@paveltiunov
Copy link
Member

Hey @zpencerq ! Great catch! Looks good to me! Thanks for contributing it!

@paveltiunov paveltiunov merged commit e918837 into cube-js:master Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:community Contribution from Cube.js community members.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants