Skip to content

refactor!: Move as_id out of TypeNode#866

Merged
Natoandro merged 20 commits intomainfrom
met-685-id-field-in-struct
Oct 11, 2024
Merged

refactor!: Move as_id out of TypeNode#866
Natoandro merged 20 commits intomainfrom
met-685-id-field-in-struct

Conversation

@Natoandro
Copy link
Copy Markdown
Contributor

@Natoandro Natoandro commented Oct 5, 2024

Solve MET-684 and MET-471

  • common/typegraph
    • Store the id field in ObjectTypeData instead of in the target type (as_id)
    • Add id() method on t.integer and t.string
  • typegraph/core
    • Store as_id, injection and policy in TypeRef::attribute
    • Add support for direct and link target in TypeRef
    • Only allow name registration for TypeDef
  • Semantics
    • Use property name instead of type name in from_parent injection source

Migration notes

BREAKING CHANGE
from_parent injections source shall be changed to the key in the parent t.struct instead of the type name.

Checklist

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

@linear
Copy link
Copy Markdown

linear bot commented Oct 5, 2024

@Natoandro Natoandro requested review from Yohe-Am, michael-0acf4 and zifeo and removed request for Yohe-Am and zifeo October 9, 2024 08:16
@Natoandro Natoandro changed the title refactor: Move as_id out of TypeNode refactor!: Move as_id out of TypeNode Oct 10, 2024
@Natoandro Natoandro requested review from j03-dev and zifeo October 10, 2024 08:14
@zifeo
Copy link
Copy Markdown
Member

zifeo commented Oct 10, 2024

Very nice!

@Natoandro Natoandro force-pushed the met-685-id-field-in-struct branch from 74aabd6 to 4f4c544 Compare October 11, 2024 06:25
Yohe-Am
Yohe-Am previously approved these changes Oct 11, 2024
Copy link
Copy Markdown
Contributor

@Yohe-Am Yohe-Am left a comment

Choose a reason for hiding this comment

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

Great reduction of debt.

@Yohe-Am
Copy link
Copy Markdown
Contributor

Yohe-Am commented Oct 11, 2024

I rec we release 0.5 after this is done.

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 58.33333% with 25 lines in your changes missing coverage. Please review.

Project coverage is 77.11%. Comparing base (bbef981) to head (ecdc009).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/typegraph/deno/src/types.ts 38.88% 11 Missing ⚠️
src/typegraph/deno/src/runtimes/deno.ts 33.33% 8 Missing ⚠️
src/typegate/src/engine/planner/args.ts 55.55% 4 Missing ⚠️
src/typegraph/deno/src/utils/injection_utils.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #866      +/-   ##
==========================================
+ Coverage   77.09%   77.11%   +0.01%     
==========================================
  Files         149      149              
  Lines       17849    17843       -6     
  Branches     1730     1732       +2     
==========================================
- Hits        13761    13759       -2     
+ Misses       4065     4061       -4     
  Partials       23       23              

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

@metatypedev metatypedev deleted a comment from linear bot Oct 11, 2024
@metatypedev metatypedev deleted a comment from linear bot Oct 11, 2024
@Natoandro Natoandro merged commit cae1342 into main Oct 11, 2024
@Natoandro Natoandro deleted the met-685-id-field-in-struct branch October 11, 2024 11:21
@Natoandro Natoandro restored the met-685-id-field-in-struct branch October 12, 2024 09:31
@Natoandro Natoandro deleted the met-685-id-field-in-struct branch October 12, 2024 09:47
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.

4 participants