Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E4122200CAF for ; Thu, 22 Jun 2017 11:28:29 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E2E74160BE7; Thu, 22 Jun 2017 09:28:29 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D07BB160BE5 for ; Thu, 22 Jun 2017 11:28:28 +0200 (CEST) Received: (qmail 27538 invoked by uid 500); 22 Jun 2017 09:28:28 -0000 Mailing-List: contact dev-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list dev@brooklyn.apache.org Received: (qmail 27526 invoked by uid 99); 22 Jun 2017 09:28:27 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jun 2017 09:28:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 369BD1AFBC2 for ; Thu, 22 Jun 2017 09:28:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -2.299 X-Spam-Level: X-Spam-Status: No, score=-2.299 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=cloudsoft-io.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Rk2CeGV8x0wK for ; Thu, 22 Jun 2017 09:28:25 +0000 (UTC) Received: from mail-wr0-f173.google.com (mail-wr0-f173.google.com [209.85.128.173]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 5BB595F5CC for ; Thu, 22 Jun 2017 09:28:25 +0000 (UTC) Received: by mail-wr0-f173.google.com with SMTP id 77so15119168wrb.1 for ; Thu, 22 Jun 2017 02:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudsoft-io.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=MA3hey7SOt8Em+V51P6UkeE8VeUuDZlRPT6wH6iy8Oo=; b=RcbFaxSC5lnopXWxYD5HM7gBtvWp2ia+KvoO3V2frRdUJMwY+7wpDX4JRgkvd4KWCT G4BkqF1YFsceW/tDS2Y6EkGEcOzvv20TR1K4lHmemRxZEaFLdFzpt7Pjp2VOFBEuIkIk gRdN9l2DzKSO/tfeW+ybeTeRxiffQuJmoMM+nnGOJHdh/ns5hQENCG+J7i78tcl2B969 AY58z240JK5xTuqamMpb0EEpu6Y6zUxN44dz/2pc6SpeFN0b6qxuw0YiXqVEOJw5iu08 r/A3oNkOsA7hZXys+rOQkmbHhhsADnMHUrt7be8AhZzAmeXv9VBwGYHslqu0guERnKDV ZM+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=MA3hey7SOt8Em+V51P6UkeE8VeUuDZlRPT6wH6iy8Oo=; b=Zdd0xL9p0Fjog/naaBKBiHD45uvsgmXfOE0hZlju1KU2CAd5WHOPCMAzFhYuHr2erm svLvAeRTGcaaQ0+kwR8jJCdaNwtPuWeEiro0wh6V+G1SxIbNZC2Yj02K6jE1zA9XgB2C LWELdy+tQ+VGxtCtigOHL4EPI3DCfzfmXrtI4wsCcmStIdWD42uOlNFxIFbzLwNGiU2f fx31qqhxqhcJ8ebm4KxIjLudf9JB0Vq0R4zXcN/0plWiW9eje5nZspdeeodynlwh+M4P W3vdoHLxS1yiNR/2WrQykwilr6jkuUiHW6RdV9PuTir+GmsAfdylj4SvjkgWA45t5Wqz 8eXA== X-Gm-Message-State: AKS2vOxEv3irEZxxpKJwys3w7dCGqYggayNYwYxe0Uuynh9Pfb8xcCzO ULxrW1foqYSAhxE8FQFByrPWfd6xB9s0Fnb90U7o1MzLtIwTAVncHlxmdR7HSsj5w6c1NfBSz0z 9HS/EAL8= X-Received: by 10.28.131.129 with SMTP id f123mr923725wmd.7.1498123704674; Thu, 22 Jun 2017 02:28:24 -0700 (PDT) Received: from [192.168.88.184] (vlan-187-static-61.comnet.bg. [84.54.187.61]) by smtp.gmail.com with ESMTPSA id y2sm833179wme.12.2017.06.22.02.28.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jun 2017 02:28:24 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Versions in Brooklyn From: Svetoslav Neykov In-Reply-To: Date: Thu, 22 Jun 2017 12:28:25 +0300 Cc: dev@brooklyn.apache.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <05318db2-8e33-11ea-0272-623cdbd1dbda@cloudsoft.io> <2e977696-24c3-ce55-4023-775f7fd68c76@cloudsoft.io> <16A5C056-8070-4696-84AE-9C72BFF94224@cloudsoft.io> To: Alex Heneveld X-Mailer: Apple Mail (2.3273) X-Legal-Virus-Advice: Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by Cloudsoft Corporation Limited in this regard and the recipient should carry out such virus and other checks as it considers appropriate. X-Legal-Confidentiality: This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. Cloudsoft Corporation Limited does not accept responsibility for changes made to this message after it was sent. X-Legal-Company-Info: Cloudsoft Corporation Limited. Registered in Scotland. Number: SC349230. Registered Office: 13 Dryden Place, Edinburgh, EH9 1RP. archived-at: Thu, 22 Jun 2017 09:28:30 -0000 Makes sense. > On 22.06.2017 =D0=B3., at 12:27, Alex Heneveld = wrote: >=20 >=20 > inline >=20 > On 22/06/2017 10:10, Svetoslav Neykov wrote: >> +1 to the proposal. >>=20 >> One thing I have reservations about is having a recommended version = syntax with other formats still supported but deprecated. >> As far as I understand the recommended syntax is there so we can = guarantee a uniqueness of the OSGi versions (when the source version is = unique). Instead of having a recommended syntax can we document what we = consider a unique version and let the user decide what format to follow? >=20 > yes, we could. but i think it's nicer in a community setting where = blueprints are being shared if versions follow the same format. (we = could enforce the recommended syntax in the community catalog.) >=20 > also i tend to think it's easier for users if we recommend a syntax = rather than have to explain about uniqueness of osgi bundles. (currently = that explanation is buried in an advanced section which can safely be = ignored.) >=20 > --a >=20 >=20 >> Svet. >>=20 >>=20 >>> On 20.06.2017 =D0=B3., at 14:23, Alex Heneveld = wrote: >>>=20 >>>=20 >>> I've drafted the documentation for how this could be explained to = users. This may be easier to grok than the email: >>>=20 >>> = https://github.com/apache/brooklyn-docs/pull/198/files#diff-21dacc664dfe4d= 0a156d65d768a0f0e2R28 >>>=20 >>> Best >>> Alex >>>=20 >>>=20 >>>=20 >>> On 19/06/2017 17:39, Alex Heneveld wrote: >>>> Hi All- >>>>=20 >>>> TL;DR - I am proposing that we encourage versions in Brooklyn of = the form "1.1.0" or "1.2-qualifier" such as "1.2-SNAPSHOT", silently = mapping when needed to OSGi as "1.1.0" or "1.2.0.qualifier" / = "1.2.0.SNAPSHOT" >>>>=20 >>>>=20 >>>> Further to my last mail -- we have a bit of discord between various = versioning schemes-- >>>>=20 >>>> * GitHub SemVer - which everyone talks lovingly about (though often = not knowledgeably, and it's stricter than I realized!) >>>> * OSGi versioning - a precursor to (1), in widespread use but I've = never heard anyone say anything nice about it >>>> * Maven - allows whatever you want but has recommendations and = conventions most people kinda follow >>>>=20 >>>> They all agree on up to three numbers at the start. It's what = comes after that varies, usually either a "-" (semver, maven, = conventions) or "." (osgi), followed by qualifiers. If practice almost = everyone seems to do "-" followed by qualifiers -- however qualifiers in = practice often don't follow the strict constraints of semver (no leading = zeroes, no underscores) nor some of the maven recommendations (use of = build number). >>>>=20 >>>> (Detailed summary on SemVer and OSGi versioning is included below = for reference.) >>>>=20 >>>> So far, Brooklyn hasn't had an opinion and I liked it that way. = However when registering OSGi bundles we MUST confirm with OSGi = versioning there. I'm pretty sure it's NOT desirable to enforce OSGi = versioning on types, given that few people use it. BUT we are moving to = a world where I think we want type versions (entity versions etc) to = align with bundle versions: there is really no point in types having = different versions to their defining bundle! This makes for an = incompatibility between what people would naturally use and what we have = to use within OSGi. >>>>=20 >>>> With examples, my assumption is that people want to use and see = strings like "1.1-SNAPSHOT". But under the covers the OSGi bundle = needs to have "1.1.0.SNAPSHOT". >>>>=20 >>>> I propose we resolve this by recommending a version syntax which = fits what most things people are doing and which is bi-di mappable to = OSGi. We use this version everywhere except where a strict OSGi version = is needed. We WARN if we get a non-compliant version in a place which = might be ambiguous. And we minimise places where we need to rely on = mapping. (The main place a mapping is needed is if we need to create an = OSGi version or compare with an OSGi version.) >>>>=20 >>>> Specifically I propose that Brooklyn type versions SHOULD be: >>>>=20 >>>> ( "." ( "." ")? )? ( "-" ) ? >>>> where qualifier can have letters, numbers, "-" or "_" but NOT = additional ".". >>>>=20 >>>> We construct an OSGi version, when needed, by replacing the first = "-" with "." and inserting 0's if needed for a missing minor/patch. So = "1.1-SNAPSHOT" becomes "1.1.0.SNAPSHOT" when an OSGi version is needed. >>>>=20 >>>> Note that the above is a SHOULD. The only strict requirement is = the version string MUST NOT contain a ":". (That breaks parsing.) >>>>=20 >>>> Where non-compliant versions are supplied, we WARN, but things = work. We apply simple heuristics to create a valid OSGi version -- but = the problem is that we can no longer guarantee uniqueness ("0.0.0-a" and = "0.0.0.a" would be conflated), and the result is possibly quite = different to the input (eg "v1" would become "0.0.0.v1"). For this = reason if given a non-compliant version string we WARN what the result = is and that the resulting OSGi version could conflict with similar but = not-identical version strings -- but things work fine unless someone is = trying to have different bundles for "0.0.0-a" and "0.0.0.a"! >>>>=20 >>>> (If version is taken from MANIFEST.MF we reverse map to find the = brooklyn type versions, by changing the "." to = "-"; no warning is needed here however as there is no risk of = non-uniqueness.) >>>>=20 >>>> Returning to examples: >>>>=20 >>>> * If a user specifies "1.1-SNAPSHOT" that's what they will see = everywhere except deep within OSGi where they will see "1.1.0.SNAPSHOT" >>>> * If a user includes a MANIFEST.MF they would have to use = "1.1.0.SNAPSHOT" syntax there; they should still use "1.1-SNAPSHOT" in = the catalog.bom (or "1.1.0-SNAPSHOT" would be fine too). If they use = "1.1.0.SNAPSHOT" in the catalog.bom things will work, but they will get = a warning, and "1.1.0-SNAPSHOT" is what will display in the UI. If a = different number or qualifier (eg "1.2.0-SNAPSHOT" or "1.1-beta") is = used, it will give an ERROR because the mapping will make an = inconsistent OSGi version. >>>>=20 >>>> I think the only other big options are to require OSGi everywhere = (user unfriendly, and bad for backwards compatibility) or completely = decouple OSGi bundle version from type versions (overly confusing). So = while I'm reluctant to get in to the "versions should look like XXX" I = think it's worth it to play nicely in OSGi and semver, and the above I = think is the simplest and best way (even if the technicalities don't = look so simple on first read!). >>>>=20 >>>> That said if there are version strings people want that aren't = going to be well-supported with this proposal, please shout now! >>>>=20 >>>> Best >>>> Alex >>>>=20 >>>>=20 >>>>=20 >>>> APPENDIX - Comparison of SemVer and OSGi >>>>=20 >>>> GITHUB SEMVER - = https://github.com/mojombo/semver/blob/master/semver.md >>>>=20 >>>> * "." "." ( "-" )? ( "+" = )?* >>>>=20 >>>> The first three parts are numbers. >>>> Where and are dot-separated tokens made = up of letters, digits, and "-". >>>> Key things: >>>> * numbers and and pre_release_id tokens must not consist of numbers = with leading zeros (e.g. "1.01" is not valid, nor is "1.0.0-01"; but = "1.0.0+01" is) >>>> * "-" immediately after the patch indicates pre-release and special = precedence rules apply >>>> * build-id metadata should be ignored when computing precedence >>>>=20 >>>>=20 >>>> OSGI VERSIONING - = https://www.osgi.org/release-4-version-4-3-download/ - sections 1.3.2 = and 3.2.5 >>>>=20 >>>> * ( "." ( "." ( "." )? )? )?* >>>>=20 >>>> The first three parts are the same as semver, except leading zeros = are allowed. >>>> consists of letters, numbers, "-", and "_". >>>>=20 >>>>=20 >>>> SUMMARY OF DIFFERENCES >>>>=20 >>>> (1) OSGi allows abbreviating when there is no qualifier data (e.g. = "1.1") whereas semver doesn't (has to be "1.1.0") >>>> (2) OSGi requires a dot before the qualifier, whereas semver uses = "-" or "+" depending on what the qualifier is meant for >>>> (3) OSGi permits underscores but not dots; semver permits dots to = separate non-empty tokens >>>>=20 >>>> END >>>>=20 >=20