-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding migration to create new disabled column for automated workflow executions table * adding new status column to automated workflow executions table * attempting to enable/disable automated workflows after pipeline initialization * trying to fix tests * updating enable/disable automated workflow based on pipeline automatable and exectuable * trying to fix ci tests * trying to fix ci tests * trying to fix ci tests * trying to fix ci tests * trying to fix ci tests * trying to fix ci tests * trying to fix ci tests * trying to fix ci tests * trying to fix ci tests * adding translations * adding a test * checking the table exists * checking the table exists * iterating through automated workflow executions instead of pipelines * adding a new test * disabling the edit link for disabled automated workflows * updating LaunchJob to only call LaunchService for enabled automated workflows * removing edit link if disabled
- Loading branch information
Showing
15 changed files
with
256 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
app/views/projects/automated_workflow_executions/edit.turbo_stream.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<% if @automated_workflow_execution.disabled %> | ||
<%= turbo_stream.append "flashes" do %> | ||
<%= viral_flash(type:, data: message) %> | ||
<% end %> | ||
<% else %> | ||
<%= turbo_stream.update( | ||
"automated_workflow_execution_modal", | ||
partial: "edit_dialog", | ||
locals: { | ||
open: true, | ||
}, | ||
) %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
db/migrate/20241017164233_add_disabled_to_automated_workflow_executions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
# Migration to add a new disabled column to the automated workflow executions table | ||
class AddDisabledToAutomatedWorkflowExecutions < ActiveRecord::Migration[7.2] | ||
def change | ||
add_column :automated_workflow_executions, :disabled, :boolean, default: false, null: false | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'test_helper' | ||
|
||
class PipelinesTest < ActiveSupport::TestCase | ||
test 'disable automated workflow executions after pipeline registration' do | ||
assert_not Irida::Pipelines.instance.available_pipelines.empty? | ||
pipeline = Irida::Pipelines.instance.available_pipelines['phac-nml/iridanextexample_1.0.0'] | ||
assert_not_nil pipeline | ||
assert_not pipeline.executable | ||
|
||
automated_workflow_execution = AutomatedWorkflowExecution.find_by( | ||
"metadata ->> 'workflow_name' = ? and metadata ->> 'workflow_version' = ?", pipeline.name, pipeline.version | ||
) | ||
assert_not_nil automated_workflow_execution | ||
assert_not automated_workflow_execution.disabled | ||
|
||
load Rails.root.join('config/initializers/pipelines.rb') | ||
|
||
assert automated_workflow_execution.reload.disabled | ||
end | ||
|
||
test 'disable automated workflow executions after pipeline registration when the pipeline has been removed' do | ||
pipeline_name = 'phac-nml/iridanextexample' | ||
pipeline_version = '1.0.4' | ||
assert_not Irida::Pipelines.instance.available_pipelines.empty? | ||
assert_nil Irida::Pipelines.instance.available_pipelines["#{pipeline_name}_#{pipeline_version}"] | ||
|
||
automated_workflow_execution = AutomatedWorkflowExecution.find_by( | ||
"metadata ->> 'workflow_name' = ? and metadata ->> 'workflow_version' = ?", pipeline_name, pipeline_version | ||
) | ||
assert_not_nil automated_workflow_execution | ||
assert_not automated_workflow_execution.disabled | ||
|
||
load Rails.root.join('config/initializers/pipelines.rb') | ||
|
||
assert automated_workflow_execution.reload.disabled | ||
end | ||
end |
Oops, something went wrong.