From 2af5bd39b45363b5bb6c00a7fa3fe8b2dc3fcf8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Feb 2024 13:04:42 -0800 Subject: [PATCH 01/16] Bump drupal/codit_menu_tools from 1.0.0-alpha3 to 1.0.0-alpha5 (#17192) Bumps drupal/codit_menu_tools from 1.0.0-alpha3 to 1.0.0-alpha5. --- updated-dependencies: - dependency-name: drupal/codit_menu_tools dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/composer.lock b/composer.lock index c71d3e0498..3feac7b66e 100644 --- a/composer.lock +++ b/composer.lock @@ -3055,17 +3055,17 @@ }, { "name": "drupal/codit_menu_tools", - "version": "1.0.0-alpha3", + "version": "1.0.0-alpha5", "source": { "type": "git", "url": "https://git.drupalcode.org/project/codit_menu_tools.git", - "reference": "1.0.0-alpha3" + "reference": "1.0.0-alpha5" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/codit_menu_tools-1.0.0-alpha3.zip", - "reference": "1.0.0-alpha3", - "shasum": "25eea2ccf5054d2d62027f87e597c18fc000a3d5" + "url": "https://ftp.drupal.org/files/projects/codit_menu_tools-1.0.0-alpha5.zip", + "reference": "1.0.0-alpha5", + "shasum": "4dff97ae333a7ae80765403c252f551887210dc6" }, "require": { "drupal/core": "^10" @@ -3073,11 +3073,11 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "1.0.0-alpha3", - "datestamp": "1701920607", + "version": "1.0.0-alpha5", + "datestamp": "1707500832", "security-coverage": { "status": "not-covered", - "message": "Project has not opted into security advisory coverage!" + "message": "Alpha releases are not covered by Drupal security advisories." } } }, @@ -26816,7 +26816,6 @@ "drupal/cer": 10, "drupal/change_labels": 20, "drupal/ckeditor_abbreviation": 15, - "drupal/codit_menu_tools": 15, "drupal/components": 10, "drupal/danse_content_moderation": 10, "drupal/entity_block": 10, From d01b45d9190f4892d11ec652df8cfc93a342150c Mon Sep 17 00:00:00 2001 From: Christian Burk Date: Fri, 9 Feb 2024 16:57:36 -0600 Subject: [PATCH 02/16] VACMS-16327: Update VBA facility post review feedback (#17156) * VACMS-16469: Updates widget to radio buttons * Update core.entity_form_display.node.nca_facility.default.yml Adds revision_log back * VACMS-16327: Updates VBA facility field order * VACMS-16327: Updates Operating status and table of contents * VACMS-16327: More changes to get the VBA facility in line with review recommendations * VACMS-16327: Updates VBA form display * VACMS-16327: Updates form display and help text * VACMS-16327: Updates Facility Photo help text * VACMS-16327: Updates link in Spotlight help text * VACMS-16327: Updates tooltip and table of contents * VACMS-16327: Changes accordion * VACMS-16327: Updates based on UX and accessibility feedback * VACMS-16327: Removes ALL CAPS on external h3 * VACMS-16327: Update Facility Image form * VACMS-16327: Update help text for image --- ...form_display.node.vba_facility.default.yml | 283 +++++++++--------- ...play.paragraph.basic_accordion.default.yml | 16 +- ...view_display.node.vba_facility.default.yml | 11 +- ...lay.node.vba_facility.external_content.yml | 8 +- ...ew_display.node.vba_facility.ief_table.yml | 4 +- ..._view_display.node.vba_facility.teaser.yml | 4 +- ...acility.field_banner_types_description.yml | 2 +- ...eld.node.vba_facility.field_intro_text.yml | 19 -- ...ld.field.node.vba_facility.field_media.yml | 11 +- ...cility.field_operating_status_facility.yml | 4 + ...ility.field_operating_status_more_info.yml | 9 +- ...e.vba_facility.field_table_of_contents.yml | 2 +- ...paragraph.basic_accordion.field_header.yml | 7 +- ...aph.basic_accordion.field_rich_wysiwyg.yml | 10 +- ...ld.paragraph.button.field_button_label.yml | 7 +- ...eld.paragraph.button.field_button_link.yml | 4 + ...aph.featured_content.field_description.yml | 8 +- ....featured_content.field_section_header.yml | 7 +- .../va_gov_consumers/va_gov_consumers.module | 4 +- .../scss/components/_centralized_content.scss | 5 + .../scss/components/_external_content.scss | 4 - 21 files changed, 233 insertions(+), 196 deletions(-) delete mode 100644 config/sync/field.field.node.vba_facility.field_intro_text.yml diff --git a/config/sync/core.entity_form_display.node.vba_facility.default.yml b/config/sync/core.entity_form_display.node.vba_facility.default.yml index 0728525c69..7ac4b106c5 100644 --- a/config/sync/core.entity_form_display.node.vba_facility.default.yml +++ b/config/sync/core.entity_form_display.node.vba_facility.default.yml @@ -20,7 +20,6 @@ dependencies: - field.field.node.vba_facility.field_facility_locator_api_id - field.field.node.vba_facility.field_facility_vba_classificatio - field.field.node.vba_facility.field_geolocation - - field.field.node.vba_facility.field_intro_text - field.field.node.vba_facility.field_last_saved_by_an_editor - field.field.node.vba_facility.field_local_spotlight - field.field.node.vba_facility.field_media @@ -64,14 +63,14 @@ third_party_settings: - field_operating_status_more_info label: 'Operating status' region: content - parent_name: '' - weight: 1 + parent_name: group_locations_and_contact_info + weight: 4 format_type: fieldset format_settings: classes: '' show_empty_fields: true id: operating-status - description: "Use this status for weather or other events that impact your facility's operations. Don't duplicate information contained in your COVID-19 status. This status will display on the facility's location page and operating status page." + description: "This status will display on the facility's page and in VA’s facility locator tool." required_fields: true description_display: after group_governance: @@ -80,7 +79,7 @@ third_party_settings: label: 'Section settings' region: content parent_name: '' - weight: 11 + weight: 9 format_type: details_sidebar format_settings: classes: '' @@ -97,7 +96,7 @@ third_party_settings: label: 'Editorial Workflow' region: content parent_name: '' - weight: 13 + weight: 11 format_type: fieldset format_settings: classes: '' @@ -106,29 +105,32 @@ third_party_settings: required_fields: true group_locations_and_contact_info: children: + - group_operating_status + - field_media - group_facility_data - label: 'Locations and contact information' + label: 'Location and contact information' region: content parent_name: '' - weight: 5 - format_type: fieldset + weight: 3 + format_type: details format_settings: - classes: '' + classes: external-content show_empty_fields: false - id: locations-and-contact-information + id: locations-and-contact-info + open: true description: '' required_fields: true - description_display: after group_facility_data: children: - - title - - field_facility_locator_api_id - - field_facility_vba_classificatio - - field_address - - field_geolocation - field_phone_number + - field_address - field_office_hours - field_timezone + - group_benefit_office_hours_vary + - group_benefits_hotline + - field_facility_locator_api_id + - field_facility_vba_classificatio + - field_geolocation - field_non_va_official_name - field_non_va_location_url - field_office @@ -136,12 +138,12 @@ third_party_settings: label: 'Facility data' region: content parent_name: group_locations_and_contact_info - weight: 15 + weight: 7 format_type: tooltip format_settings: - show_label: '1' - tooltip_description: "Why can’t I edit this?\r\nThis content is automatically populated from centralized databases, and helps maintain consistent information across all of VA.gov." - description: 'Learn how to correct or update centrally-managed data.' + show_label: '0' + tooltip_description: '' + description: '' required_fields: '1' id: external-content classes: not-editable @@ -149,53 +151,36 @@ third_party_settings: element: div label_element: h3 attributes: '' - group_vba_editable_fields: - children: - - field_intro_text - - field_media - label: 'Top of page information' - region: content - parent_name: '' - weight: 4 - format_type: fieldset - format_settings: - classes: '' - show_empty_fields: true - id: top-of-page-information - description: '' - required_fields: true - description_display: after group_prepare_for_your_visit: children: - field_prepare_for_visit label: 'Prepare for your visit' region: content parent_name: '' - weight: 8 - format_type: fieldset + weight: 4 + format_type: details format_settings: classes: '' show_empty_fields: true id: prepare-for-your-visit - description: 'Add location services available at this facility such as transportation, parking, visiting hours, lodging options, food options, etc. Do not use this for benefit services.' - required_fields: true open: true - description_display: after + description: 'Add information to help visitors find the facility and make appointments. Include details on appointments, parking, public transportation, and what to bring. For more guidance, refer to the prepare for your visit Knowledge Base article (opens in a new window).' + required_fields: true group_benefit_office_overview: children: - field_cc_vba_facility_overview label: 'Benefit office overview' region: content parent_name: '' - weight: 3 + weight: 2 format_type: tooltip format_settings: show_empty_fields: '1' - show_label: '0' + show_label: '1' tooltip_description: "Why can’t I edit this?\r\nNational editors keep this content standardized to provide consistent messaging for facilities nationwide." description: '' required_fields: '1' - id: '' + id: benefit-office-overview classes: centralized element: div label_element: h3 @@ -205,41 +190,39 @@ third_party_settings: - field_cc_benefits_hotline label: 'Benefits hotline' region: content - parent_name: '' - weight: 7 + parent_name: group_facility_data + weight: 15 format_type: tooltip format_settings: - show_empty_fields: 0 + show_label: '1' + tooltip_description: "Why can’t I edit this?\r\nInternational editors keep this content standardized to provide consistent messaging for facilities nationwide." + description: '' + required_fields: '1' id: '' classes: centralized + show_empty_fields: 0 element: div - show_label: '0' label_element: h3 - required_fields: 1 attributes: '' - description: '' - tooltip_description: "Why can’t I edit this?\r\nInternational editors keep this content standardized to provide consistent messaging for facilities nationwide." - open: false group_benefit_office_hours_vary: children: - field_cc_benefit_office_hours_va label: 'Benefit office hours may vary' region: content - parent_name: '' - weight: 6 + parent_name: group_facility_data + weight: 14 format_type: tooltip format_settings: - show_empty_fields: 0 + show_label: '1' + tooltip_description: "Why can’t I edit this? \r\nNational editors keep this content standardized to provide consistent messaging for facilities nationwide." + description: '' + required_fields: '1' id: '' classes: centralized + show_empty_fields: 0 element: div - show_label: '0' label_element: h3 - required_fields: 1 attributes: '' - description: '' - tooltip_description: "Why can’t I edit this? \r\nNational editors keep this content standardized to provide consistent messaging for facilities nationwide." - open: false group_national_spotlight: children: - field_cc_national_spotlight_1 @@ -249,57 +232,54 @@ third_party_settings: weight: 9 format_type: tooltip format_settings: - show_empty_fields: 0 + show_label: '1' + tooltip_description: "Why can’t I edit this? \r\nThis content is standardized to provide consistent messaging for facilities nationwide." + description: '' + required_fields: '1' id: '' classes: centralized + show_empty_fields: 0 element: div - show_label: '0' label_element: h3 - required_fields: 1 attributes: '' - description: '' - tooltip_description: "Why can’t I edit this? \r\nNational editors keep this content standardized to provide consistent messaging for facilities nationwide." - open: false group_can_t_find_benefits: children: - field_cc_cant_find_benefits label: "Can't find benefits" region: content parent_name: '' - weight: 10 + weight: 7 format_type: tooltip format_settings: - show_empty_fields: 0 - id: '' + show_label: '0' + tooltip_description: "Why can’t I edit this? \r\nNational editors keep this content standardized to provide consistent messaging for facilities nationwide." + description: '' + required_fields: '1' + id: cant-find-service classes: centralized + show_empty_fields: 0 element: div - show_label: '0' label_element: h3 - required_fields: 1 attributes: '' - description: '' - tooltip_description: "Why can’t I edit this? \r\nNational editors keep this content standardized to provide consistent messaging for facilities nationwide." - open: false group_get_updates_from_vba: children: - field_cc_get_updates_from_vba label: 'Get updates from VBA' region: content parent_name: '' - weight: 12 + weight: 8 format_type: tooltip format_settings: - show_empty_fields: 0 - id: '' + show_label: '1' + tooltip_description: "Why can’t I edit this? \r\nNational editors keep this content standardized to provide consistent messaging for facilities nationwide." + description: '' + required_fields: '1' + id: get-updates classes: centralized + show_empty_fields: 0 element: div - show_label: '0' label_element: h3 - required_fields: 1 attributes: '' - description: '' - tooltip_description: "Why can’t I edit this? \r\nNational editors keep this content standardized to provide consistent messaging for facilities nationwide." - open: false group_banner: children: - field_show_banner @@ -311,7 +291,7 @@ third_party_settings: label: 'Banner alert' region: content parent_name: '' - weight: 2 + weight: 1 format_type: detailswithimage format_settings: description: 'This optional segment allows you to add a banner alert to the VBA facility.' @@ -319,7 +299,7 @@ third_party_settings: visual_guide_file_name: '' visual_guide_alt_text: '' required_fields: '1' - id: '' + id: banner-alert classes: '' show_empty_fields: 0 group_spotlight_content: @@ -329,22 +309,22 @@ third_party_settings: label: 'Spotlight content' region: content parent_name: '' - weight: 9 - format_type: fieldset + weight: 5 + format_type: details format_settings: classes: '' show_empty_fields: false - id: '' - description: '' + id: spotlight-content + open: true + description: 'The VBA spotlight content area is designed to showcase items such as events, activities, or benefit news. For more guidance, refer to the Knowledge Base article about spotlight content (opens in a new window).' required_fields: true - description_display: after group_meta_tags: children: - field_cc_meta_tags label: 'Meta tags' region: content parent_name: '' - weight: 15 + weight: 13 format_type: fieldset format_settings: classes: hidden @@ -353,6 +333,56 @@ third_party_settings: description: '' required_fields: false description_display: after + group_facility_services: + children: { } + label: 'Facility services' + region: content + parent_name: '' + weight: 6 + format_type: tooltip + format_settings: + show_empty_fields: '1' + show_label: '1' + tooltip_description: '' + description: 'Facility services are created on a different page.' + required_fields: '1' + id: facility-services + classes: 'not-editable centralized' + element: div + label_element: h3 + attributes: '' + group_other_va_locations: + children: { } + label: 'Other VA locations' + region: content + parent_name: '' + weight: 10 + format_type: tooltip + format_settings: + show_empty_fields: '1' + show_label: '1' + tooltip_description: '' + description: 'Other nearby VA locations are generated automatically for this page.' + id: other-va-locations + classes: 'not-editable centralized' + element: div + label_element: h3 + required_fields: 0 + attributes: '' + group_facility_image: + children: { } + label: 'Facility image' + region: hidden + parent_name: '' + weight: 14 + format_type: fieldset + format_settings: + classes: '' + show_empty_fields: false + id: '' + description: '

Add an image that helps people recognize the facility. For best results, add an image cropped to a 3:2 aspect ratio. For accessibility, alternative text must also be added. Please refer to the alt text Knowledge Base article (opens in a new window) for more information.

' + required_fields: true + description_display: before id: node.vba_facility.default targetEntityType: node bundle: vba_facility @@ -360,7 +390,7 @@ mode: default content: field_address: type: address_default - weight: 7 + weight: 11 region: content settings: { } third_party_settings: { } @@ -394,12 +424,19 @@ content: hide_help: '1' hide_guidelines: '1' field_banner_title: - type: string_textfield + type: string_textfield_with_counter weight: 31 region: content settings: size: 60 placeholder: '' + use_field_maxlength: false + maxlength: 100 + counter_position: after + js_prevent_submit: true + count_only_mode: false + count_html_characters: true + textcount_status_message: '@remaining_count characters remaining' third_party_settings: { } field_banner_types_description: type: markup @@ -412,36 +449,36 @@ content: weight: 13 region: content settings: - show_field_label: '1' show_link_to_source: '1' show_source_updated_date: '1' + show_field_label: 0 third_party_settings: { } field_cc_benefits_hotline: type: entity_field_fetch_widget weight: 26 region: content settings: - show_field_label: '1' show_link_to_source: '1' show_source_updated_date: '1' + show_field_label: 0 third_party_settings: { } field_cc_cant_find_benefits: type: entity_field_fetch_widget weight: 11 region: content settings: - show_field_label: '1' show_link_to_source: '1' show_source_updated_date: '1' + show_field_label: 0 third_party_settings: { } field_cc_get_updates_from_vba: type: entity_field_fetch_widget weight: 11 region: content settings: - show_field_label: '1' show_link_to_source: '1' show_source_updated_date: '1' + show_field_label: 0 third_party_settings: { } field_cc_meta_tags: type: entity_field_fetch_widget @@ -457,18 +494,18 @@ content: weight: 1 region: content settings: - show_field_label: '1' show_link_to_source: '1' show_source_updated_date: '1' + show_field_label: 0 third_party_settings: { } field_cc_vba_facility_overview: type: entity_field_fetch_widget weight: 2 region: content settings: - show_field_label: '1' show_link_to_source: '1' show_source_updated_date: '1' + show_field_label: 0 third_party_settings: { } field_dismissible_option: type: options_buttons @@ -478,7 +515,7 @@ content: third_party_settings: { } field_facility_locator_api_id: type: string_textfield - weight: 5 + weight: 16 region: content settings: size: 60 @@ -486,28 +523,20 @@ content: third_party_settings: { } field_facility_vba_classificatio: type: options_select - weight: 6 + weight: 17 region: content settings: { } third_party_settings: { } field_geolocation: type: geofield_latlon - weight: 8 + weight: 18 region: content settings: html5_geolocation: false third_party_settings: { } - field_intro_text: - type: string_textarea - weight: 3 - region: content - settings: - rows: 5 - placeholder: '' - third_party_settings: { } field_last_saved_by_an_editor: type: datetime_timestamp - weight: 14 + weight: 12 region: content settings: { } third_party_settings: { } @@ -555,14 +584,14 @@ content: add_another: '' field_media: type: media_library_widget - weight: 4 + weight: 6 region: content settings: media_types: { } third_party_settings: { } field_non_va_location_url: type: link_default - weight: 15 + weight: 20 region: content settings: placeholder_url: '' @@ -570,7 +599,7 @@ content: third_party_settings: { } field_non_va_official_name: type: string_textfield - weight: 14 + weight: 19 region: content settings: size: 60 @@ -578,13 +607,13 @@ content: third_party_settings: { } field_office: type: options_select - weight: 16 + weight: 21 region: content settings: { } third_party_settings: { } field_office_hours: type: office_hours_default - weight: 11 + weight: 12 region: content settings: collapsed: false @@ -611,7 +640,7 @@ content: third_party_settings: { } field_phone_number: type: telephone_default - weight: 9 + weight: 10 region: content settings: placeholder: '' @@ -646,7 +675,7 @@ content: add_another: '' field_shared_vha_location: type: entity_reference_autocomplete - weight: 17 + weight: 22 region: content settings: match_operator: CONTAINS @@ -669,7 +698,7 @@ content: third_party_settings: { } field_timezone: type: tzfield_default - weight: 12 + weight: 13 region: content settings: { } third_party_settings: { } @@ -684,21 +713,6 @@ content: region: content settings: { } third_party_settings: { } - title: - type: string_textfield_with_counter - weight: 4 - region: content - settings: - size: 60 - placeholder: '' - use_field_maxlength: false - maxlength: 150 - counter_position: after - js_prevent_submit: false - count_only_mode: false - count_html_characters: false - textcount_status_message: '@remaining_count characters remaining' - third_party_settings: { } hidden: created: true langcode: true @@ -706,5 +720,6 @@ hidden: promote: true status: true sticky: true + title: true uid: true url_redirects: true diff --git a/config/sync/core.entity_form_display.paragraph.basic_accordion.default.yml b/config/sync/core.entity_form_display.paragraph.basic_accordion.default.yml index 2d87ac0cb2..7017f49e95 100644 --- a/config/sync/core.entity_form_display.paragraph.basic_accordion.default.yml +++ b/config/sync/core.entity_form_display.paragraph.basic_accordion.default.yml @@ -7,19 +7,28 @@ dependencies: - field.field.paragraph.basic_accordion.field_rich_wysiwyg - paragraphs.paragraphs_type.basic_accordion module: + - allowed_formats - text + - textfield_counter id: paragraph.basic_accordion.default targetEntityType: paragraph bundle: basic_accordion mode: default content: field_header: - type: string_textfield + type: string_textfield_with_counter weight: 0 region: content settings: size: 60 placeholder: '' + use_field_maxlength: true + maxlength: 0 + counter_position: after + js_prevent_submit: true + count_only_mode: false + count_html_characters: true + textcount_status_message: '@remaining_count characters remaining' third_party_settings: { } field_rich_wysiwyg: type: text_textarea @@ -28,7 +37,10 @@ content: settings: rows: 5 placeholder: '' - third_party_settings: { } + third_party_settings: + allowed_formats: + hide_help: '1' + hide_guidelines: '0' hidden: created: true status: true diff --git a/config/sync/core.entity_view_display.node.vba_facility.default.yml b/config/sync/core.entity_view_display.node.vba_facility.default.yml index 1563a78acb..f826dffb8a 100644 --- a/config/sync/core.entity_view_display.node.vba_facility.default.yml +++ b/config/sync/core.entity_view_display.node.vba_facility.default.yml @@ -20,7 +20,6 @@ dependencies: - field.field.node.vba_facility.field_facility_locator_api_id - field.field.node.vba_facility.field_facility_vba_classificatio - field.field.node.vba_facility.field_geolocation - - field.field.node.vba_facility.field_intro_text - field.field.node.vba_facility.field_last_saved_by_an_editor - field.field.node.vba_facility.field_local_spotlight - field.field.node.vba_facility.field_media @@ -104,7 +103,6 @@ third_party_settings: attributes: '' group_editable_fields: children: - - field_intro_text - field_media label: 'Facility Intro and Photo' parent_name: '' @@ -123,7 +121,7 @@ third_party_settings: - field_non_va_location_url - field_office - field_shared_vha_location - label: 'DB data' + label: 'Facility CMS data' parent_name: group_facility_data region: content weight: 11 @@ -375,13 +373,6 @@ content: third_party_settings: { } weight: 3 region: content - field_intro_text: - type: basic_string - label: above - settings: { } - third_party_settings: { } - weight: 14 - region: content field_local_spotlight: type: entity_reference_revisions_entity_view label: above diff --git a/config/sync/core.entity_view_display.node.vba_facility.external_content.yml b/config/sync/core.entity_view_display.node.vba_facility.external_content.yml index 271c7ac7a6..e5dd49d187 100644 --- a/config/sync/core.entity_view_display.node.vba_facility.external_content.yml +++ b/config/sync/core.entity_view_display.node.vba_facility.external_content.yml @@ -14,13 +14,13 @@ dependencies: - field.field.node.vba_facility.field_cc_benefits_hotline - field.field.node.vba_facility.field_cc_cant_find_benefits - field.field.node.vba_facility.field_cc_get_updates_from_vba + - field.field.node.vba_facility.field_cc_meta_tags - field.field.node.vba_facility.field_cc_national_spotlight_1 - field.field.node.vba_facility.field_cc_vba_facility_overview - field.field.node.vba_facility.field_dismissible_option - field.field.node.vba_facility.field_facility_locator_api_id - field.field.node.vba_facility.field_facility_vba_classificatio - field.field.node.vba_facility.field_geolocation - - field.field.node.vba_facility.field_intro_text - field.field.node.vba_facility.field_last_saved_by_an_editor - field.field.node.vba_facility.field_local_spotlight - field.field.node.vba_facility.field_media @@ -110,7 +110,7 @@ third_party_settings: - field_non_va_location_url - field_office - field_shared_vha_location - label: 'DB data' + label: 'Facility CMS data' parent_name: group_facility_data region: content weight: 10 @@ -119,7 +119,7 @@ third_party_settings: classes: not-editable show_empty_fields: true id: '' - description: '' + description: '

These fields are not shown on VA.gov.

' description_display: after layout_builder: enabled: false @@ -256,10 +256,10 @@ hidden: field_cc_benefits_hotline: true field_cc_cant_find_benefits: true field_cc_get_updates_from_vba: true + field_cc_meta_tags: true field_cc_national_spotlight_1: true field_cc_vba_facility_overview: true field_dismissible_option: true - field_intro_text: true field_last_saved_by_an_editor: true field_local_spotlight: true field_location_services: true diff --git a/config/sync/core.entity_view_display.node.vba_facility.ief_table.yml b/config/sync/core.entity_view_display.node.vba_facility.ief_table.yml index e496b8050c..40a13173fe 100644 --- a/config/sync/core.entity_view_display.node.vba_facility.ief_table.yml +++ b/config/sync/core.entity_view_display.node.vba_facility.ief_table.yml @@ -14,13 +14,13 @@ dependencies: - field.field.node.vba_facility.field_cc_benefits_hotline - field.field.node.vba_facility.field_cc_cant_find_benefits - field.field.node.vba_facility.field_cc_get_updates_from_vba + - field.field.node.vba_facility.field_cc_meta_tags - field.field.node.vba_facility.field_cc_national_spotlight_1 - field.field.node.vba_facility.field_cc_vba_facility_overview - field.field.node.vba_facility.field_dismissible_option - field.field.node.vba_facility.field_facility_locator_api_id - field.field.node.vba_facility.field_facility_vba_classificatio - field.field.node.vba_facility.field_geolocation - - field.field.node.vba_facility.field_intro_text - field.field.node.vba_facility.field_last_saved_by_an_editor - field.field.node.vba_facility.field_local_spotlight - field.field.node.vba_facility.field_media @@ -189,12 +189,12 @@ hidden: field_cc_benefits_hotline: true field_cc_cant_find_benefits: true field_cc_get_updates_from_vba: true + field_cc_meta_tags: true field_cc_national_spotlight_1: true field_cc_vba_facility_overview: true field_dismissible_option: true field_facility_vba_classificatio: true field_geolocation: true - field_intro_text: true field_last_saved_by_an_editor: true field_local_spotlight: true field_location_services: true diff --git a/config/sync/core.entity_view_display.node.vba_facility.teaser.yml b/config/sync/core.entity_view_display.node.vba_facility.teaser.yml index 01846c6387..4a6606bd06 100644 --- a/config/sync/core.entity_view_display.node.vba_facility.teaser.yml +++ b/config/sync/core.entity_view_display.node.vba_facility.teaser.yml @@ -14,13 +14,13 @@ dependencies: - field.field.node.vba_facility.field_cc_benefits_hotline - field.field.node.vba_facility.field_cc_cant_find_benefits - field.field.node.vba_facility.field_cc_get_updates_from_vba + - field.field.node.vba_facility.field_cc_meta_tags - field.field.node.vba_facility.field_cc_national_spotlight_1 - field.field.node.vba_facility.field_cc_vba_facility_overview - field.field.node.vba_facility.field_dismissible_option - field.field.node.vba_facility.field_facility_locator_api_id - field.field.node.vba_facility.field_facility_vba_classificatio - field.field.node.vba_facility.field_geolocation - - field.field.node.vba_facility.field_intro_text - field.field.node.vba_facility.field_last_saved_by_an_editor - field.field.node.vba_facility.field_local_spotlight - field.field.node.vba_facility.field_media @@ -66,13 +66,13 @@ hidden: field_cc_benefits_hotline: true field_cc_cant_find_benefits: true field_cc_get_updates_from_vba: true + field_cc_meta_tags: true field_cc_national_spotlight_1: true field_cc_vba_facility_overview: true field_dismissible_option: true field_facility_locator_api_id: true field_facility_vba_classificatio: true field_geolocation: true - field_intro_text: true field_last_saved_by_an_editor: true field_local_spotlight: true field_location_services: true diff --git a/config/sync/field.field.node.vba_facility.field_banner_types_description.yml b/config/sync/field.field.node.vba_facility.field_banner_types_description.yml index 54465c6f51..302f015b7a 100644 --- a/config/sync/field.field.node.vba_facility.field_banner_types_description.yml +++ b/config/sync/field.field.node.vba_facility.field_banner_types_description.yml @@ -24,6 +24,6 @@ default_value: default_value_callback: '' settings: markup: - value: "

Two types of Banner alerts are supported:

\r\n\r\n
    \r\n\t
  1. Informational alerts: These are used to provide helpful information or call attention to an announcement.
  2. \r\n\t
  3. Warning alerts: These are used to warn a user and call out negative consequences. Warning alerts are necessary when something has gone wrong.
  4. \r\n
\r\n

You can read more about these banner types on the site in the VA Design System (opens in a new window), or learn how to create them in the CMS in the Knowledge Base (opens in a new window).

" + value: '

Two types of Banner alerts are supported:

  1. Informational alerts: These are used to provide helpful information or call attention to an announcement.
  2. Warning alerts: These are used to warn a user and call out negative consequences. Warning alerts are necessary when something has gone wrong.

You can read more about these banner types on the site in the VA Design System banner page (opens in a new window), or learn how to create them in the CMS in the Knowledge Base (opens in a new window).

' format: rich_text field_type: markup diff --git a/config/sync/field.field.node.vba_facility.field_intro_text.yml b/config/sync/field.field.node.vba_facility.field_intro_text.yml deleted file mode 100644 index 5a7e2cdc54..0000000000 --- a/config/sync/field.field.node.vba_facility.field_intro_text.yml +++ /dev/null @@ -1,19 +0,0 @@ -uuid: 541dfb7a-95a2-44eb-9ac7-6d266d6a8345 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_intro_text - - node.type.vba_facility -id: node.vba_facility.field_intro_text -field_name: field_intro_text -entity_type: node -bundle: vba_facility -label: 'Page introduction' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string_long diff --git a/config/sync/field.field.node.vba_facility.field_media.yml b/config/sync/field.field.node.vba_facility.field_media.yml index 82cc7e1cd3..084371a379 100644 --- a/config/sync/field.field.node.vba_facility.field_media.yml +++ b/config/sync/field.field.node.vba_facility.field_media.yml @@ -8,21 +8,20 @@ dependencies: - node.type.vba_facility module: - entity_reference_validators - - epp + - tmgmt_content third_party_settings: entity_reference_validators: circular_reference: false circular_reference_deep: false duplicate_reference: false - epp: - value: '' - on_update: 0 + tmgmt_content: + excluded: false id: node.vba_facility.field_media field_name: field_media entity_type: node bundle: vba_facility -label: 'Facility photo' -description: "Photo guidelines
\r\n✓ Smart phone photos are ok
\r\n✓ Use landscape orientation
\r\n✓ Show the entrance side of the building
\r\n✗ No people
\r\n✗ No car license plates
" +label: 'Facility image' +description: "

Add an image that helps people recognize the facility. For best results, add an image cropped to a 3:2 aspect ratio. For accessibility, alternative text must also be added. Please refer to the alt text Knowledge Base article (opens in a new window) for more information.

\r\n

Image guidelines

\r\n

✓ Please do:

\r\n\r\n

✗ Do not

\r\n\r\n" required: false translatable: false default_value: { } diff --git a/config/sync/field.field.node.vba_facility.field_operating_status_facility.yml b/config/sync/field.field.node.vba_facility.field_operating_status_facility.yml index f3c4817149..83590e76fe 100644 --- a/config/sync/field.field.node.vba_facility.field_operating_status_facility.yml +++ b/config/sync/field.field.node.vba_facility.field_operating_status_facility.yml @@ -7,6 +7,10 @@ dependencies: - node.type.vba_facility module: - options + - tmgmt_content +third_party_settings: + tmgmt_content: + excluded: false id: node.vba_facility.field_operating_status_facility field_name: field_operating_status_facility entity_type: node diff --git a/config/sync/field.field.node.vba_facility.field_operating_status_more_info.yml b/config/sync/field.field.node.vba_facility.field_operating_status_more_info.yml index aa8d24120e..7f89dbadc0 100644 --- a/config/sync/field.field.node.vba_facility.field_operating_status_more_info.yml +++ b/config/sync/field.field.node.vba_facility.field_operating_status_more_info.yml @@ -5,12 +5,17 @@ dependencies: config: - field.storage.node.field_operating_status_more_info - node.type.vba_facility + module: + - tmgmt_content +third_party_settings: + tmgmt_content: + excluded: false id: node.vba_facility.field_operating_status_more_info field_name: field_operating_status_more_info entity_type: node bundle: vba_facility -label: 'Operating status - more info' -description: "Up to 300 characters to provide additional information about the facility's operating status. " +label: Details +description: 'Add relevant details about how this status will impact Veterans and visitors.' required: false translatable: false default_value: { } diff --git a/config/sync/field.field.node.vba_facility.field_table_of_contents.yml b/config/sync/field.field.node.vba_facility.field_table_of_contents.yml index 2b77967703..e34d03d860 100644 --- a/config/sync/field.field.node.vba_facility.field_table_of_contents.yml +++ b/config/sync/field.field.node.vba_facility.field_table_of_contents.yml @@ -25,6 +25,6 @@ default_value: default_value_callback: '' settings: markup: - value: "

Editing this content

\r\n\r\n

Provide Veterans with the basic information they need to plan a visit to a VBA facility. Some content won’t be editable because it comes from other sources. Learn more by hovering over the “?.”

\r\n\r\n

For full guidance, see How to edit VBA facility pages.

\r\n\r\n

Jump to edit...

\r\n\r\n

Operating status

\r\n\r\n

Top of page information

\r\n\r\n

Locations and contact information

\r\n\r\n

Services

\r\n\r\n

Content

\r\n" + value: "

Editing this content

Provide Veterans with the information they need to plan a visit to a VBA facility. Some content won’t be editable because it comes from other sources.\L

For more guidance, learn how to edit VBA facility pages (opens in a new window).

On this page

Banner alert

Benefit office overview

Location and contact information

Prepare for your visit

Spotlight content

Facility services

Can't find the service you're looking for?

Get updates from VBA

Other VA locations

Content

" format: rich_text field_type: markup diff --git a/config/sync/field.field.paragraph.basic_accordion.field_header.yml b/config/sync/field.field.paragraph.basic_accordion.field_header.yml index d0d793e8e2..6a685240d5 100644 --- a/config/sync/field.field.paragraph.basic_accordion.field_header.yml +++ b/config/sync/field.field.paragraph.basic_accordion.field_header.yml @@ -5,12 +5,17 @@ dependencies: config: - field.storage.paragraph.field_header - paragraphs.paragraphs_type.basic_accordion + module: + - tmgmt_content +third_party_settings: + tmgmt_content: + excluded: false id: paragraph.basic_accordion.field_header field_name: field_header entity_type: paragraph bundle: basic_accordion label: Header -description: '' +description: 'This is shown when the accordion is open or closed.' required: true translatable: false default_value: { } diff --git a/config/sync/field.field.paragraph.basic_accordion.field_rich_wysiwyg.yml b/config/sync/field.field.paragraph.basic_accordion.field_rich_wysiwyg.yml index f22886ed3d..042ec0eeb7 100644 --- a/config/sync/field.field.paragraph.basic_accordion.field_rich_wysiwyg.yml +++ b/config/sync/field.field.paragraph.basic_accordion.field_rich_wysiwyg.yml @@ -8,19 +8,23 @@ dependencies: module: - allowed_formats - text + - tmgmt_content third_party_settings: allowed_formats: allowed_formats: - rich_text_limited + tmgmt_content: + excluded: false id: paragraph.basic_accordion.field_rich_wysiwyg field_name: field_rich_wysiwyg entity_type: paragraph bundle: basic_accordion -label: 'Rich text' -description: '' +label: Content +description: 'Accordion content should be kept succinct and follow VA content guidance (opens in a new window).' required: true translatable: false default_value: { } default_value_callback: '' -settings: { } +settings: + allowed_formats: { } field_type: text_long diff --git a/config/sync/field.field.paragraph.button.field_button_label.yml b/config/sync/field.field.paragraph.button.field_button_label.yml index e2038689e4..2fa3a17e73 100644 --- a/config/sync/field.field.paragraph.button.field_button_label.yml +++ b/config/sync/field.field.paragraph.button.field_button_label.yml @@ -5,12 +5,17 @@ dependencies: config: - field.storage.paragraph.field_button_label - paragraphs.paragraphs_type.button + module: + - tmgmt_content +third_party_settings: + tmgmt_content: + excluded: false id: paragraph.button.field_button_label field_name: field_button_label entity_type: paragraph bundle: button label: 'Link text' -description: '' +description: 'This text should describe the purpose of the link. Additional tips are on the VA content style guide links page (opens in a new window).' required: true translatable: true default_value: { } diff --git a/config/sync/field.field.paragraph.button.field_button_link.yml b/config/sync/field.field.paragraph.button.field_button_link.yml index efe5353460..f49fd03ce5 100644 --- a/config/sync/field.field.paragraph.button.field_button_link.yml +++ b/config/sync/field.field.paragraph.button.field_button_link.yml @@ -7,6 +7,10 @@ dependencies: - paragraphs.paragraphs_type.button module: - link + - tmgmt_content +third_party_settings: + tmgmt_content: + excluded: false id: paragraph.button.field_button_link field_name: field_button_link entity_type: paragraph diff --git a/config/sync/field.field.paragraph.featured_content.field_description.yml b/config/sync/field.field.paragraph.featured_content.field_description.yml index ad47bbc057..4e32bde3b0 100644 --- a/config/sync/field.field.paragraph.featured_content.field_description.yml +++ b/config/sync/field.field.paragraph.featured_content.field_description.yml @@ -8,19 +8,23 @@ dependencies: module: - allowed_formats - text + - tmgmt_content third_party_settings: allowed_formats: allowed_formats: - rich_text_limited + tmgmt_content: + excluded: false id: paragraph.featured_content.field_description field_name: field_description entity_type: paragraph bundle: featured_content label: Description -description: '' +description: 'Briefly describe the service, event, or news.' required: true translatable: false default_value: { } default_value_callback: '' -settings: { } +settings: + allowed_formats: { } field_type: text_long diff --git a/config/sync/field.field.paragraph.featured_content.field_section_header.yml b/config/sync/field.field.paragraph.featured_content.field_section_header.yml index 725140e910..1fb4b7eafa 100644 --- a/config/sync/field.field.paragraph.featured_content.field_section_header.yml +++ b/config/sync/field.field.paragraph.featured_content.field_section_header.yml @@ -5,12 +5,17 @@ dependencies: config: - field.storage.paragraph.field_section_header - paragraphs.paragraphs_type.featured_content + module: + - tmgmt_content +third_party_settings: + tmgmt_content: + excluded: false id: paragraph.featured_content.field_section_header field_name: field_section_header entity_type: paragraph bundle: featured_content label: Title -description: '' +description: 'This title should be in sentence case and follow VA content guidance (opens in a new window). ' required: true translatable: false default_value: { } diff --git a/docroot/modules/custom/va_gov_consumers/va_gov_consumers.module b/docroot/modules/custom/va_gov_consumers/va_gov_consumers.module index cb87e4e4e8..e461fca085 100644 --- a/docroot/modules/custom/va_gov_consumers/va_gov_consumers.module +++ b/docroot/modules/custom/va_gov_consumers/va_gov_consumers.module @@ -313,8 +313,10 @@ function _va_gov_consumers_disable_external_content_editing(array &$form, FormSt } elseif (isset($form['external_content'])) { // We want the external content to appear in the fieldgroup - // group_locations_and_contact_info on other node types. + // group_locations_and_contact_info on other node types + // and at the bottom when other elements are present. $form['group_locations_and_contact_info']['external_content'] = $form['external_content']; + $form['group_locations_and_contact_info']['external_content']['#weight'] = 10; unset($form['external_content']); } } diff --git a/docroot/themes/custom/vagovclaro/assets/scss/components/_centralized_content.scss b/docroot/themes/custom/vagovclaro/assets/scss/components/_centralized_content.scss index e2a7245aba..b08f08ed9a 100644 --- a/docroot/themes/custom/vagovclaro/assets/scss/components/_centralized_content.scss +++ b/docroot/themes/custom/vagovclaro/assets/scss/components/_centralized_content.scss @@ -18,6 +18,11 @@ height: 0; visibility: hidden; } + + // Nested fieldsets should look like the rest of centralized + fieldset { + background-color: var(--va-gray-lightest) !important; + } } // Colors scope sections on node view page diff --git a/docroot/themes/custom/vagovclaro/assets/scss/components/_external_content.scss b/docroot/themes/custom/vagovclaro/assets/scss/components/_external_content.scss index 58d6eb4445..e39a75cee2 100644 --- a/docroot/themes/custom/vagovclaro/assets/scss/components/_external_content.scss +++ b/docroot/themes/custom/vagovclaro/assets/scss/components/_external_content.scss @@ -14,10 +14,6 @@ } } -#external-content h3 { - text-transform: uppercase; -} - #block-vagovclaro-content { .field--name-field-va-health-connect-phone, .field--name-field-vamc-ehr-system { From 49f357e662edad62188b4fb7273ed381bae66d0e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Feb 2024 19:47:07 -0800 Subject: [PATCH 03/16] Bump drupal/codit_menu_tools from 1.0.0-alpha5 to 1.0.1 (#17203) Bumps drupal/codit_menu_tools from 1.0.0-alpha5 to 1.0.1. --- updated-dependencies: - dependency-name: drupal/codit_menu_tools dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.lock b/composer.lock index 3feac7b66e..30afbf6c26 100644 --- a/composer.lock +++ b/composer.lock @@ -3055,17 +3055,17 @@ }, { "name": "drupal/codit_menu_tools", - "version": "1.0.0-alpha5", + "version": "1.0.1", "source": { "type": "git", "url": "https://git.drupalcode.org/project/codit_menu_tools.git", - "reference": "1.0.0-alpha5" + "reference": "1.0.1" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/codit_menu_tools-1.0.0-alpha5.zip", - "reference": "1.0.0-alpha5", - "shasum": "4dff97ae333a7ae80765403c252f551887210dc6" + "url": "https://ftp.drupal.org/files/projects/codit_menu_tools-1.0.1.zip", + "reference": "1.0.1", + "shasum": "06327db394d467cf1dcb40db4328364d32822a7a" }, "require": { "drupal/core": "^10" @@ -3073,11 +3073,11 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "1.0.0-alpha5", - "datestamp": "1707500832", + "version": "1.0.1", + "datestamp": "1707535222", "security-coverage": { - "status": "not-covered", - "message": "Alpha releases are not covered by Drupal security advisories." + "status": "covered", + "message": "Covered by Drupal's security advisory policy" } } }, From f3db5a3dfa9804de5ee2dac45f603b5431ffeff4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 09:01:56 -0500 Subject: [PATCH 04/16] Bump int128/datadog-actions-metrics from 1.79.0 to 1.80.0 (#17207) Bumps [int128/datadog-actions-metrics](https://github.com/int128/datadog-actions-metrics) from 1.79.0 to 1.80.0. - [Release notes](https://github.com/int128/datadog-actions-metrics/releases) - [Commits](https://github.com/int128/datadog-actions-metrics/compare/af1a1a70bb380b079e38053d5fb32ae907ce2b6a...2ca3c09b18e2185806a071ed29fd5a02b75f8599) --- updated-dependencies: - dependency-name: int128/datadog-actions-metrics dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/actions-metrics.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions-metrics.yml b/.github/workflows/actions-metrics.yml index f1ec78d3fa..2bfbb7f781 100644 --- a/.github/workflows/actions-metrics.yml +++ b/.github/workflows/actions-metrics.yml @@ -11,7 +11,7 @@ jobs: timeout-minutes: 10 steps: - name: Send GitHub Actions metrics to DataDog - uses: int128/datadog-actions-metrics@af1a1a70bb380b079e38053d5fb32ae907ce2b6a # v1.79.0 + uses: int128/datadog-actions-metrics@2ca3c09b18e2185806a071ed29fd5a02b75f8599 # v1.80.0 with: datadog-api-key: ${{ secrets.DATADOG_API_KEY }} collect-job-metrics: true From 155593165a53eb3452ea70daa601d1071cd845d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 09:02:16 -0500 Subject: [PATCH 05/16] Bump reviewdog/action-eslint from 1.22.0 to 1.23.0 (#17206) Bumps [reviewdog/action-eslint](https://github.com/reviewdog/action-eslint) from 1.22.0 to 1.23.0. - [Release notes](https://github.com/reviewdog/action-eslint/releases) - [Commits](https://github.com/reviewdog/action-eslint/compare/5deb8e2c1d8a9bbefff4d80d6702c41c5b3729cb...b3c5aa2589ed06195b52faffd3afb108c02faaf5) --- updated-dependencies: - dependency-name: reviewdog/action-eslint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/continuous_integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 5ea204ed62..158d5fc841 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -43,7 +43,7 @@ jobs: uses: ./.github/actions/post-checkout - name: ReviewDog # See also `composer va:test:eslint` in composer.json - uses: reviewdog/action-eslint@5deb8e2c1d8a9bbefff4d80d6702c41c5b3729cb # v1.22.0 + uses: reviewdog/action-eslint@b3c5aa2589ed06195b52faffd3afb108c02faaf5 # v1.23.0 with: reporter: github-pr-review eslint_flags: '--max-warnings 0 -c .eslintrc.json --no-eslintrc docroot/modules/custom/**/*.es6.js docroot/themes/custom/**/*.es6.js tests/cypress/**/*.js' From bd7f28a1ea6e8143480cbf3b176c353883e22ea3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 10:17:09 -0500 Subject: [PATCH 06/16] Bump reviewdog/action-stylelint from 1.18.1 to 1.22.1 (#17204) Bumps [reviewdog/action-stylelint](https://github.com/reviewdog/action-stylelint) from 1.18.1 to 1.22.1. - [Release notes](https://github.com/reviewdog/action-stylelint/releases) - [Commits](https://github.com/reviewdog/action-stylelint/compare/548276a94275c7865effa8d72fa8b6983d9f47c4...eadef3f639793f2b361a4719ee8720bf5055a0ff) --- updated-dependencies: - dependency-name: reviewdog/action-stylelint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/continuous_integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 158d5fc841..e21798631f 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -139,7 +139,7 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Stylelint modules # See also `composer va:test:stylelint-modules` in composer.json - uses: reviewdog/action-stylelint@548276a94275c7865effa8d72fa8b6983d9f47c4 # v1.18.1 + uses: reviewdog/action-stylelint@eadef3f639793f2b361a4719ee8720bf5055a0ff # v1.22.1 with: fail_on_error: true github_token: ${{ secrets.github_token }} @@ -149,7 +149,7 @@ jobs: stylelint_input: 'docroot/modules/custom/**/*.css' - name: Stylelint themes # See also `composer va:test:stylelint-themes` in composer.json - uses: reviewdog/action-stylelint@548276a94275c7865effa8d72fa8b6983d9f47c4 # v1.18.1 + uses: reviewdog/action-stylelint@eadef3f639793f2b361a4719ee8720bf5055a0ff # v1.22.1 with: fail_on_error: true github_token: ${{ secrets.github_token }} From 54a87cebfded60f422cb72dd5e800fc5cf2a625b Mon Sep 17 00:00:00 2001 From: Steve Wirt Date: Mon, 12 Feb 2024 12:29:02 -0500 Subject: [PATCH 07/16] VACMS-16233 Reorder VAMC menus (#17189) * VACMS-4943 Remove VA Leavenworh menu. It is empty and not used. * VACMS-4943 Remove VA Topeka menu. It is empty and not used. * VACMS-14683 Bring in scripts changes from 14683. * VACMS-16233 Add reorder VAMC System menu items. --- ...ent.va-leavenworth-health-care.changed.yml | 18 -- ...va-leavenworth-health-care.description.yml | 18 -- ...ent.va-leavenworth-health-care.metatag.yml | 18 -- ...ntent.va-leavenworth-health-care.title.yml | 18 -- ...t.va-leavenworth-health-care.view_mode.yml | 20 -- ..._content.va-topeka-health-care.changed.yml | 18 -- ...tent.va-topeka-health-care.description.yml | 18 -- ..._content.va-topeka-health-care.metatag.yml | 18 -- ...nk_content.va-topeka-health-care.title.yml | 18 -- ...ontent.va-topeka-health-care.view_mode.yml | 20 -- ...ink_content.va-leavenworth-health-care.yml | 18 -- ...enu_link_content.va-topeka-health-care.yml | 18 -- ...system.menu.va-leavenworth-health-care.yml | 14 -- .../system.menu.va-topeka-health-care.yml | 14 -- .../VACMS-16233-reorder-vamc-menu-items.php | 99 ++++++++++ scripts/content/script-library.php | 174 +++++++++++++++++- 16 files changed, 268 insertions(+), 253 deletions(-) delete mode 100644 config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.changed.yml delete mode 100644 config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.description.yml delete mode 100644 config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.metatag.yml delete mode 100644 config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.title.yml delete mode 100644 config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.view_mode.yml delete mode 100644 config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.changed.yml delete mode 100644 config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.description.yml delete mode 100644 config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.metatag.yml delete mode 100644 config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.title.yml delete mode 100644 config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.view_mode.yml delete mode 100644 config/sync/language.content_settings.menu_link_content.va-leavenworth-health-care.yml delete mode 100644 config/sync/language.content_settings.menu_link_content.va-topeka-health-care.yml delete mode 100644 config/sync/system.menu.va-leavenworth-health-care.yml delete mode 100644 config/sync/system.menu.va-topeka-health-care.yml create mode 100644 scripts/content/VACMS-16233-reorder-vamc-menu-items.php diff --git a/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.changed.yml b/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.changed.yml deleted file mode 100644 index 3d4cd89268..0000000000 --- a/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.changed.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: 3f2d2ec2-879e-47d8-a8cc-5d09217436e4 -langcode: en -status: true -dependencies: - config: - - system.menu.va-leavenworth-health-care -id: menu_link_content.va-leavenworth-health-care.changed -field_name: changed -entity_type: menu_link_content -bundle: va-leavenworth-health-care -label: Changed -description: 'The time that the menu link was last edited.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: changed diff --git a/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.description.yml b/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.description.yml deleted file mode 100644 index a222be04cf..0000000000 --- a/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.description.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: ef139ac8-8c31-4da1-86f0-8af6d9749032 -langcode: en -status: true -dependencies: - config: - - system.menu.va-leavenworth-health-care -id: menu_link_content.va-leavenworth-health-care.description -field_name: description -entity_type: menu_link_content -bundle: va-leavenworth-health-care -label: Description -description: 'Shown when hovering over the menu link.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.metatag.yml b/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.metatag.yml deleted file mode 100644 index 8b4f04fae8..0000000000 --- a/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.metatag.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: f8faf9ea-96fb-49b4-89a1-85f599800efc -langcode: en -status: true -dependencies: - config: - - system.menu.va-leavenworth-health-care -id: menu_link_content.va-leavenworth-health-care.metatag -field_name: metatag -entity_type: menu_link_content -bundle: va-leavenworth-health-care -label: 'Metatags (Hidden field for JSON support)' -description: 'The meta tags for the entity.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: map diff --git a/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.title.yml b/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.title.yml deleted file mode 100644 index 3651823a04..0000000000 --- a/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.title.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: 45771ebb-ff9f-4d41-8091-199095f6980c -langcode: en -status: true -dependencies: - config: - - system.menu.va-leavenworth-health-care -id: menu_link_content.va-leavenworth-health-care.title -field_name: title -entity_type: menu_link_content -bundle: va-leavenworth-health-care -label: 'Menu link title' -description: 'The text to be used for this link in the menu.' -required: true -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.view_mode.yml b/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.view_mode.yml deleted file mode 100644 index f847dbe409..0000000000 --- a/config/sync/core.base_field_override.menu_link_content.va-leavenworth-health-care.view_mode.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: b967b3f4-3b6a-4952-8bdd-1e29215e7d8b -langcode: en -status: true -dependencies: - config: - - system.menu.va-leavenworth-health-care - module: - - menu_item_extras -id: menu_link_content.va-leavenworth-health-care.view_mode -field_name: view_mode -entity_type: menu_link_content -bundle: va-leavenworth-health-care -label: 'View mode' -description: 'Per item view mode selector.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.changed.yml b/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.changed.yml deleted file mode 100644 index ec451acb13..0000000000 --- a/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.changed.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: 53d9a2c1-1088-4094-b3bb-abc9e2385fe5 -langcode: en -status: true -dependencies: - config: - - system.menu.va-topeka-health-care -id: menu_link_content.va-topeka-health-care.changed -field_name: changed -entity_type: menu_link_content -bundle: va-topeka-health-care -label: Changed -description: 'The time that the menu link was last edited.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: changed diff --git a/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.description.yml b/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.description.yml deleted file mode 100644 index 51dc51476b..0000000000 --- a/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.description.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: 87dd9f31-45a2-47e2-af3a-eb37a7f620d2 -langcode: en -status: true -dependencies: - config: - - system.menu.va-topeka-health-care -id: menu_link_content.va-topeka-health-care.description -field_name: description -entity_type: menu_link_content -bundle: va-topeka-health-care -label: Description -description: 'Shown when hovering over the menu link.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.metatag.yml b/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.metatag.yml deleted file mode 100644 index dd4a79ef27..0000000000 --- a/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.metatag.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: da6103a5-de28-41dd-b4f0-53087bee2889 -langcode: en -status: true -dependencies: - config: - - system.menu.va-topeka-health-care -id: menu_link_content.va-topeka-health-care.metatag -field_name: metatag -entity_type: menu_link_content -bundle: va-topeka-health-care -label: 'Metatags (Hidden field for JSON support)' -description: 'The meta tags for the entity.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: map diff --git a/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.title.yml b/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.title.yml deleted file mode 100644 index 78836b9b2a..0000000000 --- a/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.title.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: bf001922-b5fd-479d-acab-a25fb32ebca6 -langcode: en -status: true -dependencies: - config: - - system.menu.va-topeka-health-care -id: menu_link_content.va-topeka-health-care.title -field_name: title -entity_type: menu_link_content -bundle: va-topeka-health-care -label: 'Menu link title' -description: 'The text to be used for this link in the menu.' -required: true -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.view_mode.yml b/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.view_mode.yml deleted file mode 100644 index 219cb08a5e..0000000000 --- a/config/sync/core.base_field_override.menu_link_content.va-topeka-health-care.view_mode.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 24007f4e-cbb3-4b84-a87f-1416ee0818fb -langcode: en -status: true -dependencies: - config: - - system.menu.va-topeka-health-care - module: - - menu_item_extras -id: menu_link_content.va-topeka-health-care.view_mode -field_name: view_mode -entity_type: menu_link_content -bundle: va-topeka-health-care -label: 'View mode' -description: 'Per item view mode selector.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/config/sync/language.content_settings.menu_link_content.va-leavenworth-health-care.yml b/config/sync/language.content_settings.menu_link_content.va-leavenworth-health-care.yml deleted file mode 100644 index ea070a35f9..0000000000 --- a/config/sync/language.content_settings.menu_link_content.va-leavenworth-health-care.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: 79299311-302d-4d60-a3ef-cecf4524d356 -langcode: en -status: true -dependencies: - config: - - system.menu.va-leavenworth-health-care - module: - - content_translation -third_party_settings: - content_translation: - enabled: false - bundle_settings: - untranslatable_fields_hide: '0' -id: menu_link_content.va-leavenworth-health-care -target_entity_type_id: menu_link_content -target_bundle: va-leavenworth-health-care -default_langcode: site_default -language_alterable: false diff --git a/config/sync/language.content_settings.menu_link_content.va-topeka-health-care.yml b/config/sync/language.content_settings.menu_link_content.va-topeka-health-care.yml deleted file mode 100644 index bbf25f9eaf..0000000000 --- a/config/sync/language.content_settings.menu_link_content.va-topeka-health-care.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: 22aacb56-0220-4aaa-9a8f-f999dd970e91 -langcode: en -status: true -dependencies: - config: - - system.menu.va-topeka-health-care - module: - - content_translation -third_party_settings: - content_translation: - enabled: false - bundle_settings: - untranslatable_fields_hide: '0' -id: menu_link_content.va-topeka-health-care -target_entity_type_id: menu_link_content -target_bundle: va-topeka-health-care -default_langcode: site_default -language_alterable: false diff --git a/config/sync/system.menu.va-leavenworth-health-care.yml b/config/sync/system.menu.va-leavenworth-health-care.yml deleted file mode 100644 index f982dc911b..0000000000 --- a/config/sync/system.menu.va-leavenworth-health-care.yml +++ /dev/null @@ -1,14 +0,0 @@ -uuid: efdadc4b-3464-454c-975d-0cd0a83b883a -langcode: en -status: true -dependencies: - module: - - workbench_menu_access -third_party_settings: - workbench_menu_access: - access_scheme: - 356: '356' -id: va-leavenworth-health-care -label: 'VA Leavenworth health care' -description: 'VISN 15 | va.gov/leavenworth-health-care' -locked: false diff --git a/config/sync/system.menu.va-topeka-health-care.yml b/config/sync/system.menu.va-topeka-health-care.yml deleted file mode 100644 index 117c10a37d..0000000000 --- a/config/sync/system.menu.va-topeka-health-care.yml +++ /dev/null @@ -1,14 +0,0 @@ -uuid: 07a6a9a5-dfe2-4b02-8466-526d27a5d24d -langcode: en -status: true -dependencies: - module: - - workbench_menu_access -third_party_settings: - workbench_menu_access: - access_scheme: - 360: '360' -id: va-topeka-health-care -label: 'VA Topeka health care' -description: 'VISN 15 | va.gov/topeka-health-care' -locked: false diff --git a/scripts/content/VACMS-16233-reorder-vamc-menu-items.php b/scripts/content/VACMS-16233-reorder-vamc-menu-items.php new file mode 100644 index 0000000000..41123b2247 --- /dev/null +++ b/scripts/content/VACMS-16233-reorder-vamc-menu-items.php @@ -0,0 +1,99 @@ + 0]; + do { + print(va_gov_vamc_deploy_resort_vamc_menus($sandbox)); + } while ($sandbox['#finished'] < 1); + + return "Script run complete. All menus should have been updated. "; +} + +/** + * Re-sort VAMC menus. + * + * @param mixed $sandbox + * Batch sandbox to keep state during multiple runs. + * + * @return string + * The message to be output. + */ +function va_gov_vamc_deploy_resort_vamc_menus(&$sandbox) { + script_library_sandbox_init($sandbox, '_va_gov_vamc_get_system_menus', []); + _va_gov_vamc_arrange_menus($sandbox); + return script_library_sandbox_complete($sandbox, "Re-arranged @total VAMC System Menus."); +} + +/** + * Get all VAMC system menus. + * + * @return array + * An array of VAMC system menus ['machine_name' => 'Human Name']. + */ +function _va_gov_vamc_get_system_menus(): array { + // Load the menus. + $vamc_menus = MenuManipulator::getAllMenuNames('-health-'); + $non_name_compliant_menus = [ + 'va-central-western-massachusetts' => 'VA Central Western Massachusetts health care', + 'va-columbia-south-carolina-healt' => 'VA Columbia South Carolina health care', + 'va-lebanon' => 'VA Lebanon health care', + ]; + + return array_merge($vamc_menus, $non_name_compliant_menus); +} + +/** + * Re-arranges existing VAMC menus to match a pattern. + * + * @param mixed $sandbox + * Batch sandbox to keep state during multiple runs. + * + * @return string + * A message to be output. + */ +function _va_gov_vamc_arrange_menus(&$sandbox) { + $menu_name = array_key_first($sandbox['items_to_process']); + $pattern = [ + 'About us', + 'Programs', + 'Research', + 'Policies', + 'VA police', + 'Work with us', + 'Contact us', + ]; + $menu_arranger = new MenuManipulator($menu_name); + $menu_arranger->matchPattern($pattern); + $message = "The menu {$sandbox['items_to_process'][$menu_name]} had been rearranged."; + unset($sandbox['items_to_process'][$menu_name]); + $sandbox['current']++; + + return $message; +} diff --git a/scripts/content/script-library.php b/scripts/content/script-library.php index b78c6799ec..6363a152b9 100644 --- a/scripts/content/script-library.php +++ b/scripts/content/script-library.php @@ -3,13 +3,21 @@ /** * @file * Common code related to drupal content scripts. + * + * This file can also be included in other things that run during non-full + * bootstrap processes like hook_update_n, post update, and deploy. + * Put the following line wherever you want to use this library. + * require_once __DIR__ . '/script-library.php'; */ +use Drupal\Component\Render\FormattableMarkup; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Utility\UpdateException; use Drupal\node\NodeInterface; use Drupal\node\NodeStorageInterface; use Drupal\taxonomy\Entity\Term; use Drupal\user\UserStorageInterface; +use Psr\Log\LogLevel; const CMS_MIGRATOR_ID = 1317; @@ -152,6 +160,37 @@ function normalize_crisis_number($input, $plain = FALSE): string { return $output; } +/** + * Get an array of node ids for batch processing. + * + * @param string $node_bundle + * The bundle name of the nodes to lookup. + * @param bool $published_only + * TRUE if you need only published nodes. + * + * @return array + * An array of nids for for the requested bundle. + */ +function get_nids_of_type($node_bundle, $published_only = FALSE): array { + $query = \Drupal::entityQuery('node') + ->condition('type', $node_bundle) + ->accessCheck(FALSE); + if ($published_only) { + $query->condition('status', 1); + } + + $nids = $query->execute(); + // Having a node ids as a numeric keyed array is problematic when it comes + // to removing things from the array. As soon as you unset one, the array + // becomes renumbered. So we create string keys, with numeric values. + // [35, 75, 20] becomes + // ['node_35' => 35, 'node_75' => 75, 'node_20' => 20]. + $node_ids = array_combine( + array_map('_va_gov_stringifynid', array_values($nids)), + array_values($nids)); + return $node_ids; +} + /** * Saves a node revision with log messaging. * @@ -170,16 +209,18 @@ function save_node_revision(NodeInterface $node, $message = '', $new = TRUE): in $node->setNewRevision($new); $node->setSyncing(TRUE); $node->setValidationRequired(FALSE); + $node->enforceIsNew(FALSE); // New revisions deserve special treatment. if ($new) { - $node->enforceIsNew(TRUE); $node->setChangedTime(time()); $node->setRevisionCreationTime(time()); $uid = CMS_MIGRATOR_ID; } else { - $node->enforceIsNew(FALSE); $uid = $node->getRevisionUserId(); + // Append new log message to previous log message. + $prefix = !empty($message) ? $node->getRevisionLogMessage() . ' - ' : ''; + $message = $prefix . $message; } $node->setRevisionUserId($uid); $revision_time = $node->getRevisionCreationTime(); @@ -188,9 +229,7 @@ function save_node_revision(NodeInterface $node, $message = '', $new = TRUE): in // the value is not different from the original value. $revision_time++; $node->setRevisionCreationTime($revision_time); - // Append new log message to previous log message. - $prefix = !empty($message) ? $node->getRevisionLogMessage() . ' - ' : ''; - $node->setRevisionLogMessage($prefix . $message); + $node->setRevisionLogMessage($message); $node->set('moderation_state', $moderation_state); return $node->save(); @@ -258,6 +297,131 @@ function save_new_terms($vocabulary_id, array $terms): int { return $terms_created; } +/** + * Initializes the basic sandbox values. + * + * @param array $sandbox + * Standard drupal $sandbox var to keep state in hook_update_N. + * @param string $counter_callback + * A function name to call to get the items to process. Must return an array. + * @param array $callback_args + * A flat array of arguments to pass to the counter_callback. + * + * @throws Drupal\Core\Utility\UpdateException + * If the counter callback can not be found. + */ +function script_library_sandbox_init(array &$sandbox, $counter_callback, array $callback_args = []) { + if (empty($sandbox['total'])) { + // Sandbox has not been initiated. + if (is_callable($counter_callback)) { + $sandbox['items_to_process'] = call_user_func_array($counter_callback, $callback_args); + $sandbox['total'] = count($sandbox['items_to_process']); + $sandbox['current'] = 0; + } + else { + // Something went wrong could not use callback. Throw exception. + throw new UpdateException( + "Counter callback {$counter_callback} provided in script_library_sandbox_init() is not callable. Can not proceed." + ); + } + } +} + +/** + * Updates the counts and log if complete. + * + * @param array $sandbox + * Hook_update_n sandbox for keeping state. + * @param string $completed_message + * Message to log when completed. Can use '@completed' and '@total' as tokens. + * + * @return string + * String to be used as update hook messages. + */ +function script_library_sandbox_complete(array &$sandbox, $completed_message) { + // Determine when to stop batching. + $sandbox['current'] = ($sandbox['total'] - count($sandbox['items_to_process'])); + $sandbox['#finished'] = (empty($sandbox['total'])) ? 1 : ($sandbox['current'] / $sandbox['total']); + $vars = [ + '@completed' => $sandbox['current'], + '@total' => $sandbox['total'], + ]; + $message = t('Processing... @completed/@total.', $vars) . PHP_EOL; + // Log the all finished notice. + if ($sandbox['#finished'] === 1) { + Drupal::logger('va_gov_vamc')->log(LogLevel::INFO, $completed_message, $vars); + $logged_message = new FormattableMarkup($completed_message, $vars); + $message = t('Process completed:') . " {$logged_message}" . PHP_EOL; + } + return $message; +} + +/** + * Lookup a key in a map array and return the value from the map. + * + * @param string|null $lookup + * A map key to lookup. Do not lookup int as indexes can shift. + * @param array $map + * An array containing string key value pairs. [lookup => value]. + * @param bool $strict + * TRUE = only want a value from the array, FALSE = want your lookup back. + * + * @return mixed + * Whatever the value associated with the key. + */ +function script_libary_map_to_value(string|null $lookup, array $map, bool $strict = TRUE) : mixed { + if (empty($lookup)) { + if (isset($map['default'])) { + // There is a default set, so use it. + return $map['default']; + } + elseif ($strict) { + return NULL; + } + else { + return $lookup; + } + } + if ($strict) { + // Strict, so either it is there, or nothing. + return $map[$lookup] ?? NULL; + } + else { + // Not strict, so pass back what given it its not in the map. + return $map[$lookup] ?? $lookup; + } +} + +/** + * Turns on or off queueing of items to the post_api. + * + * CAUTION: The only time we would want to fully disable queueing is during a + * deploy when editors can not save anything. + * + * @param bool $state + * TRUE to toggle the settings on, FALSE to toggle them off. + */ +function script_library_disable_post_api_queueing(bool $state): void { + $on = ($state) ? 1 : 0; + $config_post_api = \Drupal::configFactory()->getEditable('post_api.settings'); + $config_post_api->set('disable_queueing', $on) + ->save(FALSE); + script_library_skip_post_api_data_check($state); +} + +/** + * Turns on or off data checks and deduping for adding items to post_api queue. + * + * @param bool $state + * TRUE to toggle the settings on, FALSE to toggle them off. + */ +function script_library_skip_post_api_data_check(bool $state): void { + $on = ($state) ? 1 : 0; + $config_va_gov_post_api = \Drupal::configFactory()->getEditable('va_gov_post_api.settings'); + $config_va_gov_post_api->set('bypass_data_check', $on) + ->save(FALSE); +} + /** * Callback function to concat node ids with string. * From 7eaf876f786498358a3de279b1d3f20e81431672 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 11:30:32 -0800 Subject: [PATCH 08/16] Bump va-gov/content-build from 0.0.3437 to 0.0.3438 (#17180) Bumps [va-gov/content-build](https://github.com/department-of-veterans-affairs/content-build) from 0.0.3437 to 0.0.3438. - [Release notes](https://github.com/department-of-veterans-affairs/content-build/releases) - [Commits](https://github.com/department-of-veterans-affairs/content-build/compare/v0.0.3437...v0.0.3438) --- updated-dependencies: - dependency-name: va-gov/content-build dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Edmund Dunn <109987005+edmund-dunn@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 9e9478136f..ca884a10c7 100644 --- a/composer.json +++ b/composer.json @@ -221,7 +221,7 @@ "symfony/phpunit-bridge": "^5.1", "symfony/process": "^6.3", "symfony/routing": "^6.3", - "va-gov/content-build": "^0.0.3437", + "va-gov/content-build": "^0.0.3438", "vlucas/phpdotenv": "^5.3", "webflo/drupal-finder": "^1.0.0", "webmozart/path-util": "^2.3", diff --git a/composer.lock b/composer.lock index 30afbf6c26..0da326200d 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "5a2e47403b810bc18a1b3c3793555a6a", + "content-hash": "6ca07aefb604394deced04a91e7826c7", "packages": [ { "name": "asm89/stack-cors", @@ -25807,7 +25807,7 @@ }, { "name": "va-gov/content-build", - "version": "v0.0.3437", + "version": "v0.0.3438", "source": { "type": "git", "url": "https://github.com/department-of-veterans-affairs/content-build.git", @@ -25843,7 +25843,7 @@ "description": "Front-end for VA.gov. This repository contains the code that generates the www.va.gov website. It contains a Metalsmith static site builder that uses a Drupal CMS for content. This file is here to publish releases to https://packagist.org/packages/va-gov/content-build, so that the CMS CI system can install it and update it using standard composer processes, and so that we can run tests across both systems. See https://github.com/department-of-veterans-affairs/va.gov-cms for the CMS repo, and stand by for more documentation.", "support": { "issues": "https://github.com/department-of-veterans-affairs/content-build/issues", - "source": "https://github.com/department-of-veterans-affairs/content-build/tree/v0.0.3437" + "source": "https://github.com/department-of-veterans-affairs/content-build/tree/v0.0.3438" }, "time": "2024-02-06T20:33:35+00:00" }, From 3bebdbd0b2fb86fad62af6788b8ec642ef1986c5 Mon Sep 17 00:00:00 2001 From: Nate Douglas Date: Mon, 12 Feb 2024 16:11:17 -0500 Subject: [PATCH 09/16] Update tugboat.md --- READMES/devops/tugboat.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/READMES/devops/tugboat.md b/READMES/devops/tugboat.md index de0332abaa..e0551b3ef6 100644 --- a/READMES/devops/tugboat.md +++ b/READMES/devops/tugboat.md @@ -36,6 +36,8 @@ Can only update CPU and memory at a project level, not repository level. ## Tugboat Crisis Intervention +Shelling into the Tugboat server can be accomplished with `ssm-session tugboat utility`. + ### Overload **Symptoms**: Tugboat is slow, requests to Tugboat dashboard return 502/504 status codes, previews disappear and reappear, etc. From 6293b563505044c05f318d767e0b0fd34ba62e41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 18:01:05 -0800 Subject: [PATCH 10/16] Bump va-gov/content-build from 0.0.3438 to 0.0.3439 (#17217) Bumps [va-gov/content-build](https://github.com/department-of-veterans-affairs/content-build) from 0.0.3438 to 0.0.3439. - [Release notes](https://github.com/department-of-veterans-affairs/content-build/releases) - [Commits](https://github.com/department-of-veterans-affairs/content-build/compare/v0.0.3438...v0.0.3439) --- updated-dependencies: - dependency-name: va-gov/content-build dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index ca884a10c7..e131258609 100644 --- a/composer.json +++ b/composer.json @@ -221,7 +221,7 @@ "symfony/phpunit-bridge": "^5.1", "symfony/process": "^6.3", "symfony/routing": "^6.3", - "va-gov/content-build": "^0.0.3438", + "va-gov/content-build": "^0.0.3439", "vlucas/phpdotenv": "^5.3", "webflo/drupal-finder": "^1.0.0", "webmozart/path-util": "^2.3", diff --git a/composer.lock b/composer.lock index 0da326200d..f24c39f1c6 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "6ca07aefb604394deced04a91e7826c7", + "content-hash": "15c7c7fba07e61d6be8de41d94c2619f", "packages": [ { "name": "asm89/stack-cors", @@ -25807,16 +25807,16 @@ }, { "name": "va-gov/content-build", - "version": "v0.0.3438", + "version": "v0.0.3439", "source": { "type": "git", "url": "https://github.com/department-of-veterans-affairs/content-build.git", - "reference": "7e1bb61b6bb656124410196ee2bb9933417c8db5" + "reference": "ef743f09f6c05b78d40bfb01730aac12f3d35988" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/department-of-veterans-affairs/content-build/zipball/7e1bb61b6bb656124410196ee2bb9933417c8db5", - "reference": "7e1bb61b6bb656124410196ee2bb9933417c8db5", + "url": "https://api.github.com/repos/department-of-veterans-affairs/content-build/zipball/ef743f09f6c05b78d40bfb01730aac12f3d35988", + "reference": "ef743f09f6c05b78d40bfb01730aac12f3d35988", "shasum": "" }, "type": "node-project", @@ -25843,9 +25843,9 @@ "description": "Front-end for VA.gov. This repository contains the code that generates the www.va.gov website. It contains a Metalsmith static site builder that uses a Drupal CMS for content. This file is here to publish releases to https://packagist.org/packages/va-gov/content-build, so that the CMS CI system can install it and update it using standard composer processes, and so that we can run tests across both systems. See https://github.com/department-of-veterans-affairs/va.gov-cms for the CMS repo, and stand by for more documentation.", "support": { "issues": "https://github.com/department-of-veterans-affairs/content-build/issues", - "source": "https://github.com/department-of-veterans-affairs/content-build/tree/v0.0.3438" + "source": "https://github.com/department-of-veterans-affairs/content-build/tree/v0.0.3439" }, - "time": "2024-02-06T20:33:35+00:00" + "time": "2024-02-08T21:53:11+00:00" }, { "name": "vlucas/phpdotenv", @@ -26816,6 +26816,7 @@ "drupal/cer": 10, "drupal/change_labels": 20, "drupal/ckeditor_abbreviation": 15, + "drupal/codit_menu_tools": 15, "drupal/components": 10, "drupal/danse_content_moderation": 10, "drupal/entity_block": 10, From abbd25885e5e944629d45d698a292efa445a869f Mon Sep 17 00:00:00 2001 From: Christian Burk Date: Tue, 13 Feb 2024 14:52:57 -0600 Subject: [PATCH 11/16] VACMS-17221: Restore field_intro_text (#17222) * Restores field.field.node.vba_facility.field_intro_text.yml * Restores field.field.node.vba_facility.field_intro_text.yml * Delete config/sync/config/sync directory Remove accidentally created directory --- ...eld.node.vba_facility.field_intro_text.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 config/sync/field.field.node.vba_facility.field_intro_text.yml diff --git a/config/sync/field.field.node.vba_facility.field_intro_text.yml b/config/sync/field.field.node.vba_facility.field_intro_text.yml new file mode 100644 index 0000000000..5a7e2cdc54 --- /dev/null +++ b/config/sync/field.field.node.vba_facility.field_intro_text.yml @@ -0,0 +1,19 @@ +uuid: 541dfb7a-95a2-44eb-9ac7-6d266d6a8345 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_intro_text + - node.type.vba_facility +id: node.vba_facility.field_intro_text +field_name: field_intro_text +entity_type: node +bundle: vba_facility +label: 'Page introduction' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string_long From 829e12ffcc33f440d62a4e5c38af5f5ae771c68f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:40:04 -0800 Subject: [PATCH 12/16] Bump drupal/codit_menu_tools from 1.0.1 to 1.0.3 (#17233) Bumps drupal/codit_menu_tools from 1.0.1 to 1.0.3. --- updated-dependencies: - dependency-name: drupal/codit_menu_tools dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/composer.lock b/composer.lock index f24c39f1c6..433eed340e 100644 --- a/composer.lock +++ b/composer.lock @@ -3055,17 +3055,17 @@ }, { "name": "drupal/codit_menu_tools", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://git.drupalcode.org/project/codit_menu_tools.git", - "reference": "1.0.1" + "reference": "1.0.3" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/codit_menu_tools-1.0.1.zip", - "reference": "1.0.1", - "shasum": "06327db394d467cf1dcb40db4328364d32822a7a" + "url": "https://ftp.drupal.org/files/projects/codit_menu_tools-1.0.3.zip", + "reference": "1.0.3", + "shasum": "090d85ecc45291e72da636ff2d51cd226f4366b7" }, "require": { "drupal/core": "^10" @@ -3073,8 +3073,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "1.0.1", - "datestamp": "1707535222", + "version": "1.0.3", + "datestamp": "1707873156", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -26816,7 +26816,6 @@ "drupal/cer": 10, "drupal/change_labels": 20, "drupal/ckeditor_abbreviation": 15, - "drupal/codit_menu_tools": 15, "drupal/components": 10, "drupal/danse_content_moderation": 10, "drupal/entity_block": 10, From 3ffc27a6ba33c6285465aaddd4e713badb5c8fe0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 18:37:03 -0800 Subject: [PATCH 13/16] Bump va-gov/content-build from 0.0.3439 to 0.0.3440 (#17246) Bumps [va-gov/content-build](https://github.com/department-of-veterans-affairs/content-build) from 0.0.3439 to 0.0.3440. - [Release notes](https://github.com/department-of-veterans-affairs/content-build/releases) - [Commits](https://github.com/department-of-veterans-affairs/content-build/compare/v0.0.3439...v0.0.3440) --- updated-dependencies: - dependency-name: va-gov/content-build dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index e131258609..74ad0e308e 100644 --- a/composer.json +++ b/composer.json @@ -221,7 +221,7 @@ "symfony/phpunit-bridge": "^5.1", "symfony/process": "^6.3", "symfony/routing": "^6.3", - "va-gov/content-build": "^0.0.3439", + "va-gov/content-build": "^0.0.3440", "vlucas/phpdotenv": "^5.3", "webflo/drupal-finder": "^1.0.0", "webmozart/path-util": "^2.3", diff --git a/composer.lock b/composer.lock index 433eed340e..cc3f1ee783 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "15c7c7fba07e61d6be8de41d94c2619f", + "content-hash": "3972bf23590490ac39137ab6b269c754", "packages": [ { "name": "asm89/stack-cors", @@ -25807,16 +25807,16 @@ }, { "name": "va-gov/content-build", - "version": "v0.0.3439", + "version": "v0.0.3440", "source": { "type": "git", "url": "https://github.com/department-of-veterans-affairs/content-build.git", - "reference": "ef743f09f6c05b78d40bfb01730aac12f3d35988" + "reference": "4ff558516c6af0270ce577b42127f5cd413ddf8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/department-of-veterans-affairs/content-build/zipball/ef743f09f6c05b78d40bfb01730aac12f3d35988", - "reference": "ef743f09f6c05b78d40bfb01730aac12f3d35988", + "url": "https://api.github.com/repos/department-of-veterans-affairs/content-build/zipball/4ff558516c6af0270ce577b42127f5cd413ddf8f", + "reference": "4ff558516c6af0270ce577b42127f5cd413ddf8f", "shasum": "" }, "type": "node-project", @@ -25843,9 +25843,9 @@ "description": "Front-end for VA.gov. This repository contains the code that generates the www.va.gov website. It contains a Metalsmith static site builder that uses a Drupal CMS for content. This file is here to publish releases to https://packagist.org/packages/va-gov/content-build, so that the CMS CI system can install it and update it using standard composer processes, and so that we can run tests across both systems. See https://github.com/department-of-veterans-affairs/va.gov-cms for the CMS repo, and stand by for more documentation.", "support": { "issues": "https://github.com/department-of-veterans-affairs/content-build/issues", - "source": "https://github.com/department-of-veterans-affairs/content-build/tree/v0.0.3439" + "source": "https://github.com/department-of-veterans-affairs/content-build/tree/v0.0.3440" }, - "time": "2024-02-08T21:53:11+00:00" + "time": "2024-02-14T14:09:01+00:00" }, { "name": "vlucas/phpdotenv", @@ -26816,6 +26816,7 @@ "drupal/cer": 10, "drupal/change_labels": 20, "drupal/ckeditor_abbreviation": 15, + "drupal/codit_menu_tools": 15, "drupal/components": 10, "drupal/danse_content_moderation": 10, "drupal/entity_block": 10, From 6d4696e536768da0ae5e40508ffc43f7158c6cb1 Mon Sep 17 00:00:00 2001 From: Steve Wirt Date: Thu, 15 Feb 2024 12:26:44 -0500 Subject: [PATCH 14/16] VACMS-16233 make script batches pick up where they left off (#17236) * VACMS-16233 Make script-library sandbox keep track of the last success and resume. * VACMS-16233 Make menu script report progress more specific. * Fix logging category. --- .../VACMS-16233-reorder-vamc-menu-items.php | 13 ++++++----- scripts/content/script-library.php | 22 +++++++++++++++++-- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/scripts/content/VACMS-16233-reorder-vamc-menu-items.php b/scripts/content/VACMS-16233-reorder-vamc-menu-items.php index 41123b2247..15c50e79c8 100644 --- a/scripts/content/VACMS-16233-reorder-vamc-menu-items.php +++ b/scripts/content/VACMS-16233-reorder-vamc-menu-items.php @@ -12,7 +12,10 @@ * If for some reason the run crashes before it is complete: * - Check CMS recent log messages for cause * /admin/reports/dblog?type%5B%5D=codit_menu_tools - * - Simply re-run the script. + * - Simply re-run the script, it will pick up where it left off. + * - If for some reason you need to start it at a different number, you can use + * `drush php:eval '\Drupal::state()->set("script_library__va_gov_vamc_get_system_menus", DESIRED_NUMBER);'` + * to set the last number that ran successfully. */ use Drupal\codit_menu_tools\MenuManipulator; @@ -47,8 +50,8 @@ function run(): string { */ function va_gov_vamc_deploy_resort_vamc_menus(&$sandbox) { script_library_sandbox_init($sandbox, '_va_gov_vamc_get_system_menus', []); - _va_gov_vamc_arrange_menus($sandbox); - return script_library_sandbox_complete($sandbox, "Re-arranged @total VAMC System Menus."); + $message = _va_gov_vamc_arrange_menus($sandbox); + return $message . script_library_sandbox_complete($sandbox, "Re-arranged @total VAMC System Menus."); } /** @@ -91,9 +94,9 @@ function _va_gov_vamc_arrange_menus(&$sandbox) { ]; $menu_arranger = new MenuManipulator($menu_name); $menu_arranger->matchPattern($pattern); - $message = "The menu {$sandbox['items_to_process'][$menu_name]} had been rearranged."; + $message = "The menu {$sandbox['items_to_process'][$menu_name]} had been rearranged. "; + // It has been run successfully, so remove it. unset($sandbox['items_to_process'][$menu_name]); - $sandbox['current']++; return $message; } diff --git a/scripts/content/script-library.php b/scripts/content/script-library.php index 6363a152b9..ac00016965 100644 --- a/scripts/content/script-library.php +++ b/scripts/content/script-library.php @@ -317,6 +317,17 @@ function script_library_sandbox_init(array &$sandbox, $counter_callback, array $ $sandbox['items_to_process'] = call_user_func_array($counter_callback, $callback_args); $sandbox['total'] = count($sandbox['items_to_process']); $sandbox['current'] = 0; + $sandbox['multi_run_state_key'] = "script_library_$counter_callback"; + + // This seems like the first run, see if there is already a state saved + // from a previous attempt. + $last_run_completed = \Drupal::state()->get($sandbox['multi_run_state_key']); + if (!is_null($last_run_completed)) { + // A state exists, so alter the 'current' and 'items_to_process'. + $sandbox['current'] = $last_run_completed + 1; + // Remove the last successful run, and all that came before it. + $sandbox['items_to_process'] = array_slice($sandbox['items_to_process'], $last_run_completed); + } } else { // Something went wrong could not use callback. Throw exception. @@ -325,6 +336,7 @@ function script_library_sandbox_init(array &$sandbox, $counter_callback, array $ ); } } + $sandbox['element'] = array_key_first($sandbox['items_to_process']); } /** @@ -341,17 +353,23 @@ function script_library_sandbox_init(array &$sandbox, $counter_callback, array $ function script_library_sandbox_complete(array &$sandbox, $completed_message) { // Determine when to stop batching. $sandbox['current'] = ($sandbox['total'] - count($sandbox['items_to_process'])); + // Save the 'current' value to state, to record a successful run. + \Drupal::state()->set($sandbox['multi_run_state_key'], $sandbox['current']); $sandbox['#finished'] = (empty($sandbox['total'])) ? 1 : ($sandbox['current'] / $sandbox['total']); $vars = [ '@completed' => $sandbox['current'], + '@element' => $sandbox['element'], '@total' => $sandbox['total'], ]; - $message = t('Processing... @completed/@total.', $vars) . PHP_EOL; + + $message = t('Processed @element. @completed/@total.', $vars) . PHP_EOL; // Log the all finished notice. if ($sandbox['#finished'] === 1) { - Drupal::logger('va_gov_vamc')->log(LogLevel::INFO, $completed_message, $vars); + Drupal::logger('script_library')->log(LogLevel::INFO, $completed_message, $vars); $logged_message = new FormattableMarkup($completed_message, $vars); $message = t('Process completed:') . " {$logged_message}" . PHP_EOL; + // Delete the state as it is no longer needed. + \Drupal::state()->delete($sandbox['multi_run_state_key']); } return $message; } From 828acc9b9adad7361649f454bc1e6e4a2756b46a Mon Sep 17 00:00:00 2001 From: Alex Finnarn Date: Thu, 15 Feb 2024 15:26:28 -0500 Subject: [PATCH 15/16] VACMS-16853: next build branches ftw (#17154) * add next-build as an option for requesting a content release * only override needed form fields for content release form * be more specific with repo roots in settings for different envs * fix broken unit test * fix broken integration test * add api client for next-build * try different file root location * add frontend information to payload, pass info to build trigger * add start to next-build frontend script * update next-build-frontend.sh script * further separate content release state machines * remove seperate release state manager * remove all references to simulatenous building using current pattern * simpler build trigger within form submission * debug Tugboat * filename change for queue runner * try kicking off script via cron * add more debugging to cron run * correct git location for next-build * make build script executable * cleanup code * add documentation * more code cleanup * update docs to trigger after failed tugboat * cleanup code * Update scripts/next-build-frontend.sh Co-authored-by: Tanner Heffner * Update scripts/next-build-frontend.sh Co-authored-by: Tanner Heffner * Update scripts/next-build-frontend.sh Co-authored-by: Tanner Heffner * fixes from code review --------- Co-authored-by: Tanner Heffner --- .tugboat/config.yml | 7 + READMES/cms-content-release.md | 30 +- ...xt.next_site.next_build_preview_server.yml | 4 +- .../custom/va_gov_content_release/README.md | 13 + .../src/Form/NextGitForm.php | 399 ++++++++++++++++++ .../FrontendVersionSearch.php | 30 +- .../va_gov_content_release.module | 6 - .../va_gov_content_release.routing.yml | 8 + .../va_gov_content_release.services.yml | 2 + .../Factory/BranchSearchFactory.php | 8 + .../Factory/BranchSearchFactoryInterface.php | 8 + .../Repository/Factory/RepositoryFactory.php | 7 + .../Factory/RepositoryFactoryInterface.php | 11 +- .../Settings/RepositorySettings.php | 2 +- .../Settings/RepositorySettingsInterface.php | 5 + .../custom/va_gov_git/va_gov_git.services.yml | 4 + .../Api/Client/Factory/ApiClientFactory.php | 9 + .../Factory/ApiClientFactoryInterface.php | 11 + .../va_gov_github/va_gov_github.services.yml | 4 + docroot/sites/default/settings.php | 1 + .../default/settings/settings.tugboat.php | 1 + scripts/next-build-frontend.sh | 120 ++++++ scripts/next-build.sh | 13 +- scripts/next-install.sh | 14 +- scripts/queue_runner/next_queue_runner.sh | 6 + .../Settings/RepositorySettingsTest.php | 5 + .../Settings/RepositorySettingsTest.php | 7 + 27 files changed, 717 insertions(+), 18 deletions(-) create mode 100644 docroot/modules/custom/va_gov_content_release/README.md create mode 100644 docroot/modules/custom/va_gov_content_release/src/Form/NextGitForm.php delete mode 100644 docroot/modules/custom/va_gov_content_release/va_gov_content_release.module create mode 100644 scripts/next-build-frontend.sh create mode 100644 scripts/queue_runner/next_queue_runner.sh diff --git a/.tugboat/config.yml b/.tugboat/config.yml index 6e628ef6c4..e1f37c407e 100644 --- a/.tugboat/config.yml +++ b/.tugboat/config.yml @@ -226,6 +226,13 @@ services: - mv "${TUGBOAT_ROOT}/scripts/queue_runner/queue_runner.sh" /etc/service/drupal_events/run - chmod +x /etc/service/drupal_events/run + # Separate process for next-build preview. + - mkdir -p /etc/service/next_build + - mv "${TUGBOAT_ROOT}/scripts/queue_runner/next_queue_runner.sh" /etc/service/next_build/run + - chmod +x /etc/service/next_build/run + # Need to make build script executable so the runner can run it. + - chmod +x "${TUGBOAT_ROOT}/scripts/next-build-frontend.sh" + clone: # This j2 command is shared in both the build & clone stages. If modifying, change the other too. - j2 "${TUGBOAT_ROOT}/.tugboat/.env.j2" -o "${TUGBOAT_ROOT}/.env" diff --git a/READMES/cms-content-release.md b/READMES/cms-content-release.md index 8d9119600e..0c8c93e598 100644 --- a/READMES/cms-content-release.md +++ b/READMES/cms-content-release.md @@ -116,7 +116,6 @@ sequenceDiagram Complete->>+Ready: Content release workflow has completed ``` - # Environment specific details ## BRD Production @@ -144,6 +143,35 @@ The Tugboat and local development versions of the release content page do not tr For more information on creating or releasing content from a preview environment, see [Environments](./environments.md). +### Next Build Releases + +The upcoming static frontend "next-build" can be rebuilt using different versions of next-build and vets-website. It +is a simpler process than the current content-build workflow. + +1. Go to "/admin/content/deploy/next". +2. If the form elements are disabled, then a lock file exists preventing another build from being triggered. You + can skip to step #6. +2. Choose a version for next-build or leave at default. +3. Choose a version for vets-website or leave at default. When content-build is releasing, these form fields might + be disabled. We can't change the vets-website version while another frontend build is running. +4. Click "Release Content" to set the versions of next-build and vets-website as well as write a "buildrequest" file. +5. A `scripts/queue_runner/next_queue_runner.sh` script continuously runs in the background looking for the + "buildrequest" file and then start a build if found. Locally, the script has to be triggered manually. See the + [caveats](#caveats) section for more information. +6. Back on "/admin/content/deploy/next" you can view the build log via a link in the "Status" section of the + "Next Build Information" block. +7. Once the build completes no new build will be triggered until you click to release content again. +8. View the frontend at the provided "View Preview" link in the "Next Build Information" block. + +#### Caveats + +There are some caveats to the process outlined above. + +- **Manually running the background script** - On `ddev` the `queue_runner` scripts aren't running continuously in + background jobs. So you must `ddev ssh && ./scripts/queue_runner/` to kick off the content build or next build + release locally. In the future, it might be a good idea to use `system.d` or `supervisor` or something else to + keep the background jobs going locally just like on Tugoboat. + ## Troubleshooting Sometimes the state gets stuck and needs to be reset. It can be done with a drush command diff --git a/config/sync/next.next_site.next_build_preview_server.yml b/config/sync/next.next_site.next_build_preview_server.yml index 3e3a99c8bb..caf6c88f5d 100644 --- a/config/sync/next.next_site.next_build_preview_server.yml +++ b/config/sync/next.next_site.next_build_preview_server.yml @@ -4,8 +4,8 @@ status: true dependencies: { } id: next_build_preview_server label: 'Next Build Preview Server' -base_url: 'http://localhost:3000' -preview_url: 'http://localhost:3000/api/preview' +base_url: 'http://localhost:3999' +preview_url: 'http://localhost:3999/api/preview' preview_secret: secret revalidate_url: '' revalidate_secret: '' diff --git a/docroot/modules/custom/va_gov_content_release/README.md b/docroot/modules/custom/va_gov_content_release/README.md new file mode 100644 index 0000000000..226790fb81 --- /dev/null +++ b/docroot/modules/custom/va_gov_content_release/README.md @@ -0,0 +1,13 @@ +# VA.gov Content Release + +va.gov is built using two separate frontend systems with a third being built: + +- content-build - This is the frontend for generating static content files. You can read more about the project here: + https://github.com/department-of-veterans-affairs/content-build +- vets-website - This is the frontend for integrating React widgets. You can read more about the project here: + https://github.com/department-of-veterans-affairs/vets-website +- next-build - This is the new frontend for generating static content files. You can read more about the project here: + https://github.com/department-of-veterans-affairs/next-build + +More detailed documentation about how these frontends are build and released can be found in the main READMEs +directory on the [CMS Content Release](../../../../READMES/cms-content-release.md) page. diff --git a/docroot/modules/custom/va_gov_content_release/src/Form/NextGitForm.php b/docroot/modules/custom/va_gov_content_release/src/Form/NextGitForm.php new file mode 100644 index 0000000000..e20b3870b9 --- /dev/null +++ b/docroot/modules/custom/va_gov_content_release/src/Form/NextGitForm.php @@ -0,0 +1,399 @@ +frontendVersion = $frontendVersion; + $this->fileSystem = $fileSystem; + $this->config = $config; + $this->state = $state; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('va_gov_content_release.frontend_version'), + $container->get('file_system'), + $container->get('config.factory'), + $container->get('state') + ); + } + + /** + * Build the form. + * + * @param array $form + * Default form array structure. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * Object containing current form state. + */ + public function buildForm(array $form, FormStateInterface $form_state) { + $form['build_request']['description'] = [ + '#prefix' => '

', + '#markup' => $this->t('Release content to update the front end of this environment with the latest published content changes.'), + '#suffix' => '

', + ]; + + $form['build_request']['next_build_selection'] = [ + '#title' => $this->t('Which version of next-build would you like to use?'), + '#type' => 'radios', + '#options' => [ + 'default' => $this->t('Use default - the next-build version from the time this demo environment was created.'), + 'choose' => $this->t('Select a different next-build branch/pull request - for example, to see your content in a newer frontend design.'), + ], + '#default_value' => 'default', + ]; + + $form['build_request']['next_build_git_ref'] = [ + '#type' => 'textfield', + '#title' => $this->t('Select branch/pull request'), + '#description' => $this->t('Start typing to select a branch for the next-build version you want to use.'), + '#autocomplete_route_name' => 'va_gov_content_release.frontend_version_autocomplete', + '#autocomplete_route_parameters' => [ + 'frontend' => 'next_build', + 'count' => 10, + ], + '#size' => 72, + '#maxlength' => 1024, + '#hidden' => TRUE, + '#states' => [ + 'visible' => [':input[name="next_build_selection"]' => ['value' => 'choose']], + ], + ]; + + $form['build_request']['vets_website_selection'] = [ + '#title' => $this->t('Which version of vets-website would you like to use?'), + '#type' => 'radios', + '#options' => [ + 'default' => $this->t('Use default - the vets-website version from the time this demo environment was created.'), + 'choose' => $this->t('Select a different vets-website branch/pull request - for example, to see your content in a newer frontend design.'), + ], + '#default_value' => 'default', + ]; + + $form['build_request']['vets_website_git_ref'] = [ + '#type' => 'textfield', + '#title' => $this->t('Select branch/pull request'), + '#description' => $this->t('Start typing to select a branch for the vets-website version you want to use.'), + '#autocomplete_route_name' => 'va_gov_content_release.frontend_version_autocomplete', + '#autocomplete_route_parameters' => [ + 'frontend' => 'vets_website', + 'count' => 10, + ], + '#size' => 72, + '#maxlength' => 1024, + '#hidden' => TRUE, + '#states' => [ + 'visible' => [':input[name="vets_website_selection"]' => ['value' => 'choose']], + ], + ]; + + $form['build_request']['actions']['#type'] = 'actions'; + $form['build_request']['actions']['submit'] = [ + '#type' => 'submit', + '#value' => $this->t('Release Content'), + '#button_type' => 'primary', + ]; + + // Lock the vets-website form fields if a content-build is in progress. + $build_status = $this->state->get('va_gov_build_trigger.release_state'); + if ($build_status !== ReleaseStateManager::STATE_READY) { + $form['build_request']['vets_website_selection']['#disabled'] = TRUE; + $form['build_request']['vets_website_git_ref']['#disabled'] = TRUE; + } + + // Disable form changes and submission if a build is in progress. + if (file_exists($this->fileSystem->realpath('public://' . self::LOCK_FILE_NAME))) { + $form['build_request']['next_build_selection']['#disabled'] = TRUE; + $form['build_request']['next_build_git_ref']['#disabled'] = TRUE; + $form['build_request']['vets_website_selection']['#disabled'] = TRUE; + $form['build_request']['vets_website_git_ref']['#disabled'] = TRUE; + $form['build_request']['actions']['submit']['#disabled'] = TRUE; + + $target_url = Url::fromUserInput("/sites/default/files/next-build.txt"); + $build_log_text = Link::fromTextAndUrl('Build is in progress. View log file', $target_url); + } + else { + $build_log_text = 'Build is not in progress.'; + } + + // Set variables needed for build status information. + $lock_file_text = $this->getFileLink(self::LOCK_FILE_NAME); + $request_file_text = $this->getFileLink(self::REQUEST_FILE_NAME); + $next_build_version = $this->frontendVersion->getVersion(Frontend::NextBuild); + $vets_website_version = $this->frontendVersion->getVersion(Frontend::VetsWebsite); + $view_preview = $this->getPreviewLink(); + $last_build_time = $this->state->get('next_build.status.last_build_date', 'N/A'); + $form['content_release_status_block'] = [ + '#theme' => 'status_report_grouped', + '#grouped_requirements' => [ + [ + 'title' => $this->t('Next Build Information'), + 'type' => 'content-release-status', + 'items' => [ + 'status' => [ + 'title' => $this->t('Status'), + 'value' => $build_log_text, + ], + 'lock_file' => [ + 'title' => $this->t('Lock File'), + 'value' => $lock_file_text, + ], + 'request_file' => [ + 'title' => $this->t('Request File'), + 'value' => $request_file_text, + ], + 'next_build_version' => [ + 'title' => $this->t('Next-build Version'), + 'value' => $next_build_version, + ], + 'vets_website_version' => [ + 'title' => $this->t('Vets-website Version'), + 'value' => $vets_website_version, + ], + 'view_preview' => [ + 'title' => $this->t('View Preview'), + 'value' => $view_preview, + ], + 'last_build_time' => [ + 'title' => $this->t('Last Build Time'), + 'value' => $last_build_time, + ], + ], + ], + ], + ]; + + return $form; + } + + /** + * Get the text for a file. + * + * @param string $file_name + * The name of the file. + * + * @return \Drupal\Core\Link|string + * The file link. + */ + private function getFileLink(string $file_name): Link|string { + $file_path = $this->fileSystem->realpath("public://$file_name"); + if (file_exists($file_path)) { + $target_url = Url::fromUserInput("/sites/default/files/$file_name"); + return Link::fromTextAndUrl($file_name, $target_url); + } + else { + return 'does not exist'; + } + } + + /** + * Get the preview link. + * + * @return \Drupal\Core\Link + * The preview link. + */ + private function getPreviewLink(): Link { + $frontend_base_url = $this->config + ->get('next.next_site.next_build_preview_server') + ->get('base_url'); + $target_url = Url::fromUri($frontend_base_url, ['attributes' => ['target' => '_blank']]); + return Link::fromTextAndUrl($this->t('View front end'), $target_url); + } + + /** + * Submit the build trigger form. + * + * @param array $form + * Default form array structure. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * Object containing current form state. + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $this->submitFormForFrontend(Frontend::NextBuild, $form_state); + $this->submitFormForFrontend(Frontend::VetsWebsite, $form_state); + + $lock_file = $this->fileSystem->realpath('public://' . self::LOCK_FILE_NAME); + if (file_exists($lock_file)) { + $this->messenger() + ->addMessage($this->t('The build is in progress. Please wait for the build to complete.')); + } + else { + $this->fileSystem->saveData( + 'Build me, Seymour!', + 'public://' . self::REQUEST_FILE_NAME, + 1); + $this->messenger()->addMessage($this->t('Build request file set.')); + } + } + + /** + * Submit the form. + * + * @param \Drupal\va_gov_content_release\Frontend\FrontendInterface $frontend + * The frontend whose version we are managing. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * Object containing current form state. + */ + protected function submitFormForFrontend( + FrontendInterface $frontend, + FormStateInterface $form_state + ) { + $selectionName = $frontend->getRawValue() . '_selection'; + if ($form_state->getValue($selectionName) === 'default') { + $this->resetFrontendVersion($frontend, $form_state); + } + else { + $this->setFrontendVersion($frontend, $form_state); + } + } + + /** + * {@inheritdoc} + */ + public function validateForm(array &$form, FormStateInterface $form_state) { + $this->validateFormForFrontend(Frontend::NextBuild, $form_state); + $this->validateFormForFrontend(Frontend::VetsWebsite, $form_state); + } + + /** + * Validate the form. + * + * @param \Drupal\va_gov_content_release\Frontend\FrontendInterface $frontend + * The frontend whose version we are managing. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * Object containing current form state. + */ + protected function validateFormForFrontend( + FrontendInterface $frontend, + FormStateInterface $form_state + ) { + $selectionName = $frontend->getRawValue() . '_selection'; + $gitRefName = $frontend->getRawValue() . '_git_ref'; + if ($form_state->getValue($selectionName) !== 'default') { + if (empty($this->getGitRef($frontend, $form_state))) { + $form_state->setErrorByName($gitRefName, + $this->t('Invalid selection.')); + } + } + } + + /** + * Reset the frontend version. + * + * @param \Drupal\va_gov_content_release\Frontend\FrontendInterface $frontend + * The frontend whose version we are resetting. + */ + public function resetFrontendVersion(FrontendInterface $frontend) { + $this->frontendVersion->resetVersion($frontend); + } + + /** + * Set the frontend version according to the form. + * + * @param \Drupal\va_gov_content_release\Frontend\FrontendInterface $frontend + * The frontend whose version we are setting. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * Object containing current form state. + */ + public function setFrontendVersion( + FrontendInterface $frontend, + FormStateInterface $form_state + ) { + $this->frontendVersion->setVersion($frontend, + $this->getGitRef($frontend, $form_state)); + } + + /** + * Parse a git ref out of the `git_ref` field value. + * + * @param \Drupal\va_gov_content_release\Frontend\FrontendInterface $frontend + * The frontend whose version we are setting. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * Object containing current form state. + * + * @return string + * A standalone git ref, or an empty string. + */ + public function getGitRef( + FrontendInterface $frontend, + FormStateInterface $form_state + ): string { + // If they selected a specific git ref, use that. + $gitRefName = $frontend->getRawValue() . '_git_ref'; + $formValue = $form_state->getValue($gitRefName); + $result = ''; + if (preg_match("/.+\\s\\(([^\\)]+)\\)/", $formValue, $matches)) { + $result = $matches[1]; + } + return $result; + } + + /** + * {@inheritdoc} + */ + public function getFormId(): string { + return 'va_gov_content_release_next_git_form'; + } + +} diff --git a/docroot/modules/custom/va_gov_content_release/src/FrontendVersionSearch/FrontendVersionSearch.php b/docroot/modules/custom/va_gov_content_release/src/FrontendVersionSearch/FrontendVersionSearch.php index d2d6145d39..1420453091 100644 --- a/docroot/modules/custom/va_gov_content_release/src/FrontendVersionSearch/FrontendVersionSearch.php +++ b/docroot/modules/custom/va_gov_content_release/src/FrontendVersionSearch/FrontendVersionSearch.php @@ -50,6 +50,20 @@ class FrontendVersionSearch implements FrontendVersionSearchInterface { */ protected $logger; + /** + * The branch search service for `vets-website`. + * + * @var \Drupal\va_gov_git\BranchSearch\BranchSearchInterface + */ + protected $nbBranchSearch; + + /** + * The API client for `vets-website`. + * + * @var \Drupal\va_gov_github\Api\Client\ApiClientInterface + */ + protected $nbApiClient; + /** * Constructor. * @@ -63,19 +77,27 @@ class FrontendVersionSearch implements FrontendVersionSearchInterface { * The API client for `vets-website`. * @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $loggerFactory * The logger factory service. + * @param \Drupal\va_gov_git\BranchSearch\BranchSearchInterface $nbBranchSearch + * The branch search service for `next-build`. + * @param \Drupal\va_gov_github\Api\Client\ApiClientInterface $nbApiClient + * The API client for `next-build`. */ public function __construct( BranchSearchInterface $cbBranchSearch, ApiClientInterface $cbApiClient, BranchSearchInterface $vwBranchSearch, ApiClientInterface $vwApiClient, - LoggerChannelFactoryInterface $loggerFactory + LoggerChannelFactoryInterface $loggerFactory, + BranchSearchInterface $nbBranchSearch, + ApiClientInterface $nbApiClient, ) { $this->cbBranchSearch = $cbBranchSearch; $this->cbApiClient = $cbApiClient; $this->vwBranchSearch = $vwBranchSearch; $this->vwApiClient = $vwApiClient; $this->logger = $loggerFactory->get('va_gov_content_release'); + $this->nbBranchSearch = $nbBranchSearch; + $this->nbApiClient = $nbApiClient; } /** @@ -95,6 +117,9 @@ protected function getBranchSearch(FrontendInterface $frontend) : BranchSearchIn case $frontend->isVetsWebsite(): return $this->vwBranchSearch; + case $frontend->isNextBuild(): + return $this->nbBranchSearch; + default: throw new \InvalidArgumentException('Invalid frontend: ' . $frontend->getRawValue()); } @@ -117,6 +142,9 @@ protected function getApiClient(FrontendInterface $frontend) : ApiClientInterfac case $frontend->isVetsWebsite(): return $this->vwApiClient; + case $frontend->isNextBuild(): + return $this->nbApiClient; + default: throw new \InvalidArgumentException('Invalid frontend: ' . $frontend->getRawValue()); } diff --git a/docroot/modules/custom/va_gov_content_release/va_gov_content_release.module b/docroot/modules/custom/va_gov_content_release/va_gov_content_release.module deleted file mode 100644 index 35beaf8b98..0000000000 --- a/docroot/modules/custom/va_gov_content_release/va_gov_content_release.module +++ /dev/null @@ -1,6 +0,0 @@ -repositoryFactory->getVetsWebsite(), $this->loggerFactory); } + /** + * {@inheritDoc} + */ + public function getNextBuild(): BranchSearchInterface { + return new BranchSearch($this->repositoryFactory->getNextBuild(), + $this->loggerFactory); + } + } diff --git a/docroot/modules/custom/va_gov_git/src/BranchSearch/Factory/BranchSearchFactoryInterface.php b/docroot/modules/custom/va_gov_git/src/BranchSearch/Factory/BranchSearchFactoryInterface.php index 8d67cb0b1f..616cc686ce 100644 --- a/docroot/modules/custom/va_gov_git/src/BranchSearch/Factory/BranchSearchFactoryInterface.php +++ b/docroot/modules/custom/va_gov_git/src/BranchSearch/Factory/BranchSearchFactoryInterface.php @@ -55,4 +55,12 @@ public function getContentBuild(): BranchSearchInterface; */ public function getVetsWebsite(): BranchSearchInterface; + /** + * Get the next-build branch search service. + * + * @return \Drupal\va_gov_git\BranchSearch\BranchSearchInterface + * The next-build branch search object. + */ + public function getNextBuild(): BranchSearchInterface; + } diff --git a/docroot/modules/custom/va_gov_git/src/Repository/Factory/RepositoryFactory.php b/docroot/modules/custom/va_gov_git/src/Repository/Factory/RepositoryFactory.php index fe70477b26..4a1f8a93d4 100644 --- a/docroot/modules/custom/va_gov_git/src/Repository/Factory/RepositoryFactory.php +++ b/docroot/modules/custom/va_gov_git/src/Repository/Factory/RepositoryFactory.php @@ -65,4 +65,11 @@ public function getVetsWebsite(): RepositoryInterface { return $this->get(RepositorySettingsInterface::VETS_WEBSITE); } + /** + * {@inheritDoc} + */ + public function getNextBuild(): RepositoryInterface { + return $this->get(RepositorySettingsInterface::NEXT_BUILD); + } + } diff --git a/docroot/modules/custom/va_gov_git/src/Repository/Factory/RepositoryFactoryInterface.php b/docroot/modules/custom/va_gov_git/src/Repository/Factory/RepositoryFactoryInterface.php index 3e0a3350f2..877b59e3ae 100644 --- a/docroot/modules/custom/va_gov_git/src/Repository/Factory/RepositoryFactoryInterface.php +++ b/docroot/modules/custom/va_gov_git/src/Repository/Factory/RepositoryFactoryInterface.php @@ -10,10 +10,11 @@ * This service provides a way to create services corresponding to specific Git * repositories. * - * At this time, we're primarily interested in three repositories: + * At this time, we're primarily interested in four repositories: * - The `va.gov-cms` repository. * - The `content-build` repository. * - The `vets-website` repository. + * - The `next-build` repository. */ interface RepositoryFactoryInterface { @@ -55,4 +56,12 @@ public function getContentBuild(): RepositoryInterface; */ public function getVetsWebsite(): RepositoryInterface; + /** + * Get the next-build repository. + * + * @return \Drupal\va_gov_git\Repository\RepositoryInterface + * The next-build repository. + */ + public function getNextBuild(): RepositoryInterface; + } diff --git a/docroot/modules/custom/va_gov_git/src/Repository/Settings/RepositorySettings.php b/docroot/modules/custom/va_gov_git/src/Repository/Settings/RepositorySettings.php index 4d131e6043..c2f09cbdea 100644 --- a/docroot/modules/custom/va_gov_git/src/Repository/Settings/RepositorySettings.php +++ b/docroot/modules/custom/va_gov_git/src/Repository/Settings/RepositorySettings.php @@ -59,7 +59,7 @@ public function getPath(string $name): string { } $path = $this->settings->get($pathKey); if (empty($path)) { - throw new RepositoryPathNotSetException('Path not set for repository: ' . $name); + throw new RepositoryPathNotSetException('Path not set for repository: ' . $name . ' (' . $pathKey . ')'); } return $path; } diff --git a/docroot/modules/custom/va_gov_git/src/Repository/Settings/RepositorySettingsInterface.php b/docroot/modules/custom/va_gov_git/src/Repository/Settings/RepositorySettingsInterface.php index 15615705cc..dfcfbbca84 100644 --- a/docroot/modules/custom/va_gov_git/src/Repository/Settings/RepositorySettingsInterface.php +++ b/docroot/modules/custom/va_gov_git/src/Repository/Settings/RepositorySettingsInterface.php @@ -14,10 +14,12 @@ interface RepositorySettingsInterface { const VA_GOV_CMS = 'va.gov-cms'; const CONTENT_BUILD = 'content-build'; const VETS_WEBSITE = 'vets-website'; + const NEXT_BUILD = 'next-build'; const REPOSITORY_NAMES = [ self::VA_GOV_CMS, self::CONTENT_BUILD, self::VETS_WEBSITE, + self::NEXT_BUILD, ]; // Settings keys for the repositories' filesystem paths. @@ -26,10 +28,13 @@ interface RepositorySettingsInterface { const VA_GOV_CMS_PATH_KEY = 'va_gov_app_root'; const CONTENT_BUILD_PATH_KEY = 'va_gov_web_root'; const VETS_WEBSITE_PATH_KEY = 'va_gov_vets_website_root'; + const NEXT_BUILD_PATH_KEY = 'va_gov_next_build_root'; + const PATH_KEYS = [ self::VA_GOV_CMS => self::VA_GOV_CMS_PATH_KEY, self::CONTENT_BUILD => self::CONTENT_BUILD_PATH_KEY, self::VETS_WEBSITE => self::VETS_WEBSITE_PATH_KEY, + self::NEXT_BUILD => self::NEXT_BUILD_PATH_KEY, ]; /** diff --git a/docroot/modules/custom/va_gov_git/va_gov_git.services.yml b/docroot/modules/custom/va_gov_git/va_gov_git.services.yml index bd4757fffe..3d02a62691 100644 --- a/docroot/modules/custom/va_gov_git/va_gov_git.services.yml +++ b/docroot/modules/custom/va_gov_git/va_gov_git.services.yml @@ -32,4 +32,8 @@ services: class: Drupal\va_gov_git\BranchSearch\BranchSearch factory: ['@va_gov_git.branch_search_factory', 'getVetsWebsite'] arguments: [] + va_gov_git.branch_search.next_build: + class: Drupal\va_gov_git\BranchSearch\BranchSearch + factory: [ '@va_gov_git.branch_search_factory', 'getNextBuild' ] + arguments: [] diff --git a/docroot/modules/custom/va_gov_github/src/Api/Client/Factory/ApiClientFactory.php b/docroot/modules/custom/va_gov_github/src/Api/Client/Factory/ApiClientFactory.php index f4f59cc7ed..5244d41b29 100644 --- a/docroot/modules/custom/va_gov_github/src/Api/Client/Factory/ApiClientFactory.php +++ b/docroot/modules/custom/va_gov_github/src/Api/Client/Factory/ApiClientFactory.php @@ -18,6 +18,7 @@ class ApiClientFactory implements ApiClientFactoryInterface { const VA_GOV_CMS = 'va.gov-cms'; const CONTENT_BUILD = 'content-build'; const VETS_WEBSITE = 'vets-website'; + const NEXT_BUILD = 'next-build'; /** * The settings service. @@ -64,4 +65,12 @@ public function getVetsWebsite(): ApiClientInterface { return $this->get(static::OWNER, static::VETS_WEBSITE, $this->settings->getApiToken()); } + /** + * {@inheritDoc} + */ + public function getNextBuild(): ApiClientInterface { + return $this->get(static::OWNER, static::NEXT_BUILD, + $this->settings->getApiToken()); + } + } diff --git a/docroot/modules/custom/va_gov_github/src/Api/Client/Factory/ApiClientFactoryInterface.php b/docroot/modules/custom/va_gov_github/src/Api/Client/Factory/ApiClientFactoryInterface.php index 4dbd126985..e97d8c7ae0 100644 --- a/docroot/modules/custom/va_gov_github/src/Api/Client/Factory/ApiClientFactoryInterface.php +++ b/docroot/modules/custom/va_gov_github/src/Api/Client/Factory/ApiClientFactoryInterface.php @@ -67,4 +67,15 @@ public function getContentBuild(): ApiClientInterface; */ public function getVetsWebsite(): ApiClientInterface; + /** + * Retrieve an API client for the Next Build repository. + * + * @return \Drupal\va_gov_github\Api\Client\ApiClientInterface + * The GitHub Api Client instance. + * + * @throws \Drupal\va_gov_github\Exception\InvalidApiTokenException + * If the GitHub API token is provided, but is invalid. + */ + public function getNextBuild(): ApiClientInterface; + } diff --git a/docroot/modules/custom/va_gov_github/va_gov_github.services.yml b/docroot/modules/custom/va_gov_github/va_gov_github.services.yml index 60aa99976c..f881f35ab4 100644 --- a/docroot/modules/custom/va_gov_github/va_gov_github.services.yml +++ b/docroot/modules/custom/va_gov_github/va_gov_github.services.yml @@ -17,3 +17,7 @@ services: class: Drupal\va_gov_github\Api\Client\ApiClientInterface factory: ['@va_gov_github.api_client_factory', 'getVetsWebsite'] arguments: [] + va_gov_github.api_client.next_build: + class: Drupal\va_gov_github\Api\Client\ApiClientInterface + factory: [ '@va_gov_github.api_client_factory', 'getNextBuild' ] + arguments: [] diff --git a/docroot/sites/default/settings.php b/docroot/sites/default/settings.php index b22fa5300e..99271a5dd2 100755 --- a/docroot/sites/default/settings.php +++ b/docroot/sites/default/settings.php @@ -126,6 +126,7 @@ $settings['va_gov_web_root'] = '/var/www/cms/web'; $settings['va_gov_app_root'] = '/var/www/cms'; $settings['va_gov_vets_website_root'] = '/var/www/cms/docroot/vendor/va-gov/vets-website'; +$settings['va_gov_next_build_root'] = '../next'; // Defaults (should only be local that doesn't set these), default to dev for config_split $config['config_split.config_split.dev']['status'] = TRUE; diff --git a/docroot/sites/default/settings/settings.tugboat.php b/docroot/sites/default/settings/settings.tugboat.php index 5bcd14b1e3..c6ab9b0c63 100644 --- a/docroot/sites/default/settings/settings.tugboat.php +++ b/docroot/sites/default/settings/settings.tugboat.php @@ -64,6 +64,7 @@ $settings['va_gov_app_root'] = getenv('TUGBOAT_ROOT'); $settings['va_gov_web_root'] = getenv('TUGBOAT_ROOT') . '/web'; $settings['va_gov_vets_website_root'] = getenv('TUGBOAT_ROOT') . '/docroot/vendor/va-gov/vets-website'; +$settings['va_gov_next_build_root'] = getenv('TUGBOAT_ROOT') . '/next'; $settings['memcache']['servers'] = [ 'memcache:11211' => 'default', diff --git a/scripts/next-build-frontend.sh b/scripts/next-build-frontend.sh new file mode 100644 index 0000000000..c6e32d1d4a --- /dev/null +++ b/scripts/next-build-frontend.sh @@ -0,0 +1,120 @@ +#!/usr/bin/env bash + +# Exit if a command fails with a non-zero status code. +set -ex + +# Find repo root -> $reporoot +reporoot="unknown" +if [ ! -z "$IS_DDEV_PROJECT" ]; then + reporoot="/var/www/html" +fi +if [ ! -z "$TUGBOAT_ROOT" ]; then + reporoot="$TUGBOAT_ROOT" +fi +if [ "$reporoot" == "unknown" ]; then + echo "[!] Could not determine the environment type. Aborting!" + exit 1 +fi + +# For convenience. +cd $reporoot + +# Store path to site default files directory. +filesdir="${reporoot}/docroot/sites/default/files" + +# We really only want one build running at a time on any given environment. +if [ -f "${filesdir}/next-buildlock.txt" ]; then + echo "[!] There is already a build in progress. Aborting!" + exit 1 +fi +touch ${filesdir}/next-buildlock.txt + +# Make sure we clean up the build lock file if an error occurs or the build is killed. +trap "rm -f ${filesdir}/next-buildlock.txt && rm -f ${filesdir}/next-buildrequest.txt" INT TERM EXIT + +# Just because the path is really long: +logfile="${filesdir}/next-build.txt" + +# The currently selected version of next-build (may be "__default", a PR#, or a git ref) +next_build_version=$(drush va-gov-content-release:frontend-version:get next_build | tail -1) + +# The currently selected version of vets-website (may be "__default", a PR#, or a git ref) +vets_website_version=$(drush va-gov-content-release:frontend-version:get vets_website | tail -1) + +# Create a fresh log file. +[ -f "${logfile}" ] && rm ${logfile} +touch ${logfile} + +date >> ${logfile} + +echo "next-build version: ${next_build_version}" >> ${logfile} +echo "vets-website version: ${vets_website_version}" >> ${logfile} + +# Tell the frontend (and the user) that we're starting. +#drush va-gov:content-release:advance-state starting +echo "==> Starting a frontend build. This file will be updated as the build progresses." >> ${logfile} + +# Reset the repos to defaults. +#echo "==> Resetting VA repos to default versions" >> ${logfile} +#rm -rf ${reporoot}/docroot/vendor/va-gov +#composer install --no-scripts &>> ${logfile} + +# Get the requested next-build version +if [ "${next_build_version}" != "__default" ]; then + echo "==> Checking out the requested frontend version" >> ${logfile} + pushd ${reporoot}/next + if echo "${next_build_version}" | grep -qE '^[0-9]+$' > /dev/null; then + echo "==> Checking out PR #${next_build_version}" + git fetch origin pull/${next_build_version}/head &>> ${logfile} + else + echo "==> Checking out git ref ${next_build_version}" + git fetch origin ${next_build_version} &>> ${logfile} + fi + git checkout FETCH_HEAD &>> ${logfile} + popd +else + echo "==> Using default next-build version" >> ${logfile} +fi + +# Install 3rd party deps. +echo "==> Installing yarn dependencies" >> ${logfile} +composer va:next:install &>> ${logfile} + +# Get the requested vets-website version +if [ "${vets_website_version}" != "__default" ]; then + echo "==> Checking out the requested vets-website version" >> ${logfile} + pushd ${reporoot}/docroot/vendor/va-gov/vets-website + if echo "$vets_website_version" | grep -qE '^[0-9]+$' > /dev/null; then + echo "==> Checking out PR #${vets_website_version}" + git fetch origin pull/${vets_website_version}/head &>> ${logfile} + else + echo "==> Checking out git ref ${vets_website_version}" + git fetch origin ${vets_website_version} &>> ${logfile} + fi + git checkout FETCH_HEAD &>> ${logfile} + popd +else + echo "==> Using default vets-website version" >> ${logfile} +fi + +# Run the build. +echo "==> Starting build" >> ${logfile} +#drush va-gov:content-release:advance-state inprogress +composer va:next:build &>> ${logfile} + +# Advance the state in the frontend so another build can start. +echo "==> Build complete" >> ${logfile} +#drush va-gov:content-release:advance-state complete +#drush va-gov:content-release:advance-state ready + +# After this point, we are less concerned with errors; the build has completed. +set +e + +# Switch to the docroot to run drush commands. +cd "${reporoot}/docroot" + +# Log the timestamp of the build for reporting purposes. +drush state:set next_build.status.last_build_date "$(date)" + +# Just in case it wasn't clear :) +echo "==> Done" >> ${logfile} diff --git a/scripts/next-build.sh b/scripts/next-build.sh index ff134cf6fe..f322083dbf 100755 --- a/scripts/next-build.sh +++ b/scripts/next-build.sh @@ -1,11 +1,20 @@ #!/usr/bin/env bash #preview +ROOT=${TUGBOAT_ROOT:-${DDEV_APPROOT:-/var/www/html}} +if [ -n "${IS_DDEV_PROJECT}" ]; then + APP_ENV="local" +elif [ -n "${TUGBOAT_ROOT}" ]; then + APP_ENV="tugboat" +else + APP_ENV="tugboat" +fi + export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" source ~/.bashrc -cd next +cd "${ROOT}/next" -APP_ENV=tugboat yarn build:preview \ No newline at end of file +APP_ENV=${APP_ENV} yarn build:preview diff --git a/scripts/next-install.sh b/scripts/next-install.sh index e7063b52c2..11f3ba5c85 100755 --- a/scripts/next-install.sh +++ b/scripts/next-install.sh @@ -8,7 +8,10 @@ source ~/.bashrc # Installs the content-build dependencies. if [ ! -d next ]; then - git clone --single-branch --depth 1 https://github.com/department-of-veterans-affairs/next-build.git next + # Clone full so git information is available for content release form. + # I don't think this should be necessary, but branch information was not + # available in the content release form until I pulled down all information. + git clone https://github.com/department-of-veterans-affairs/next-build.git next else echo "Repo next-build already cloned." fi @@ -17,10 +20,13 @@ cd next #repo_root="$(git rev-parse --show-toplevel)" #pushd "${repo_root}" > /dev/null -nvm install 18.17.0 +nvm install 18.17.0 nvm use 18.17.0 -corepack enable -corepack prepare yarn@stable --activate + +# These steps caused the build to fail for me so I disabled temporarily. +#corepack enable +#corepack prepare yarn@stable --activate + echo "Node $(node -v)" echo "NPM $(npm -v)" echo "Yarn $(yarn -v)" diff --git a/scripts/queue_runner/next_queue_runner.sh b/scripts/queue_runner/next_queue_runner.sh new file mode 100644 index 0000000000..b636f6c686 --- /dev/null +++ b/scripts/queue_runner/next_queue_runner.sh @@ -0,0 +1,6 @@ +#!/bin/bash -l + +ROOT=${TUGBOAT_ROOT:-${DDEV_APPROOT:-/var/www/html}} +cd "${ROOT}" +[ -f "./docroot/sites/default/files/next-buildrequest.txt" ] && ./scripts/next-build-frontend.sh +sleep 10s diff --git a/tests/phpunit/va_gov_git/functional/Repository/Settings/RepositorySettingsTest.php b/tests/phpunit/va_gov_git/functional/Repository/Settings/RepositorySettingsTest.php index b50b2de832..ba8fc95b2d 100644 --- a/tests/phpunit/va_gov_git/functional/Repository/Settings/RepositorySettingsTest.php +++ b/tests/phpunit/va_gov_git/functional/Repository/Settings/RepositorySettingsTest.php @@ -47,6 +47,7 @@ public function testGetPathKey() { $this->assertEquals(RepositorySettingsInterface::PATH_KEYS['va.gov-cms'], $repositorySettings->getPathKey('va.gov-cms')); $this->assertEquals(RepositorySettingsInterface::PATH_KEYS['content-build'], $repositorySettings->getPathKey('content-build')); $this->assertEquals(RepositorySettingsInterface::PATH_KEYS['vets-website'], $repositorySettings->getPathKey('vets-website')); + $this->assertEquals(RepositorySettingsInterface::PATH_KEYS['next-build'], $repositorySettings->getPathKey('next-build')); } /** @@ -69,6 +70,10 @@ public function testList() { 'name' => RepositorySettingsInterface::VETS_WEBSITE, 'path' => Settings::get('va_gov_vets_website_root'), ], + [ + 'name' => RepositorySettingsInterface::NEXT_BUILD, + 'path' => Settings::get('va_gov_next_build_root'), + ], ], $repositorySettings->list()); } diff --git a/tests/phpunit/va_gov_git/unit/Repository/Settings/RepositorySettingsTest.php b/tests/phpunit/va_gov_git/unit/Repository/Settings/RepositorySettingsTest.php index 20b5d104d3..b0b3813dc8 100644 --- a/tests/phpunit/va_gov_git/unit/Repository/Settings/RepositorySettingsTest.php +++ b/tests/phpunit/va_gov_git/unit/Repository/Settings/RepositorySettingsTest.php @@ -30,6 +30,7 @@ public function getRepositorySettings() { 'va_gov_app_root' => '/srv/cms', 'va_gov_web_root' => '/srv/web', 'va_gov_vets_website_root' => '/srv/vets-website', + 'va_gov_next_build_root' => '/srv/next', ]); return new RepositorySettings($settings); } @@ -68,6 +69,7 @@ public function getPathKeyDataProvider() { ['va.gov-cms', RepositorySettings::VA_GOV_CMS_PATH_KEY], ['content-build', RepositorySettings::CONTENT_BUILD_PATH_KEY], ['vets-website', RepositorySettings::VETS_WEBSITE_PATH_KEY], + ['next-build', RepositorySettings::NEXT_BUILD_PATH_KEY], ]; } @@ -97,6 +99,7 @@ public function getPathDataProvider() { ['va.gov-cms', '/srv/cms'], ['content-build', '/srv/web'], ['vets-website', '/srv/vets-website'], + ['next-build', '/srv/next'], ]; } @@ -146,6 +149,10 @@ public function testList() { 'name' => RepositorySettingsInterface::VETS_WEBSITE, 'path' => '/srv/vets-website', ], + [ + 'name' => RepositorySettingsInterface::NEXT_BUILD, + 'path' => '/srv/next', + ], ], $repositorySettings->list()); } From c008ca2706418907f810f79e588d2f38636e545d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:01:04 -0800 Subject: [PATCH 16/16] Bump va-gov/content-build from 0.0.3440 to 0.0.3441 (#17259) Bumps [va-gov/content-build](https://github.com/department-of-veterans-affairs/content-build) from 0.0.3440 to 0.0.3441. - [Release notes](https://github.com/department-of-veterans-affairs/content-build/releases) - [Commits](https://github.com/department-of-veterans-affairs/content-build/compare/v0.0.3440...v0.0.3441) --- updated-dependencies: - dependency-name: va-gov/content-build dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 74ad0e308e..658c1118bd 100644 --- a/composer.json +++ b/composer.json @@ -221,7 +221,7 @@ "symfony/phpunit-bridge": "^5.1", "symfony/process": "^6.3", "symfony/routing": "^6.3", - "va-gov/content-build": "^0.0.3440", + "va-gov/content-build": "^0.0.3441", "vlucas/phpdotenv": "^5.3", "webflo/drupal-finder": "^1.0.0", "webmozart/path-util": "^2.3", diff --git a/composer.lock b/composer.lock index cc3f1ee783..35509b265c 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "3972bf23590490ac39137ab6b269c754", + "content-hash": "0aafdc84754d748d9a73e8856c353b95", "packages": [ { "name": "asm89/stack-cors", @@ -25807,7 +25807,7 @@ }, { "name": "va-gov/content-build", - "version": "v0.0.3440", + "version": "v0.0.3441", "source": { "type": "git", "url": "https://github.com/department-of-veterans-affairs/content-build.git", @@ -25843,7 +25843,7 @@ "description": "Front-end for VA.gov. This repository contains the code that generates the www.va.gov website. It contains a Metalsmith static site builder that uses a Drupal CMS for content. This file is here to publish releases to https://packagist.org/packages/va-gov/content-build, so that the CMS CI system can install it and update it using standard composer processes, and so that we can run tests across both systems. See https://github.com/department-of-veterans-affairs/va.gov-cms for the CMS repo, and stand by for more documentation.", "support": { "issues": "https://github.com/department-of-veterans-affairs/content-build/issues", - "source": "https://github.com/department-of-veterans-affairs/content-build/tree/v0.0.3440" + "source": "https://github.com/department-of-veterans-affairs/content-build/tree/v0.0.3441" }, "time": "2024-02-14T14:09:01+00:00" },