-
Notifications
You must be signed in to change notification settings - Fork 52
add rake task to update morpheus models #2198
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
base: seek-1.16
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -9,11 +9,14 @@ namespace :seek do | |||||||||||||||||||||||||||||||||||
task upgrade_version_tasks: %i[ | ||||||||||||||||||||||||||||||||||||
environment | ||||||||||||||||||||||||||||||||||||
db:seed:007_sample_attribute_types | ||||||||||||||||||||||||||||||||||||
db:seed:003_model_formats | ||||||||||||||||||||||||||||||||||||
db:seed:004_model_recommended_environments | ||||||||||||||||||||||||||||||||||||
update_rdf | ||||||||||||||||||||||||||||||||||||
update_observation_unit_policies | ||||||||||||||||||||||||||||||||||||
fix_xlsx_marked_as_zip | ||||||||||||||||||||||||||||||||||||
add_policies_to_existing_sample_types | ||||||||||||||||||||||||||||||||||||
fix_previous_sample_type_permissions | ||||||||||||||||||||||||||||||||||||
update_morpheus_model | ||||||||||||||||||||||||||||||||||||
] | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
# these are the tasks that are executes for each upgrade as standard, and rarely change | ||||||||||||||||||||||||||||||||||||
|
@@ -91,6 +94,22 @@ namespace :seek do | |||||||||||||||||||||||||||||||||||
end | ||||||||||||||||||||||||||||||||||||
end | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
task(update_morpheus_model: [:environment]) do | ||||||||||||||||||||||||||||||||||||
puts "... updating morpheus model" | ||||||||||||||||||||||||||||||||||||
Model.all.each do |model| | ||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||||
next unless model.is_morpheus_supported? | ||||||||||||||||||||||||||||||||||||
unless model.model_format | ||||||||||||||||||||||||||||||||||||
model.model_format = ModelFormat.find_by(title: 'Morpheus') | ||||||||||||||||||||||||||||||||||||
end | ||||||||||||||||||||||||||||||||||||
unless model.recommended_environment | ||||||||||||||||||||||||||||||||||||
model.recommended_environment = RecommendedModelEnvironment.find_by(title: 'Morpheus') | ||||||||||||||||||||||||||||||||||||
end | ||||||||||||||||||||||||||||||||||||
Comment on lines
+101
to
+106
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If no
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||||
model.save | ||||||||||||||||||||||||||||||||||||
model.update_column(:model_format_id, model.model_format_id) | ||||||||||||||||||||||||||||||||||||
model.update_column(:recommended_environment_id, model.recommended_environment_id) | ||||||||||||||||||||||||||||||||||||
Comment on lines
+107
to
+109
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code calls
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||||
end | ||||||||||||||||||||||||||||||||||||
end | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
task(add_policies_to_existing_sample_types: [:environment]) do | ||||||||||||||||||||||||||||||||||||
puts '... Adding policies to existing sample types' | ||||||||||||||||||||||||||||||||||||
counter = 0 | ||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The seed tasks are ordered with
007_sample_attribute_types
before003
and004
, which may lead to missing lookup values if dependencies aren’t loaded in the correct order. Consider reordering these seeds numerically.Copilot uses AI. Check for mistakes.