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

Add ability to clone previous jobs #334

Merged
merged 1 commit into from
Oct 23, 2015
Merged

Conversation

jmancewicz
Copy link
Contributor

A 'Clone Job' button has been added to the Job pages.

The approach I took was to save the form settings when a job starts for each Field (except SubmitField and FileField in a dict() on the job called form_data.

When a job is cloned, the form is created and populated with the saved form_data from the source job. If a field in the form can not be populated with saved form_data, a warning is presented at the head of the document.

I put the 'Clone Job' button to the left of the 'Abort Job' button.
clone
I'd don't love this. When the Job completes, the 'Abort Job' disappears and the Clone moves to where the Abort Job had been, and could fire a Clone when the user means to Abort. Also, if the source job does not have form_data, the 'Clone Job' button is disabled rather then hidden. I'm not sure I feel is better.

I need to make a test for the suite, but prefer to get this out as is for comment.

I changed the print_errors macro to also print warnings and added a hl_errors macro to add has-error and has-warning classes.

  •            <div class="form-group{{ ' has-error' if form.resize_channels.errors else '' }}">
    
  •            <div class="form-group{{hl_errors([form.resize_channels])}}">
    

@jmancewicz
Copy link
Contributor Author

Added tests for cloning the four creating pages. @lukeyeager can you have a look?

@lukeyeager
Copy link
Member

Sure, I'll take a look. But you've got 5 test failures that need resolving before a merge.

@@ -115,6 +115,10 @@ def create_dataset(cls, **kwargs):
if request_json:
url += '.json'

clone = data.pop('clone', None)
if clone is not None:
url += '?clone=' + clone
Copy link
Member

Choose a reason for hiding this comment

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

I thought we said this was going to work for POST data as well as query string arguments? Why is this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you asking did I put it into data?

@lukeyeager
Copy link
Member

This looks good to me. Let's squash into a single commit and merge.

jmancewicz added a commit that referenced this pull request Oct 23, 2015
Add ability to clone previous jobs
@jmancewicz jmancewicz merged commit f4a0d00 into NVIDIA:master Oct 23, 2015
@jmancewicz jmancewicz deleted the clone branch October 23, 2015 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants