Skip to content

Commit

Permalink
Merge branch 'main' into VACMS-16853-next-build-branches
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfinnarn authored Jan 19, 2024
2 parents dd57f8a + d44d81a commit 292d9ff
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 26 deletions.
20 changes: 20 additions & 0 deletions READMES/devops/tugboat.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,23 @@ Can only update CPU and memory at a project level, not repository level.
1. `tugboat ls 5fd3b8ee7b465711575722d5 -j | grep memory` # Get current limit
1. `tugboat update 5fd3b8ee7b465711575722d5 memory=16384` # Set limit to 16GB
1. `tugboat ls 5fd3b8ee7b465711575722d5 -j | grep memory` # Verify new limit

## Tugboat Crisis Intervention

### Overload

**Symptoms**: Tugboat is slow, requests to Tugboat dashboard return 502/504 status codes, previews disappear and reappear, etc.

**Diagnosis**: Tugboat might be overloaded; too many previews might be running simultaneously.

**Verification**:

1. Log into the Tugboat server (`ssm-session utility tugboat auto`).
2. Check system load and free memory (e.g. `top`).
3. If load is incredibly high, and available memory is very low, then the Tugboat server might be dealing with too many open previews.

**Remediation**:

1. Close unused previews in the CMS/Pull Requests project. Target older previews and those corresponding to closed/merged PRs; these should be closed automatically, but there may be issues somewhere in the system that impair communication and cause these to remain open.
2. Suspend older previews. This normally happens automatically (for Pull Request-based previews that haven't been touched in some period of time), but a flurry of previews might have been created inadvertently.
3. Consider upscaling the Tugboat server or migrating to an alternative architecture.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"composer/installers": "^2.2",
"consolidation/site-process": "^5.2",
"cweagans/composer-patches": "^1.7",
"datadog/dd-trace": "^0.96.0",
"datadog/dd-trace": "^0.97.0",
"dealerdirect/phpcodesniffer-composer-installer": "0.7.2",
"drupal/address": "^1.4",
"drupal/admin_feedback": "^2.2",
Expand Down Expand Up @@ -50,7 +50,7 @@
"drupal/content_lock": "^2.3",
"drupal/content_model_documentation": "^1.0.19",
"drupal/core-composer-scaffold": "^10.2.0",
"drupal/core-recommended": "10.2.0",
"drupal/core-recommended": "^10.2.0",
"drupal/crop": "^2.0",
"drupal/csv_serialization": "^4.0",
"drupal/ctools_block": "^4.0",
Expand Down
40 changes: 20 additions & 20 deletions composer.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "bcf35a9e2344b65730db884e9d446951",
"content-hash": "51d220ecfe8df989362d2542bd555bee",
"packages": [
{
"name": "asm89/stack-cors",
Expand Down Expand Up @@ -1175,16 +1175,16 @@
},
{
"name": "datadog/dd-trace",
"version": "0.96.0",
"version": "0.97.0",
"source": {
"type": "git",
"url": "https://github.com/DataDog/dd-trace-php.git",
"reference": "96ce8786574a1cc1f0fbcf8570a5b9025cdabca9"
"reference": "e76850105e99ba5d5b36697b3e4553ee70cfdae9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/DataDog/dd-trace-php/zipball/96ce8786574a1cc1f0fbcf8570a5b9025cdabca9",
"reference": "96ce8786574a1cc1f0fbcf8570a5b9025cdabca9",
"url": "https://api.github.com/repos/DataDog/dd-trace-php/zipball/e76850105e99ba5d5b36697b3e4553ee70cfdae9",
"reference": "e76850105e99ba5d5b36697b3e4553ee70cfdae9",
"shasum": ""
},
"require": {
Expand Down Expand Up @@ -1273,9 +1273,9 @@
],
"support": {
"issues": "https://github.com/DataDog/dd-trace-php/issues",
"source": "https://github.com/DataDog/dd-trace-php/tree/0.96.0"
"source": "https://github.com/DataDog/dd-trace-php/tree/0.97.0"
},
"time": "2023-12-19T09:26:52+00:00"
"time": "2024-01-18T10:15:17+00:00"
},
{
"name": "davedevelopment/stiphle",
Expand Down Expand Up @@ -3828,16 +3828,16 @@
},
{
"name": "drupal/core",
"version": "10.2.0",
"version": "10.2.2",
"source": {
"type": "git",
"url": "https://github.com/drupal/core.git",
"reference": "2f6c400cd6200f6e5900754e7e363cac811546b8"
"reference": "fc9abad1ab687635a5eddec00aa1a5f2a29a23bd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/drupal/core/zipball/2f6c400cd6200f6e5900754e7e363cac811546b8",
"reference": "2f6c400cd6200f6e5900754e7e363cac811546b8",
"url": "https://api.github.com/repos/drupal/core/zipball/fc9abad1ab687635a5eddec00aa1a5f2a29a23bd",
"reference": "fc9abad1ab687635a5eddec00aa1a5f2a29a23bd",
"shasum": ""
},
"require": {
Expand Down Expand Up @@ -3985,9 +3985,9 @@
],
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"support": {
"source": "https://github.com/drupal/core/tree/10.2.0"
"source": "https://github.com/drupal/core/tree/10.2.2"
},
"time": "2023-12-15T22:46:04+00:00"
"time": "2024-01-16T21:10:58+00:00"
},
{
"name": "drupal/core-composer-scaffold",
Expand Down Expand Up @@ -4041,16 +4041,16 @@
},
{
"name": "drupal/core-recommended",
"version": "10.2.0",
"version": "10.2.2",
"source": {
"type": "git",
"url": "https://github.com/drupal/core-recommended.git",
"reference": "13b68ef925c75455fd6cb6766d5879790727d83f"
"reference": "d8cb769d86449af5ad763f3517c7f3c0e226ed60"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/drupal/core-recommended/zipball/13b68ef925c75455fd6cb6766d5879790727d83f",
"reference": "13b68ef925c75455fd6cb6766d5879790727d83f",
"url": "https://api.github.com/repos/drupal/core-recommended/zipball/d8cb769d86449af5ad763f3517c7f3c0e226ed60",
"reference": "d8cb769d86449af5ad763f3517c7f3c0e226ed60",
"shasum": ""
},
"require": {
Expand All @@ -4059,7 +4059,7 @@
"doctrine/annotations": "~1.14.3",
"doctrine/deprecations": "~1.1.2",
"doctrine/lexer": "~2.1.0",
"drupal/core": "10.2.0",
"drupal/core": "10.2.2",
"egulias/email-validator": "~4.0.2",
"guzzlehttp/guzzle": "~7.8.1",
"guzzlehttp/promises": "~2.0.2",
Expand Down Expand Up @@ -4120,9 +4120,9 @@
],
"description": "Core and its dependencies with known-compatible minor versions. Require this project INSTEAD OF drupal/core.",
"support": {
"source": "https://github.com/drupal/core-recommended/tree/10.2.0"
"source": "https://github.com/drupal/core-recommended/tree/10.2.2"
},
"time": "2023-12-15T22:46:04+00:00"
"time": "2024-01-16T21:10:58+00:00"
},
{
"name": "drupal/core_event_dispatcher",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ content:
counter_position: after
js_prevent_submit: true
count_html_characters: false
textcount_status_message: 'Maxlength: <span class="maxlength_count">@maxlength</span><br />Used: <span class="current_count">@current_length</span><br />Remaining: <span class="remaining_count">@remaining_count</span>'
textcount_status_message: '<span class="remaining_count">@remaining_count</span> characters remaining'
third_party_settings:
allowed_formats:
hide_help: '0'
Expand Down
18 changes: 15 additions & 3 deletions docroot/modules/custom/va_gov_backend/va_gov_backend.module
Original file line number Diff line number Diff line change
Expand Up @@ -1933,12 +1933,24 @@ function _va_gov_backend_disable_autopath_alias(FieldableEntityInterface $entity
$toggled_on_this_save = $current_use_alias_pattern && !$original_use_alias_pattern;
$active_entity = \Drupal::entityTypeManager()->getStorage('node')->load($entity->id());
$published_previously = ($active_entity instanceof NodeInterface) ? $active_entity->isPublished() : FALSE;

if ($published_previously && !$toggled_on_this_save) {
// This was published and this was not an intentional toggle on.
$path = '/node/' . (int) $active_entity->nid->value;
$langcode = \Drupal::languageManager()->getCurrentLanguage()->getId();
$path_alias = \Drupal::service('path_alias.manager')->getAliasByPath($path, $langcode);
// If the path_alias is the node path, alias is not set.
$path_alias_set = (bool) preg_match('/\/node\/\d+/', $path_alias) ? FALSE : TRUE;

if ($path_alias_set && $published_previously && !$toggled_on_this_save) {
// This has a path alias, was published,
// and was not an intentional toggle on.
// Disable the pathauto pattern.
$entity->path->pathauto = 0;
}
elseif (!$path_alias_set) {
// If this is not set pathauto already is 0,
// so we need to explicitly set it to 1
// to get an alias generated.
$entity->path->pathauto = 1;
}
}
}

Expand Down

0 comments on commit 292d9ff

Please sign in to comment.