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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent removing relationships with Remove Unused Elements disabled #3173

Merged
merged 10 commits into from
Mar 11, 2024

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented Mar 8, 2024

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is the current behavior?

If you disable the "Remove Unused Elements" option, and remove a diagram, the relations in that diagram are removed anyway.

Issue Number: Fixes #2616 and #3047.

What is the new behavior?

All unlinking is left to the SanitizerService. This service knows if the "Remove Unused Elements" option has been disabled and acts accordingly.

Does this PR introduce a breaking change?

  • Yes
  • No

Without a configured Sanitizer Service, relationships are no longer removed on model level when a relation is broken in a diagram.

Other information

The change itself is quite simple: remove the unlink call from the connector. Fixing the tests took most of the time 馃槃 .

  • Fixed Pin interaction Messages and Execution Specification too.
  • Use custom properties cache folder, so user settings are not intervening with tests.
  • Added a hack to the macOS build, to allow Homebrew to upgrade Python 3.12.

So we do no longer explicitly have to unlink.
@github-actions github-actions bot added the python Pull requests that update Python code label Mar 8, 2024
@amolenaar amolenaar requested review from sz332 and danyeaw March 8, 2024 21:09
@amolenaar amolenaar marked this pull request as draft March 9, 2024 09:14
@amolenaar amolenaar marked this pull request as ready for review March 9, 2024 10:03
@amolenaar amolenaar force-pushed the fix-retain-relations branch 6 times, most recently from 319fefb to 9d52cc5 Compare March 10, 2024 16:24
So test data is not interfering with real user settings
They are taken care of by the sanitizer service.
That way we can avoid deletion if the option
_Remove Unused Elements_ is disabled.
Leave it to the Sanitizer service.
Let Sanitizer service take care of this. On disconnected
unused MessageEnds are still removed, though.
Instead the Sanitizer service has to take care of this.
This should avoid errors like:

    ==> Pouring python@3.12--3.12.2_1.monterey.bottle.tar.gz
    Error: The `brew link` step did not complete successfully
    The formula built, but is not symlinked into /usr/local
    Could not symlink bin/2to3
@danyeaw danyeaw added fix A fix for a bug and removed python Pull requests that update Python code labels Mar 11, 2024
Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

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

Hi @amolenaar, this is a really great way to handle this!

@danyeaw danyeaw merged commit d27bfe2 into main Mar 11, 2024
19 checks passed
@danyeaw danyeaw deleted the fix-retain-relations branch March 11, 2024 02:02
@danyeaw danyeaw changed the title Fix retain relations Prevent removing relationships with Remove Unused Elements disabled Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A fix for a bug
Projects
None yet
2 participants