Skip to content

Commit

Permalink
Merge branch 'main' into 18244-revert-removal-of-media-video-menu-item
Browse files Browse the repository at this point in the history
  • Loading branch information
edmund-dunn authored May 31, 2024
2 parents efb6dd5 + 2f7d496 commit 4b3a0d6
Show file tree
Hide file tree
Showing 9 changed files with 198 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .ddev/mutagen/mutagen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# and add your own configuration. If you override it you will
# probably want to check it in.
# Please do `ddev mutagen reset` after changing the file.
# See DDEV Mutagen docs at
# https://ddev.readthedocs.io/en/stable/users/install/performance/#mutagen
# See ddev mutagen docs at
# https://ddev.readthedocs.io/en/latest/users/install/performance/
# For detailed information about mutagen configuration options, see
# https://mutagen.io/documentation/introduction/configuration
sync:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
timeout-minutes: 10
steps:
- name: Send GitHub Actions metrics to DataDog
uses: int128/datadog-actions-metrics@519686d5aeec89083d24b723724656e65fc0b7e4 # v1.87.0
uses: int128/datadog-actions-metrics@432f143460957c07e730f9f082af7d5063e99f84 # v1.88.0
with:
datadog-api-key: ${{ secrets.DATADOG_API_KEY }}
collect-job-metrics: true
Expand Down
55 changes: 55 additions & 0 deletions READMES/events-api
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Directions for Events API

This is a REST API created in Drupal Views using the REST UI Module. It is located in the Drupal CMS backend and is administered by the CMS team.

The current location to view the API is: /all-events-data_format=json

The API is currently set to json format but can also be used for xml or to get a csv download. This is accomplished by changing the data_format in the url above. (I.e. /all-events-data_format=csv or /all-events-data_format=xml)

To make changes to the Events API in the Drupal Admin you can go to /admin/structure/views/view/events_data. Any changes made to this API require an export of Drupal config so please consult with (and have your changes reviewed by) a Drupal CMS Developer.

Below are the options that can be modified.

Format:

Format: set to “Serializer” by default and can be changed to data export.
Settings: options will allow you to choose output (json, xml, csv, etc)

Show: this is set to fields by default to ensure that all the needed event fields are represented.
Settings: an alias can be set for each field type and a checkbox is available for RAW output.

Fields:

These are the individual fields displayed.
Under the “Add” dropdown there is an option to rearrange the fields.
These fields should be set by a Drupal CMS Developer.

Filter criteria:

This is currently set to published events only.
For changes please contact to a Drupal CMS Developer.

Sort criteria:

This can be used to change the order that events are sorted by. Currently, this is by date. This can be changed by a Drupal CMS Devloper.

Path Settings:

The current path for the feed is /all-events-data
Authentication is not currently set but can be changed to basic_auth, oauth2 or cookie.

Access:

This can be set but a CMS Drupal Admin.

Language:

This is set to the basic setting and does not need to changed since we are not using multilingual site capabilities.

JSON API:

There is only one setting for this and it is currently set to expose the JSON API.

Advanced Settings:

Please consult with a Drupal CMS Developer if you feel that you need one of these settings changed.
25 changes: 12 additions & 13 deletions composer.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19032,16 +19032,16 @@
},
{
"name": "phpstan/phpstan",
"version": "1.11.1",
"version": "1.11.2",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "e524358f930e41a2b4cca1320e3b04fc26b39e0b"
"reference": "0d5d4294a70deb7547db655c47685d680e39cfec"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e524358f930e41a2b4cca1320e3b04fc26b39e0b",
"reference": "e524358f930e41a2b4cca1320e3b04fc26b39e0b",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d5d4294a70deb7547db655c47685d680e39cfec",
"reference": "0d5d4294a70deb7547db655c47685d680e39cfec",
"shasum": ""
},
"require": {
Expand Down Expand Up @@ -19086,29 +19086,28 @@
"type": "github"
}
],
"time": "2024-05-15T08:00:59+00:00"
"time": "2024-05-24T13:23:04+00:00"
},
{
"name": "phpstan/phpstan-deprecation-rules",
"version": "1.1.4",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-deprecation-rules.git",
"reference": "089d8a8258ed0aeefdc7b68b6c3d25572ebfdbaa"
"reference": "fa8cce7720fa782899a0aa97b6a41225d1bb7b26"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/089d8a8258ed0aeefdc7b68b6c3d25572ebfdbaa",
"reference": "089d8a8258ed0aeefdc7b68b6c3d25572ebfdbaa",
"url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/fa8cce7720fa782899a0aa97b6a41225d1bb7b26",
"reference": "fa8cce7720fa782899a0aa97b6a41225d1bb7b26",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0",
"phpstan/phpstan": "^1.10.3"
"phpstan/phpstan": "^1.11"
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/phpstan-php-parser": "^1.1",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5"
},
Expand All @@ -19132,9 +19131,9 @@
"description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.",
"support": {
"issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues",
"source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.1.4"
"source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.2.0"
},
"time": "2023-08-05T09:02:04+00:00"
"time": "2024-04-20T06:39:48+00:00"
},
{
"name": "phpunit/php-code-coverage",
Expand Down
18 changes: 0 additions & 18 deletions docroot/sites/default/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,24 +238,6 @@
$deploy_service->run($GLOBALS['request'], $app_root, $site_path);
}

// Because Jenkins can't resolve e.g. prod.cms.va.gov DNS, and only the
// internal*elb addresses. And sometimes the host would return data with
// "http://default/..." hostnames for files so we set the host here and pass it
// to the `file_public_base_url` setting to fix that.
if (!empty($webhost_on_cli)) {
if (PHP_SAPI === 'cli') {
// This is running from drush so set the webhost.
// Var $webhost_on_cli is set in <settings.<environment>.php.
$webhost = $webhost_on_cli;
}
else {
// This is running from an HTTP request.
$webhost = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}";
}

$settings['file_public_base_url'] = "{$webhost}/sites/default/files";
}

// Monolog
$settings['container_yamls'][] = __DIR__ . '/services/services.monolog.yml';

Expand Down
32 changes: 32 additions & 0 deletions docroot/sites/default/settings/settings.local.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,35 @@
$settings['cms_datadog_api_key'] = getenv('CMS_DATADOG_API_KEY');

$settings['va_cms_bot_github_auth_token'] = getenv('GITHUB_TOKEN') ?: 'fake-token';

// Because Jenkins can't resolve e.g. prod.cms.va.gov DNS, and only the
// internal*elb addresses. And sometimes the host would return data with
// "http://default/..." hostnames for files so we set the host here and pass it
// to the `file_public_base_url` setting to fix that.
if (!empty($webhost_on_cli)) {
if (PHP_SAPI === 'cli') {
// This is running from drush so set the webhost.
// Var $webhost_on_cli is set in <settings.<environment>.php.
$webhost = $webhost_on_cli;
}
else {
// This is running from an HTTP request.
$webhost = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}";
}

// Setting the custom header to switch the file base URL in next-build
// Uncomment this next line to test that the header is being set
// header('File-Public-Base-Url-Check: true');

// Get all headers
$headersArray = headers_list();

// If the header is set in the response headers
if (in_array('File-Public-Base-Url-Check: true', $headersArray, true)) {
// Make the file base url point to staging
$settings['file_public_base_url'] = "https://dsva-vagov-staging-cms-files.s3.us-gov-west-1.amazonaws.com";
} else {
// Otherwise use the default webhost
$settings['file_public_base_url'] = "{$webhost}/sites/default/files";
}
}
32 changes: 32 additions & 0 deletions docroot/sites/default/settings/settings.prod.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,35 @@

// Settings supporting broken link report import.
$settings['broken_link_report_import_enabled'] = TRUE;

