-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
joegl
committed
Nov 1, 2024
1 parent
355906c
commit 1a4be8f
Showing
1 changed file
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml | ||
new file mode 100644 | ||
index 0000000000000000000000000000000000000000..ddfcfcc18cefdce73f8134b2751415580b46ea28 | ||
--- /dev/null | ||
+++ b/.gitlab-ci.yml | ||
@@ -0,0 +1,106 @@ | ||
+################ | ||
+# DrupalCI GitLabCI template | ||
+# | ||
+# Gitlab-ci.yml to replicate DrupalCI testing for Contrib | ||
+# | ||
+# With thanks to: | ||
+# * The GitLab Acceleration Initiative participants | ||
+# * DrupalSpoons | ||
+################ | ||
+ | ||
+################ | ||
+# Guidelines | ||
+# | ||
+# This template is designed to give any Contrib maintainer everything they need to test, without requiring modification. It is also designed to keep up to date with Core Development automatically through the use of include files that can be centrally maintained. | ||
+# | ||
+# However, you can modify this template if you have additional needs for your project. | ||
+################ | ||
+ | ||
+################ | ||
+# Includes | ||
+# | ||
+# Additional configuration can be provided through includes. | ||
+# One advantage of include files is that if they are updated upstream, the changes affect all pipelines using that include. | ||
+# | ||
+# Includes can be overridden by re-declaring anything provided in an include, here in gitlab-ci.yml | ||
+# https://docs.gitlab.com/ee/ci/yaml/includes.html#override-included-configuration-values | ||
+################ | ||
+ | ||
+include: | ||
+ ################ | ||
+ # DrupalCI includes: | ||
+ # As long as you include this, any future includes added by the Drupal Association will be accessible to your pipelines automatically. | ||
+ # View these include files at https://git.drupalcode.org/project/gitlab_templates/ | ||
+ ################ | ||
+ - project: $_GITLAB_TEMPLATES_REPO | ||
+ # "ref" value can be: | ||
+ # - Recommended (default) - `ref: $_GITLAB_TEMPLATES_REF` - The Drupal Association will update this value to the recommended tag for contrib. | ||
+ # - Latest - `ref: main` - Get the latest additions and bug fixes as they are merged into the templates. | ||
+ # - Minor or Major latests - `ref: 1.x-latest` or `ref: 1.0.x-latest` - Get the latest additions within a minor (mostly bugfixes) or major (bugs and new features). | ||
+ # - Fixed tag - `ref: 1.0.1` - Set the value to a known tag. This will not get any updates. | ||
+ # If you change the default value of ref, you should set the _CURL_TEMPLATES_REF variable in the variables section to be the same as set here. | ||
+ ref: $_GITLAB_TEMPLATES_REF | ||
+ file: | ||
+ - "/includes/include.drupalci.main.yml" | ||
+ # For Drupal 7, remove the above line and uncomment the below. | ||
+ # - "/includes/include.drupalci.main-d7.yml" | ||
+ - "/includes/include.drupalci.variables.yml" | ||
+ - "/includes/include.drupalci.workflows.yml" | ||
+# | ||
+################ | ||
+# Pipeline configuration variables | ||
+# | ||
+# These are the variables provided to the Run Pipeline form that a user may want to override. | ||
+# | ||
+# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml | ||
+################ | ||
+# variables: | ||
+# SKIP_ESLINT: '1' | ||
+# OPT_IN_TEST_NEXT_MAJOR: '1' | ||
+# _CURL_TEMPLATES_REF: 'main' | ||
+ | ||
+################################################################################### | ||
+# | ||
+# * | ||
+# /( | ||
+# ((((, | ||
+# /((((((( | ||
+# ((((((((((* | ||
+# ,((((((((((((((( | ||
+# ,((((((((((((((((((( | ||
+# ((((((((((((((((((((((((* | ||
+# *((((((((((((((((((((((((((((( | ||
+# ((((((((((((((((((((((((((((((((((* | ||
+# *(((((((((((((((((( .(((((((((((((((((( | ||
+# ((((((((((((((((((. /(((((((((((((((((* | ||
+# /((((((((((((((((( .(((((((((((((((((, | ||
+# ,(((((((((((((((((( (((((((((((((((((( | ||
+# .(((((((((((((((((((( .((((((((((((((((( | ||
+# ((((((((((((((((((((((( ((((((((((((((((/ | ||
+# (((((((((((((((((((((((((((/ ,(((((((((((((((* | ||
+# .((((((((((((((/ /(((((((((((((. ,((((((((((((((( | ||
+# *(((((((((((((( ,(((((((((((((/ *((((((((((((((. | ||
+# ((((((((((((((, /(((((((((((((. ((((((((((((((, | ||
+# (((((((((((((/ ,(((((((((((((* ,(((((((((((((, | ||
+# *((((((((((((( .((((((((((((((( ,((((((((((((( | ||
+# ((((((((((((/ /((((((((((((((((((. ,((((((((((((/ | ||
+# ((((((((((((( *(((((((((((((((((((((((* *(((((((((((( | ||
+# ((((((((((((( ,(((((((((((((..((((((((((((( *(((((((((((( | ||
+# ((((((((((((, /((((((((((((* /((((((((((((/ (((((((((((( | ||
+# ((((((((((((( /((((((((((((/ (((((((((((((* (((((((((((( | ||
+# (((((((((((((/ /(((((((((((( ,((((((((((((, *(((((((((((( | ||
+# (((((((((((((( *(((((((((((/ *((((((((((((. ((((((((((((/ | ||
+# *((((((((((((((((((((((((((, /((((((((((((((((((((((((( | ||
+# ((((((((((((((((((((((((( ((((((((((((((((((((((((, | ||
+# .(((((((((((((((((((((((/ ,((((((((((((((((((((((( | ||
+# ((((((((((((((((((((((/ ,(((((((((((((((((((((/ | ||
+# *((((((((((((((((((((( (((((((((((((((((((((, | ||
+# ,(((((((((((((((((((((, ((((((((((((((((((((/ | ||
+# ,(((((((((((((((((((((* /(((((((((((((((((((( | ||
+# ((((((((((((((((((((((, ,/((((((((((((((((((((, | ||
+# ,((((((((((((((((((((((((((((((((((((((((((((((((((( | ||
+# .((((((((((((((((((((((((((((((((((((((((((((( | ||
+# .((((((((((((((((((((((((((((((((((((,. | ||
+# .,(((((((((((((((((((((((((. | ||
+# | ||
+################################################################################### | ||
diff --git a/src/NodeRevisionDelete.php b/src/NodeRevisionDelete.php | ||
index 737c32f16482eee93762faef93ab8125428eb584..65d051e67154a7de17ff1d9b2abdbeceb18b213f 100644 | ||
--- a/src/NodeRevisionDelete.php | ||
+++ b/src/NodeRevisionDelete.php | ||
@@ -121,6 +121,11 @@ class NodeRevisionDelete implements NodeRevisionDeleteInterface { | ||
* {@inheritdoc} | ||
*/ | ||
public function nodeExistsInQueue(int $nid): int { | ||
+ // The queue table does not exist, and a node was not added to queue. | ||
+ if (!$this->queueTableExists()) { | ||
+ return 0; | ||
+ } | ||
+ | ||
$query = $this->connection->select(DatabaseQueue::TABLE_NAME, 'q'); | ||
$query->condition('name', 'node_revision_delete'); | ||
$query->condition('data', serialize($nid)); | ||
@@ -136,6 +141,11 @@ class NodeRevisionDelete implements NodeRevisionDeleteInterface { | ||
* {@inheritdoc} | ||
*/ | ||
public function deleteItemFromQueue(int $item_id): void { | ||
+ // Nothing to delete as table was not created yet. | ||
+ if (!$this->queueTableExists()) { | ||
+ return; | ||
+ } | ||
+ | ||
$this->connection->delete(DatabaseQueue::TABLE_NAME) | ||
->condition('item_id', $item_id) | ||
->execute(); | ||
@@ -157,4 +167,14 @@ class NodeRevisionDelete implements NodeRevisionDeleteInterface { | ||
return FALSE; | ||
} | ||
|
||
+ /** | ||
+ * Checks if the queue table exists. | ||
+ * | ||
+ * @return bool | ||
+ * TRUE if the table exists, otherwise FALSE. | ||
+ */ | ||
+ protected function queueTableExists(): bool { | ||
+ return $this->connection->schema()->tableExists(DatabaseQueue::TABLE_NAME); | ||
+ } | ||
+ | ||
} |