Bug#987241: uscan: Use version from package.json when mode=git and type=nodejs for multi tar sources

2021-04-24 Thread Mattia Rizzolo
On Wed, Apr 21, 2021 at 11:02:42PM +0530, Pirate Praveen wrote:
> >This is not the spirit of HEAD/pretty mode: the goal is to pick commits
> >after last tag. Upstream did a strange thing in this repo: set a tag
> >outside any named branch. I'm not sure we should modify uscan because of
> >an unlikely upstream behavior.

I do agree this is a very odd behaviour, and likely a unique one.  In
this case it's not a forgotten tag, is a tag that is not an ancestor of
what you downloaded.   (that said, I can't see such tag in my clone of
bnjmnt4n/lodash-cli ?  So, what are you talking about?)

> >But if Devscript Team agree with you, I can modify "ctype" feature to
> >fix tag when last tag is lower than package.json#version, then version
> >will be 4.17.5+timestamp instead of 4.17.4.20+timestamp
> 
> I have reopened for comments from devscripts team.

So my "official" on this is: before getting yet another feature like
this, I'd like at least another package where this actually proves
useful and preferably more than one more.

> It does not have to be the default, but as an optional setting in the watch 
> file. May be ctype=nodejs,version=package.json
> 
> Or ctype=nodejs,pretty=package.json
> 
> In this case it should be 4.17.21+git.timestamp.hash as version in 
> package.json is 4.17.21.

Besides, in this case it's not even that useful, IMHO.
Since you are using the group+checksum feature, the actual version that
uscan gets from the lodash-cli component is very hidden and doesn't
really matter in the end, as long it monotonically increases whenever
there is an updated upstream, which I believe it does in your watchfile.

> uscan supports a lot of weird upstream conventions anyway. Many upstream 
> don't use tags consistently so we need ways to handle those cases.

Well, I would rather we do not add more support for more weird
upstreams.  There used to be a time when we tried to collaborate with
upstreams to get something that works for both, and I honestly believe
that asking them to create tags whenever they release something is
totally acceptable and you should do that.  Did you try here?  What
answer did you get?

> Also checksum option does not support mode=git scheme default values. So I 
> used pretty=4.17.21.%cd to force using digits only.
> 
> Should I open another bug for using checksum with git ? Current it supports 
> only digits in version so ~git or +git or the hash in version does not work.

Well, for this, whatever Yadd prefers.  I guess forcing a different
pretty= format with version `checksum` is fine to do and probably makes
sense if it fails otherwise.

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
More about me:  https://mapreri.org : :'  :
Launchpad user: https://launchpad.net/~mapreri  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-


signature.asc
Description: PGP signature


Bug#987241: uscan: Use version from package.json when mode=git and type=nodejs for multi tar sources

2021-04-21 Thread Pirate Praveen
Control: reopen -1

On 2021, ഏപ്രിൽ 21 9:32:52 PM IST, Yadd  wrote:
>Le 21/04/2021 à 17:23, Pirate Praveen a écrit :
>> On Wed, 21 Apr 2021 15:48:14 +0200 Yadd  wrote:
>>> Hi,
>>>
>>> `pretty=describe` uses the result of `git describe`. You got a
>>> "4.17.4.20" because this is the last tag on the branch you tried to
>>> clone. The "4.17.5" tag is attached to a different branch (unnamed).
>>>
>>> So uscan is right here ;-)
>> 
>> I don't think uscan is right here. The correct version is available in
>> the package.json. I think it'd be a nice option if uscan can pick the
>> version available in package.json instead of us adding it manually for
>> every update. I currently have to hard code the version in watch file
>> which I don't think is a right solution.
>> 
>> Tag is only one way of finding the version and often not used by node
>> projects. package.json is also a way to find the version of the node
>> module and consistently used by all node modules. Since we already have
>> a type=nodejs we know it has a package.json.
>
>This is not the spirit of HEAD/pretty mode: the goal is to pick commits
>after last tag. Upstream did a strange thing in this repo: set a tag
>outside any named branch. I'm not sure we should modify uscan because of
>an unlikely upstream behavior.
>But if Devscript Team agree with you, I can modify "ctype" feature to
>fix tag when last tag is lower than package.json#version, then version
>will be 4.17.5+timestamp instead of 4.17.4.20+timestamp

