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

Fix upgrading task in task #679

Merged
merged 12 commits into from
Sep 6, 2024
Merged

Fix upgrading task in task #679

merged 12 commits into from
Sep 6, 2024

Conversation

deviantintegral
Copy link
Member

@deviantintegral deviantintegral commented Sep 3, 2024

This will fix this error when upgrading task originally reported at #164

[drupal:composer:development] 🪠 [Drainpipe] vendor/lullabot/drainpipe/scaffold/env/dotenv.php' missing from autoload-dev files
[drupal:composer:development] 🪠 [Drainpipe] vendor/lullabot/drainpipe/scaffold/env/dotenv.php' missing from autoload-dev files
[drupal:composer:development] Using cached version of task v3.38.0 (30d3c727a434ee3bf69fb69e5d1aa84c3ab401fc2343a2760b4c7808acc689b8)
[drupal:composer:development]
[drupal:composer:development] In Filesystem.php line 372:
[drupal:composer:development]
[drupal:composer:development]   copy(/var/www/html/vendor/bin/task): Failed to open stream: Text file busy
[drupal:composer:development]
[drupal:composer:development]

$fs->copy($cacheExtractedBinary, $binDestination);

We need to add a remove() call before the copy, so the task binary can be replaced if it is still in use by a process.

Here's a test that should hopefully fail and reproduce this issue: https://github.com/Lullabot/drainpipe/actions/runs/10692591483/job/29641292997

image

Comment on lines 82 to 87
cd test/fixtures/drainpipe-task-upgrade
ddev start
ddev composer install
ddev task drupal:composer:development
cp composer-upgraded.lock composer.lock
ddev task drupal:composer:development
Copy link
Member Author

Choose a reason for hiding this comment

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

@justafish I wonder if we should consider pulling in bats for testing, which is what ddev uses and is pretty nice for "shell as tests".

@github-actions github-actions bot temporarily deployed to pantheon-pr-679 September 4, 2024 00:00 Destroyed
@github-actions github-actions bot temporarily deployed to pantheon-pr-679 September 4, 2024 00:03 Destroyed
@github-actions github-actions bot temporarily deployed to pantheon-pr-679 September 4, 2024 00:10 Destroyed
@github-actions github-actions bot temporarily deployed to pantheon-pr-679 September 4, 2024 00:14 Destroyed
@github-actions github-actions bot temporarily deployed to pantheon-pr-679 September 4, 2024 11:53 Destroyed
@github-actions github-actions bot temporarily deployed to pantheon-pr-679 September 4, 2024 11:57 Destroyed
@github-actions github-actions bot temporarily deployed to pantheon-pr-679 September 4, 2024 12:17 Destroyed
@deviantintegral deviantintegral marked this pull request as ready for review September 4, 2024 12:54
# Composer won't run updated plugin code until after its been
# installed. Once we have two new releases after 3.11.0, that upgrade
# task, we can remove this double call.
ddev task drupal:composer:development || ddev task drupal:composer:development
Copy link
Member

Choose a reason for hiding this comment

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

Clever!

@justafish
Copy link
Member

nice one 👍

@justafish justafish merged commit 9a24bfc into main Sep 6, 2024
53 checks passed
@justafish justafish deleted the fix-upgrading-task-in-task branch September 6, 2024 14:21
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.

3 participants