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

1912: Check and fix circular dependencies #1913

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

f1sh1918
Copy link
Contributor

@f1sh1918 f1sh1918 commented Feb 17, 2025

Short Description

To avoid circular dependencies i added madge to detect them.
Since we got a couple of them, i provided some refactoring

Proposed Changes

  • add madge to detect circular dependencies

  • add bash script to check circular dependencies

  • execute bash script on checkAdministration in ci pipeline

  • refactor components and imports to solve circular dependencies (see screenshot)

  • add eslint config (couldn't test it yet)

  • TODO Refactor JsonFieldView & JsonFieldArray #1914 since this needs some more investigation

Side Effects

  • may affect application view

Testing

Note: That most of the changes are just imports and moving components in functions in separate files, so a rough code review should be sufficient

  1. Test the application views also for applicants and verifiers. Therefore create a new application with valid mail addresses
  2. run runConfig "Check circular dependencies"

Resolved Issues

Fixes: #1912

Additional information

circular_deps

@f1sh1918 f1sh1918 force-pushed the 1912-detect-circular-deps branch 2 times, most recently from da5c3c9 to d0ed239 Compare February 17, 2025 19:28
@f1sh1918 f1sh1918 force-pushed the 1912-detect-circular-deps branch 2 times, most recently from 1a1ce7d to 8ba139f Compare February 17, 2025 21:39
@f1sh1918 f1sh1918 changed the title 1912: Check circular dependencies 1912: Check and fix circular dependencies Feb 17, 2025
@f1sh1918 f1sh1918 force-pushed the 1912-detect-circular-deps branch 2 times, most recently from f735947 to 812bc82 Compare February 18, 2025 09:26
@f1sh1918 f1sh1918 marked this pull request as ready for review February 18, 2025 09:26
@f1sh1918 f1sh1918 marked this pull request as draft February 18, 2025 09:32
@f1sh1918 f1sh1918 force-pushed the 1912-detect-circular-deps branch 3 times, most recently from 1802ce2 to c130690 Compare February 18, 2025 10:23
@f1sh1918 f1sh1918 force-pushed the 1912-detect-circular-deps branch 3 times, most recently from 549f9d6 to 0ff17e3 Compare February 18, 2025 13:39
@f1sh1918 f1sh1918 force-pushed the 1912-detect-circular-deps branch from 0ff17e3 to ad5f85b Compare February 18, 2025 13:47
@f1sh1918 f1sh1918 marked this pull request as ready for review February 18, 2025 13:52
Copy link
Member

@steffenkleinle steffenkleinle left a comment

Choose a reason for hiding this comment

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

LGTM, nice work! Tested application on firefox.

Copy link
Member

Choose a reason for hiding this comment

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

🙃 Rename to check_circular_deps (no .sh)

Copy link
Member

Choose a reason for hiding this comment

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

❓ Is this copied from somewhere or did you write it yourself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Partly copied but adjusted to our needs . I will add the source

@@ -117,7 +118,8 @@
"format": "NODE_ENV=test eslint . --fix && prettier . --write",
"generate-graphql": "graphql-codegen --config graphql-codegen.yml",
"generate-protobuf": "protoc -I ../specs --es_out=src/generated --es_opt=target=ts --plugin=protoc-gen-es=../node_modules/.bin/protoc-gen-es ../specs/card.proto",
"postinstall": "npm run generate-protobuf && npm run generate-graphql"
"postinstall": "npm run generate-protobuf && npm run generate-graphql",
"check-circular-deps": "bash ./scripts/check_circular_deps.sh"
Copy link
Member

Choose a reason for hiding this comment

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

🔧 I think it would be better not to request bash explicitly.

Suggested change
"check-circular-deps": "bash ./scripts/check_circular_deps.sh"
"check-circular-deps": "./scripts/check_circular_deps"

Perhaps you have to run chmod +x check_circular_deps first though.

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.

Detect circular dependencies
2 participants