ManageIQ / manageiq-v2v

ManageIQ plugin for v2v transformations
Apache License 2.0
10 stars 42 forks source link

User can schedule a migration plan #369

Closed serenamarie125 closed 6 years ago

serenamarie125 commented 6 years ago

The user should be able to schedule a migration plan, by specifying a date and time for it to be run.

serenamarie125 commented 6 years ago

Note that there is a requirements meeting around schedule the first week of June. Design work won't be started until we know requirements and identified use cases.

blomquisg commented 6 years ago

@serenamarie125 the functional requirements below assume that a user would create a migration plan, and then schedule that migration plan. I.e., the back end could assume that the migration plan already exists before allowing a caller to schedule it. Lemme know if I got that wrong, and I can change this.

Backend functional requirement: Probably using either the scheduler or the queue messages' delivery_on, allow migration plans to be scheduled in the future. Surface this functionality in the migration plan models to allow callers to schedule migration plans.

API functional requirement: Allow caller to specify a migration plan and a start time for that migration plan.

serenamarie125 commented 6 years ago

@bthurber, I'm guessing the end goal is to be able to both:

  1. Schedule an existing migration plan
  2. Create a migration plan and specify the date and time for it to be run

For sprint 9, is (1) sufficient?

bthurber commented 6 years ago

@serenamarie125 yes that sounds like it will meet the criteria. The only other option I would suggest is to be able to delete a scheduled migration before it has run.

bdunne commented 6 years ago

It looks like the API already has everything it needs and we just need to pass the following in the options hash of the request:

{ :schedule_type => "schedule", :schedule_time => the_time }
serenamarie125 commented 6 years ago

@vconzola please add mockups for scheduling a migration plan

@priley86 do you know what we have for support in PF React for Date/Time combo?

serenamarie125 commented 6 years ago

Good news @bdunne thanks for the info! Removing needs-api message.

vconzola commented 6 years ago

@serenamarie125 I checked in CloudForms and they do scheduling like this: adding a new schedule in cfme I also talked with Matt C. and the PR for the PatterFly core date/time picker that Agnes was working on will be merged very soon. He said, "Yes, the plan is to put this into PF Core. It leverages the current Bootstrap widget, so there is minimal dev work to be done. You should feel free to use this approach and let @nding-anges and I know if you see any issues with applying this." So which way should we go - stay consistent with current CloudForms or implement PatternFly component?

vconzola commented 6 years ago

@serenamarie125 I have some mockups done, but want to review them with you and team before adding here. Can we discuss in Thursday standup?

nding-anges commented 6 years ago

@vconzola Hi, we will send a P.R of Date&Time Picker soon. Please find more detail about the design here: https://docs.google.com/document/d/1kVAhNzSB-szucfeGgq815dB6e214WavZ-gqRR0Sydj0/edit?usp=sharing and let us know if you have any questions.

vconzola commented 6 years ago

Mockups are here: https://docs.google.com/presentation/d/1gMpkoVBzYb_L5orh_VFk3ZhwtLfl1S6fuI2whIdJVh8/edit?usp=sharing Still a WIP, but enough to get started on development.

AllenBW commented 6 years ago

just cuz i like ๐Ÿ–ผ

screen shot 2018-06-08 at 12 36 55 pm screen shot 2018-06-08 at 12 36 47 pm screen shot 2018-06-08 at 12 36 37 pm
serenamarie125 commented 6 years ago

@vconzola I think we should pull Stacy in for messaging around the cancel. It feels like this is actually canceling the plan which is migrating, when it's actually "unscheduling" it. Maybe "remove schedule" or "unschedule" as the action button label would be more descriptive?

mturley commented 6 years ago

This all looks good so far, but I just want to throw this out there before it gets discussed from a design standpoint: If we are asked to build a calendar of upcoming migrations, I fear it will be more work than we expect. I've just been spooked by https://zachholman.com/talk/utc-is-enough-for-everyone-right ๐Ÿ˜„

I agree with @serenamarie125 about the word "cancel" maybe sounding too destructive, too.

AllenBW commented 6 years ago

@vconzola Gonna echo the above sentiments, what is the intended behavior of the cancel? To clear a migration planned in the future?

vconzola commented 6 years ago

@serenamarie125 @mturley @AllenBW All right! All right! I get it. "Cancel" was a crappy word choice. Stop ganging up on me. :-) I really don't like "unschedule" either and I think "remove" has the same problem as "cancel". But I can't think of a better alternative, so let's try "unschedule". It's possible this will get revisited when Stacy does her text review. Here are updated mockups. filter is not started - w schedule scheduled w cancel _2 filter is not started - w schedule scheduled w cancel confirm _2

vconzola commented 6 years ago

@serenamarie125 Any guidance on which scheduling components we should use for the actual schedule creation - the one about to be merged into PatternFly core or the ones currently used in CloudForms? See my comment above from last week.

AllenBW commented 6 years ago

