If a patch or something else cannot be applied, do not automatically redirect to the instance

Created on 20 September 2023, 9 months ago
Updated 8 January 2024, 6 months ago

Problem/Motivation

I attempted to apply a patch using the incorrect URL. The patch reasonably failed to apply. However, I did not get to see the error message because the process automatically redirects to the test instance whether or not there was an error.

Steps to reproduce

1. Go to https://simplytest.me/
2. In the field Evaluate Drupal Projects, type Drupal
3. Choose Drupal core
4. Accept 10.1.3 (or whatever the latest version offered is) as the default
5. Click Advanced options
6. In the field Add patches on the chosen project, paste the (incorrect) URL https://git.drupalcode.org/issue/drupal-3273986/-/commit/7bd5d37bb692615...
7. Click Launch sandbox

Expected results:

  • Once the build has gone through its procedure, I get a message that there has been an error and to examine the error log.
  • The page does not automatically redirect.
  • There is a button for me to go to the instance in the event that I want to continue anyway despite the error.

Actual results:

  • There is no message to call out the fact that there was an error during the build.
  • Once the build has gone through its procedure, I get a message that I will be redirected. The message is on a green background, which implies that the build was fully successful.
  • I do not have time to read the build log before a redirect occurs.
  • I get redirected without having seen the error.
  • I have to suss out from the build behavior that my patch was not applied.

Attempted workaround once I realized that the requested patch had not been applied:

8. Go back to the build page.

The first time I tried this, the site actually redid the redirect without giving me time to look at the build log.
I was successful on the second attempt and discovered the following message in the build log:

- Applying patches for drupal/core
https://git.drupalcode.org/issue/drupal-3273986/-/commit/7bd5d37bb692615... (STM patch 7bd5d37bb6926152fd9cca21cc565824e6b034f2)
Could not apply patch! Skipping. The error was: Cannot apply patch https://git.drupalcode.org/issue/drupal-3273986/-/commit/7bd5d37bb692615...

Proposed resolution

  • Check for errors and don't do the redirect if there is an error.
  • Display a message to examine the build log for errors.
  • Provide a button to proceed to the test instance.

Remaining tasks

User interface changes

  • If there is an error, display a message to examine the build log for errors.
  • Provide a button to proceed to the test instance.

API changes

Data model changes

🐛 Bug report
Status

Active

Version

4.0

Component

User interface

Created by

🇺🇸United States Charles Belov San Francisco, CA, US

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Charles Belov
  • 🇺🇸United States Charles Belov San Francisco, CA, US
  • 🇮🇳India abhisekmazumdar India

    I can confirm that the said issue exists and applying the patch is skipped.

    https://git.drupalcode.org/issue/drupal-3273986/-/commit/7bd5d37bb6926152fd9cca21cc565824e6b034f2 (STM patch 7bd5d37bb6926152fd9cca21cc565824e6b034f2)
    Could not apply patch! Skipping. The error was: Cannot apply patch https://git.drupalcode.org/issue/drupal-3273986/-/commit/7bd5d37bb6926152fd9cca21cc565824e6b034f2
    

    A high-level analysis from my side:

    I assume while creating a new site the cweagans/composer-patches has a default value for composer-exit-on-patch-failure as false. We will need to add composer-exit-on-patch-failure as true to the composer.json for the newly created site.
    https://github.com/cweagans/composer-patches/tree/1.7.3?tab=readme-ov-fi...

  • 🇮🇳India abhisekmazumdar India

    I gave some more thinking to it and believe it's acceptable to skip and proceed with the site installation process. We have already virtually created the site, and at this point(composer is installing the dependency.).

    However, I agree that the skipped patch error should be emphasized more. I'm unsure if it's possible or if the project maintainers are open to achieving this.

Production build 0.69.0 2024