Bug 1497570

Summary: Unexpected behavior when importing datastore with 2 domains from Git
Product: Red Hat CloudForms Management Engine Reporter: Ryan Spagnola <rspagnol>
Component: AutomateAssignee: Patrik Kománek <pkomanek>
Status: CLOSED CURRENTRELEASE QA Contact: Dmitry Misharov <dmisharo>
Severity: high Docs Contact:
Priority: medium    
Version: 5.8.0CC: ccoupel, dmisharo, gmccullo, jhardy, mkanoor, obarenbo, rspagnol, smallamp, tfitzger
Target Milestone: GAKeywords: TestOnly
Target Release: 5.10.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 5.10.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1539124 (view as bug list) Environment:
Last Closed: 2018-06-21 20:30:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1539124    

Description Ryan Spagnola 2017-10-01 23:04:44 UTC
Description of problem:
When importing a datastore with 2 domains from Git one of the domains is marked as Git repo domain, the other is imported as regular domain in disabled state but not locked.

Version-Release number of selected component (if applicable):
5.8.1.5

How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
https://github.com/ManageIQ/manageiq-automation_engine/issues/45

Comment 2 Greg McCullough 2017-10-02 13:22:39 UTC
Madhu - Please review and reassign if needed.  Is this something Patrik can work on?

Comment 3 mkanoor 2017-10-04 14:19:01 UTC
When we import from a Git Repo we should check if there is a single __domain__.yaml file. The current approach allows us to import all domains in the repository and it dependent on the users creating one Automate Domain per GIT Repository. We should enforce this in the importer and reject repositories that have multiple domains.

During the pre_import step we should check the number of domains in the repository if more than one we can reject it here

https://github.com/ManageIQ/manageiq-automation_engine/blob/7d0268ff22fc9be260d4a07677bc941ac2776e14/app/models/miq_ae_git_import.rb#L25

Comment 4 Greg McCullough 2017-10-05 15:27:46 UTC
Ryan - The work-around for this is to only create git repos with a single domain.  The suggest code fix will be enforcing this requirement.

Comment 6 Cyril Coupel 2017-12-12 14:05:59 UTC
Hi, i need to give my intention on this behaviour.
My customer manage its appliance with more than 3 domains in a single GIT repo.
It will be usefull if, as for file import, we can choose which domain we want to use instead of rejecting all unless we will not import all the domains. This way, we have a coherent working maner on importing from file and importing from GIT.

Comment 7 mkanoor 2017-12-12 14:51:37 UTC
We have been trying to follow the One Domain One Repository rule. It keeps it simpler. If you have multiple domains in a single repo there is lot of book keeping that would have to be done.
Domain A -> Branch X or Tag X
Domain B -> Branch Y or Tag Y

The multiple file export/import was meant for Backup/Restore it was not meant for importing/exporting multiple domains.

Comment 8 mkanoor 2017-12-12 14:51:43 UTC
We have been trying to follow the One Domain One Repository rule. It keeps it simpler. If you have multiple domains in a single repo there is lot of book keeping that would have to be done.
Domain A -> Branch X or Tag X
Domain B -> Branch Y or Tag Y

The multiple file export/import was meant for Backup/Restore it was not meant for importing/exporting multiple domains.

Comment 9 Patrik Kománek 2018-01-17 13:33:36 UTC
It is no more allowed to import multiple domains from a single git repository.

PR: https://github.com/ManageIQ/manageiq-automation_engine/pull/124