Skip to content

add ability to make branches publish by default #596

Closed
smcv opened this Issue Feb 17, 2014 · 5 comments

2 participants

@smcv
smcv commented Feb 17, 2014

I'm using an instance of OBS where a small team branch and edit packages.

At the moment, OBS has the following behaviour:

  • when smcv branches project/package, if home:smcv:branches:project doesn't exist, create it
  • if home:smcv:branches:project is created like this, explicitly turn off publishing for it, even if it's enabled for project

darix explained on IRC that this is deliberate, to save space and bandwidth on public OBS instances. However, our OBS deployment is small, and it's much more convenient for a developer's test machine to be able to add the apt source for home:smcv:branches:project and get packages that way.

Exacerbating that, if I only have one package left in my branch, I submit it back to the main project, and my request is accepted, the "cleanup" code in OBS (which is enabled by default) will delete home:smcv:branches:project and not just home:smcv:branches:project/package, which means that if I've explicitly enabled publishing, I lose that setting. This can be worked around by creating a dummy package obs-please-do-not-delete-this (or something) in the branch.

Here's what I'm trying to do about the first thing:

  • add CONFIG['publish_branches'] to the API's configuration, defaulting to "disable"
  • take a publish parameter from the HTTP request, defaulting to CONFIG['publish_branches']
  • if publish is "enable", forcibly enable publishing
  • if publish is "inherit", copy publishing flags from project
  • modify osc branch to give it --publish and --no-publish options

and about the second:

  • confirm how developers who want it can have the effect of osc sr --no-cleanup all the time by editing ~/.oscrc
  • perhaps add a config option for "remove a branch project when its last package is cleaned up?", defaulting to true - I don't think this needs per-SR overrides, since developers can already use --no-cleanup

I don't really know Ruby so please bear with me :-)

@adrianschroeter
The openSUSE Project member
@smcv
smcv commented Feb 17, 2014

it should not be a CONFIG setting in options.yml anymore, but a setting in the /configuration api and database. Check for the "default_access_disabled" there as an example.

Thanks, I'll do that.

Maybe we should have there three settings:

  • on: by default no publishes
  • off: by default publishing
  • default: current default, on by default, but not for :branches: projects.

If you like. I'll look into that.

there is an open FATE request for an option to take over defaults from a linked project for flags. Maybe this should be implemented instead.

Sorry, I'm not familiar with FATE. Link, please?

The current behaviour seems to be that when I branch a project P, my branch already gets all of P's flags, except for three specific exceptions: build (always on), publish (currently always off but I want to change that), and lock (always off so that packages can be created in the branch). As far as I know, all I'm trying to do is alter the publish special case?

hm, I am not too happy about such options, we do cleanups on purpose :) But if it is really absolute needed for some people ...

Well, if you've reconfigured your branch project (perhaps to publish everything when it isn't the default, or to only build for x86-64 and skip slower architectures, or to build with different optimization, or whatever else), it seems bad to lose that configuration as a side-effect of getting all the packages on your to-do list merged back into the parent distribution :-)

I can see that relatively aggressive cleanup is needed if you have 38k developers like build.opensuse.org does, but they seem like overkill for teams of < 10.

@adrianschroeter
The openSUSE Project member
@smcv
smcv commented Feb 18, 2014

Maybe we should have there three settings:

  • on: by default no publishes
  • off: by default publishing
  • default: current default, on by default, but not for :branches: projects.

I'm not sure how much sense that makes: if the parent project has publishing turned off (although it's not clear to me why that would happen), we probably don't want to be explicitly turning it on? I think the most sensible settings are "branches are published if their parent project was" and "branches are unpublished".

I was trying to avoid the configuration option being called disable_publish_for_branches or something, because double negatives are confusing... but perhaps that's what would make most sense. (d_p_f_b = on (default): explicitly disable publishing for branches; d_p_f_b = off: let the publishing flag propagate from the project that's being branched. Or something.)

https://features.opensuse.org/315077

Sorry, I don't know enough about OBS internals to understand that feature request...

@smcv smcv added a commit to smcv/open-build-service that referenced this issue Feb 18, 2014
@smcv smcv cleanup_empty_projects: add new configuration option
Normally, if a submit request is accepted and results in cleaning up
the last package in a branched project, the branched project is
deleted too. This is annoying if the branched project is a long-running
branch (e.g. for a developer in a small team) and has been reconfigured,
for instance to turn on publishing in installations where branches do
not normally have publishing.

