Skip to content

Check for and remove cycles in module dependencies#3189

Merged
datho7561 merged 1 commit intoredhat-developer:mainfrom
datho7561:fix-circular-dependencies
Sep 7, 2023
Merged

Check for and remove cycles in module dependencies#3189
datho7561 merged 1 commit intoredhat-developer:mainfrom
datho7561:fix-circular-dependencies

Conversation

@datho7561
Copy link
Copy Markdown
Contributor

@datho7561 datho7561 commented Sep 5, 2023

Having cycles in the modules occasionally prevents the extension from starting.

  • Run GitHub Actions check for cycles in module dependencies using dpdm
  • Fix cli -> tools cycle
  • Remove cluster -> clusterViewLoader cycle
  • Move name validation functions out of OpenShiftItem to avoid cycles
  • Refactor ServerlessFunction -> ServerlessFunctionModel to avoid cycles
  • Remove view -> loader -> functions cycle

Signed-off-by: David Thompson davthomp@redhat.com

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 5, 2023

Codecov Report

Patch coverage: 58.12% and project coverage change: +0.26% 🎉

Comparison is base (d854988) 37.30% compared to head (ee73678) 37.56%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3189      +/-   ##
==========================================
+ Coverage   37.30%   37.56%   +0.26%     
==========================================
  Files          75       77       +2     
  Lines        5265     5271       +6     
  Branches     1000     1000              
==========================================
+ Hits         1964     1980      +16     
+ Misses       3301     3291      -10     
Files Changed Coverage Δ
src/extension.ts 67.36% <ø> (-0.34%) ⬇️
src/registriesView.ts 34.37% <ø> (ø)
src/serverlessFunction/types.ts 100.00% <ø> (ø)
src/webview/cluster/clusterViewLoader.ts 9.65% <25.00%> (+0.24%) ⬆️
...ew/serverless-function/serverlessFunctionLoader.ts 15.23% <25.92%> (+0.78%) ⬆️
src/openshift/openshiftItem.ts 35.48% <33.33%> (+8.10%) ⬆️
src/openshift/cluster.ts 10.23% <36.36%> (-0.20%) ⬇️
src/webview/common-ext/createComponentHelpers.ts 12.69% <40.00%> (ø)
src/webview/common-ext/utils.ts 47.50% <40.00%> (ø)
src/serverlessFunction/functionModel.ts 33.82% <43.33%> (ø)
... and 10 more

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

@datho7561 datho7561 self-assigned this Sep 6, 2023
@datho7561 datho7561 force-pushed the fix-circular-dependencies branch 2 times, most recently from 0a901bc to a1efb56 Compare September 6, 2023 19:47
@datho7561 datho7561 marked this pull request as ready for review September 6, 2023 19:48
@datho7561 datho7561 changed the title [WIP] run check for cycles in module dependencies Check for and remove cycles in module dependencies Sep 6, 2023
vrubezhny
vrubezhny previously approved these changes Sep 7, 2023
Copy link
Copy Markdown
Contributor

@vrubezhny vrubezhny left a comment

Choose a reason for hiding this comment

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

Looks good to me and running check cycles returns success:

$ npm run check-cycles

> vscode-openshift-connector@1.7.0 check-cycles
> dpdm --no-tree --no-warning --exit-code circular:1 ./src/extension.ts

✔ [75/75] Analyze done!
• Circular Dependencies
  ✅ Congratulations, no circular dependency was found in your project.

Copy link
Copy Markdown
Collaborator

@msivasubramaniaan msivasubramaniaan left a comment

Choose a reason for hiding this comment

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

LGTM

@datho7561 datho7561 force-pushed the fix-circular-dependencies branch from a1efb56 to 5d2e102 Compare September 7, 2023 14:04
Having cycles in the modules occaisionally prevents the extension from starting.

- Run GitHub Actions check for cycles in module dependencies using dpdm
- Fix cli -> tools cycle
- Remove cluster -> clusterViewLoader cycle
- Move name validation functions out of OpenShiftItem to avoid cycles
- Refactor ServerlessFunction -> ServerlessFunctionModel to avoid cycles
- Remove view -> loader -> functions cycle

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561 datho7561 force-pushed the fix-circular-dependencies branch from 5d2e102 to ee73678 Compare September 7, 2023 15:18
@datho7561 datho7561 merged commit f592290 into redhat-developer:main Sep 7, 2023
@datho7561 datho7561 added this to the 1.8.0 milestone Sep 7, 2023
@datho7561 datho7561 added the debt label Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants