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

chore!: Checks/validation on t.either #868

Merged
merged 16 commits into from
Oct 17, 2024
Merged

Conversation

j03-dev
Copy link
Contributor

@j03-dev j03-dev commented Oct 8, 2024

Emit a warning or an error when a variant is a subtype of another one.

Migration notes

BREAKING CHANGE: Previously valid typegraph might fail validation.
You will need to fix your types to add some consistency in t.either/t.union types.

  • The change comes with new or modified tests
  • Hard-to-understand functions have explanatory comments
  • End-user documentation is updated to reflect the change

Copy link

linear bot commented Oct 8, 2024

@j03-dev j03-dev marked this pull request as draft October 8, 2024 20:58
@j03-dev j03-dev changed the title Chore(graph): Checks/validation on t.either Chore: Checks/validation on t.either Oct 8, 2024
@j03-dev j03-dev changed the title Chore: Checks/validation on t.either chore: Checks/validation on t.either Oct 8, 2024
@j03-dev j03-dev force-pushed the feat/met-674-t-either-validation branch from 47cf656 to df33b46 Compare October 10, 2024 08:28
Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.01%. Comparing base (bbef981) to head (4fdfaa7).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #868      +/-   ##
==========================================
- Coverage   77.09%   77.01%   -0.08%     
==========================================
  Files         149      149              
  Lines       17849    17867      +18     
  Branches     1730     1737       +7     
==========================================
  Hits        13761    13761              
- Misses       4065     4083      +18     
  Partials       23       23              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@j03-dev j03-dev requested a review from Natoandro October 11, 2024 09:00
@j03-dev j03-dev marked this pull request as ready for review October 11, 2024 16:59
Copy link
Contributor

@Natoandro Natoandro left a comment

Choose a reason for hiding this comment

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

Very nice 👍
A few comments...

src/common/src/typegraph/validator/mod.rs Outdated Show resolved Hide resolved
src/common/src/typegraph/validator/mod.rs Outdated Show resolved Hide resolved
src/common/src/typegraph/validator/mod.rs Outdated Show resolved Hide resolved
@j03-dev j03-dev requested a review from Natoandro October 15, 2024 09:13
@j03-dev j03-dev requested a review from Yohe-Am October 15, 2024 18:52
Copy link
Contributor

@Natoandro Natoandro left a comment

Choose a reason for hiding this comment

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

Can you also add a validation for TypeNode::Union which should fail validation if we have two variants with the same type.

src/common/src/typegraph/validator/mod.rs Outdated Show resolved Hide resolved
@j03-dev j03-dev requested a review from Natoandro October 16, 2024 10:05
Natoandro
Natoandro previously approved these changes Oct 17, 2024
tests/e2e/typegraph/__snapshots__/validator_test.ts.snap Outdated Show resolved Hide resolved
@Natoandro
Copy link
Contributor

The metagen test is failing...

@j03-dev j03-dev requested a review from Natoandro October 17, 2024 09:27
@Natoandro Natoandro changed the title chore: Checks/validation on t.either chore!: Checks/validation on t.either Oct 17, 2024
@j03-dev j03-dev merged commit defae4c into main Oct 17, 2024
15 of 16 checks passed
@j03-dev j03-dev deleted the feat/met-674-t-either-validation branch October 17, 2024 15:38
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