[pony-build] Context Failures

Max Laite mlaite at gmail.com
Sat Apr 17 11:47:36 PDT 2010


The bug, which is cause of missing '=' , should of been fixed in one the
more recent pushes. Ah, its fixed in my initial stab at context failure
push.

Yea stuff seems to be sneaking in to my other branches. Will do your steps
and figure out a clean branch.

Yup, it is extremely ugly....I wanted to get something working though after
a couple hours of banging my head heh

Line ~813 does not really make sense to me anywhere, or 713 or 913 for that
matter, so I can only assume you mean around...

http://github.com/mlaite/pony-build/blob/env/client/pony_client.py#L776

However.....With Virtualenv we have to catch the error before it even jumps
into the "for c in commands:" All the Dependencies are done during the
following call in do()
if context:
        context.initialize()

I originally tried doing the break in the for loop but it would never work
how expected. Putting a failure in the for loop will only take care of build
command errors (checkout,build,test)

This is still with global variable but want through out the general
idea.....So what if we just put the "for c in commands:" inside an
if....so....... if not error_state do the for loop.....So then that would
take out all that redundancy and would skip to all the other steps if the
test passes....


On Sat, Apr 17, 2010 at 2:23 PM, C. Titus Brown <ctb at msu.edu> wrote:

> On Sat, Apr 10, 2010 at 05:29:38PM -0400, Max Laite wrote:
> > Looking for some suggestions on how to go about doing this context
> failure
> > stuff. Which we can assume should work for all context classes if we want
> it
> > to and not just Virtualenv.
>
> [ ... ]
>
> Hey Max,
>
> I merged my latest into your 'env' branch, resolved a conflict, and pushed
> it to my 'max_env' branch.  You should be able to pull from that branch
> into your 'env' branch w/o any conflicts.
>
> A couple of comments --
>
> ---
>
> The code in this branch contains a syntax error because of a bug in your
> log_level change:
>
>
> http://github.com/mlaite/pony-build/commit/a2634e60c3c89de987bed9580552f01fa71be058
>
> So not only are you not running your own code, you're not running the
> tests.  Tsk, tsk...
>
> Also, I think the log level is redundant with my --verbose and --debug
> changes.  What do you think?  That redundancy isn't necessarily bad;
> it might be nice to set a log level explicitly.  If you agree, could
> you call set_log_level, if-and-only-if -l is specified, just before
> 'parse_cmdline' returns?
>
> Finally, please do this work in a branch separate from your context stuff.
> You can do this pretty easily --
>
>  git fetch ctb master:ctb   # fetch my latest into local branch 'ctb'
>  git checkout ctb
>
>  git cherry-pick a2634e60c3   # grab your log_level patch.
>
>  ... continue work as usual ...
>
> This will let me merge it in independently of your Context work.
>
> --
>
> OK, on to the context stuff!
>
> globals are bad, for testing if nothing else -- imagine trying to test
> this code, you'd have to reset the error_state variable every time.  Can
> you think of an object or scope to which to attach this state variable?
>
> What happens in your code if context is None?
>
> Also, error_state should be set if 'c.run(...)' ~ line 813 raises an
> exception, and the for loop should abort at that point (although cleanup
> code should still run).
>
> In case c.run raises an exception, how should that exception be
> communicated to the server, do you think?
>
> That 'if error_state' code is really ugly; you're duplicating the code at
> the
> end of the function.  Is there a way to refactor the code so that the
> 'exit'
> cleanup code (file upload, etc.) is all at the end of the 'do' function?
>
> --
>
> cheers,
> --titus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/pony-build/attachments/20100417/e61c9595/attachment.htm>


More information about the pony-build mailing list