Skip to content

Commit

Permalink
DP-16759: Resolve issue with cache tags not being cleared at end of r…
Browse files Browse the repository at this point in the history
…elease (#43)

* DP-16759: Downgrade Drush to 9 (#41)

* DP-16759: Downgrade Drush to 9

* Resolve PHPCS warning that came out of nowhere

* Backport cache:tags command for temporary use

* Add changelog

* Move to a class without a validation handler

* Extend DrushCommands
  • Loading branch information
rbayliss authored and Youssef Riahi committed Dec 12, 2019
1 parent c1a26a6 commit e69889c
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 0 deletions.
33 changes: 33 additions & 0 deletions changelogs/DP-16759-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Write your changelog entry here. Every PR must have a changelog.
#
# You can use the following types:
# Added: For new features.
# Changed: For changes to existing functionality.
# Deprecated: For soon-to-be removed features.
# Removed: For removed features.
# Fixed: For any bug fixes.
# Security: In case of vulnerabilities.
#
# The format is crucial. Please follow the examples below exactly. For reference, the requirements are:
# * All 3 parts are required: you must include type, description, and issue.
# * Type must be left aligned and followed by a colon.
# * Description must be indented 2 spaces.
# * Issue must be indented 4 spaces.
# * Issue should include just the Jira ticket number, not a URL.
# * No extra spaces, indents, or blank lines are allowed.
#
# Fixed:
# - description: Fixes scrolling on edit pages in Safari.
# issue: DP-13314
#
# You may add more than 1 description & issue for each type. Use the following format:
# Changed:
# - description: Automating the release branch.
# issue: DP-10166
# - description: Second change item that needs a description.
# issue: DP-19875
# - description: Third change item that needs a description along with an issue.
# issue: DP-19843
Fixed:
- description: ma:deploy erroring during cache clearing
issue: DP-16759
33 changes: 33 additions & 0 deletions changelogs/DP-16759.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Write your changelog entry here. Every PR must have a changelog.
#
# You can use the following types:
# Added: For new features.
# Changed: For changes to existing functionality.
# Deprecated: For soon-to-be removed features.
# Removed: For removed features.
# Fixed: For any bug fixes.
# Security: In case of vulnerabilities.
#
# The format is crucial. Please follow the examples below exactly. For reference, the requirements are:
# * All 3 parts are required: you must include type, description, and issue.
# * Type must be left aligned and followed by a colon.
# * Description must be indented 2 spaces.
# * Issue must be indented 4 spaces.
# * Issue should include just the Jira ticket number, not a URL.
# * No extra spaces, indents, or blank lines are allowed.
#
# Fixed:
# - description: Fixes scrolling on edit pages in Safari.
# issue: DP-13314
#
# You may add more than 1 description & issue for each type. Use the following format:
# Changed:
# - description: Automating the release branch.
# issue: DP-10166
# - description: Second change item that needs a description.
# issue: DP-19875
# - description: Third change item that needs a description along with an issue.
# issue: DP-19843
Fixed:
- description: Downgrade Drush to fix sitemap and massdocs cron tasks.
issue: DP-16759
30 changes: 30 additions & 0 deletions drush/Commands/CacheBackportCommands.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Drush\Commands;

use Drupal\Core\Cache\Cache;
use Drush\Utils\StringUtils;

class CacheBackportCommands extends DrushCommands {

/**
* Invalidate by cache tags.
*
* Note: This is a temporary backport of a Drush 10 feature.
* Remove when we go to Drush 10.
*
* @command cache:tags
* @param string $tags A comma delimited list of cache tags to clear.
* @aliases ct
* @bootstrap full
* @usage drush cache:tag node:12,user:4
* Purge content associated with two cache tags.
*/
public function tags($tags)
{
$tags = StringUtils::csvToArray($tags);
Cache::invalidateTags($tags);
$this->logger()->success(dt("Invalidated tag(s): !list.", ['!list' => implode(' ', $tags)]));
}

}
2 changes: 2 additions & 0 deletions drush/Commands/DeployCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
use Consolidation\AnnotatedCommand\CommandData;
use Consolidation\SiteAlias\SiteAliasManagerAwareTrait;
use Consolidation\SiteProcess\Util\Shell;
use Drupal\Core\Cache\Cache;
use Drush\Drush;
use Drush\Exceptions\UserAbortException;
use Drush\SiteAlias\SiteAliasManagerAwareInterface;
use Drush\Utils\StringUtils;
use Webmozart\PathUtil\Path;

/**
Expand Down

0 comments on commit e69889c

Please sign in to comment.