Skip to content

feat: add image support for case studies, events, and news.#703

Open
heisdinesh wants to merge 1 commit intoaiondemand:developfrom
heisdinesh:develop
Open

feat: add image support for case studies, events, and news.#703
heisdinesh wants to merge 1 commit intoaiondemand:developfrom
heisdinesh:develop

Conversation

@heisdinesh
Copy link

Resolves #624

Change(s)

Change Type: Added

Change Category: Internal

Changelog Entry:
Added custom /image sub-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 s were 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

  • Tests have been added or updated to reflect the changes, or their absence is explicitly explained.
  • Documentation has been added or updated to reflect the changes, or their absence is explicitly explained.
  • A self-review has been conducted checking:
    • No unintended changes have been committed.
    • The changes in isolation seem reasonable.
    • Anything that may be odd or unintuitive is provided with a GitHub comment explaining it (but consider if this should not be a code comment or in the documentation instead).
  • All CI checks pass before pinging a reviewer, or provide an explanation if they do not.
  • The PR title matches the changelog entry's one-line description.

Related Issues

Closes #624

@heisdinesh
Copy link
Author

Hey @PGijsbers could you review this PR.

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.

Allow images for additional entities

1 participant