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

Launcher save fixed attributes #3784

Merged
merged 19 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions apps/dashboard/app/models/launcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,17 @@ def add_script_to_form(form: [], attributes: {})

dir = { directory: project_dir }
attributes[:auto_scripts] = if attributes[:auto_scripts]
attributes[:auto_scripts].merge(dir)
else
dir
end
attributes[:auto_scripts].merge(dir)
else
dir
end

# Delete 'value' if it does not exist in the available options
# so that projects created from templates don't point to another
# user's script
script_value = attributes[:auto_scripts]['value']
script_options = attributes[:auto_scripts]['options']
attributes[:auto_scripts].delete('value') if script_options.none? { |opt| opt.include?(script_value) }
johrstrom marked this conversation as resolved.
Show resolved Hide resolved
end

def add_cluster_to_form(form: [], attributes: {})
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/test/system/project_manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -955,11 +955,11 @@ def add_auto_environment_variable(project_id, script_id, save: true)

find("#launch_8woi7ghd").click

assert_selector('.alert-success', text: 'job-id-123')

# sleep here because this test can error with Errno::ENOTEMPTY: Directory not empty @ dir_s_rmdir
# something still has a hold on these files.
sleep 2

assert_selector('.alert-success', text: 'job-id-123')
end
end
end
Loading