Re: Goodbye nvr.rsplit('-', 2), hello modularity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 15, 2018 at 04:14:34PM +0100, Patrick Uiterwijk wrote:
> Hi all,
> 
> If you maintain any application in Fedora Infra (or outside) that
> tries to parse things out of RPM names, you might be interested in
> this.
> 
> For those wondering where I've been spending most of my time the last
> few weeks: I've been deep in the internals of Bodhi fixing all kinds
> of issues I've found between it and Modularity (turns out enabling
> composing was just the beginning).
> 
> At some point, I was informed that for modules, they are throwing all
> kinds of old assumptions out of the door.
> One of those is the good old Name-Version-Release in RPM land.
> 
> Modules do not have an NVR, they have an NSVC: Name, Stream, Version, Context.
> Name is the name of the module ("nodejs").
> Stream is a stream, like "6", "7" or "8", these are crucial for the
> parallel availability that modules are trying to accomplish.
> Version is a date/time stamp, used to indicate new versions in the
> same name-stream.
> Context is a hash of some information in the built module that makes
> it so that the nodejs-6-20170314 built for Fedora 28 has a different
> identifier than the one built for Fedora 29.
> 
> There are some additional fields for installed things (arch and
> profile), but those aren't really important for things trying to
> parse/show module names I think.
> 
> One of the interesting things they wanted to also allow: dashes in streams.
> As a consequence, when you get an N-S-V.C as modules are represented
> in Koji builds, doing a .rsplit('-', 2) will not give you Name,
> Stream, Version.Context per se.
> You could totally have a module called
> nodejs-my-stream-5-20170314.abcd, with name=nodejs,
> stream=my-stream-5, version=20170314, context=abcd.
> There is no way for you to independently figure out what the NSVC
> components are, you will need to ask Koji, and use its name, version
> and release fields (with name=name, version=stream,
> release=version(.context)).

Have a non-deterministic naming format whose ambiguity you can only
resolve by querying Koji feels like a pretty undesirable thing. At
least it doesn't leak into the RPMs themselves, but from a developer
pov it would be really nice to be able to unambiguously parse the
module names into their parts without calling out to RPC services.
There may be contexts where you want to do such things where you
would rather not have outbound network connectivity to anywhere,
let along Koji.

If we need to allow '-' in the streams, could we use something
other than '-' as the field separator for the module names to
remove ambiguity ?

> For user consumption, they are Name:Stream:Version:Context, so you may
> need to manually convert between one representation and the other if
> you need to look up in koji or other systems versus display to users.

What stops us using Name:Stream:Version:Context everywhere,
or  Name:Stream:Context-Version or Name:Stream-Version-Context
if we need it closer to RPM NVR style ?


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux