feat: add image support for case studies, events, and news.#703
Open
heisdinesh wants to merge 1 commit intoaiondemand:developfrom
Open
feat: add image support for case studies, events, and news.#703heisdinesh wants to merge 1 commit intoaiondemand:developfrom
heisdinesh wants to merge 1 commit intoaiondemand:developfrom
Conversation
Author
|
Hey @PGijsbers could you review this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #624
Change(s)
Change Type: Added
Change Category: Internal
Changelog Entry:
Added custom
/imagesub-routes (POST, PUT, GET, DELETE) to CaseStudyRouter, EventRouter, and NewsRouter to bring them to feature parity with Project and Organisation.The AIResource base model already supports media, so no database migrations were needed. The existing add_custom_routes utility was leveraged for the routing, and the get_resources functions were updated to accept the get_image query parameter. Default test fixtures for these components were also set up to include them in the automated image sub-router test suite. Finally, a test runner bug was fixed where endpoints ending in
swere naively pluralized (e.g., generating/case_studys/instead of/case_studies/), which previously led to 404s.How to Test
No special steps are required outside of standard CI/CD.
You can verify it locally by running the tests for the image sub-routers via docker:
docker run -v ./scripts:/scripts -e KEYCLOAK_CLIENT_SECRET="mocked_secret" --entrypoint "" aiod/metadata_catalogue:ci sh -c "pip install '.[dev]' && pytest src/tests/routers/resource_routers/test_image_subrouters.py"Checklist
Related Issues
Closes #624