You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Nicolas Lalevée (JIRA)" <ji...@apache.org> on 2008/01/17 15:22:33 UTC

[jira] Created: (IVY-704) In the ResolveReport class, add the possibility to filter the evicted module while getting the list of DownloadArtifact

In the ResolveReport class, add the possibility to filter the evicted module while getting the list of DownloadArtifact
-----------------------------------------------------------------------------------------------------------------------

                 Key: IVY-704
                 URL: https://issues.apache.org/jira/browse/IVY-704
             Project: Ivy
          Issue Type: Improvement
          Components: Core
    Affects Versions: 2.0.0-beta-2
            Reporter: Nicolas Lalevée


As disscussed here : http://mail-archives.apache.org/mod_mbox/ant-dev/200801.mbox/%3c635a05060801160721w7fcd1declaa32803ad3cfbe8c@mail.gmail.com%3e

In order to get the list of artifacts which are part of the dependencies of a module, it will be useful to have a function in the ResolveReport class to get the download reports without the ones from the evited modules.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (IVY-704) In the ResolveReport class, add the possibility to filter the evicted module while getting the list of DownloadArtifact

Posted by "Xavier Hanin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVY-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xavier Hanin resolved IVY-704.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0-beta-2

I've applied your patch with some modifications, thanks a lot for your contribution!

I've made two changes:
- first one is only algorithmic, I changed the way to detect an artifact is evicted in ConfigurationResolveReport
- second is functional, in ResolveReport I include artifacts when withEvicted is false as soon as the artifact is not evicted in at least one configuration. Hence there is no other logic in ResolveReport than merging the results from each conf. I find this more logic to include artifacts even if they are part of an evicted module in one conf and not in another one, because if they aren't evicted in at least one conf it means they can be used in some way

I've also done another change after my first commit, this is not directly related to this issue, but I've changed all Sets and Maps in those two report classes to used Linked versions, so that order is preserved. This should be better for predictability, especially when used from IvyDE.

> In the ResolveReport class, add the possibility to filter the evicted module while getting the list of DownloadArtifact
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: IVY-704
>                 URL: https://issues.apache.org/jira/browse/IVY-704
>             Project: Ivy
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Nicolas Lalevée
>             Fix For: 2.0.0-beta-2
>
>         Attachments: IVY-704-r612799.patch
>
>
> As disscussed here : http://mail-archives.apache.org/mod_mbox/ant-dev/200801.mbox/%3c635a05060801160721w7fcd1declaa32803ad3cfbe8c@mail.gmail.com%3e
> In order to get the list of artifacts which are part of the dependencies of a module, it will be useful to have a function in the ResolveReport class to get the download reports without the ones from the evited modules.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (IVY-704) In the ResolveReport class, add the possibility to filter the evicted module while getting the list of DownloadArtifact

