symplify / monorepo-builder

Composer tools to maintain a monorepo

Home Page:https://www.tomasvotruba.cz/blog/2019/02/18/how-we-automated-shopsys-packages-release-from-2-days-to-1-console-command/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Forcing release workers by default might not suit every use case

tobalsan opened this issue · comments

Hi Tomas

in a recent update, the PushTagReleaseWorker and TagVersionReleaseWorker release workers are now always included by default in the release process.

In our company, we have a custom release process which requires us to create custom release workers, two of them that fill the role of the default release workers, amongst other things.
It was working well prior the update, but now the two default release worker try to do their thing, which causes some conflict (one of our release workers takes care of creating the local tag, which the TagVersionReleaseWorker also tries to do).

What would be the most elegant way to disable this behavior?

Thanks for your help.

Hi

I have a similar issue. I'm using git-flow to create releases and I need to perform all release workers except Push and Tag, which are actually handled by git flow release finish xxxx command.

Thanks

I think main issue is that default config.php is appended to MonorepoKernel configFiles instead of being preprended:

https://github.com/symplify/monorepo-builder/blob/main/src/Kernel/MonorepoBuilderKernel.php#L20

Then all config found in use monorepo-builder.php is overriden by https://github.com/symplify/monorepo-builder/blob/main/config/config.php. So this is the same issue if you need to use $mbConfig->packageDirectoriesExcludes(); method in your project.

Thank you for feedback, this makes sense to revert then 👍

Could you send PR?

It is the same issue on https://github.com/symplify/symplify-kernel package.

# src/Kernel/MonorepoBuilderKernel.php
// Always prepend default config files
$configFiles = array_merge(
    [
        ConsoleColorDiffConfig::FILE_PATH,
        __DIR__ . '/../../config/config.php',
    ],
    $configFiles,
);
# vendor/symplify/symplify-kernel/src/HttpKernel/AbstractSymplifyKernel.php
// Always prepend default config files
$configFiles = array_merge(
  [
      SymplifyKernelConfig::FILE_PATH,
  ],
  $configFiles,
);

That seems like playing with Symfony magic.
Instead, those default workes should be removed.

@TomasVotruba I don't understand what do you mean by

those default workes should be removed

For the moment, configuration order does matter because we cannot override default release workers or excluded folders defined in https://github.com/symplify/monorepo-builder/blob/main/config/config.php

Then it seems there are 2 separate issues. This one is about default registered workers.