Bug 1645174 - Reimporting the existing CV version should have more refined validation message
Summary: Reimporting the existing CV version should have more refined validation message
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Inter Satellite Sync
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
low vote
Target Milestone: Released
Assignee: Chris Roberts
QA Contact: Jitendra Yejare
URL: https://projects.theforeman.org/issue...
Whiteboard:
Depends On:
Blocks: 1644596
TreeView+ depends on / blocked
 
Reported: 2018-11-01 14:24 UTC by Jitendra Yejare
Modified: 2019-10-07 17:19 UTC (History)
5 users (show)

Fixed In Version: tfm-rubygem-katello-3.10.0,tfm-rubygem-hammer_cli_katello-0.16.0.6-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:38:32 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github Katello hammer-cli-katello pull 625 None None None 2019-01-28 15:38:50 UTC
Github Katello katello pull 7806 None None None 2018-11-02 16:08:19 UTC
Foreman Issue Tracker 25406 None None None 2018-11-07 14:37:16 UTC
Foreman Issue Tracker 25932 None None None 2019-01-28 15:38:07 UTC
Red Hat Product Errata RHSA-2019:1222 None None None 2019-05-14 12:38:43 UTC

Description Jitendra Yejare 2018-11-01 14:24:16 UTC
Description of problem:
Currently, If one tries to reimport the CV version with the same minor and major version, Satellite throws validation message as :
"Validation failed: Minor , must be unique to major and version id version."

which I feel needs improvement.

Version-Release number of selected component (if applicable):
Satellite 6.5 snap 1

How reproducible:
Always

Steps to Reproduce:
1. Export the CV version (lets say 1.0 major 1 and minor 0)
2. Import the exported CV version in another org/satellite ( in our case confirm the imported CV version is 1.0 major 1 and minor 0) 
3. After successful import, try to reimport the exported CV version (in our case 1.0 major 1 minor 0)

Actual results:
The reimport throws a validation as:
"Validation failed: Minor , must be unique to major and version id version."

Expected results:
More refined validation message something like;
"CV Version with same major and minor version already exists"


Additional info:

Comment 2 pm-sat@redhat.com 2018-11-02 18:08:39 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24569 has been resolved.

Comment 3 Chris Roberts 2018-11-06 18:12:04 UTC
need to make a new upstream issue for this

Comment 5 Jitendra Yejare 2018-12-17 15:51:46 UTC
The validation message is fixed, but still, satellite tries to resync the repositories(recreation of symlinks I believe) and while publishing it throws a message.

It would be great if we throw this message to user, even before resyncing(recreating symlink) and by first checking what version it is going to import and match with the existing one. This will save the users time.

Logs may help here, what I wanted to say :

```
# hammer content-view version import --organization-id 19 --export-tar /var/lib/pulp/katello-export/export-30.tar
[................................................................................................] [100%]
No new packages.
Could not import the content view.:
  A CV version already exists with the same major and minor version (1.0)

```

If you see above, first it resynced and then throw the message. It would be good if we throw the message first and abort resyncing.

Comment 6 Jitendra Yejare 2018-12-17 15:52:14 UTC
NeedInfo comment 5.

Comment 7 Chris Roberts 2019-01-16 16:02:51 UTC
After talking to beav about this and i will make a pr to move the check first so we dont try to resync

I will use the same redmine issue and just create a 'Refs' PR

Comment 8 Bryan Kearney 2019-01-16 17:08:40 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25406 has been resolved.

Comment 9 Jitendra Yejare 2019-01-21 10:19:09 UTC
@Toledo,

Even after the fix, the behavior from hammer looks same:

# hammer -u admin -p changeme content-view version import --export-tar /var/lib/pulp/katello-export/export-cvexpo_cv-401.tar --organization-id 304
[................................................................................................] [100%]
No new packages.
Could not import the content view.:
  A CV version already exists with the same major and minor version (1.0)


So if have fixed resyncing of repo, Can we have somehow remove the progress bar.

Comment 10 Jitendra Yejare 2019-01-24 16:18:47 UTC
As per discussion with DEV on irc ... moving this back to the assigned state.

Comment 13 Jitendra Yejare 2019-02-04 08:51:58 UTC
Verified!

As per Comment 5 and comment 9, I verified the said part in a comment. The first part is already verified in comment 5.

Steps:
Same as per bug description


Behavior(Expected):

The validation message is only shown and the re-sync is avoided:

# hammer content-view version import --export-tar /var/lib/pulp/katello-export/export-custom_cv-10.tar --organization-id 3
Could not import the content view:
  Error: The latest version (1.0) of the Content View 'custom_cv' is greater or equal to the version you are trying to import (1.0)

Comment 16 errata-xmlrpc 2019-05-14 12:38:32 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-2019:1222


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