Posted by Nicolas Lalevée <ni...@anyware-tech.com>.
Le lundi 21 janvier 2008, Xavier Hanin a écrit :
> On Jan 19, 2008 2:44 PM, Nicolas Lalevée <ni...@anyware-tech.com>
>
> wrote:
> > Answering in ant-dev, because this might be a larger topic.
> >
> > Le 19 janv. 08 à 07:56, Xavier Hanin (JIRA) a écrit :
> > >    [
> >
> > https://issues.apache.org/jira/browse/IVY-704?page=com.atlassian.jira.plu
> >gin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560662
> >
> > > #action_12560662 ]
> > >
> > > Xavier Hanin commented on IVY-704:
> > > ----------------------------------
> > >
> > > {quote}
> > > does it means that some evicted modules will still be returned by
> > > ResolveReport#getArtifactsReports(DownloadStatus, boolean) ?
> > > {quote}
> > > Yes, but not fully evicted (by fully evicted I mean evicted in all
> > > configurations). The rationale behind this is that I think this
> > > method should return the same set of artifacts as what you get if
> > > you use a retrieve or a cachepath task. So as soon as one artifact
> > > is not evicted in one conf, you get it with retrieve if you retrieve
> > > all confs.
> > >
> > > {quote}
> > > the eviction information is in the conf which contains the not
> > > evicted one.
> > > {quote}
> > > Mmm, this seems ok to me: a module revision is usually evicted in
> > > favor of another one in one given configuration, so in this
> > > configuration report we have to store both the selected module and
> > > the evicted one. That's where the withEvicted you implemented is
> > > used, and that's fine. Am I missing something?
> >
> > In fact I was assuming that in the list of artifact returned by a
> > retrieve task, there won't be any duplicate entry, even with different
> > version, because they will conflict.
> >
> > I have a such ivy.xml on which I do a resolve for every conf on, and
> > then I have duplicate entries in IvyDE. And from the ivy reports,
> > there is effectively a configuration where the should-be-evicted
> > artifact is resolved without being evicted.
> >
> > Then what does mean doing a single resolve on several conf. As you
> > explained, in the actual implementation it is just a aggregation of
> > several independent resolve tasks, each task on one conf. As a user I
> > would expect that a multi-conf retrieve will generate a coherent
> > classpath. It would be similar to creating a new conf, making it
> > depends on the confs I really want, and then doing a resolve on it.
> >
> > (continuing thinking loudly)
> >
> > But my conf maybe wrong in fact. Having two confs which produce two
> > same artifacts without the same version seems wrong. We can imagine
> > two different confs named withJetty5 and withJetty6. And of course
> > they should not be retrieved jointly.
> > Maybe Ivy should trigger a warn/error ? Or at least the ant task and
> > IvyDE ?
> >
> >
> > Nicolas, discovering the complexity of the dependency management
>
> Configurations in Ivy are considered isolated. Resolving or retrieving
> several confs at a time is only a shortcut for doing the same thing with
> each conf at a time. I don't know if it's the best thing to do or not, but
> at least it's consistent, and it works like that since the beginning. Any
> time resolving several confs at a time has an impact this is considered a
> bug and we fix it. So if you really want your confs to be resolved at once
> and conflict management to occur between them, you need to create another
> conf extending the others.
>
> Now should we add a warning/error when we find conflicts between confs? I
> don't know. It seems indeed that it would benefit some (most?) users, since
> the use case where someone need different versions for different confs
> seems to be rare. But we should be able to disable this behavior.

Finally it seems that it should be the user of the core API (ant task or 
IvyDE) which should warn the end user, so yes the current API should stay the 
same without trigerring a warn.
I will put it to IvyDE.

cheers,
Nicolas

> Xavier
>
> > >> In the ResolveReport class, add the possibility to filter the
> > >> evicted module while getting the list of DownloadArtifact
> >
> > -------------------------------------------------------------------------
> >----------------------------------------------
> >
> > >>                Key: IVY-704
> > >>                URL: https://issues.apache.org/jira/browse/IVY-704
> > >>            Project: Ivy
> > >>         Issue Type: Improvement
> > >>         Components: Core
> > >>   Affects Versions: 2.0.0-beta-2
> > >>           Reporter: Nicolas Lalevée
> > >>            Fix For: 2.0.0-beta-2
> > >>
> > >>        Attachments: IVY-704-r612799.patch
> > >>
> > >>
> > >> As disscussed here :
> >
> > http://mail-archives.apache.org/mod_mbox/ant-dev/200801.mbox/%3c635a05060
> >801160721w7fcd1declaa32803ad3cfbe8c@mail.gmail.com%3e
> >
> > >> In order to get the list of artifacts which are part of the
> > >> dependencies of a module, it will be useful to have a function in
> > >> the ResolveReport class to get the download reports without the
> > >> ones from the evited modules.
> > >
> > > --
> > > This message is automatically generated by JIRA.
> > > -
> > > You can reply to this email to add a comment to the issue online.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail: dev-help@ant.apache.org



-- 
Nicolas LALEVÉE
ANYWARE TECHNOLOGIES
Tel : +33 (0)5 61 00 52 90
Fax : +33 (0)5 61 00 51 46
http://www.anyware-tech.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: [jira] Commented: (IVY-704) In the ResolveReport class, add the possibility to filter the evicted module while getting the list of DownloadArtifact

Posted by Xavier Hanin <xa...@gmail.com>.
On Jan 19, 2008 2:44 PM, Nicolas Lalevée <ni...@anyware-tech.com>
wrote:

> Answering in ant-dev, because this might be a larger topic.
>
> Le 19 janv. 08 à 07:56, Xavier Hanin (JIRA) a écrit :
>
> >
> >    [
> https://issues.apache.org/jira/browse/IVY-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560662
> > #action_12560662 ]
> >
> > Xavier Hanin commented on IVY-704:
> > ----------------------------------
> >
> > {quote}
> > does it means that some evicted modules will still be returned by
> > ResolveReport#getArtifactsReports(DownloadStatus, boolean) ?
> > {quote}
> > Yes, but not fully evicted (by fully evicted I mean evicted in all
> > configurations). The rationale behind this is that I think this
> > method should return the same set of artifacts as what you get if
> > you use a retrieve or a cachepath task. So as soon as one artifact
> > is not evicted in one conf, you get it with retrieve if you retrieve
> > all confs.
> >
> > {quote}
> > the eviction information is in the conf which contains the not
> > evicted one.
> > {quote}
> > Mmm, this seems ok to me: a module revision is usually evicted in
> > favor of another one in one given configuration, so in this
> > configuration report we have to store both the selected module and
> > the evicted one. That's where the withEvicted you implemented is
> > used, and that's fine. Am I missing something?
> >
>
> In fact I was assuming that in the list of artifact returned by a
> retrieve task, there won't be any duplicate entry, even with different
> version, because they will conflict.
>
> I have a such ivy.xml on which I do a resolve for every conf on, and
> then I have duplicate entries in IvyDE. And from the ivy reports,
> there is effectively a configuration where the should-be-evicted
> artifact is resolved without being evicted.
>
> Then what does mean doing a single resolve on several conf. As you
> explained, in the actual implementation it is just a aggregation of
> several independent resolve tasks, each task on one conf. As a user I
> would expect that a multi-conf retrieve will generate a coherent
> classpath. It would be similar to creating a new conf, making it
> depends on the confs I really want, and then doing a resolve on it.
>
> (continuing thinking loudly)
>
> But my conf maybe wrong in fact. Having two confs which produce two
> same artifacts without the same version seems wrong. We can imagine
> two different confs named withJetty5 and withJetty6. And of course
> they should not be retrieved jointly.
> Maybe Ivy should trigger a warn/error ? Or at least the ant task and
> IvyDE ?
>
>
> Nicolas, discovering the complexity of the dependency management

Configurations in Ivy are considered isolated. Resolving or retrieving
several confs at a time is only a shortcut for doing the same thing with
each conf at a time. I don't know if it's the best thing to do or not, but
at least it's consistent, and it works like that since the beginning. Any
time resolving several confs at a time has an impact this is considered a
bug and we fix it. So if you really want your confs to be resolved at once
and conflict management to occur between them, you need to create another
conf extending the others.

Now should we add a warning/error when we find conflicts between confs? I
don't know. It seems indeed that it would benefit some (most?) users, since
the use case where someone need different versions for different confs seems
to be rare. But we should be able to disable this behavior.

Xavier

>
>
>
> >> In the ResolveReport class, add the possibility to filter the
> >> evicted module while getting the list of DownloadArtifact
> >>
> -----------------------------------------------------------------------------------------------------------------------
> >>
> >>                Key: IVY-704
> >>                URL: https://issues.apache.org/jira/browse/IVY-704
> >>            Project: Ivy
> >>         Issue Type: Improvement
> >>         Components: Core
> >>   Affects Versions: 2.0.0-beta-2
> >>           Reporter: Nicolas Lalevée
> >>            Fix For: 2.0.0-beta-2
> >>
> >>        Attachments: IVY-704-r612799.patch
> >>
> >>
> >> As disscussed here :
> http://mail-archives.apache.org/mod_mbox/ant-dev/200801.mbox/%3c635a05060801160721w7fcd1declaa32803ad3cfbe8c@mail.gmail.com%3e
> >> In order to get the list of artifacts which are part of the
> >> dependencies of a module, it will be useful to have a function in
> >> the ResolveReport class to get the download reports without the
> >> ones from the evited modules.
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > You can reply to this email to add a comment to the issue online.
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>


-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/

Re: [jira] Commented: (IVY-704) In the ResolveReport class, add the possibility to filter the evicted module while getting the list of DownloadArtifact

Posted by Nicolas Lalevée <ni...@anyware-tech.com>.
Answering in ant-dev, because this might be a larger topic.

Le 19 janv. 08 à 07:56, Xavier Hanin (JIRA) a écrit :

>
>    [ https://issues.apache.org/jira/browse/IVY-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560662 
> #action_12560662 ]
>
> Xavier Hanin commented on IVY-704:
> ----------------------------------
>
> {quote}
> does it means that some evicted modules will still be returned by  
> ResolveReport#getArtifactsReports(DownloadStatus, boolean) ?
> {quote}
> Yes, but not fully evicted (by fully evicted I mean evicted in all  
> configurations). The rationale behind this is that I think this  
> method should return the same set of artifacts as what you get if  
> you use a retrieve or a cachepath task. So as soon as one artifact  
> is not evicted in one conf, you get it with retrieve if you retrieve  
> all confs.
>
> {quote}
> the eviction information is in the conf which contains the not  
> evicted one.
> {quote}
> Mmm, this seems ok to me: a module revision is usually evicted in  
> favor of another one in one given configuration, so in this  
> configuration report we have to store both the selected module and  
> the evicted one. That's where the withEvicted you implemented is  
> used, and that's fine. Am I missing something?
>

In fact I was assuming that in the list of artifact returned by a  
retrieve task, there won't be any duplicate entry, even with different  
version, because they will conflict.

I have a such ivy.xml on which I do a resolve for every conf on, and  
then I have duplicate entries in IvyDE. And from the ivy reports,  
there is effectively a configuration where the should-be-evicted  
artifact is resolved without being evicted.

Then what does mean doing a single resolve on several conf. As you  
explained, in the actual implementation it is just a aggregation of  
several independent resolve tasks, each task on one conf. As a user I  
would expect that a multi-conf retrieve will generate a coherent  
classpath. It would be similar to creating a new conf, making it  
depends on the confs I really want, and then doing a resolve on it.

(continuing thinking loudly)

But my conf maybe wrong in fact. Having two confs which produce two  
same artifacts without the same version seems wrong. We can imagine  
two different confs named withJetty5 and withJetty6. And of course  
they should not be retrieved jointly.
Maybe Ivy should trigger a warn/error ? Or at least the ant task and  
IvyDE ?


Nicolas, discovering the complexity of the dependency management


>> In the ResolveReport class, add the possibility to filter the  
>> evicted module while getting the list of DownloadArtifact
>> -----------------------------------------------------------------------------------------------------------------------
>>
>>                Key: IVY-704
>>                URL: https://issues.apache.org/jira/browse/IVY-704
>>            Project: Ivy
>>         Issue Type: Improvement
>>         Components: Core
>>   Affects Versions: 2.0.0-beta-2
>>           Reporter: Nicolas Lalevée
>>            Fix For: 2.0.0-beta-2
>>
>>        Attachments: IVY-704-r612799.patch
>>
>>
>> As disscussed here : http://mail-archives.apache.org/mod_mbox/ant-dev/200801.mbox/%3c635a05060801160721w7fcd1declaa32803ad3cfbe8c@mail.gmail.com%3e
>> In order to get the list of artifacts which are part of the  
>> dependencies of a module, it will be useful to have a function in  
>> the ResolveReport class to get the download reports without the  
>> ones from the evited modules.
>
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


[jira] Commented: (IVY-704) In the ResolveReport class, add the possibility to filter the evicted module while getting the list of DownloadArtifact

Posted by "Xavier Hanin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560662#action_12560662 ] 

Xavier Hanin commented on IVY-704:
----------------------------------

{quote}
does it means that some evicted modules will still be returned by ResolveReport#getArtifactsReports(DownloadStatus, boolean) ?
{quote}
Yes, but not fully evicted (by fully evicted I mean evicted in all configurations). The rationale behind this is that I think this method should return the same set of artifacts as what you get if you use a retrieve or a cachepath task. So as soon as one artifact is not evicted in one conf, you get it with retrieve if you retrieve all confs.

{quote}
the eviction information is in the conf which contains the not evicted one.
{quote}
Mmm, this seems ok to me: a module revision is usually evicted in favor of another one in one given configuration, so in this configuration report we have to store both the selected module and the evicted one. That's where the withEvicted you implemented is used, and that's fine. Am I missing something?

> In the ResolveReport class, add the possibility to filter the evicted module while getting the list of DownloadArtifact
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: IVY-704
>                 URL: https://issues.apache.org/jira/browse/IVY-704
>             Project: Ivy
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Nicolas Lalevée
>             Fix For: 2.0.0-beta-2
>
>         Attachments: IVY-704-r612799.patch
>
>
> As disscussed here : http://mail-archives.apache.org/mod_mbox/ant-dev/200801.mbox/%3c635a05060801160721w7fcd1declaa32803ad3cfbe8c@mail.gmail.com%3e
> In order to get the list of artifacts which are part of the dependencies of a module, it will be useful to have a function in the ResolveReport class to get the download reports without the ones from the evited modules.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IVY-704) In the ResolveReport class, add the possibility to filter the evicted module while getting the list of DownloadArtifact

Posted by "Nicolas Lalevée (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVY-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Lalevée updated IVY-704:
--------------------------------

    Attachment: IVY-704-r612799.patch

I have added a generic function {{getArtifactsReports(DownloadStatus downloadStatus, boolean withEvicted)}} to ResolveReport and ConfigurationResolveReport.
The one on ConfigurationResolveReport may not be needed. But when I first coded it, I didn't realized that an artifact in a conf can be evicted in another conf. Nevertheless this function might be useful, so I let it in the patch.
I also added some minor javadoc improvements.

> In the ResolveReport class, add the possibility to filter the evicted module while getting the list of DownloadArtifact
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: IVY-704
>                 URL: https://issues.apache.org/jira/browse/IVY-704
>             Project: Ivy
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Nicolas Lalevée
>         Attachments: IVY-704-r612799.patch
>
>
> As disscussed here : http://mail-archives.apache.org/mod_mbox/ant-dev/200801.mbox/%3c635a05060801160721w7fcd1declaa32803ad3cfbe8c@mail.gmail.com%3e
> In order to get the list of artifacts which are part of the dependencies of a module, it will be useful to have a function in the ResolveReport class to get the download reports without the ones from the evited modules.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IVY-704) In the ResolveReport class, add the possibility to filter the evicted module while getting the list of DownloadArtifact

Posted by "Nicolas Lalevée (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560533#action_12560533 ] 

Nicolas Lalevée commented on IVY-704:
-------------------------------------

About the second point, does it means that some evicted modules will still be returned by {{ResolveReport#getArtifactsReports(DownloadStatus, boolean)}} ?
Because I think there is a use case where an artifact may be retreived by two different confs, with two different versions; and as far I can see (or debug), the eviction information is in the conf which contains the not evicted one.

So first, is the evicted info misplaced ?
If correctly placed, then I think either the algorithm should be revert to the one I posted, or update the javadoc to warn about that use case.

> In the ResolveReport class, add the possibility to filter the evicted module while getting the list of DownloadArtifact
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: IVY-704
>                 URL: https://issues.apache.org/jira/browse/IVY-704
>             Project: Ivy
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Nicolas Lalevée
>             Fix For: 2.0.0-beta-2
>
>         Attachments: IVY-704-r612799.patch
>
>
> As disscussed here : http://mail-archives.apache.org/mod_mbox/ant-dev/200801.mbox/%3c635a05060801160721w7fcd1declaa32803ad3cfbe8c@mail.gmail.com%3e
> In order to get the list of artifacts which are part of the dependencies of a module, it will be useful to have a function in the ResolveReport class to get the download reports without the ones from the evited modules.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.