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

[#369] Inactive migration plans can be scheduled to run #401

Merged

Conversation

AllenBW
Copy link
Member

@AllenBW AllenBW commented Jun 8, 2018

@AllenBW AllenBW force-pushed the enhancement/#369-schedule-migration branch 6 times, most recently from 55dc8a2 to d39f843 Compare June 13, 2018 18:01
@AllenBW
Copy link
Member Author

AllenBW commented Jun 13, 2018

@vconzola any chance yah have the rest of the mockups for this available? (as mentioned here)

Other things we're waiting on

🌮 💃

EDIT - yeah, sorry, asking now cuz this has kinda reached the point of highest heights without ☝️

Another Edit - we just gotta get bdunne's pr in then this will be g2g

@AllenBW AllenBW force-pushed the enhancement/#369-schedule-migration branch 7 times, most recently from 2a6a83b to 54f6bce Compare June 15, 2018 20:06
<strong>{plan.name}</strong>
{__(' targted to run on ')}
{moment(plan.schedule_time).format('MMMM Do YYYY, h:mm a')}
{__('?')}
Copy link
Contributor

Choose a reason for hiding this comment

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

I am aware the PR is still WIP, but here's the thing that we discussed in the i18n context about complete sentences.

The sentence should ideally look like this -
"Are you sure you want to unschedule plan %s targeted to run on %s?"

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah! thanks for the 👁 🙇 ❤️

@AllenBW AllenBW force-pushed the enhancement/#369-schedule-migration branch 5 times, most recently from 1f439db to 0afbd49 Compare June 19, 2018 17:41
'Are you sure you want to unschedule plan %s targted to run on %s ?'
),
plan.name,
moment(plan.schedule_time).format('MMMM Do YYYY, h:mm a')
Copy link
Member

Choose a reason for hiding this comment

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

can this one use our formatDateTime helper? 🍬

Copy link
Member Author

Choose a reason for hiding this comment

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

this one yeah! that sounds like a gooooood call

