Bug 1392981

Summary: Deleting a Git Domain doesn't delete the git repository on the appliance
Product: Red Hat CloudForms Management Engine Reporter: mkanoor
Component: AutomateAssignee: mkanoor
Status: CLOSED CURRENTRELEASE QA Contact: Milan Falešník <mfalesni>
Severity: high Docs Contact:
Priority: high    
Version: 5.7.0CC: cpelland, jhardy, mfalesni, mkanoor, obarenbo, tfitzger
Target Milestone: GAKeywords: TestOnly
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: automate:git
Fixed In Version: 5.8.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1396179 (view as bug list) Environment:
Last Closed: 2017-06-12 17:02:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1396179    

Description mkanoor 2016-11-08 15:30:41 UTC
Description of problem:
The repository contents of a Git domain are stored in the appliance with a Git owner role. When the domain is deleted the repository on the Git owner appliance should get deleted.

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


How reproducible:
every time

Steps to Reproduce:
1. Import a Git domain
2. Delete the domain
3. Check the <vmdb>/data/git_repos/... directory for the bare Git repo, it should get deleted.

When there are multiple appliances, the delete of the directory has to run on the correct appliance.

Actual results:
The bare git repo is left on the appliance

Expected results:
The bare git repo should get deleted

Additional info:

Comment 3 mkanoor 2016-11-09 22:35:13 UTC
There are 2 PR's for this I am waiting for https://github.com/ManageIQ/manageiq/pull/12539 to get merged

Comment 4 CFME Bot 2016-11-11 18:41:02 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/a16cdd69892b99c2e84c95b5d53df9e5c3f12dee

commit a16cdd69892b99c2e84c95b5d53df9e5c3f12dee
Author:     Greg McCullough <gmccullo>
AuthorDate: Tue Nov 8 15:42:47 2016 -0500
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Fri Nov 11 13:39:29 2016 -0500

    Merge pull request #12192 from mkanoor/delete_repo_dir
    
    Delete the repo directory on destroy
    (cherry picked from commit 3e56320c2c5230c36aceefac6ee2b5bc5c9e25ac)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1392981

 app/models/git_repository.rb       |  5 +++++
 spec/models/git_repository_spec.rb | 25 +++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

Comment 5 CFME Bot 2016-11-16 19:16:28 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/3a00b93c1f71e1dd043cb44349abf3c4e673ba5e

commit 3a00b93c1f71e1dd043cb44349abf3c4e673ba5e
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Wed Nov 9 14:49:46 2016 -0500
Commit:     Madhu Kanoor <mkanoor>
CommitDate: Wed Nov 9 14:49:46 2016 -0500

    Delete the repo directory for Git based domains
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1392981

 app/controllers/miq_ae_class_controller.rb         |  3 ++
 app/services/git_based_domain_import_service.rb    | 26 +++++++++++++++
 spec/controllers/miq_ae_class_controller_spec.rb   |  6 +++-
 .../git_based_domain_import_service_spec.rb        | 39 +++++++++++++++++++---
 4 files changed, 68 insertions(+), 6 deletions(-)

Comment 6 CFME Bot 2016-11-16 19:26:20 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/cc0a2a919695c4e8b3105431e0cb848675ee97e6

commit cc0a2a919695c4e8b3105431e0cb848675ee97e6
Author:     Greg McCullough <gmccullo>
AuthorDate: Wed Nov 16 14:14:09 2016 -0500
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Wed Nov 16 14:23:48 2016 -0500

    Merge pull request #12539 from mkanoor/bugzilla_1392981
    
    Delete the repo directory for Git based domains
    (cherry picked from commit 03f24a1c1adcf79a53029e2de1c8cf1707427104)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1392981

 app/controllers/miq_ae_class_controller.rb         | 28 ++++++++++-
 app/services/git_based_domain_import_service.rb    | 25 ++++++++++
 lib/miq_automation_engine/models/miq_ae_domain.rb  |  2 +-
 .../models/miq_ae_yaml_import.rb                   |  3 +-
 spec/controllers/miq_ae_class_controller_spec.rb   | 23 ++++++---
 .../git_based_domain_import_service_spec.rb        | 54 +++++++++++++++++++---
 6 files changed, 118 insertions(+), 17 deletions(-)

Comment 8 Milan Falešník 2017-03-01 10:46:40 UTC
Verified in 5.8.0.2, the repository is deleted (only an empty folder with github user name remains).