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: circular dependency between types.ts and validate-request.ts #1337

Closed
wants to merge 10 commits into from

Conversation

schaeferka
Copy link
Contributor

Description

We need to fix the circular dependency between types.ts and validate-request.ts
...

End to End Test:

Related Issue

Fixes #

Relates to #

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

@schaeferka schaeferka added this to the v0.39.0 milestone Oct 25, 2024
@schaeferka schaeferka self-assigned this Oct 25, 2024
@schaeferka schaeferka requested a review from a team as a code owner October 25, 2024 15:48
@schaeferka schaeferka marked this pull request as draft October 25, 2024 15:49
Copy link

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.00%. Comparing base (97c2845) to head (3831bd4).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1337   +/-   ##
=======================================
  Coverage   86.00%   86.00%           
=======================================
  Files          31       31           
  Lines        1443     1443           
  Branches      315      315           
=======================================
  Hits         1241     1241           
  Misses        200      200           
  Partials        2        2           
Files with missing lines Coverage Δ
src/fixtures/loader.ts 100.00% <ø> (ø)
src/lib/adjudicators.ts 100.00% <100.00%> (ø)
src/lib/capability.ts 94.90% <100.00%> (ø)
src/lib/common.ts 100.00% <100.00%> (ø)
src/lib/filter.ts 94.73% <100.00%> (ø)
src/lib/finalizer.ts 100.00% <100.00%> (ø)
src/lib/module.ts 81.25% <ø> (ø)
src/lib/mutate-request.ts 100.00% <100.00%> (ø)
src/lib/types.ts 100.00% <ø> (ø)
src/lib/validate-request.ts 100.00% <100.00%> (ø)
... and 1 more

Comment on lines 9 to 14
*/
export interface GroupVersionResource {
readonly group: string;
readonly version: string;
readonly resource: string;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do generic kinds needed by all the app need to go to a validate types? This is a little confusing to me. I see mutate processor pulling from validate-types too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had moved them initially to fix the circular dependency. But now that I've made some other changes, I'll go back to revisit the initial changes to see if I can move things back to types.ts so that both mutate and validate can import them from there.

Copy link
Collaborator

Choose a reason for hiding this comment

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

bloating our softwares size is going to cause even more memory problems, this is not the approach we should take when fixing circular dependencies because we are not introducing more problems. We should fix the code that was already merged in that duplicated types

Copy link
Collaborator

@cmwylie19 cmwylie19 left a comment

Choose a reason for hiding this comment

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

code is duplicated across types, leading to increase in memory and storage size. Increasing bloat of Pepr is going to cause more problems and actually introduce more dependencies since the code is now dependent on the duplicate type. This is an anti-pattern

@schaeferka
Copy link
Contributor Author

Replaced by:

chore: fix circular dependencies related to types.ts #1339

@schaeferka schaeferka closed this Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

chore: fix circular dependency between types and validate-request
3 participants