Bug 1450217

Summary: The credentials for Automate Git Repository wasn't updating the correct authentications type
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: UI - OPSAssignee: mkanoor
Status: CLOSED ERRATA QA Contact: Milan Falešník <mfalesni>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.8.0CC: cpelland, dclarizi, hkataria, jhardy, mfalesni, mkanoor, mpovolny, obarenbo, simaishi
Target Milestone: GAKeywords: ZStream
Target Release: 5.7.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.7.3.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1445522 Environment:
Last Closed: 2017-06-28 15:02:38 UTC Type: ---
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: 1445522    
Bug Blocks:    

Comment 2 CFME Bot 2017-05-11 21:21:14 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/388a8199d5a2cfb1335d8fb2d0f02027470d96f8

commit 388a8199d5a2cfb1335d8fb2d0f02027470d96f8
Author:     Martin Povolny <mpovolny>
AuthorDate: Wed Apr 26 08:52:34 2017 +0200
Commit:     Satoe Imaishi <simaishi>
CommitDate: Thu May 11 17:17:51 2017 -0400

    Merge pull request #1157 from mkanoor/set_default_type_for_auth
    
    Incorrect authentication_type being used
    (cherry picked from commit 7d6d8c94029f5ac45275559713788e473280be22)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1450217

 app/services/git_repository_service.rb       | 2 +-
 spec/services/git_repository_service_spec.rb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comment 3 Milan Falešník 2017-06-12 13:00:46 UTC
Reproducer steps are unclear, I am trying to reproduce the erroneous behaviour on 5.7.2.1 and from the description of the bug I cannot figure out what should I look for since when I import a github repo without credentials via rake and then I try to do the same repo in the UI but I specify bad credentials, it just simply works.

Comment 4 mkanoor 2017-06-14 16:15:26 UTC
This requires creating the credential from 2 different sources
(1) rake command
(2) UI

The UI wasn't setting the same authtype as the rake command.

If you check the credential count you should see only one for the GitRepository.
Without this fix in you would have seen 2.

From a rails console, if you have a single GitRepository you can run this command

GitRepository.first.authentications.collect(&:authtype)

Without the fix the result would be ["default", "values"]

With the fix it should be just ["default"]

In an existing environment where you have run this previously we won't delete the "values" authentication type, it would sit around we won't use it.

Comment 5 Milan Falešník 2017-06-16 09:29:03 UTC
I can see only the ["default"] in 5.7.3.1 when using both rake and UI import.

Comment 7 errata-xmlrpc 2017-06-28 15:02:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2017:1601