Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1785547 - [UI] Importing Templates - Associate "new" is working as "always"
Summary: [UI] Importing Templates - Associate "new" is working as "always"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Templates Plugin
Version: 6.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.7.0
Assignee: Ondřej Pražák
QA Contact: Jitendra Yejare
URL:
Whiteboard:
Depends On:
Blocks: 1778146
TreeView+ depends on / blocked
 
Reported: 2019-12-20 08:08 UTC by Jitendra Yejare
Modified: 2020-07-10 12:33 UTC (History)
4 users (show)

Fixed In Version: tfm-rubygem-foreman_templates-7.0.7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-14 13:38:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 28626 0 Normal Closed [UI] Importing Templates ignores current taxonomy context 2020-10-05 07:34:59 UTC

Description Jitendra Yejare 2019-12-20 08:08:31 UTC
Description of problem:
While importing templates from UI, the templates are being assigned to the taxonomies they are being imported + the taxonomies that are mentioned in templates metadata. Here the '+' part is functioning as an associate "always".

Version-Release number of selected component (if applicable):
Satellite 6.7 snap 6

How reproducible:
always from UI

Steps to Reproduce:
1. Keep(in local dir/git) the templates to be imported in a satellite that has multiple orgs and locs in their metadata. Make sure all the taxonomies in metadata are available in the satellite.
2. Attempt to import those templates in org and loc by switching the taxonomies context in satellite. 
3. Observe the taxonomies associated with imported templates.

Actual results:
While importing templates from UI, the templates are being assigned to the taxonomies they are being imported + the taxonomies that are mentioned in templates metadata. Here the '+' part is functioning as an associate "always".

Expected results:
Only the taxonomies from where the templates are imported should be assigned to imported templates.

Additional info:

Comment 3 Ondřej Pražák 2020-01-03 09:53:14 UTC
Created redmine issue https://projects.theforeman.org/issues/28626 from this bug

Comment 4 Ondřej Pražák 2020-01-03 09:54:32 UTC
There is a problem that form ignores current context and does not send the current location/organization on form submit, cloning upstream.

Comment 5 Bryan Kearney 2020-01-29 11:01:16 UTC
Upstream bug assigned to oprazak

Comment 6 Bryan Kearney 2020-01-29 11:01:19 UTC
Upstream bug assigned to oprazak

Comment 8 Bryan Kearney 2020-03-02 17:01:22 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28626 has been resolved.

Comment 9 Jitendra Yejare 2020-03-09 15:31:00 UTC
FailedQA !

@Satellite 6.7 snap 15
@tfm-rubygem-foreman_templates-7.0.7-1.el7sat.noarch


Steps:
---------
As per Description of this bug 


Observation:
--------------
1. The taxonomies are not being updated in Template from where the templates are being imported. {FAIL}
2. The template is being imported in taxonomies mentioned in template.erb {FAIL}

Comment 10 Ondřej Pražák 2020-03-10 10:53:47 UTC
Comment 9 makes me think I misunderstood the reported issue.

1. The taxonomies are not being updated in Template from where the templates are being imported. {FAIL} - Assuming 'taxonomies from where the templates are imported' refers to current organization/location, does this mean import is expected to modify metadata in template? If so, it should be a new RFE as we currently do not modify the content of templates on import.

2. The template is being imported in taxonomies mentioned in template.erb {FAIL} - True if 'associate' setting is set to 'never'. The current behaviour is as follows:

A. importing new templates with 'associate: never' imports the templates into current organization/location regardless of taxonomies in template metadata
B. importing new templates with 'associate: new' or 'associate: always' and taxonomies in template metadata imports the templates only into organizations/locations specified in metadata. Templates are imported into current organization/location only if their names are specified in metadata.

This seems to be the originally expected behaviour as the issue reported templates being always imported into the taxonomies from metadata. Is this acceptable? If not, could you specify the expected behaviour that would resolve this issue?

Comment 11 Avi Sharvit 2020-03-11 09:20:26 UTC
Based on the last comment, can we move it to 6.8 as more information and development is needed?

Comment 12 Jitendra Yejare 2020-03-12 15:05:57 UTC
(In reply to Ondřej Pražák from comment #10)
> Comment 9 makes me think I misunderstood the reported issue.
> 
> 1. The taxonomies are not being updated in Template from where the templates
> are being imported. {FAIL} - Assuming 'taxonomies from where the templates
> are imported' refers to current organization/location, does this mean import
> is expected to modify metadata in template? If so, it should be a new RFE as
> we currently do not modify the content of templates on import.

No, it's not about updating the template metadata. But I mean the taxonomies assigned to the template after importing doesnt have current taxonomies. Lets say I import x template from org1 and loc2 then, the imported template is not imported in org1 and loc2. Its associated with the taxonomies which are only mentioned in the template(local_path/x.erb) metadata. Is this expected behavior? 

For me the expected behavior is, only associating the current taxonomies to imported template and disassociate the taxonomies mentioned in template metadata.

> 
> 2. The template is being imported in taxonomies mentioned in template.erb
> {FAIL} - True if 'associate' setting is set to 'never'. The current
> behaviour is as follows:

Here in my case and in this bug, the associate is set to 'new' and this bug is all about new.
> 
> A. importing new templates with 'associate: never' imports the templates
> into current organization/location regardless of taxonomies in template
> metadata
But does imported template should be imported in taxonomies mentioned in template metadata in this case of 'associate : never'. ?

> B. importing new templates with 'associate: new' or 'associate: always' and
> taxonomies in template metadata imports the templates only into
> organizations/locations specified in metadata. Templates are imported into
> current organization/location only if their names are specified in metadata.

So here in this bug, the 'new' template with associate 'new', is not being assigned to the current location. It is only being assigned to taxonomies mentioned in template metadata. And thats what this bug is all about :)

> 
> This seems to be the originally expected behaviour as the issue reported
> templates being always imported into the taxonomies from metadata. Is this
> acceptable? If not, could you specify the expected behavior that would
> resolve this issue?
See my comments above, Let's have a meeting if this does not answer your questions.

Comment 13 Jitendra Yejare 2020-03-13 07:32:48 UTC
After meeting with Oprazak, 

I have concluded that now 'associate: new' is working as expected: By only importing the templates into the new taxonomies(which are not associated earlier) mentioned in template metadata(metadata can be changed to include the new taxonomies) regardless of current taxonomies.

So the observations I made in Comment 9 and 10 are the actual behavior.

Hence changing the bug state to Verified!

Comment 14 Bryan Kearney 2020-04-14 13:38:52 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-2020:1454


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