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

refactor: Introduce OntologyService and refactor resource creation #3255

Merged
merged 12 commits into from
May 29, 2024

Conversation

BalduinLandolt
Copy link
Contributor

Pull Request Checklist

Task Description/Number

Issue Number: DEV-

PR Type

  • build/chore: maintenance tasks (no production code change)
  • docs: documentation changes (no production code change)
  • feat: represents new features
  • fix: represents bug fixes
  • perf: performance improvements
  • refactor: represents production code refactoring
  • test: adding or refactoring tests (no production code change)
  • deprecated: Deprecation warning (ideally referencing a migration guide)

Basic requirements for bug fixes and features

  • Tests for the changes have been added
  • Docs have been added / updated

Does this PR introduce a breaking change?

  • Yes

@BalduinLandolt BalduinLandolt self-assigned this May 28, 2024
@BalduinLandolt BalduinLandolt marked this pull request as ready for review May 29, 2024 10:47
case Some(_: ApiV2Schema) => true
case _ => false
})
iriInfo.iriType == KnoraDefinitionIri && iriInfo.ontologySchema.isInstanceOf[ApiV2Schema]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this precise? It's always going to be an instance of Option first, ApiV2Schema second. It's never a good idea to use isInstanceOf, it's not type safe, as you see here. If you're interested in the subtype, add WithAsIs and use .contains(_.is[ApiV2Schema]).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right... that's actually not at all correct, I completely ignored the option. That may be the reason why suddenly all the tests fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reverted the change which fixed the tests.
I don't think I want to spend anymore time on this PR, so I leave WithAsIs for another time.

@BalduinLandolt BalduinLandolt merged commit 21b82bf into main May 29, 2024
9 checks passed
@BalduinLandolt BalduinLandolt deleted the wip/refactor-resource-creation branch May 29, 2024 12:13
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.

2 participants