Ivy
  1. Ivy
  2. IVY-1037

Buildnumber task does not work for chained resolvers

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.0-RC1
    • Component/s: Ant, Core
    • Labels:
      None

      Description

      If the resolver attribute of the buildnumber task point to a chained resolver the buildnumber task will not find any existing revision.
      I will attach a unittest to show the problem.
      I've debuged into this point:
      The Buildnubmer task uses SearchEngine.listModules whcih in turn uses
      Resolver.listTokenValues. The Doc says ListTokenValue must not return values for child resolvers.
      So litTokenValues can not return values for child resolvers either. I don't know how to fix.

      1. IVY1037.patch
        7 kB
        Martin Eigenbrodt

        Activity

        Hide
        Martin Eigenbrodt added a comment -

        A Unittest to reproduce the bug.

        Show
        Martin Eigenbrodt added a comment - A Unittest to reproduce the bug.
        Hide
        Martin Eigenbrodt added a comment -

        The Diff was made against the test Dir of the current trunkt.

        Show
        Martin Eigenbrodt added a comment - The Diff was made against the test Dir of the current trunkt.
        Hide
        Maarten Coene added a comment -

        I'm not sure what would be the correct behaviour for the ChainResolver to do in this situation...
        Anyone has some good ideas?

        Show
        Maarten Coene added a comment - I'm not sure what would be the correct behaviour for the ChainResolver to do in this situation... Anyone has some good ideas?
        Hide
        Martin Eigenbrodt added a comment -

        I would expect the buildnumbertask on a chained resovler to take in acount
        all revisions.
        Example:
        ChainResolver
        Resolver 1:
        module "A" in Revision 4
        Resolver 2
        module "A" n Revision 2

        <buildnumber resolver="ChainResolver"> should give "5" as next number.

        I'm very into the ivy code but i Think there must be a way to ask a chained
        resolver for all artifacts. Somethingh Like ListTokenValue but including
        child.

        2009/3/3 Maarten Coene (JIRA) <jira@apache.org>

        Show
        Martin Eigenbrodt added a comment - I would expect the buildnumbertask on a chained resovler to take in acount all revisions. Example: ChainResolver Resolver 1: module "A" in Revision 4 Resolver 2 module "A" n Revision 2 <buildnumber resolver="ChainResolver"> should give "5" as next number. I'm very into the ivy code but i Think there must be a way to ask a chained resolver for all artifacts. Somethingh Like ListTokenValue but including child. 2009/3/3 Maarten Coene (JIRA) <jira@apache.org>
        Hide
        Xavier Hanin added a comment -

        From the functional point of view, I agree with Martin, taking into account all resolvers is what seems the most natural.

        Now I'm not sure how difficult it is to implement, if we don't do it, we should at least document this limitation clearly.

        Show
        Xavier Hanin added a comment - From the functional point of view, I agree with Martin, taking into account all resolvers is what seems the most natural. Now I'm not sure how difficult it is to implement, if we don't do it, we should at least document this limitation clearly.
        Hide
        Martin Eigenbrodt added a comment -

        A Workaround that is not to hard to implement is to allow the resovler
        attribute to contain a Comma or space seperated list of
        multiple resolvers. Users could than specify the individual resolvers.
        However I'd prefere a "real" solution.

        2009/3/4 Xavier Hanin (JIRA) <jira@apache.org>

        Show
        Martin Eigenbrodt added a comment - A Workaround that is not to hard to implement is to allow the resovler attribute to contain a Comma or space seperated list of multiple resolvers. Users could than specify the individual resolvers. However I'd prefere a "real" solution. 2009/3/4 Xavier Hanin (JIRA) <jira@apache.org>
        Hide
        Maarten Coene added a comment -

        I've implemented the listTokenValues method of the ChainResolver and added it into SVN trunk.
        Could you give it a try to see if it solves your problem?

        Show
        Maarten Coene added a comment - I've implemented the listTokenValues method of the ChainResolver and added it into SVN trunk. Could you give it a try to see if it solves your problem?
        Hide
        Martin Eigenbrodt added a comment -

        Thanks Maarten. Your commit solved the unittest and my "real world problem". Have you considered commiting the test? Is there anythingh I could/should have done better there?

        Show
        Martin Eigenbrodt added a comment - Thanks Maarten. Your commit solved the unittest and my "real world problem". Have you considered commiting the test? Is there anythingh I could/should have done better there?
        Hide
        Maarten Coene added a comment -

        Martin, I didn't commit the junit test yet, I wanted to know if your problem was solved before committing it. Now that I know it solved your problem, I can commit the junit test. The only thing I changed was that I merged your test-class into the already existing IvyBuildnumberTest.

        Show
        Maarten Coene added a comment - Martin, I didn't commit the junit test yet, I wanted to know if your problem was solved before committing it. Now that I know it solved your problem, I can commit the junit test. The only thing I changed was that I merged your test-class into the already existing IvyBuildnumberTest.
        Hide
        Maarten Coene added a comment -

        I've committed the junit test as well.
        Thanks again for the contribution.

        Maarten

        Show
        Maarten Coene added a comment - I've committed the junit test as well. Thanks again for the contribution. Maarten

          People

          • Assignee:
            Maarten Coene
            Reporter:
            Martin Eigenbrodt
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development