Skip to content

Conversation

vanessavmac
Copy link
Collaborator

Summary

Fix bugs associated with filtering processing services by project.

List of Changes

  • Fixed the value of "Processing Services Online" on the pipeline overview page. Previous, the count included all processing services of a pipeline across all projects. Filter to only include the activate project.
  • Ensure images can only be processed by processing services in the active project.

Related Issues

Closes #700

@vanessavmac vanessavmac requested a review from mihow January 28, 2025 05:56
@vanessavmac vanessavmac self-assigned this Jan 28, 2025
Copy link

netlify bot commented Jan 28, 2025

Deploy Preview for antenna-preview ready!

Name Link
🔨 Latest commit a32b987
🔍 Latest deploy log https://app.netlify.com/sites/antenna-preview/deploys/67cf83a7dbf505000897b2a8
😎 Deploy Preview https://deploy-preview-705--antenna-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 76
Accessibility: 89
Best Practices: 92
SEO: 100
PWA: 80
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@vanessavmac
Copy link
Collaborator Author

vanessavmac commented Jan 28, 2025

@mihow From #700:

Also "Pipelines registered" includes all pipelines under that processing service, not filtered by current project.

285f8ae addresses this bug, but just to make sure I understood correctly: When a user adds pipelines by clicking the "Register Pipelines" button, it automatically adds those pipelines to that project. But if the pipeline is removed from the project (i.e. through Django admin) the user should not be able to see this pipeline as "registered" or in the ProcessingServiceDetails for this project? Not sure how in a real-life use case without the admin this would occur

I also updated the ProcessingServiceDetails so that only pipelines added to the project are visible

@vanessavmac vanessavmac marked this pull request as ready for review January 28, 2025 07:08
@vanessavmac
Copy link
Collaborator Author

vanessavmac commented Jan 28, 2025

@mihow Backend tests failed but I think it's a cache issue? cb69c66 should fix the tests

@mihow mihow changed the title 700 fix the list of online processing services per project Fix the list of online processing services per project Feb 19, 2025
Copy link
Collaborator

@mihow mihow left a comment

Choose a reason for hiding this comment

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

Great work! There is a chance we can make the serializers & views for Pipelines and ProcessingServices more slim by querying less data. But they are fairly small tables used for configuration. If we are working with views & serializers for large tables like Captures, Detections, Occurrences or Taxa then we should profile the queries and limit the data being fetched & passed to the serializer. I'm just noting that here for the future!

ami/ml/views.py Outdated
# If pipelines are filtered by project, also filter processing services by project
if project:
query_set = query_set.filter(projects=project)
query_set = query_set.filter(projects=project).prefetch_related(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice work finding the custom filter for the Prefetch related query

ami/ml/views.py Outdated

if project:
query_set = query_set.filter(projects=project)
query_set = query_set.filter(projects=project).prefetch_related(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think the processing service view needs to filter the related pipelines by project, but! it will once you add the enabled flag in #738 so I am okay to leave this here

…-list-of-online-processing-services-per-project
@mihow mihow merged commit 9d737c2 into main Mar 11, 2025
6 checks passed
@mihow mihow deleted the 700-fix-the-list-of-online-processing-services-per-project branch March 11, 2025 00:38
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.

Fix the list of online processing services per-project

2 participants