{__(`Migration scheduled`)}
<br />
{moment(plan.schedule_time).format(
'MMMM Do YYYY, h:mm a'
Copy link
Member

Choose a reason for hiding this comment

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

same deal w/ the helper

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah!

@AllenBW AllenBW force-pushed the enhancement/#369-schedule-migration branch from 0afbd49 to 8a47d69 Compare June 20, 2018 12:25
@AllenBW
Copy link
Member Author

AllenBW commented Jun 20, 2018

Just in case an inquiring mind was wondering... ux is done.... our path to completion is presently
👇 this pr has to be merged:
ManageIQ/manageiq#17594
so 👉 this pr can be merged: ManageIQ/manageiq-api#400

then whatever cleanup befalls after the fact...

profit 🌮 🥇

@AllenBW AllenBW changed the title [WIP] Inactive migration plans can be scheduled to run [WIP] #369 -Inactive migration plans can be scheduled to run Jun 21, 2018
@priley86
Copy link
Member

If it's not much additional work, fine w/ me ;)

otherwise, lgtm

@AllenBW
Copy link
Member Author

AllenBW commented Jul 11, 2018

Yah, it'll be some work, can do it later if desired by QE 👍

@AparnaKarve
Copy link
Contributor

AparnaKarve commented Jul 11, 2018

@AllenBW The "Validation failed: Name has already been taken" issue described here #401 (comment) still persists. Is that expected?

EDIT:
Sorry, (ignore the above) -- not getting the above error now. My local manageiq-api repo was not rebased.

@AparnaKarve
Copy link
Contributor

AparnaKarve commented Jul 12, 2018

@AllenBW This looks really great... the delay however...

The delay is noticeable and big enough to get us in this situation -
An enabled Schedule button when the Plan is already scheduled.

screen shot 2018-07-11 at 4 39 03 pm

Clicking on the button causes the 500 error Validation failed: Name has already been taken"

Would it be possible to gray out the Schedule and the Unschedule button in the listview until the Plan is actually scheduled/unscheduled?
Also delay the notification until the Plan is actually Scheduled/Unscheduled

@AllenBW
Copy link
Member Author

AllenBW commented Jul 12, 2018

@AparnaKarve the notification is thrown as soon as the callback is resolved, as in when the plan is actually Scheduled/unscheduled. The delay is because we poll the page... If the behavior blocks the merging of this pr, I can work on this nowish 🤷‍♀️

In the defense of leaving it as is for the moment, seems that scheduling while a schedule is already in place, doesn't disrupt the existing schedule, just throws the, "hey there's already something scheduled error" at which point the schedule can be removed and readded 🤔

@AllenBW
Copy link
Member Author

AllenBW commented Jul 12, 2018

So a few changes come to mind.... we can... (in order of effort, least to most to absolute least)

  1. increase the polling frequency here (this is only polling transformation plans, might make the whole migration process feel a little better)
  2. swap the "schedule migration" button visibility to an internally managed variable rather than the presence or absence of the a schedule run_time (but this will still appear laggy, meaning the schedule time won't show up till polling happens)
  3. pass fetchTransformationPlansAction all the way down into the modal, and throw that on click (but again, this might resolve before the schedule is completed, so not a guaranteed fix)
  4. somehow call fetchTransformationPlansAction from the scheduleMigration(action) callback? feels really wrong to be calling an action from an action though... unsure if this is kosher 🤔
  5. give up and eat 🥑 🍿 by the 🌆 while wearing 🕴

@michaelkro
Copy link
Contributor

michaelkro commented Jul 12, 2018

  1. somehow call fetchTransformationPlansAction from the scheduleMigration(action) callback? feels really wrong to be calling an action from an action though... unsure if this is kosher 🤔

I believe this is indeed kosher :) One of the great things about redux-thunk is that it gives us total control over the dispatch process, and one of the things it allows us to do is dispatch multiple actions from a single action creator (documentation)

edit 1: In the documentation, scroll down to function makeASandwichWithSecretSauce
edit 2: Here is an example of where we dispatch multiple actions in V2V

So, if you decided to go down this road, I will not complain :)

@priley86
Copy link
Member

priley86 commented Jul 12, 2018

yes - of the options you list, it seems like 3 or 4 (calling fetchTransformationPlansAction again explicitly) should work. You can import actions (and reuse them) from within a nested view like this.

I should add that I don't think option 1 is really an option - b/c I have heard previously that the backend automate code is only refreshing every 15 seconds, currently...so polling more frequently on the frontend seems like a bad route.

@AllenBW
Copy link
Member Author

AllenBW commented Jul 12, 2018

@michaelkro Thanks for the input! I've been chewing on what ya posted, still very unclear on how this approach might be successfully wired up. If you have some spare cycles would appreciate a pair on this :-/

@bdunne
Copy link
Member

bdunne commented Jul 12, 2018

@AllenBW @AparnaKarve This should fix the "Name has already been taken" validation error. ManageIQ/manageiq#17696

@AllenBW AllenBW force-pushed the enhancement/#369-schedule-migration branch from eb1d285 to 624c379 Compare July 12, 2018 14:22
@AllenBW
Copy link
Member Author

AllenBW commented Jul 12, 2018

@AparnaKarve, @michaelkro put up with me for 30 minutes and we have da solution, MORE DUPLICATE CODE EVERYWHERE aka, when you schedule or unschedule we refetch plans 😋 👍

i picked option 5, he picked option 3

@AllenBW
Copy link
Member Author

AllenBW commented Jul 12, 2018

@priley86 but @AparnaKarve is out today/tomorrow, can you confirm the desired behavior/merge? 🙇‍♀️

@priley86
Copy link
Member

@AllenBW sure thing... will test it out now.

@priley86
Copy link
Member

yes - calling fetchTransformationPlansAction after scheduleMigration seems to have the desired effect... approving/merging to get this out for QE.

I am going to follow up w/ some schema validation checks later on... (always just a bonus).

@priley86 priley86 merged commit 18a306f into ManageIQ:master Jul 12, 2018
@AllenBW AllenBW deleted the enhancement/#369-schedule-migration branch July 12, 2018 14:48
@AparnaKarve
Copy link
Contributor

@simaishi We will need this backported first before #491.
Thanks.

@simaishi
Copy link
Contributor

and it looks like ManageIQ/manageiq-api#400 needs to be backported before this PR... btw, it will really help if all dependencies are listed in the top description, as I could easily miss if it's in comment somewhere.

simaishi pushed a commit that referenced this pull request Jul 31, 2018
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit 4032ca240376bd32d0673ce248459fc52e906f75
Author: Patrick Riley <priley86@gmail.com>
Date:   Thu Jul 12 10:44:34 2018 -0400

    Merge pull request #401 from AllenBW/enhancement/#369-schedule-migration
    
    [#369] Inactive migration plans can be scheduled to run
    (cherry picked from commit 18a306ff7a4767ca80d8a72b649e545a8afec683)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1608351

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User can schedule a migration plan
8 participants