joachim-n / dorgflow

Automated git workflow for drupal.org patches.
69 stars 10 forks source link

Not working as expected on big issues #32

Open chrfritsch opened 6 years ago

chrfritsch commented 6 years ago

Today I am trying out drogflow the first time. I used it a few times for new or smaller issues and it looked really nice.

Wehn I started to use it with https://www.drupal.org/project/drupal/issues/2831944 my branch is completely broken. I assume it's because of not applying patches.

$ dorgflow https://www.drupal.org/project/drupal/issues/2831944 Hello, this is Dorgflow! Detected master branch 8.6.x. Fetching node 2831944 from drupal.org. Created feature branch 2831944-Implement-media-source-plugin-for-remote-video-via-oEmbed. Patch 2831944_4.patch did not apply. Patch 2831944-10.patch did not apply. Patch 2831944-26.patch did not apply. Patch 2831944-30.patch did not apply. Patch 2831944-31.patch did not apply. Patch 2831944-32.patch did not apply. Patch 2831944-34.patch did not apply. Patch 2831944-36.patch did not apply. Patch 2831944-37.patch did not apply. Patch 2831944-40.patch did not apply. Patch 2831944-42.patch did not apply. Patch 2831944-51.patch did not apply. Patch 2831944-58.patch did not apply. Patch 2831944-60.patch did not apply. Patch 2831944-63.patch did not apply. Patch 2831944-64.patch did not apply. Patch 2831944-65.patch did not apply. Patch 2831944-67.patch did not apply. Patch 2831944-68.patch did not apply. Patch 2831944-71.patch did not apply. Patch 2831944-73.patch did not apply. Applied and committed patch 2831944-87.patch. Applied and committed patch 2831944-91.patch. Applied and committed patch 2831944-92.patch. Applied and committed patch 2831944-95.patch. Applied and committed patch 2831944-98.patch. Applied and committed patch 2831944-103.patch. Applied and committed patch 2831944-113.patch. Applied and committed patch 2831944-115.patch. Applied and committed patch 2831944-116.patch. Applied and committed patch 2831944-119.patch. Applied and committed patch 2831944-120.patch. Applied and committed patch 2831944-123.patch.

joachim-n commented 6 years ago

The output looks ok to me -- earlier patches don't apply and are skipped, and the more recent patches apply and get committed.

Can you output your branch's log?

chrfritsch commented 6 years ago

So first it looks to me that renamed or removed files are still on the filesystem:

On branch 2831944-Implement-media-source-plugin-for-remote-video-via-oEmbed
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    core/modules/media/src/OEmbed/
    core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php
    core/modules/media/src/Plugin/Validation/
    core/modules/media/src/Plugin/media/Source/OEmbed.php
    core/modules/media/src/Plugin/media/Source/OEmbedDeriver.php
    core/modules/media/tests/src/Functional/FieldFormatter/
    core/modules/media/tests/src/Functional/OEmbedProviderDiscoveryTest.php
    core/modules/media/tests/src/Functional/OEmbedTest.php
    core/modules/media/tests/src/FunctionalJavascript/MediaSourceRemoteVideoTest.php
    core/profiles/standard/config/optional/core.entity_form_display.media.remote_video.default.yml
    core/profiles/standard/config/optional/core.entity_view_display.media.remote_video.default.yml
    core/profiles/standard/config/optional/field.field.media.remote_video.field_media_oembed_remote_video.yml
    core/profiles/standard/config/optional/field.storage.media.field_media_oembed_remote_video.yml
    core/profiles/standard/config/optional/media.type.remote_video.yml

Second, it seems that not everything was correctly applied, because for example the media.services.yml looks now like this:

services:
  plugin.manager.media.source:
    class: Drupal\media\MediaSourceManager
    parent: default_plugin_manager

  access_check.media.revision:
    class: Drupal\media\Access\MediaRevisionAccessCheck
    arguments: ['@entity_type.manager']
    tags:
      - { name: access_check, applies_to: _access_media_revision }

but in the latest patch we have this block

diff --git a/core/modules/media/media.services.yml b/core/modules/media/media.services.yml
index f22f90a124..395294214e 100644
--- a/core/modules/media/media.services.yml
+++ b/core/modules/media/media.services.yml
@@ -2,9 +2,17 @@ services:
   plugin.manager.media.source:
     class: Drupal\media\MediaSourceManager
     parent: default_plugin_manager
-
   access_check.media.revision:
     class: Drupal\media\Access\MediaRevisionAccessCheck
     arguments: ['@entity_type.manager']
     tags:
       - { name: access_check, applies_to: _access_media_revision }
+  media.oembed_manager:
+    class: Drupal\media\OEmbed\OEmbedManager
+    arguments: ['@media.oembed.provider_collector', '@media.oembed.resource_fetcher', '@http_client', '@module_handler', '@cache.default']
+  media.oembed.provider_collector:
+    class: Drupal\media\OEmbed\ProviderCollector
+    arguments: ['@http_client', 'https://oembed.com/providers.json', '@datetime.time', '@cache.default']
+  media.oembed.resource_fetcher:
+    class: Drupal\media\OEmbed\ResourceFetcher
+    arguments: ['@http_client', '@cache.default']
joachim-n commented 6 years ago

The technique for applying successive patches doesn't work properly if files are added, unfortunately. (I should document that, sorry!)

Best thing to workaround is to update the d.org issue to hide all the old patches that are no longer relevant.