Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISAICP-6036: Remove circular dependency - Move Drupal commands outside the repo. #150

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

idimopoulos
Copy link
Contributor

@idimopoulos idimopoulos commented Mar 4, 2021

ISAICP-6036

Description

In ISAICP-6037, the changelog command was split off from the repo and now resides in openeuropa/task-runner-changelog - called changelog from now on. As it is normal, since the changelog repo has a dependency towards the task-runner repo since it contains a fraction of the code and is not usable without the later.
However, for BC purposes, and in order to not disturb the workflow of the current projects, a second dependency was added from the task-runner repo towards the changelog repo.
This is causing a major problem for the development. Currently, task-runner requires ^1.0 from changelog and changelog requires dev-master from task-runner.
Before proceeding to the main problem, I think that changing the version dependency in both repos to "*" is not a solution as it might cause issues later in some project.

The main problem is when attempting to develop. While circular dependencies in composer are resolvable, it locks both packages in a specific version. Even if one of the repos has a dependency version of "*" towards the other, the package is still unable to be developed.
The below table will make it clear-er.

changelog ver. req. in task-runner task-runner ver. req. in changelog Problem
^1.0 (current) dev-master (current) Both repos are unworkable. Let's say I work in task-runner. I create a branch BLAH-001 for my BLAH project. I run composer install. My BLAH-001 requires "changelog": "^1.0" but that repo requires "task-runner": "dev-master" and I just checked out BLAH-001. Composer breaks as there are no candidates to be installed.
^1.0 (current) * The same problem as above but only if I am working on changelog. task-runner works fine since changelog does not care about the version
* (current) dev-master (current) Same problem as above but for the task-runner repo this time.
* * Both repos are workable but compatibility breaks between the packages are not trackable and might break unexpectedly.

The problem becomes heavier with the introduction of our ISAICP-6036 and the #130 which requires Drupal commands to be moved outside and have the same circular dependency. Without "*" in both repos, packages cannot be worked at all as circular dependencies do not allow the creation of new branches.

Change log

  • Changed: Drupal commands moved to an external repo.
  • Removed: Drupal commands in task-runner.

@idimopoulos idimopoulos changed the title ISAICP-6036: Remove circular dependency. ISAICP-6036: Remove circular dependency - Move Drupal commands outside the repo. Mar 4, 2021
@@ -1,21 +0,0 @@
<?php
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removal of this file breaks BC as ec-europa/toolkit uses this trait in \EcEuropa\Toolkit\TaskRunner\Commands\InstallCommands

*
* phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
*/
trait loadTasks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...but it should:

  • use the \OpenEuropa\TaskRunnerDrupal\Tasks\Drush\loadTasks trait,
  • remove the method as now is inherited from \OpenEuropa\TaskRunnerDrupal\Tasks\Drush\loadTasks,
  • Add a deprecation error trigger (see Drupal deprecation policies on how to...)

*
* @return \Robo\Collection\CollectionBuilder
*/
public function settingsSetup(array $options = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting this class, breaks Toolkit's \EcEuropa\Toolkit\TaskRunner\Commands\DrupalCommands.

From #131, bullet 4:

Keep the drupal:settings-setup as default command, so that is guaranteed that Toolkit can override it as it does now but remove the command body and replace it with a call to the openeuropa/task-runner-drupal method.

It seems that this requirement hasn't been honoured. We should keep this command, but deprecate it, triggering the appropriate muted error and adding the deprecation label, as per #131, bullet 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants