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

fix: Invalidate cached project information when adding an ontology to a project (DEV-2926) #2949

Conversation

BalduinLandolt
Copy link
Collaborator

@BalduinLandolt BalduinLandolt commented Nov 21, 2023

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)

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

Does this PR change client-test-data?

  • Yes

@BalduinLandolt BalduinLandolt self-assigned this Nov 21, 2023
Copy link

linear bot commented Nov 21, 2023

DEV-2926 on localhost, /admin/projects routes don't return the ontologies

The following requests return incomplete information:

  • GET /admin/projects/shortname/{shortname}
  • GET /admin/projects/shortcode/{shortcode}
  • GET /admin/projects/iri/{iri}

Steps to reproduce

{
    "project": {
        ...
        "ontologies": [],   # expected: "http://www.knora.org/ontology/082E/rosetta"
    }
}

The same request on a server works correctly:

GET https://api.demo.dasch.swiss/admin/projects/shortname/rosetta

{
    "project": {
        ...
        "ontologies": [
            "http://www.knora.org/ontology/082E/rosetta"
        ],
    }
}

Severity / affected users

Low severity, probably no users affected, but blocks DEV-2921 (DSP-TOOLS)

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Attention: 169 lines in your changes are missing coverage. Please review.

Comparison is base (ef714c1) 11.64% compared to head (b4db2ee) 11.63%.
Report is 9 commits behind head on main.

Files Patch % Lines
...knora/webapi/responders/v2/SearchResponderV2.scala 0.00% 57 Missing ⚠️
...ra/webapi/responders/admin/ListsResponderADM.scala 0.00% 21 Missing ⚠️
...la/org/knora/webapi/routing/v2/SearchRouteV2.scala 0.00% 19 Missing ⚠️
...lice/admin/repo/service/KnoraProjectRepoLive.scala 0.00% 13 Missing ⚠️
...ebapi/store/cache/impl/CacheServiceInMemImpl.scala 0.00% 11 Missing ⚠️
...ora/webapi/responders/v2/OntologyResponderV2.scala 0.00% 9 Missing ⚠️
...ra/webapi/responders/v2/ResourcesResponderV2.scala 0.00% 8 Missing ⚠️
...ch/gravsearch/transformers/SparqlTransformer.scala 14.28% 6 Missing ⚠️
...org/knora/webapi/responders/v2/SearchQueries.scala 0.00% 5 Missing ⚠️
...org/knora/webapi/routing/v2/ResourcesRouteV2.scala 0.00% 5 Missing ⚠️
... and 10 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2949      +/-   ##
==========================================
- Coverage   11.64%   11.63%   -0.02%     
==========================================
  Files         246      246              
  Lines       22885    22880       -5     
==========================================
- Hits         2666     2661       -5     
  Misses      20219    20219              

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

@BalduinLandolt BalduinLandolt changed the title fix: after creating an ontology, the project endpoint doesn't return it because the cache is not invalidated (DEV-2926) fix: After creating an ontology, the project endpoint doesn't return it because the cache is not invalidated (DEV-2926) Nov 21, 2023
@BalduinLandolt BalduinLandolt marked this pull request as ready for review November 22, 2023 11:43
Copy link
Collaborator

@mpro7 mpro7 left a comment

Choose a reason for hiding this comment

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

Well done, just 2 minor comments:

@BalduinLandolt BalduinLandolt changed the title fix: After creating an ontology, the project endpoint doesn't return it because the cache is not invalidated (DEV-2926) fix: Invalidate cached project information when adding an ontology to a project (DEV-2926) Nov 22, 2023
Co-authored-by: Marcin Procyk <marcin.procyk@dasch.swiss>
@BalduinLandolt BalduinLandolt enabled auto-merge (squash) November 22, 2023 12:20
@BalduinLandolt BalduinLandolt merged commit d0700a2 into main Nov 22, 2023
14 checks passed
@BalduinLandolt BalduinLandolt deleted the feature/dev-2926-on-localhost-adminprojects-routes-dont-return-the-ontologies branch November 22, 2023 12:39
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.

None yet

2 participants