I have reopened for comments from devscripts team.

It does not have to be the default, but as an optional setting in the watch 
file. May be ctype=nodejs,version=package.json

Or ctype=nodejs,pretty=package.json

In this case it should be 4.17.21+git.timestamp.hash as version in package.json 
is 4.17.21.

uscan supports a lot of weird upstream conventions anyway. Many upstream don't 
use tags consistently so we need ways to handle those cases.

Also checksum option does not support mode=git scheme default values. So I used 
pretty=4.17.21.%cd to force using digits only.

Should I open another bug for using checksum with git ? Current it supports 
only digits in version so ~git or +git or the hash in version does not work.

>Cheers,
>Yadd

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.



Bug#987241: uscan: Use version from package.json when mode=git and type=nodejs for multi tar sources

2021-04-21 Thread Yadd
Le 21/04/2021 à 17:23, Pirate Praveen a écrit :
> On Wed, 21 Apr 2021 15:48:14 +0200 Yadd  wrote:
>> Hi,
>>
>> `pretty=describe` uses the result of `git describe`. You got a
>> "4.17.4.20" because this is the last tag on the branch you tried to
>> clone. The "4.17.5" tag is attached to a different branch (unnamed).
>>
>> So uscan is right here ;-)
> 
> I don't think uscan is right here. The correct version is available in
> the package.json. I think it'd be a nice option if uscan can pick the
> version available in package.json instead of us adding it manually for
> every update. I currently have to hard code the version in watch file
> which I don't think is a right solution.
> 
> Tag is only one way of finding the version and often not used by node
> projects. package.json is also a way to find the version of the node
> module and consistently used by all node modules. Since we already have
> a type=nodejs we know it has a package.json.

This is not the spirit of HEAD/pretty mode: the goal is to pick commits
after last tag. Upstream did a strange thing in this repo: set a tag
outside any named branch. I'm not sure we should modify uscan because of
an unlikely upstream behavior.
But if Devscript Team agree with you, I can modify "ctype" feature to
fix tag when last tag is lower than package.json#version, then version
will be 4.17.5+timestamp instead of 4.17.4.20+timestamp

Cheers,
Yadd



Bug#987241: uscan: Use version from package.json when mode=git and type=nodejs for multi tar sources

2021-04-21 Thread Pirate Praveen
On Wed, 21 Apr 2021 15:48:14 +0200 Yadd  wrote:
> Hi,
> 
> `pretty=describe` uses the result of `git describe`. You got a
> "4.17.4.20" because this is the last tag on the branch you tried to
> clone. The "4.17.5" tag is attached to a different branch (unnamed).
> 
> So uscan is right here ;-)

I don't think uscan is right here. The correct version is available in the 
package.json. I think it'd be a nice option if uscan can pick the version 
available in package.json instead of us adding it manually for every update. I 
currently have to hard code the version in watch file which I don't think is a 
right solution.

Tag is only one way of finding the version and often not used by node projects. 
package.json is also a way to find the version of the node module and 
consistently used by all node modules. Since we already have a type=nodejs we 
know it has a package.json.

> Cheers,
> Yadd
> 
> 

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Bug#987241: uscan: Use version from package.json when mode=git and type=nodejs for multi tar sources

2021-04-20 Thread Pirate Praveen
Package: devscripts
Severity: wishlist

Currently pretty=describe takes latest tag and the commit hash, but sometimes 
the tags are not updated but version is updated in package.json.

Example lodash-cli

https://github.com/bnjmnt4n/lodash-cli

Current version in archive is 4.17.5 but git mode pretty=describe shows 
4.17.4.20.hash which is lower than latest tag. But actual version we want is 
4.17.21 present in package.json.

It could be another option like pretty=package.json
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.