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 Workflows by Type and Update Endpoints #582

Open
2 of 10 tasks
drjova opened this issue Sep 25, 2024 · 1 comment · May be fixed by inspirehep/inspirehep#3269
Open
2 of 10 tasks

Refactor Workflows by Type and Update Endpoints #582

drjova opened this issue Sep 25, 2024 · 1 comment · May be fixed by inspirehep/inspirehep#3269

Comments

@drjova
Copy link
Contributor

drjova commented Sep 25, 2024

As we plan to introduce more workflow types in the backoffice, we need to refactor the current structure to better separate workflows by type. This involves creating dedicated Django apps for each workflow type, updating models, serializers, API endpoints, and ensuring changes are reflected in OpenSearch and the UI.

Separate Workflow Types:

  • Create a separate Django app for each type of workflow (starting with authors).
  • Move the existing Workflow model under the authors app.

Update API Endpoints:

  • Change the current workflows endpoint from /api/workflows to /api/workflows/authors.
  • Ensure all new workflow types will have dedicated endpoints under /api/workflows/{type}.

Serializer and Model Refactoring:

  • Separate serializers for each workflow type.
  • Ensure that models are properly refactored and cleaned, removing unnecessary components like core that are no longer relevant, for example core for authors.

OpenSearch Index Update:

  • Update Elasticsearch indices to reflect the new workflow structure.
  • Ensure the indices are properly aligned with the refactored models and endpoints.

UI Update:

  • Ensure the UI is updated to call the new API endpoint /api/workflows/authors for author workflows.
  • Test and verify that the UI behaves correctly with the new structure.

Acceptance:
A more modular workflow system with dedicated apps, serializers, and endpoints for each workflow type. The new /api/workflows/authors endpoint should be fully functional, with corresponding updates in Elasticsearch and the UI.

@drjova drjova changed the title Separate workflow types Refactor Workflows by Type and Update Endpoints Sep 25, 2024
@DonHaul DonHaul self-assigned this Sep 30, 2024
@DonHaul DonHaul linked a pull request Oct 1, 2024 that will close this issue
@DonHaul
Copy link
Collaborator

DonHaul commented Oct 1, 2024

Questions that have risen:
should is_update be removed?

https://docs.djangoproject.com/en/5.1/topics/db/models/#model-inheritance
abstract or Multi-table inheritance? Base Workflow model from which all wf types (Author,Literature) etc inherit

Choices cannot really be merged / concatted as they are Models.TextChoices, once we upgrade to django 5 the issue is fixed
https://docs.djangoproject.com/en/5.1/releases/5.0/#more-options-for-declaring-field-choices

DonHaul added a commit to DonHaul/inspirehep that referenced this issue Oct 2, 2024
DonHaul added a commit to DonHaul/inspirehep that referenced this issue Oct 7, 2024
DonHaul added a commit to DonHaul/inspirehep that referenced this issue Oct 7, 2024
DonHaul added a commit to DonHaul/inspirehep that referenced this issue Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants