Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

User can schedule a migration plan #369

Closed
serenamarie125 opened this issue Jun 1, 2018 · 38 comments · Fixed by #401
Closed

User can schedule a migration plan #369

serenamarie125 opened this issue Jun 1, 2018 · 38 comments · Fixed by #401

Comments

@serenamarie125
Copy link

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

@serenamarie125
Copy link
Author

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
Copy link
Member

@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
Copy link
Author

serenamarie125 commented Jun 2, 2018

@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
Copy link

bthurber commented Jun 4, 2018

@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
Copy link
Member

bdunne commented Jun 4, 2018

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
Copy link
Author

serenamarie125 commented Jun 5, 2018

@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
Copy link
Author

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

@vconzola
Copy link

vconzola commented Jun 6, 2018

@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
Copy link

vconzola commented Jun 6, 2018

@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
Copy link

@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
Copy link

vconzola commented Jun 8, 2018

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
Copy link
Member

AllenBW commented Jun 8, 2018

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
Copy link
Author

@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
Copy link
Contributor

mturley commented Jun 10, 2018

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
Copy link
Member

AllenBW commented Jun 11, 2018

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

@vconzola
Copy link

@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
Copy link

@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
Copy link
Member

AllenBW commented Jun 12, 2018

{“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
Copy link
Member

AllenBW commented Jun 12, 2018

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
Copy link
Member

bdunne commented Jun 12, 2018

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
Copy link
Member

AllenBW commented Jun 13, 2018

Yah know... we could really use... patternfly/patternfly-react#232 🤔 💡

@vconzola
Copy link

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

@nding-anges
Copy link

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

@priley86
Copy link
Member

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:

  • there is existing jquery datepickers and timepickers in the existing design and the new design (and existing implementations for datepicker and timepicker independently). The new design for integrated datepicker/timepicker will still have to be developed. For that reason, I would propose fast tracking this by showing the existing design if we want to be 100% PatternFly.

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
Copy link
Member

AllenBW commented Jun 14, 2018

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
Copy link

@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
Copy link
Member

AllenBW commented Jun 15, 2018

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
Copy link
Member

AllenBW commented Jun 18, 2018

@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
Copy link
Author

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

@serenamarie125
Copy link
Author

@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
Copy link

@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
Copy link

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

@AllenBW
Copy link
Member

AllenBW commented Jun 18, 2018

@vconzola can we get updated mocks?

@vconzola
Copy link

vconzola commented Jun 19, 2018

@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
Copy link
Member

JPrause commented Jun 26, 2018

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

@JPrause
Copy link
Member

JPrause commented Jul 3, 2018

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

@AllenBW
Copy link
Member

AllenBW commented Jul 3, 2018

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

@nding-anges
Copy link

nding-anges commented Jul 5, 2018

@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.

priley86 added a commit that referenced this issue Jul 12, 2018
[#369] Inactive migration plans can be scheduled to run
simaishi pushed a commit that referenced this issue Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants