Maven Wagon

Wagon SCM does not automatically create missing directories during deployment

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.0-beta-6
  • Fix Version/s: None
  • Component/s: wagon-scm
  • Labels:
    None
  • Number of attachments :
    2
  1. WAGON-297.patch
    29/Jun/10 5:07 AM
    18 kB
    Maria Odea Ching
  2. WAGON-297.patch
    11/Jan/10 2:42 AM
    8 kB
    Maria Odea Ching

Issue Links

Activity

Hide
Maria Odea Ching added a comment - - edited

The attached patch automatically creates the missing directory/directories when put(...) or putDirectory(...) is executed for wagon-scm. A unit test is also provided.

Can someone kindly review this first before I commit them to SVN? Thanks..

Show
Maria Odea Ching added a comment - - edited The attached patch automatically creates the missing directory/directories when put(...) or putDirectory(...) is executed for wagon-scm. A unit test is also provided. Can someone kindly review this first before I commit them to SVN? Thanks..
Hide
Brett Porter added a comment -

I'm a bit confused by it.

  • the multiple levels of try/catch is a bit scary
  • the checkOut call that fails with a TransferFailedException seems to be called identically after calculating the missing directories. Am I misreading it?
  • it might be nice to have a block comment that explains what happens (are the directories added in the local checkout, created, remotely, etc? Is it checking out a new base directory higher up to create the directories?)
  • also, you want to make sure you don't start creating directories within the original supplied URL - wagon doesn't do that, only create those that it tries to put within that.

Separately - is the test case one that is valid across all the providers? Maybe it can be pushed up to the abstract class?

Show
Brett Porter added a comment - I'm a bit confused by it.
  • the multiple levels of try/catch is a bit scary
  • the checkOut call that fails with a TransferFailedException seems to be called identically after calculating the missing directories. Am I misreading it?
  • it might be nice to have a block comment that explains what happens (are the directories added in the local checkout, created, remotely, etc? Is it checking out a new base directory higher up to create the directories?)
  • also, you want to make sure you don't start creating directories within the original supplied URL - wagon doesn't do that, only create those that it tries to put within that.
Separately - is the test case one that is valid across all the providers? Maybe it can be pushed up to the abstract class?
Hide
Maria Odea Ching added a comment -
  • the multiple levels of try/catch is a bit scary

I'll see what else I can do about this.

  • the checkOut call that fails with a TransferFailedException seems to be called identically after calculating the missing directories. Am I misreading it?

Yes, it's being called again but this time using the base scm url (where the missing directories will be added). The TransferFailedException is the one thrown when the checkout fails because of the missing directory.

  • it might be nice to have a block comment that explains what happens (are the directories added in the local checkout, created, remotely, etc? Is it checking out a new base directory higher up to create the directories?)

Ok, I'll add a block comment for what it does.

  • also, you want to make sure you don't start creating directories within the original supplied URL - wagon doesn't do that, only create those that it tries to put within that.

That's what the patch does.. it only creates the missing directories where it tried to deploy.
For example: the deployment site url is http://svn.example.com/repos/myproject/www/docs/${project.version} whereas docs/${project.version} does not exist yet, with this patch, what will be created will be starting from the docs directory. Is this what you meant?

Separately - is the test case one that is valid across all the providers? Maybe it can be pushed up to the abstract class?

I'll see if I can move this up to the abstract class as I just based it on the existing test case for ScmSvnExeWagonTest.

Show
Maria Odea Ching added a comment -
  • the multiple levels of try/catch is a bit scary
I'll see what else I can do about this.
  • the checkOut call that fails with a TransferFailedException seems to be called identically after calculating the missing directories. Am I misreading it?
Yes, it's being called again but this time using the base scm url (where the missing directories will be added). The TransferFailedException is the one thrown when the checkout fails because of the missing directory.
  • it might be nice to have a block comment that explains what happens (are the directories added in the local checkout, created, remotely, etc? Is it checking out a new base directory higher up to create the directories?)
Ok, I'll add a block comment for what it does.
  • also, you want to make sure you don't start creating directories within the original supplied URL - wagon doesn't do that, only create those that it tries to put within that.
That's what the patch does.. it only creates the missing directories where it tried to deploy. For example: the deployment site url is http://svn.example.com/repos/myproject/www/docs/${project.version} whereas docs/${project.version} does not exist yet, with this patch, what will be created will be starting from the docs directory. Is this what you meant?
Separately - is the test case one that is valid across all the providers? Maybe it can be pushed up to the abstract class?
I'll see if I can move this up to the abstract class as I just based it on the existing test case for ScmSvnExeWagonTest.
Hide
Brett Porter added a comment -

I don't think it's appropriate to checkout again from the higher directory level that you indicated in point 2. This might result in checking out a lot of content that isn't needed just to create the directory. Can the directories be created remotely using the URL in this scenario? (I'm thinking of Subversion, but I think the SCM API provides the abstraction that others can implement too).

Let me know when it's updated, I'd be happy to take another look.

Show
Brett Porter added a comment - I don't think it's appropriate to checkout again from the higher directory level that you indicated in point 2. This might result in checking out a lot of content that isn't needed just to create the directory. Can the directories be created remotely using the URL in this scenario? (I'm thinking of Subversion, but I think the SCM API provides the abstraction that others can implement too). Let me know when it's updated, I'd be happy to take another look.
Hide
Maria Odea Ching added a comment -

Hi Brett, I checked the SCM API code and currently there's no implementation for the mkdir command. I'll file a separate issue for that in Maven SCM jira and add an implementation of that command so we can use it for wagon SCM.

Show
Maria Odea Ching added a comment - Hi Brett, I checked the SCM API code and currently there's no implementation for the mkdir command. I'll file a separate issue for that in Maven SCM jira and add an implementation of that command so we can use it for wagon SCM.
Hide
Maria Odea Ching added a comment -

Attached the updated patch. Instead of checking out the entire root tree, it utilizes the SCM mkdir command instead (implemented in SCM-558). Please take note that I upgraded the maven-scm APIs to 1.4-SNAPSHOT so we can use the SCM mkdir command.

Show
Maria Odea Ching added a comment - Attached the updated patch. Instead of checking out the entire root tree, it utilizes the SCM mkdir command instead (implemented in SCM-558). Please take note that I upgraded the maven-scm APIs to 1.4-SNAPSHOT so we can use the SCM mkdir command.
Hide
luke w patterson added a comment -

mvn-svn-wagon is the way to go: http://code.google.com/p/maven-svn-wagon/

Show
luke w patterson added a comment - mvn-svn-wagon is the way to go: http://code.google.com/p/maven-svn-wagon/

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated: