Skip to content

Conversation

@itallix
Copy link
Contributor

@itallix itallix commented Dec 19, 2025

Summary

  • Rename model_revision_id to model_id and allow both aliases when validating model
  • Fix legacy references

Checklist

  • The PR title and description are clear and descriptive
  • I have manually tested the changes
  • All changes are covered by automated tests
  • All related issues are linked to this PR (if applicable)
  • Documentation has been updated (if applicable)

Copilot AI review requested due to automatic review settings December 19, 2025 13:50
@itallix itallix requested review from a team, jpggvilaca and leoll2 as code owners December 19, 2025 13:50
@itallix itallix linked an issue Dec 19, 2025 that may be closed by this pull request
@github-actions github-actions bot added TEST Any changes in tests DOC Improvements or additions to documentation Geti Tune Backend Issues related to Geti Tune Studio backend labels Dec 19, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR renames the model_revision_id field to model_id in the Pipeline model to improve API consistency, while maintaining backward compatibility by accepting both field names during validation. The change also includes adding support for detecting model changes in running pipelines through a new event type.

  • Renamed model_revision_id to model_id with backward-compatible validation using AliasChoices
  • Added MODEL_CHANGED event type and corresponding event handling logic
  • Updated all references throughout the codebase to use the new model_id field name

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
application/docs/models.md Fixed grammatical error ("an parent-child" → "a parent-child")
application/backend/app/models/pipeline.py Renamed field from model_revision_id to model_id with alias support for backward compatibility
application/backend/app/services/pipeline_service.py Updated to use model_id and added MODEL_CHANGED event emission logic
application/backend/app/services/pipeline_metrics_service.py Updated references from model_revision_id to model_id
application/backend/app/services/event/event_bus.py Added MODEL_CHANGED event type and notification logic
application/backend/tests/unit/services/event/test_event_bus.py Added test coverage for MODEL_CHANGED event
application/backend/tests/integration/services/test_pipeline_service.py Updated test assertions and added new test for model switching with both field name aliases
application/backend/tests/integration/services/test_dataset_service.py Updated test references from model_revision_id to model_id
application/backend/tests/conftest.py Updated fixture to use model_id instead of model_revision_id

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Dec 19, 2025

📊 Test coverage report

Metric Coverage
Lines 40.2%
Functions 34.9%
Branches 84.8%
Statements 40.2%

@github-actions
Copy link

github-actions bot commented Dec 19, 2025

Docker Image Sizes

CPU

Image Size
geti-tune-cpu:pr-5089 2.85G
geti-tune-cpu:sha-0883aea 2.85G

GPU

Image Size
geti-tune-gpu:pr-5089 10.62G
geti-tune-gpu:sha-0883aea 10.62G

XPU

Image Size
geti-tune-xpu:pr-5089 8.69G
geti-tune-xpu:sha-0883aea 8.69G

pipeline = self.get_pipeline_by_id(project_id)
to_update = type(pipeline).model_validate(pipeline.model_copy(update=partial_config))
base = pipeline.model_dump()
to_update = type(pipeline).model_validate({**base, **partial_config})
Copy link
Contributor

Choose a reason for hiding this comment

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

Pipeline is already imported in this file, why not use it again?

Copy link
Contributor Author

@itallix itallix Dec 23, 2025

Choose a reason for hiding this comment

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

Both are valid. But type(pipeline).model_validate(...) validates with the concrete runtime model returned by get_pipeline_by_id(), which makes this code more resilient to refactors (e.g., subclasses) than hard-coding Pipeline.model_validate(...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DOC Improvements or additions to documentation Geti Tune Backend Issues related to Geti Tune Studio backend TEST Any changes in tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent key names in PATCH pipeline endpoint body

3 participants