Bug: openSUSE#596
ad8004f
@smcv smcv added a commit to smcv/open-build-service that referenced this issue Feb 19, 2014
@smcv smcv cleanup_empty_projects: add new configuration option
Normally, if a submit request is accepted and results in cleaning up
the last package in a branched project, the branched project is
deleted too. This is annoying if the branched project is a long-running
branch (e.g. for a developer in a small team) and has been reconfigured,
for instance to turn on publishing in installations where branches do
not normally have publishing.

Bug: openSUSE#596
dac466e
@smcv smcv added a commit to smcv/open-build-service that referenced this issue Feb 19, 2014
@smcv smcv disable_publish_for_branches: new configuration option
OBS currently disables publishing for any new branch in order to avoid
using disk space and bandwidth to carry out publishing. For small private
installations, it can make sense to avoid that, and inherit the publish
flags from the parent project instead.

Bug: openSUSE#596
941a39c
@smcv smcv added a commit to smcv/open-build-service that referenced this issue Feb 19, 2014
@smcv smcv cleanup_empty_projects: add new configuration option
Normally, if a submit request is accepted and results in cleaning up
the last package in a branched project, the branched project is
deleted too. This is annoying if the branched project is a long-running
branch (e.g. for a developer in a small team) and has been reconfigured,
for instance to turn on publishing in installations where branches do
not normally have publishing.

Bug: openSUSE#596
a1f3bb2
@smcv smcv added a commit to smcv/open-build-service that referenced this issue Feb 19, 2014
@smcv smcv disable_publish_for_branches: new configuration option
OBS currently disables publishing for any new branch in order to avoid
using disk space and bandwidth to carry out publishing. For small private
installations, it can make sense to avoid that, and inherit the publish
flags from the parent project instead.

Bug: openSUSE#596
0f508c3
@smcv
smcv commented Feb 19, 2014

perhaps add a config option for "remove a branch project when its last package is cleaned up?", defaulting to true

Implemented, using the database-backed configuration.

I was trying to avoid the configuration option being called disable_publish_for_branches or something, because double negatives are confusing... but perhaps that's what would make most sense.

Also implemented.

take a publish parameter from the HTTP request

Not yet.

please note that I will also request a test case when you submit such a feature

I just about understand enough Ruby/Rails to do the features in the first place, but the test-cases are something of a mystery to me, so I've only done manual testing so far.

@adrianschroeter adrianschroeter added a commit that referenced this issue Feb 21, 2014
@smcv smcv cleanup_empty_projects: add new configuration option
Normally, if a submit request is accepted and results in cleaning up
the last package in a branched project, the branched project is
deleted too. This is annoying if the branched project is a long-running
branch (e.g. for a developer in a small team) and has been reconfigured,
for instance to turn on publishing in installations where branches do
not normally have publishing.

Bug: #596
18ef82c
@adrianschroeter adrianschroeter added a commit that referenced this issue Feb 21, 2014
@smcv smcv disable_publish_for_branches: new configuration option
OBS currently disables publishing for any new branch in order to avoid
using disk space and bandwidth to carry out publishing. For small private
installations, it can make sense to avoid that, and inherit the publish
flags from the parent project instead.

Bug: #596
7580add
@dbnicholson dbnicholson pushed a commit to dbnicholson/open-build-service that referenced this issue Jan 11, 2016
@smcv smcv cleanup_empty_projects: add new configuration option
Normally, if a submit request is accepted and results in cleaning up
the last package in a branched project, the branched project is
deleted too. This is annoying if the branched project is a long-running
branch (e.g. for a developer in a small team) and has been reconfigured,
for instance to turn on publishing in installations where branches do
not normally have publishing.

This is a backport to our 2.3.8-based OBS; the patches I've sent
upstream are rather different, because the way OBS deals with
configuration has changed significantly.

Bug: openSUSE/open-build-service#596
Applied-upstream: no
89e0934
@dbnicholson dbnicholson pushed a commit to dbnicholson/open-build-service that referenced this issue Jan 11, 2016
@smcv smcv disable_publish_for_branches: new configuration option
OBS currently disables publishing for any new branch in order to avoid
using disk space and bandwidth to carry out publishing. For small private
installations, it can make sense to avoid that, and inherit the publish
flags from the parent project instead.

This is a backport to our 2.3.8-based OBS; the patches I've sent
upstream are rather different, because the way OBS deals with
configuration has changed significantly.

Bug: openSUSE/open-build-service#596
Applied-upstream: no
28702ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.