Problems with do_clean_checkout

View: New views
7 Messages — Rating Filter:   Alert me  

Problems with do_clean_checkout

by Adam Byrtek-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Recently I started to experiment with do_clean_checkout (with
Subversion adapter) in order to make sure there are no interactions
between different builds. Unfortunately this feature breaks in 1.4.0
(I haven't tried HEAD yet) with an error message "Repository location
is not specified".

I took a quick a look at the code and looks like the problem is caused
by the fact that the SourceControl adapter is initialized based only
on the path to the "work" directory. It means that it doesn't contain
the :repository option required to do a proper checkout, which leads
to the error quoted above.

I'll appreciate any feedback from others that encountered the same
issue or use do_clean_checkout without any problems. If this is really
a bug I can volunteer to work on a patch. In fact I'm surprised that
this feature has actually worked for somebody.

Best regards,
Adam


--
Adam Byrtek
_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Re: Problems with do_clean_checkout

by Jeremy Lightsmith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think the idea is that, if you actually want to use this feature, you need to do additional initialization in your cruise_config.rb file.  I don't have it in front of me, but it would be something like :

Project.config do |project|
  project.source_control = Subversion.new(:repository => "svn://my.repos...", :user ...)
end

if all we ever do is svn updates, we don't need this info, and while you do enter it in order to create your project in the first place, cruise doesn't store it.

does that make sense?

Jeremy

On Tue, Aug 11, 2009 at 2:24 PM, Adam Byrtek <adambyrtek@...> wrote:
Recently I started to experiment with do_clean_checkout (with
Subversion adapter) in order to make sure there are no interactions
between different builds. Unfortunately this feature breaks in 1.4.0
(I haven't tried HEAD yet) with an error message "Repository location
is not specified".

I took a quick a look at the code and looks like the problem is caused
by the fact that the SourceControl adapter is initialized based only
on the path to the "work" directory. It means that it doesn't contain
the :repository option required to do a proper checkout, which leads
to the error quoted above.

I'll appreciate any feedback from others that encountered the same
issue or use do_clean_checkout without any problems. If this is really
a bug I can volunteer to work on a patch. In fact I'm surprised that
this feature has actually worked for somebody.

Best regards,
Adam


--
Adam Byrtek
_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users



--
Jeremy Lightsmith
Coaching Teams & Creating Communities

312-953-1193
http://onemanswalk.com/ (blog)
http://facilitationpatterns.org/ (book in progress)
http://www.linkedin.com/in/jeremylightsmith

_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Re: Problems with do_clean_checkout

by Adam Byrtek-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Aug 12, 2009 at 00:06, Jeremy
Lightsmith<jeremy.lightsmith@...> wrote:
> I think the idea is that, if you actually want to use this feature, you need
> to do additional initialization in your cruise_config.rb file.  I don't have
> it in front of me, but it would be something like :
>
> Project.config do |project|
>   project.source_control = Subversion.new(:repository =>
> "svn://my.repos...", :user ...)
> end

I didn't want to overwrite source_control if it exists so I tried this

   project.source_control.repository = "https://..."

and it works, thanks. Fortunately the user credentials are cached by
the Subversion client.

> if all we ever do is svn updates, we don't need this info, and while you do
> enter it in order to create your project in the first place, cruise doesn't
> store it.

I understand that. Looks like all the options that are provided on the
command line are lost after the initial checkout is done. Even the
type of the source control system is auto-detected based on contents
of the work directory.

On the other hand do_clean_checkout is described in the documentation
without any additional comments and when you use it as documented the
effect is as follows

1. The work directory is purged completely.
2. The web interface fails with 500, you cannot even access the main page.

In other words the application is in inconsistent state and the
situation has to be resolved manually.

My proposition to solve this issue would be

1. Get the repository URL from "svn info" (or equivalents in other
SCMs) before the work directory is purged. This file is already parsed
to get some other information so this should be quite easy.
2. Fail gracefully when the work directory doesn't exist.
3. Document it better.

If there are no objections I can start with preparing a patch for 1.

Best regards,
Adam


--
Adam Byrtek
_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Re: Problems with do_clean_checkout

by Jeremy Lightsmith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sounds like a great patch candidate



On Aug 12, 2009, at 3:28 AM, Adam Byrtek <adambyrtek@...> wrote:

> On Wed, Aug 12, 2009 at 00:06, Jeremy
> Lightsmith<jeremy.lightsmith@...> wrote:
>> I think the idea is that, if you actually want to use this feature,  
>> you need
>> to do additional initialization in your cruise_config.rb file.  I  
>> don't have
>> it in front of me, but it would be something like :
>>
>> Project.config do |project|
>>   project.source_control = Subversion.new(:repository =>
>> "svn://my.repos...", :user ...)
>> end
>
> I didn't want to overwrite source_control if it exists so I tried this
>
>   project.source_control.repository = "https://..."
>
> and it works, thanks. Fortunately the user credentials are cached by
> the Subversion client.
>
>> if all we ever do is svn updates, we don't need this info, and  
>> while you do
>> enter it in order to create your project in the first place, cruise  
>> doesn't
>> store it.
>
> I understand that. Looks like all the options that are provided on the
> command line are lost after the initial checkout is done. Even the
> type of the source control system is auto-detected based on contents
> of the work directory.
>
> On the other hand do_clean_checkout is described in the documentation
> without any additional comments and when you use it as documented the
> effect is as follows
>
> 1. The work directory is purged completely.
> 2. The web interface fails with 500, you cannot even access the main  
> page.
>
> In other words the application is in inconsistent state and the
> situation has to be resolved manually.
>
> My proposition to solve this issue would be
>
> 1. Get the repository URL from "svn info" (or equivalents in other
> SCMs) before the work directory is purged. This file is already parsed
> to get some other information so this should be quite easy.
> 2. Fail gracefully when the work directory doesn't exist.
> 3. Document it better.
>
> If there are no objections I can start with preparing a patch for 1.
>
> Best regards,
> Adam
>
>
> --
> Adam Byrtek
> _______________________________________________
> Cruisecontrolrb-users mailing list
> Cruisecontrolrb-users@...
> http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users
_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Re: Problems with do_clean_checkout

by Adam Byrtek-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Aug 12, 2009 at 18:50, Jeremy
Lightsmith<jeremy.lightsmith@...> wrote:
> Sounds like a great patch candidate

I've implemented and submitted a patch
https://cruisecontrolrb.lighthouseapp.com/projects/9150-cruise-control-rb/tickets/270-patch-do_clean_checkout-fixed

It should be fine, I tested this on the build server of my company.

Best regards,
Adam

PS. I'm leaving for vacation so I won't be able to respond during the
next week or two.

--
Adam Byrtek
_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Re: Problems with do_clean_checkout

by Brian Guthrie-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Adam - thanks so much for the patch. I've gone ahead and sent you a
CCRB contributor's agreement--I'll go ahead and merge the patch
locally, but I have to hold off on merging it into master until I've
got your OK.

Cheers,

Brian

On Fri, Aug 14, 2009 at 5:43 PM, Adam Byrtek<adambyrtek@...> wrote:

> On Wed, Aug 12, 2009 at 18:50, Jeremy
> Lightsmith<jeremy.lightsmith@...> wrote:
>> Sounds like a great patch candidate
>
> I've implemented and submitted a patch
> https://cruisecontrolrb.lighthouseapp.com/projects/9150-cruise-control-rb/tickets/270-patch-do_clean_checkout-fixed
>
> It should be fine, I tested this on the build server of my company.
>
> Best regards,
> Adam
>
> PS. I'm leaving for vacation so I won't be able to respond during the
> next week or two.
>
> --
> Adam Byrtek
> _______________________________________________
> Cruisecontrolrb-users mailing list
> Cruisecontrolrb-users@...
> http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users
>
_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Re: Problems with do_clean_checkout

by Adam Byrtek-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Aug 15, 2009 at 19:46, Brian Guthrie<btguthrie@...> wrote:
> Adam - thanks so much for the patch. I've gone ahead and sent you a
> CCRB contributor's agreement--I'll go ahead and merge the patch
> locally, but I have to hold off on merging it into master until I've
> got your OK.

I've just responded to your email, hope it will be enough to integrate
the patch.

Best regards,
Adam

--
Adam Byrtek
_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users