openSUSE / osc

The Command Line Interface to work with an Open Build Service
http://openbuildservice.org/
GNU General Public License v2.0
169 stars 182 forks source link

Feature: osc branch --no-linked-packages #217

Open afaerber opened 8 years ago

afaerber commented 8 years ago

By default, branching packages with many .spec files - such as binutils or gccX or u-boot or JeOS - will create dozens of linked packages in the branch project, which start building immediately. Often that is not desired and leads to wasted build power and people avoiding branches and committing directly, maybe even without testing.

I would like to have a new command line option for osc branch please, to enforce that only the package I specify gets created.

So that if I were to run osc branch --no-linked-packages devel:gcc gcc6 home:a_faerber:foo I would only get one gcc6 package and no gcc6-testresults or cross-aarch64-gcc6 or libffi-gcc6. Currently I need to clean up packages after branching:

proj=home:a_faerber:foo
for p in `osc ls ${proj} | grep -e -gcc6` gcc6-testresults; do
  osc rdelete ${proj} $p -m "Drop unneeded _link"
done

Another consideration might be an attribute on the package that osc branch honors by default. openSUSE:Factory:ARM/JeOS would be a candidate for defaulting to not creating all the links.

marcus-h commented 8 years ago

On 2016-07-31 10:45:06 -0700, Andreas Färber wrote:

By default, branching packages with many .spec files - such as binutils or gccX or u-boot or JeOS - will create dozens of linked packages in the branch project, which start building immediately. Often that is not desired and leads to wasted build power and people avoiding branches and committing directly, maybe even without testing.

I would like to have a new command line option for osc branch please, to enforce that only the package I specify gets created.

Hmm yes that makes sense... actually I was a bit suprised about the default behavior:) Currently the api automatically creates all these linked packages (extend_packages_to_link in helpers/branch_package.rb). So we need to add a new parameter to the api first.

afaerber commented 8 years ago

Will you track that on the OBS side yourself or should I create a mirror issue there? I assume an API change can come with OBS 2.8 earliest?

marcus-h commented 8 years ago

On 2016-08-01 11:47:48 -0700, Andreas Färber wrote:

Will you track that on the OBS side yourself or should I create a mirror issue there?

I'll try to have a look at it tomorrow.

I assume an API change can come with OBS 2.8 earliest?

Yes, but api.o.o is usually running a recent git snapshot.

If you need a quick workaround, it should be possible to write a small osc plugin that cleans up the superfluous packages after the branch... (similar to your shell script).