Thread: Re: [COMMITTERS] pgsql: Branch refs/heads/REL9_1_STABLE was removed

Re: [COMMITTERS] pgsql: Branch refs/heads/REL9_1_STABLE was removed

From
Tom Lane
Date:
Magnus Hagander <magnus@hagander.net> writes:
> We discussed earlier to potentially block the creation, and removal,
> of branches on the origin server, to prevent mistakes like this. It
> has only happened once in almost a year, so it's probably not
> necessary - but I wanted to raise the option anyway in case people
> forgot about it.

> The downside would be that in order to create or drop a branch *when
> intended* a committer would need someone from the infrastructure team
> to temporarily switch off the branch-blocking setting, and then back
> on..

I think it would be sensible to block branch removal, as there's
basically never a scenario where we'd do that during current usage.
I'm not excited about blocking branch addition, although I worry
sooner or later somebody will accidentally push a private development
branch :-(.  Is it possible to block only removal and not addition?
        regards, tom lane


Re: [COMMITTERS] pgsql: Branch refs/heads/REL9_1_STABLE was removed

From
Magnus Hagander
Date:
On Tue, Jun 28, 2011 at 16:39, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Magnus Hagander <magnus@hagander.net> writes:
>> We discussed earlier to potentially block the creation, and removal,
>> of branches on the origin server, to prevent mistakes like this. It
>> has only happened once in almost a year, so it's probably not
>> necessary - but I wanted to raise the option anyway in case people
>> forgot about it.
>
>> The downside would be that in order to create or drop a branch *when
>> intended* a committer would need someone from the infrastructure team
>> to temporarily switch off the branch-blocking setting, and then back
>> on..
>
> I think it would be sensible to block branch removal, as there's
> basically never a scenario where we'd do that during current usage.
> I'm not excited about blocking branch addition, although I worry
> sooner or later somebody will accidentally push a private development
> branch :-(.  Is it possible to block only removal and not addition?

Yes, I think so. Either way it'll require a small addition to the
scripts we're using, so I'll try to just turn it into two different
settings. I don't see offhand any reason why this shouldn't work.


--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


Re: [COMMITTERS] pgsql: Branch refs/heads/REL9_1_STABLE was removed

From
Andrew Dunstan
Date:

On 06/28/2011 10:39 AM, Tom Lane wrote:
> Magnus Hagander<magnus@hagander.net>  writes:
>> We discussed earlier to potentially block the creation, and removal,
>> of branches on the origin server, to prevent mistakes like this. It
>> has only happened once in almost a year, so it's probably not
>> necessary - but I wanted to raise the option anyway in case people
>> forgot about it.
>> The downside would be that in order to create or drop a branch *when
>> intended* a committer would need someone from the infrastructure team
>> to temporarily switch off the branch-blocking setting, and then back
>> on..
> I think it would be sensible to block branch removal, as there's
> basically never a scenario where we'd do that during current usage.
> I'm not excited about blocking branch addition, although I worry
> sooner or later somebody will accidentally push a private development
> branch :-(.  Is it possible to block only removal and not addition?
>
>             

+1. Spurious branch addition shouldn't cause us much pain - we'd just 
remove the new branch. Unwanted deletion is more disruptive.

cheers

andrew


Re: [COMMITTERS] pgsql: Branch refs/heads/REL9_1_STABLE was removed

From
Robert Haas
Date:
On Tue, Jun 28, 2011 at 11:05 AM, Andrew Dunstan <andrew@dunslane.net> wrote:
> +1. Spurious branch addition shouldn't cause us much pain - we'd just remove
> the new branch. Unwanted deletion is more disruptive.

How about if we allow addition only of branches matching
/^REL_[0-9_]+_STABLE$/ and disallow deletion of all branches?  That
seems like it'd allow the one operation we will likely want to do with
any regularity (creating a new release branch once a year) without
going through hoops, while disallowing most of the problem cases.

The problem with allowing people to create branches and not remove
them is that someone might push a private branch and not be able to
get rid of it.  But if we only allow creation of branches that look
like the branches that are supposed to be there, then that shouldn't
be a danger.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [COMMITTERS] pgsql: Branch refs/heads/REL9_1_STABLE was removed

From
Tom Lane
Date:
Robert Haas <robertmhaas@gmail.com> writes:
> How about if we allow addition only of branches matching
> /^REL_[0-9_]+_STABLE$/ and disallow deletion of all branches?

+1, if feasible.
        regards, tom lane


Re: [COMMITTERS] pgsql: Branch refs/heads/REL9_1_STABLE was removed

From
Magnus Hagander
Date:
<p><br /> On Jun 28, 2011 6:29 PM, "Tom Lane" <<a href="mailto:tgl@sss.pgh.pa.us">tgl@sss.pgh.pa.us</a>>
wrote:<br/> ><br /> > Robert Haas <<a href="mailto:robertmhaas@gmail.com">robertmhaas@gmail.com</a>>
writes:<br/> > > How about if we allow addition only of branches matching<br /> > > /^REL_[0-9_]+_STABLE$/
anddisallow deletion of all branches?<br /> ><br /> > +1, if feasible.<br /> ><p>Pretty sure that's just a
SmallMatter Of Programming. I'll give it a try. <p>/Magnus <br /> 

Re: [COMMITTERS] pgsql: Branch refs/heads/REL9_1_STABLE was removed

From
Alvaro Herrera
Date:
Excerpts from Tom Lane's message of mar jun 28 10:39:22 -0400 2011:

> I think it would be sensible to block branch removal, as there's
> basically never a scenario where we'd do that during current usage.
> I'm not excited about blocking branch addition, although I worry
> sooner or later somebody will accidentally push a private development
> branch :-(.  Is it possible to block only removal and not addition?

If we can tweak the thing, how about we only allow creating branches
that match a certain pattern, say ^REL_\d+_\d+_STABLE$?

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


Re: [COMMITTERS] pgsql: Branch refs/heads/REL9_1_STABLE was removed

From
Magnus Hagander
Date:
On Tue, Jun 28, 2011 at 19:45, Alvaro Herrera
<alvherre@commandprompt.com> wrote:
> Excerpts from Tom Lane's message of mar jun 28 10:39:22 -0400 2011:
>
>> I think it would be sensible to block branch removal, as there's
>> basically never a scenario where we'd do that during current usage.
>> I'm not excited about blocking branch addition, although I worry
>> sooner or later somebody will accidentally push a private development
>> branch :-(.  Is it possible to block only removal and not addition?
>
> If we can tweak the thing, how about we only allow creating branches
> that match a certain pattern, say ^REL_\d+_\d+_STABLE$?

I've put this in place - except I used ^REL\d+... and not what you
suggested, since that's how we name our branches :P

I'm going to push an actual valid branch, let's say 9.7, and then
remove it again, just to make sure things worked (with it installed I
cannot push an invalid branch, so i can't test the branch removal
block). So don't panic if you see that one :)

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


Re: [COMMITTERS] pgsql: Branch refs/heads/REL9_1_STABLE was removed

From
Magnus Hagander
Date:
On Wed, Jun 29, 2011 at 16:30, Magnus Hagander <magnus@hagander.net> wrote:
> On Tue, Jun 28, 2011 at 19:45, Alvaro Herrera
> <alvherre@commandprompt.com> wrote:
>> Excerpts from Tom Lane's message of mar jun 28 10:39:22 -0400 2011:
>>
>>> I think it would be sensible to block branch removal, as there's
>>> basically never a scenario where we'd do that during current usage.
>>> I'm not excited about blocking branch addition, although I worry
>>> sooner or later somebody will accidentally push a private development
>>> branch :-(.  Is it possible to block only removal and not addition?
>>
>> If we can tweak the thing, how about we only allow creating branches
>> that match a certain pattern, say ^REL_\d+_\d+_STABLE$?
>
> I've put this in place - except I used ^REL\d+... and not what you
> suggested, since that's how we name our branches :P
>
> I'm going to push an actual valid branch, let's say 9.7, and then
> remove it again, just to make sure things worked (with it installed I
> cannot push an invalid branch, so i can't test the branch removal
> block). So don't panic if you see that one :)

Ok, I'm done experimenting and this is now in production.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


Re: [COMMITTERS] pgsql: Branch refs/heads/REL9_1_STABLE was removed

From
Alvaro Herrera
Date:
Excerpts from Magnus Hagander's message of mié jun 29 10:30:51 -0400 2011:
> On Tue, Jun 28, 2011 at 19:45, Alvaro Herrera
> <alvherre@commandprompt.com> wrote:
> > Excerpts from Tom Lane's message of mar jun 28 10:39:22 -0400 2011:
> >
> >> I think it would be sensible to block branch removal, as there's
> >> basically never a scenario where we'd do that during current usage.
> >> I'm not excited about blocking branch addition, although I worry
> >> sooner or later somebody will accidentally push a private development
> >> branch :-(.  Is it possible to block only removal and not addition?
> >
> > If we can tweak the thing, how about we only allow creating branches
> > that match a certain pattern, say ^REL_\d+_\d+_STABLE$?
> 
> I've put this in place - except I used ^REL\d+... and not what you
> suggested, since that's how we name our branches :P

Hah!  It took me a while to notice the difference :-D

Thanks!  I know I feel safer with this in place :-P

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


Re: [COMMITTERS] pgsql: Branch refs/heads/REL9_1_STABLE was removed

From
Michael Paquier
Date:

On Thu, Jun 30, 2011 at 12:03 AM, Alvaro Herrera <alvherre@commandprompt.com> wrote:
Excerpts from Magnus Hagander's message of mié jun 29 10:30:51 -0400 2011:
> On Tue, Jun 28, 2011 at 19:45, Alvaro Herrera
> <alvherre@commandprompt.com> wrote:
> > Excerpts from Tom Lane's message of mar jun 28 10:39:22 -0400 2011:
> >
> >> I think it would be sensible to block branch removal, as there's
> >> basically never a scenario where we'd do that during current usage.
> >> I'm not excited about blocking branch addition, although I worry
> >> sooner or later somebody will accidentally push a private development
> >> branch :-(.  Is it possible to block only removal and not addition?
> >
> > If we can tweak the thing, how about we only allow creating branches
> > that match a certain pattern, say ^REL_\d+_\d+_STABLE$?
>
> I've put this in place - except I used ^REL\d+... and not what you
> suggested, since that's how we name our branches :P
Thanks, +10.
This is cool and will avoid for sure future problems.

--
Michael Paquier
http://michael.otacoo.com