This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
[#437] Resolve all Retry Migration issues #468
Merged
priley86
merged 10 commits into
ManageIQ:master
from
AparnaKarve:show_progress_in_migration_card
Jul 9, 2018
+193
−126
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8600e7b
Use `mostRecentRequest` to get the task details
AparnaKarve a2ef240
request and task math to get previous task records
AparnaKarve 822de91
create a helper for reusing utils like groupBy and flatten array
AparnaKarve dc3ea31
API now uses a new url to get tasks for all requests of a given plan
AparnaKarve 9cffc1f
fix tests
AparnaKarve e00904f
Extract Task/Request logic in a helper (for reuse)
AparnaKarve f689f89
Use the helper to get most recent VM tasks for Plan
AparnaKarve a45a951
Use the helper in PlanReducer to get most recent VM tasks for Plan
AparnaKarve 8228673
PR feedback - rename `flattenArray` to `flatten`
AparnaKarve e6f6846
Adjustments w.r.t the new structure of the `vm_id` array retrieval
AparnaKarve File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...ct/screens/App/Overview/components/Migrations/helpers/getMostRecentVMTasksFromRequests.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import commonUtilitiesHelper from '../../../../common/commonUtilitiesHelper'; | ||
|
||
const getMostRecentVMTasksFromRequests = (requests, actions) => { | ||
const vm_ids = actions.map(a => a.vm_id); | ||
|
||
const allTasks = requests.map(request => request.miq_request_tasks); | ||
|
||
const flattenAllTasks = []; | ||
commonUtilitiesHelper.flatten(allTasks, flattenAllTasks); | ||
|
||
const groupedByVMId = commonUtilitiesHelper.groupBy(flattenAllTasks, 'source_id'); | ||
|
||
const vmTasksForRequestOfPlan = []; | ||
vmTasksForRequestOfPlan.push( | ||
vm_ids.map(vmId => commonUtilitiesHelper.getMostRecentEntityByCreationDate(groupedByVMId[vmId])) | ||
); | ||
|
||
const flattenVMTasksForRequestOfPlan = []; | ||
commonUtilitiesHelper.flatten(vmTasksForRequestOfPlan, flattenVMTasksForRequestOfPlan); | ||
|
||
return flattenVMTasksForRequestOfPlan; | ||
}; | ||
|
||
export default getMostRecentVMTasksFromRequests; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we still haven't extracted these task statuses to constants... since the number of places these are used is increasing, and we have pre/post playbook support upcoming, i think it would be nice to move those to constants in a future PR