Bug 1388942

Summary: Rake Automate import from a Git Repository uses case sensitive branch and tag names
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, gmccullo, jhardy, mfalesni, mkanoor, obarenbo, tfitzger
Target Milestone: GAKeywords: TestOnly
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: automate
Fixed In Version: 5.8.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1393037 (view as bug list) Environment:
Last Closed: 2017-06-12 16:45:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1393037    

Description mkanoor 2016-10-26 14:00:42 UTC
Description of problem:
When running a rake automate model import command the branch or tag is case sensitive. This would make it harder for a user to enter the branch or tag name.

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


How reproducible:
100%

Steps to Reproduce:
1. bin/rake evm:automate:import PREVIEW=false GIT_URL=https://github.com/mkanoor/SimpleDomain REF=test2branch
2.
3.

Actual results:
** Using session_store: ActionDispatch::Session::MemCacheStore
Importing automate domain from url https://github.com/mkanoor/SimpleDomain
/Users/madhukanoor/devsrc/manageiq/lib/git_worktree.rb:41:in `branch='
/Users/madhukanoor/devsrc/manageiq/lib/miq_automation_engine/models/miq_ae_yaml_import_gitfs.rb:13:in `load_repo'
/Users/madhukanoor/devsrc/manageiq/lib/miq_automation_engine/models/miq_ae_yaml_import_gitfs.rb:5:in `initialize'
/Users/madhukanoor/devsrc/manageiq/lib/miq_automation_engine/models/miq_ae_git_import.rb:16:in `new'
/Users/madhukanoor/devsrc/manageiq/lib/miq_automation_engine/models/miq_ae_git_import.rb:16:in `import'
/Users/madhukanoor/devsrc/manageiq/lib/tasks/evm_automate.rake:170:in `block (3 levels) in <top (required)>'


Expected results:
branch should get set properly irrespective of the case

Additional info:

Comment 2 CFME Bot 2016-11-07 19:56:19 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/e2bc3b66c8967cb3fe853269ef7442837f0f9af6

commit e2bc3b66c8967cb3fe853269ef7442837f0f9af6
Author:     Greg McCullough <gmccullo>
AuthorDate: Thu Nov 3 08:54:37 2016 -0400
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Mon Nov 7 14:50:48 2016 -0500

    Merge pull request #12115 from mkanoor/case_insensitive_branch
    
    Support for case insensitive tag and branch name when importing from Git
    (cherry picked from commit ea95a6bd20f4e75b340b614a92c7dc14e806a290)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1388942

 .../models/miq_ae_git_import.rb                    |   3 +
 .../models/miq_ae_git_import_spec.rb               | 143 +++++++++++++++------
 2 files changed, 104 insertions(+), 42 deletions(-)

Comment 4 Milan Falešník 2017-03-01 10:37:33 UTC
Verified in 5.8.0.2, import works fine and without regard to the case.