Bug 1666887 - Tags that are changed disappear from the UI but are still present in rails
Summary: Tags that are changed disappear from the UI but are still present in rails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.9.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.11.0
Assignee: Yuri Rudman
QA Contact: Angelina Vasileva
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks: 1668730 1669269
TreeView+ depends on / blocked
 
Reported: 2019-01-16 21:01 UTC by David Luong
Modified: 2022-03-13 16:46 UTC (History)
8 users (show)

Fixed In Version: 5.11.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1668730 1669269 (view as bug list)
Environment:
Last Closed: 2019-12-13 15:09:26 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3812911 0 None None None 2019-01-16 21:13:05 UTC

Description David Luong 2019-01-16 21:01:26 UTC
Description of problem:
Tags that are changed disappear from objects that are tagged with it in the UI, but not the rails console

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

How reproducible:
Always

Steps to Reproduce:
1.  Tag object, check rails and UI
=> #<ActiveRecord::Associations::CollectionProxy [#<Tag id: 147, name: "/managed/location/test">]>
2.  Change tag
(Changed tag to test1)
3.  Check UI and rails
Disappears from UI, shows up in console as old tag:
=> #<ActiveRecord::Associations::CollectionProxy [#<Tag id: 147, name: "/managed/location/test">]>

Actual results:
According to the UI, it is untagged, but rails still show it is tagged
irb(main):003:0> Vm.find_by(:name=>"VM_NAME").ext_management_system.tags(:location)

Expected results:
The changed tag is actually updated for the object(s) in both the UI and rails, instead of being untagged/old tag is kept

Additional info:

Comment 2 Gregg Tanzillo 2019-01-16 22:17:15 UTC
Question - on step 2, above "Change tag" where is that to be done? in the UI or console? Please elaborate on this. Thanks

Comment 3 David Luong 2019-01-16 22:19:49 UTC
Hey Greg, the change tag happens through the UI through Configuration > Settings >  Region > Tag > My Company Tags, then edit the tag by clicking on the name of it and save

Comment 4 dmetzger 2019-01-17 14:36:47 UTC
Please verify if this behavior exists on 5.10

Comment 5 Yuri Rudman 2019-01-17 16:49:41 UTC
yes, the same exists on master

Comment 6 Yuri Rudman 2019-01-23 15:58:00 UTC
PR: https://github.com/ManageIQ/manageiq/pull/18378

Comment 9 Keenan Brock 2019-01-30 21:43:35 UTC
first PR had some issues, we're trying it again:

https://github.com/ManageIQ/manageiq/pull/18409

Comment 11 CFME Bot 2019-02-13 04:21:41 UTC
New commit detected on ManageIQ/manageiq/hammer:

https://github.com/ManageIQ/manageiq/commit/48c25883df8719d728bda268205fb68ea714b0f6
commit 48c25883df8719d728bda268205fb68ea714b0f6
Author:     Keenan Brock <keenan>
AuthorDate: Tue Jan 29 12:44:14 2019 -0500
Commit:     Keenan Brock <keenan>
CommitDate: Tue Jan 29 12:44:14 2019 -0500

    Update classification

    https://bugzilla.redhat.com/show_bug.cgi?id=1666887

    changing a classification name caused a new tag record to get
    created in the database

    existing objects tied to the tag were left with an orphan tag that
    had no corresponding classification.

    It now changes the value for the tag and objects keep their tagging

 app/models/classification.rb | 7 +-
 spec/models/classification_spec.rb | 26 +
 2 files changed, 32 insertions(+), 1 deletion(-)

Comment 12 CFME Bot 2019-02-13 08:27:27 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/90051e44ad64fc865fed14c49aa6f7c8ff98fc07
commit 90051e44ad64fc865fed14c49aa6f7c8ff98fc07
Author:     Keenan Brock <keenan>
AuthorDate: Tue Jan 29 12:44:14 2019 -0500
Commit:     Keenan Brock <keenan>
CommitDate: Tue Jan 29 12:44:14 2019 -0500

    Update classification

    https://bugzilla.redhat.com/show_bug.cgi?id=1666887

    changing a classification name caused a new tag record to get
    created in the database

    existing objects tied to the tag were left with an orphan tag that
    had no corresponding classification.

    It now changes the value for the tag and objects keep their tagging

 app/models/classification.rb | 6 +-
 spec/models/classification_spec.rb | 26 +
 2 files changed, 31 insertions(+), 1 deletion(-)

Comment 13 CFME Bot 2019-02-15 03:42:13 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/6b83dfb0f075bcc1ece6b36804d982c3459bf359
commit 6b83dfb0f075bcc1ece6b36804d982c3459bf359
Author:     Yuri Rudman <yrudman>
AuthorDate: Mon Jan 21 16:22:39 2019 -0500
Commit:     Yuri Rudman <yrudman>
CommitDate: Mon Jan 21 16:22:39 2019 -0500

    Do not create new record in Tag table when editing existing tag
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1666887

 app/models/classification.rb | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comment 14 Angelina Vasileva 2019-05-06 11:00:22 UTC
Fixed and verified in 5.11.0.2.20190430174828_0e34dea


Note You need to log in before you can comment on or make changes to this bug.