{โ€œerror":{"kind":"bad_request","message":"Could not update Service Template - unknown attribute 'schedule_type' for ServiceTemplateTransformationPlan.","klass":"Api::BadRequestError"}}

is the error experienced when...

POST http://localhost:8080/api/service_templates/50
{โ€œactionโ€:"edit", "schedule_type":"schedule", "schedule_time": 1528891391}

Looking to figure out how to schedule a migration... wondering if anyone can spare some cycles to help get me on the right trackโ€ฆ

Edit:

there's other actions present on the collection... but i suspect edit is what we want...

 "actions": [
        {
          "name": "edit",
          "method": "post",
          "href": "http://localhost:8080/api/service_templates/43"
        },
        {
          "name": "edit",
          "method": "patch",
          "href": "http://localhost:8080/api/service_templates/43"
        },
        {
          "name": "edit",
          "method": "put",
          "href": "http://localhost:8080/api/service_templates/43"
        },
        {
          "name": "delete",
          "method": "post",
          "href": "http://localhost:8080/api/service_templates/43"
        },
        {
          "name": "order",
          "method": "post",
          "href": "http://localhost:8080/api/service_templates/43"
        },
        {
          "name": "archive",
          "method": "post",
          "href": "http://localhost:8080/api/service_templates/43"
        },
        {
          "name": "unarchive",
          "method": "post",
          "href": "http://localhost:8080/api/service_templates/43"
        },
        {
          "name": "delete",
          "method": "delete",
          "href": "http://localhost:8080/api/service_templates/43"
        }
      ]
AllenBW commented 6 years ago

soooooooooooo

when posting with a body of ๐Ÿ‘‡

{
  "action" : "edit",
  "resource" : {
    "options" : {
      "schedule_type":"schedule", 
      "schedule_time": 1528821391
    }
  }
}

We overwrite the contents of the service template options... looks like put and patch, while are listed as actions aren't enabled? @bdunne do yah see anything that might confirm or deny the (un)availability of these additional actions?

bdunne commented 6 years ago

Okay, just to keep everyone in the loop... Allen and I talked earlier. TIL that this is using ServiceTemplates and that is a different API endpoint, which doesn't support scheduling yet. I'm working on that now.

AllenBW commented 6 years ago

Yah know... we could really use... https://github.com/patternfly/patternfly-react/issues/232 ๐Ÿค” ๐Ÿ’ก

vconzola commented 6 years ago

Hi @nding-anges - Has the P.R of Date&Time Picker been merged yet?

nding-anges commented 6 years ago

Hi @vconzola We have just fixed one little issue and the P.R is waiting for review now. https://github.com/patternfly/patternfly-design/pull/676

priley86 commented 6 years ago

hey @vconzola @AllenBW - some things we have to consider here. Since we don't yet have this component in PF React and there is a new design coming...here is my advice:

PF Jquery Datepicker: https://rawgit.com/patternfly/patternfly/master-dist/dist/tests/bootstrap-datepicker.html

PF Jquery Timepicker: https://rawgit.com/patternfly/patternfly/master-dist/dist/tests/time-picker.html

Some alternatives in React that are similar, but not 100%:

React Bootstrap Datepicker (not in line w/ existing design 100% but similar): https://github.com/pushtell/react-bootstrap-date-picker

React Widget Date & Time Picker (not in line w/ new design but would work): http://jquense.github.io/react-widgets/api/DateTimePicker/

There may be others that could fit, but we really need this component still in PF React. I would pick a short term option that works for now and we can start the contribution to PF React separately that meets the new design and circle back later when it's done.

thoughts?

AllenBW commented 6 years ago

down with React Widget Date & Time Picker! would be real hesitant to introduce a jquery asset... but just need the blessing that we can go our own way (for the time being) ๐Ÿ™‡ ๐Ÿ™

vconzola commented 6 years ago

@AllenBW After discussing with @priley86 I say we go with the existing jquery assets to stay PatternFly compliant and in parallel try to get a React component developed based on the design here:, the PR for which should be merged very soon. Patrick said it will take a while to implement the design in React to stay PF compliant. I know you don't agree, but do you have what you need to do the jquery date/time picker or do you need a mockup?

AllenBW commented 6 years ago

Ugh. Well ok then.

Yeah! Mockups for the record would be gooood to have @vconzola ๐Ÿ™‡โ€โ™€๏ธ

Also, would be nice to know how yah want those things arranged on the page.

AllenBW commented 6 years ago

@vconzola

screen shot 2018-06-18 at 11 17 20 am screen shot 2018-06-18 at 11 17 12 am

no mockups required if this is what yah had in mind ๐Ÿค”

serenamarie125 commented 6 years ago

@AllenBW @vconzola i'm checking with Jenny on the spacing ... i'll come back with some direction there in a couple!

serenamarie125 commented 6 years ago

@AllenBW left margin should be 20px so that it lines up with the modal heading. There should be 15 px between the date and time picker components. @vconzola fyi i did verify that with Jenny from a PF perspective

vconzola commented 6 years ago

@AllenBW Sorry I've been slow to respond. Trying to catch up from meetings in Westford last week. The only thing I see missing/different from the current CloudForms scheduler is a time zone selector. (See screen shot way at the top of this issue.)

vconzola commented 6 years ago

@AllenBW One other thing...title should be Schedule Migration Plan.

AllenBW commented 6 years ago

@vconzola can we get updated mocks?

vconzola commented 6 years ago

@AllenBW I've given this some thought and looked at various date/time pickers in jQuery and I like what you did above as much as any of them. So let's just use what you did and with the spacing specified by Serena above. We will not add a time zone selector since I think it will just add confusion. We display times in other places in the UI, which I assume are based on the platform clock. So the scheduler should just use the same clock reference.

screen shot 2018-06-18 at 4 36 34 pm
JPrause commented 6 years ago

@miq-bot add_label blocker This is a blocker to: https://bugzilla.redhat.com/show_bug.cgi?id=1564255

JPrause commented 6 years ago

Any update on this PR. We have an upcoming build on July 10

AllenBW commented 6 years ago

375 is the pr for this issue, has the latest info, presently blocked by api work (detailed in pr) @JPrause

nding-anges commented 6 years ago

@vconzola Hi, the P.R of Date&Time Picker been merged. https://rawgit.com/patternfly/patternfly/master-dist/dist/tests/date-and-time.html#! Please tell me if you have any questions.