Skip to content

Conversation

pbrown12303
Copy link
Contributor

Factored subset logic into new subsettable_umlproperty class; Updated association class to handle subsets.

This pull request enables subsetting of associations. I factored the subset logic into a new subclass of umlproperty (subsettable_umlproperty) and made it the parent class of all subsettable properties, including association. I updated the association class to coordinate the subset contents. The documentation of association details the logic governing the superset/subset contents under various editing scenarios. Some of the logic is not determined solely by standard set theory, but is rather based on policy. Please examine these policies to see if they make sense.

The test cases cover all of the cases described and verify that a subsetted association still works correctly as a subset of a derived union.

One of the checks I added in subsettable_umlproperty.add() is to ensure that a subclass with multiplicity of many is not allowed as a subclass of an association with a multiplicity of 1. I originally raised an error here, but that created its own problem. The add() method is called during initialization when the uml.py file is read in, which would be appropriate except for the fact that the execution of poetry run poe uml also loads uml.py in its startup. If there is a subsetting error in the model (which there was - see below), then poe cannot generate a new uml.py file. In other words, there is no mechanism for fixing the error. Consequently, instead of raising an error, I log a warning that will appear when gaphor runs.

As mentioned, there was a modeling error in the existing UML model. The BehavioralFeature.ownedParameterSet was modeled with an upper multiplicity of many, but is declared to be a subset of namespace which has a multiplicity of 1. This was caught in the updated add() function. I changed the multiplicity to 1. That is the only change to the UML model.

PR Checklist

Please check if your PR fulfills the following requirements:

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?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Factored subset logic into new subsettable class; Updated association class to handle subsets.
@github-actions github-actions bot added the python Pull requests that update Python code label Oct 8, 2024
@amolenaar
Copy link
Member

This looks good. I'll have to give it a spin 😃

pbrown12303 and others added 23 commits October 11, 2024 15:11
They're now part of GTK 4.16, so we do not have to maintain our own.
Now we have a bare model base class we can use for multiple
modeling languages.
It means it has no name, owner, or anything. It's just a stylesheet.
Currently translated at 86.3% (577 of 668 strings)

Translation: Gaphor/Gaphor
Translate-URL: https://hosted.weblate.org/projects/gaphor/gaphor/fi/

Co-authored-by: Jiri Grönroos <jiri.gronroos@iki.fi>
Automatically update pre-commit hooks weekly
amolenaar and others added 16 commits October 23, 2024 14:33
According to the apple docs, the conformance type should
be some sort of super-type for our Gaphor model.

Since our models are saved as XML, I suppose `public.xml` is
the most approprate.

https://developer.apple.com/documentation/uniformtypeidentifiers/defining-file-and-data-types-for-your-app?language=objc
macos: Fix Gaphor model file conformance
Fixed property pages for Dependency; added isFinalSpecialization
Currently translated at 100.0% (668 of 668 strings)

Translation: Gaphor/Gaphor
Translate-URL: https://hosted.weblate.org/projects/gaphor/gaphor/nl/
Currently translated at 97.0% (648 of 668 strings)

Translation: Gaphor/Gaphor
Translate-URL: https://hosted.weblate.org/projects/gaphor/gaphor/de/
Presentation class inherits directly from Base
Implemented drop for ActivityPartition (swimlane)
@danyeaw
Copy link
Member

danyeaw commented Oct 26, 2024

Hi @pbrown12303 it looks like we are going to need to resolve the UML.gaphor conflict before we merge this one.

@pbrown12303
Copy link
Contributor Author

That's what I expected! @amolenaar Please ping me when you are ready for this.

dependabot bot and others added 3 commits October 28, 2024 20:50
Bumps the github-action-updates group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4.2.1` | `4.2.2` |
| [actions/setup-python](https://github.com/actions/setup-python) | `5.2.0` | `5.3.0` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3.26.13` | `3.27.0` |
| [actions/dependency-review-action](https://github.com/actions/dependency-review-action) | `4.3.4` | `4.4.0` |
| [actions/cache](https://github.com/actions/cache) | `4.1.1` | `4.1.2` |
| [crazy-max/ghaction-virustotal](https://github.com/crazy-max/ghaction-virustotal) | `4.0.0` | `4.1.0` |


Updates `actions/checkout` from 4.2.1 to 4.2.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@eef6144...11bd719)

Updates `actions/setup-python` from 5.2.0 to 5.3.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@f677139...0b93645)

Updates `github/codeql-action` from 3.26.13 to 3.27.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@f779452...6624720)

Updates `actions/dependency-review-action` from 4.3.4 to 4.4.0
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](actions/dependency-review-action@5a2ce3f...4081bf9)

Updates `actions/cache` from 4.1.1 to 4.1.2
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@3624ceb...6849a64)

Updates `crazy-max/ghaction-virustotal` from 4.0.0 to 4.1.0
- [Release notes](https://github.com/crazy-max/ghaction-virustotal/releases)
- [Commits](crazy-max/ghaction-virustotal@92a6081...93ce6fb)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-action-updates
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-action-updates
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-action-updates
- dependency-name: actions/dependency-review-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-action-updates
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-action-updates
- dependency-name: crazy-max/ghaction-virustotal
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-action-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Currently translated at 100.0% (668 of 668 strings)

Translation: Gaphor/Gaphor
Translate-URL: https://hosted.weblate.org/projects/gaphor/gaphor/pt_BR/

Co-authored-by: Léo <leonardoleozinho576@gmail.com>
@github-actions github-actions bot added skip-changelog Do not add this entry to the changelog translation Everything regarding translation, localization, and internationalization packaging Update to packaging aspects documentation labels Nov 1, 2024
@amolenaar
Copy link
Member

amolenaar commented Nov 1, 2024

I merged the changes from this branch with the main branch.

Since Dependency has moved from the core model to UML, I re-applied the changes there.

It looks like GitHub doesn't like the reverse-merge trick. I merged subset to main, then merged the merge request back into the branch.

If you want to see what really changed, check the merge commit.

@amolenaar amolenaar merged commit 4dc42ee into gaphor:main Nov 1, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation packaging Update to packaging aspects python Pull requests that update Python code skip-changelog Do not add this entry to the changelog translation Everything regarding translation, localization, and internationalization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants