[katello-devel] Modelling of environments, products, etc in Katello (related to renaming of environments)

Dmitri Dolguikh dmitri at redhat.com
Thu Aug 9 12:39:56 UTC 2012


On 09/08/12 01:20 PM, James Bowes wrote:
> On Thu, Aug 09, 2012 at 12:34:57PM +0100, Dmitri Dolguikh wrote:
>> Please see https://bugzilla.redhat.com/show_bug.cgi?id=795928 for
>> description of an issue with environment renaming.
>>
>> The immediate problems around environments: using of environment
>> names and environment ids for identification of environments
>> interchangeably. Using db ids for environment identification when
>> not using environment names.
>>
>> To resolve these:
>>   - introduce environment uuids
>>   - update katello/katello cli to use uuids for environment identification
>>   - update repository naming to use environment uuids
>>   - update candlepin (this will include updates to schema, and
>> resource controller)
>>
> -1 to UUIDs, for the same reason as has been discussed wrt pulp
> repo labels. a url like:
>
> https://my-cdn.local/content/dev/rhel-server/i386/
>
> is way more useful than:
>
> https://my-cdn.local/content/abc123213-23423423-aaa123/rhel-server/i386/
>
> not to mention, far more handsome!
>
> I'd rather see either immutable labels, or supporting renaming labels,
> too.
The issue boils down to renaming of environments. If we are to use 
environment names for environment identification, we have to provide 
resolution for urls that are no longer valid (via 301). Doable, but 
additional work.

The idea of labels is interesting, but I don't think it would work out 
in the long-term: it would become stale after a rename or two

With uuid's we won't need to support url redirection, they won't go 
stale. For user-friendliness we should provide querying by name with 
environment resource, smt. like:

GET 
http://localhost/katello/api/organizations/ACME_Corporation/environments?name=super-duper

Less convenient, but easier to implement and maintain (from both user 
and developer perspective).

-d

>
> To clarify, UUIDs are fine imo as an internal canonical id for envs
> within katello as a whole, but once the env is exposed on the cli or in
> a url, label should be used.
>
>> The larger problem: Katello and Candlepin modelling of
>> products/product content/environments lost coherency.
>>
>> Candlepin's view of the above trifecta (use of a monospaced font is
>> encouraged for the content below):
>> +-------------+          +--------------------+
>> | Environment | 1 <--- * | EnvironmentContent |
>> +-------------+          +--------------------+
>>                                  ^
>>                                  | *
>>                                  | 1
>> +---------+          +----------------+
>>      | Product | 1 ---> * | ProductContent |
>>      +---------+          +----------------+
>>
>>
>> same thing in Katello (with added pulp repositories):
>>
>>     +-------------+
>>     | Pulp::Repos |<-----------------------+
>>     +-------------+                        |
>>         ^                                  |
>>         | uses                             |
>>      +----------------------------------+  |  +-------------+
>>      | Candlepin::Product               |  |  | Environment |
>>      | (uses Candlepin::ProductContent) |  |  +-------------+
>>      +----------------------------------+  |          ^
>>         |       ^                          |          | 1
>>         |uses   | uses                     |          |
>>         |       |                          |          | *
>> +---------+                      +--------------------+
>>        | Product | 1 ---------------> * | EnvironmentProduct |
>>        +---------+                      +--------------------+
>>                                            |          |1
>>                                            |          |*
>>                                            |          V
>>                                            | uses +------------+
>>                                            +------| Repository |
>>                                                   +------------+
>>
>>
>> I propose:
>>   - Rename EnvironmentProduct to ProductContent
>>     - make it use Candlepin::ProductContent
>>     - remove use of Pulp::Repos from Product
>>     - delegate responsibility of generation of environment uuids to
>> Candlepin (should cp folks agree on this)
>>
>> resulting in:
>>
>>                          +-------------+
>>                          | Environment |
>>                          +-------------+
>>                                 ^
>>                                 | 1
>>                                 | *
>>    +---------+          +----------------+
>>    | Product | 1 ---> * | ProductContent |
>>    +---------+          +----------------+
>>                             |1  | uses
>>                             |   |    +---------------------------+
>>                             |1  +->  | Candlepin::ProductContent |
>>                             V        +---------------------------+
>>      +-------------+ uses +------------+
>>      | Pulp::Repos |<-----| Repository |
>>      +-------------+      +------------+
>>
>> I don't think many-1 relation is required on
>> Repository-ProductContent, it's 1-1?
>>
>>
>> Thoughts, concerns, opinions?
>> -d
>>
>>
>>
>>
>> _______________________________________________
>> katello-devel mailing list
>> katello-devel at redhat.com
>> https://www.redhat.com/mailman/listinfo/katello-devel
>
> -James





More information about the katello-devel mailing list