Bug 760703

Summary: API allows promotion of empty products, breaks repo addition in UI
Product: Red Hat Satellite Reporter: Jeff Weiss <jweiss>
Component: InfrastructureAssignee: Lukas Zapletal <lzap>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: bkearney, dajohnso, sghai
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-22 18:11:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 747354    

Description Jeff Weiss 2011-12-06 19:55:43 UTC
Description of problem:


Version-Release number of selected component (if applicable):
katello-0.1.125-1.git.3.cee0c63.el6.x86_64

How reproducible:


Steps to Reproduce:
1.  Create a custom provider and product using API or CLI
2.  Promote the empty product with API or CLI
3.  
  
Actual results:
In the UI, the product does not allow adding more repos (expanding the product does nothing, no "Add Repository" button).
The product does not show up in the next environment on the Promotions page, but on the Templates page, you can still add the product (as if it's been promoted)

Expected results:
The API should throw an error that products with no repos cannot be promoted.

Additional info:

Comment 1 Lukas Zapletal 2011-12-07 14:08:22 UTC
Right now it promotes.

kk changeset promote --name empty --environment testing
Changeset [ empty ] promoted 

Taking.

Comment 2 Lukas Zapletal 2011-12-15 13:21:32 UTC
765888 - Error during promotion

Comment 3 Sachin Ghai 2011-12-28 11:34:16 UTC
I verified this on latest katello build:

katello-glue-pulp-0.1.155-1.el6.noarch
katello-configure-0.1.48-1.el6.noarch
katello-trusted-ssl-cert-1.0-1.noarch
katello-cli-common-0.1.31-1.el6.noarch
katello-glue-foreman-0.1.155-1.el6.noarch
katello-common-0.1.155-1.el6.noarch
katello-httpd-ssl-key-pair-1.0-1.noarch
katello-0.1.155-1.el6.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
katello-repos-0.1.4-1.el6.noarch
katello-cli-0.1.31-1.el6.noarch
katello-glue-candlepin-0.1.155-1.el6.noarch
katello-all-0.1.155-1.el6.noarch
katello-certs-tools-1.0.1-1.el6.noarch


I can still promote a empty product ( product with no repos )

I created a provider 'rhel' and created a product 'myproduct' and promoted it to 'test' env and it was promoted successfully. However a proper error should be raised "Product with no repo can not be promoted"

----

katello> product create --name myproduct --org ACME_Corporation --provider rhel
Successfully created product [ myproduct ]

katello> changeset create --org ACME_Corporation --environment test --name empty
Successfully created changeset [ empty ] for environment [ test ]

katello> changeset update --org ACME_Corporation --environment test --name empty --add_product myproduct
Successfully updated changeset [ empty ]


katello> changeset promote --name empty --environment test --org ACME_Corporation
Changeset [ empty ] promoted

---

Comment 4 Lukas Zapletal 2012-01-20 15:49:52 UTC
How about:

[lzap@lzapx src]$ kk changeset update --name empty --environment env --add_product empty_product
Product 'empty_product' hasn't any repositories

It is not possible to add empty product now.

4a7649b 760703 - promotion of empty products now not possible

Comment 5 Sachin Ghai 2012-01-24 08:10:54 UTC
Verified with following katello build:

katello-0.1.192-1.el6.noarch

Now while updating a changeset with empty product will raise a message as below:
Product 'myproduct' hasn't any repositories

-----
katello> provider create --name rhel --org ACME_Corporation
Successfully created provider [ rhel ]

katello> product create --name myproduct --org ACME_Corporation --provider rhel
Successfully created product [ myproduct ]


katello> changeset create --org ACME_Corporation --environment test --name empty
Successfully created changeset [ empty ] for environment [ test ]


katello> changeset update --org ACME_Corporation --environment test --name empty --add_product myproduct
Product 'myproduct' hasn't any repositories

----