// Because Jenkins can't resolve e.g. prod.cms.va.gov DNS, and only the
// internal*elb addresses. And sometimes the host would return data with
// "http://default/..." hostnames for files so we set the host here and pass it
// to the `file_public_base_url` setting to fix that.
if (!empty($webhost_on_cli)) {
if (PHP_SAPI === 'cli') {
// This is running from drush so set the webhost.
// Var $webhost_on_cli is set in <settings.<environment>.php.
$webhost = $webhost_on_cli;
}
else {
// This is running from an HTTP request.
$webhost = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}";
}

// Setting the custom header to switch the file base URL in next-build
// Uncomment this next line to test that the header is being set
// header('File-Public-Base-Url-Check: true');

// Get all headers
$headersArray = headers_list();

// If the header is set in the response headers
if (in_array('File-Public-Base-Url-Check: true', $headersArray, true)) {
// Make the file base url point to prod
$settings['file_public_base_url'] = "https://dsva-vagov-prod-cms-files.s3.us-gov-west-1.amazonaws.com";
} else {
// Otherwise use the default webhost
$settings['file_public_base_url'] = "{$webhost}/sites/default/files";
}
}
32 changes: 32 additions & 0 deletions docroot/sites/default/settings/settings.staging.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,35 @@
$settings['va_gov_frontend_url'] = 'https://staging.va.gov';
$settings['va_gov_frontend_build_type'] = 'brd';
$settings['github_actions_deploy_env'] = 'staging';

// Because Jenkins can't resolve e.g. prod.cms.va.gov DNS, and only the
// internal*elb addresses. And sometimes the host would return data with
// "http://default/..." hostnames for files so we set the host here and pass it
// to the `file_public_base_url` setting to fix that.
if (!empty($webhost_on_cli)) {
if (PHP_SAPI === 'cli') {
// This is running from drush so set the webhost.
// Var $webhost_on_cli is set in <settings.<environment>.php.
$webhost = $webhost_on_cli;
}
else {
// This is running from an HTTP request.
$webhost = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}";
}

// Setting the custom header to switch the file base URL in next-build
// Uncomment this next line to test that the header is being set
// header('File-Public-Base-Url-Check: true');

// Get all headers
$headersArray = headers_list();

// If the header is set in the response headers
if (in_array('File-Public-Base-Url-Check: true', $headersArray, true)) {
// Make the file base url point to staging
$settings['file_public_base_url'] = "https://dsva-vagov-staging-cms-files.s3.us-gov-west-1.amazonaws.com";
} else {
// Otherwise use the default webhost
$settings['file_public_base_url'] = "{$webhost}/sites/default/files";
}
}
32 changes: 32 additions & 0 deletions docroot/sites/default/settings/settings.tugboat.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,35 @@
// Settings supporting broken link report import.
$settings['broken_link_report_import_enabled'] = TRUE;
$settings['broken_link_report_location'] = '/var/lib/tugboat/docroot/vendor/va-gov/content-build/logs/vagovdev-broken-links.json';

// Because Jenkins can't resolve e.g. prod.cms.va.gov DNS, and only the
// internal*elb addresses. And sometimes the host would return data with
// "http://default/..." hostnames for files so we set the host here and pass it
// to the `file_public_base_url` setting to fix that.
if (!empty($webhost_on_cli)) {
if (PHP_SAPI === 'cli') {
// This is running from drush so set the webhost.
// Var $webhost_on_cli is set in <settings.<environment>.php.
$webhost = $webhost_on_cli;
}
else {
// This is running from an HTTP request.
$webhost = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}";
}

// Setting the custom header to switch the file base URL in next-build
// Uncomment this next line to test that the header is being set
// header('File-Public-Base-Url-Check: true');

// Get all headers
$headersArray = headers_list();

// If the header is set in the response headers
if (in_array('File-Public-Base-Url-Check: true', $headersArray, true)) {
// Make the file base url point to staging
$settings['file_public_base_url'] = "https://dsva-vagov-staging-cms-files.s3.us-gov-west-1.amazonaws.com";
} else {
// Otherwise use the default webhost
$settings['file_public_base_url'] = "{$webhost}/sites/default/files";
}
}

0 comments on commit 4b3a0d6

Please sign in to comment.