Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VACMS-16335 Add VAMC System police contact migration #16430

Merged
merged 8 commits into from
Dec 18, 2023

Conversation

swirtSJW
Copy link
Contributor

@swirtSJW swirtSJW commented Dec 14, 2023

Description

Relates to #16335

Testing done

Screenshots

QA steps

What needs to be checked to prove this works?
What needs to be checked to prove it didn't break any related things?
What variations of circumstances (users, actions, values) need to be checked?

As an admin

  1. Go to the VA Police contact migration

    • Validate the the row for "Node - VAMC System Police contact" shows 170 total items (the number of data rows in the CSV)
  2. Click the Execute button for "vamc_system_police_contact" and Execute the migration with no additional options.

    • Validate that 170 items were processed, Should show 139 created... which is a like it only updated, but it can't tell.

image

  1. Go to the migrate messages list
    • validate there are no messages for this migration.
  2. Go to the content list filtered by va police
  3. Toggle the updated date sort back and forth.
    • validate the first item in the list and the last were both updated by the migration. (times may be a few minutes apart)
  4. Go to content with extension
    • validate that it has both a phone number and extension
    • Validate it has a revision log message by cms migrator that shows the update of contact info.
  5. Go to content with no extension
    • validate that it has both a phone number but no extension

Definition of Done

  • Documentation has been updated, if applicable.
  • Tests have been added if necessary.
  • Automated tests have passed.
  • Code Quality Tests have passed.
  • Acceptance Criteria in related issue are met.
  • Manual Code Review Approved.
  • If there are field changes, front end output has been thoroughly checked.

Select Team for PR review

  • CMS Team
  • Public websites
  • Facilities
  • User support
  • Accelerated Publishing

Is this PR blocked by another PR?

  • DO NOT MERGE

Does this PR need review from a Product Owner

  • Needs PO review

CMS user-facing announcement

Is an announcement needed to let editors know of this change?

  • Yes, and it's written in issue ____ and queued for publication.
    • Merge and ping the UX writer so they are ready to publish after deployment
  • Yes, but it hasn't yet been written
    • Don't merge yet -- ping the UX writer to write and queue content
  • No announcement is needed for this code change.
    • Merge & carry on unburdened by announcements

@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 14, 2023 16:07 Destroyed
@swirtSJW swirtSJW self-assigned this Dec 14, 2023
@swirtSJW swirtSJW force-pushed the VACMS-16335-va-police-contact-migration branch from 6306bed to b151294 Compare December 15, 2023 20:41
@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 15, 2023 20:41 Destroyed
@swirtSJW
Copy link
Contributor Author

swirtSJW commented Dec 15, 2023

The node lookup is currently failing
image

edited 12/16/23: This is resolved.

@swirtSJW
Copy link
Contributor Author

There is an upstream issue with token replacement
image

image

I will get it patched and fixed this weekend.

@swirtSJW swirtSJW force-pushed the VACMS-16335-va-police-contact-migration branch from b151294 to f83493c Compare December 18, 2023 02:02
@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 18, 2023 02:03 Destroyed
@swirtSJW
Copy link
Contributor Author

This is largely working
I resolved the upstream bug #3409215: Process plugin create_default_paragraph_revision does not support values or tokens

I also created an upstream feature request and patched it to work out the phone number parsing #3409322: Add process plugin gate_comparator

I am only seeing 4 failures related to failed lookups. This is usually the result of data mismatches in the CSV. I am looking into those now

  Source ID(s)                                                Destination ID(s)   Level   Message                                                             
 ----------------------------------------------------------- ------------------- ------- -------------------------------------------------------------------- 
  16: MO":VA Fayetteville Arkansas health care                                    4       vamc_system_police_contact:nid: Entity lookup found no VAMC System  
                                                                                          for @vamc_system_label.                                             
  VA Greater Los Angeles health care:VA Greater LA HCS -                          4       vamc_system_police_contact:nid: Entity lookup found no police page  
  Sepulveda ACC:vha_691                                                                   for @vamc_system_label.                                             
  VA Greater Los Angeles health care:VA Greater LA HCS - W.                       4       vamc_system_police_contact:nid: Entity lookup found no police page  
  LA VAMC:vha_691                                                                         for @vamc_system_label.                                             
  17:"West Texas VA HCS - George H. O'Brien:VA West Texas                         4       vamc_system_police_contact:nid: Entity lookup found no VAMC System  
  health care                                                                             for @vamc_system_label.  

@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 18, 2023 02:47 Destroyed
@swirtSJW
Copy link
Contributor Author

Solved the problem with the missing entity lookups. It was due to a mismatch in data enclosures. Switched to " and we are all good.

@swirtSJW
Copy link
Contributor Author

swirtSJW commented Dec 18, 2023

16 are not showing as updated.... which is probably a data problem

Looking at it by the numbers
Rows: 170
skips: 31
Number of Police nodes 139
Expected updates based on rows 170-31 = 139

image
created and updated: 132
The updated count 9 plus the extra skipped (38ignored - 31expected = 7) Gives us the missing 16.

Now to figure out why.

@swirtSJW
Copy link
Contributor Author

swirtSJW commented Dec 18, 2023

Troubleshooting log

  • The missing 16 were not skipped by 'skip' setting in CSV
  • The missing 16 were correctly labelled for the system
  • Difference between the updated and the ignored? nothing.
  • Forcing an update migration changes nothing.
  • There are no messages that would indicate a lookup could not be found.
  • ones not updated
    • VA Washington DC health care
    • VA White River Junction health care
    • VA Walla Walla health care
    • VA Syracuse health care
    • VA Western New York health care
    • VA Tuscaloosa health care
    • VA West Texas health care
    • VA Western Colorado health care
    • VA Tampa health care
    • VA West Palm Beach health care
    • VA Wilmington health care
    • VA Wilkes-Barre health care
    • VA Tennessee Valley health care
    • VA Wichita health care
    • VA Tomah health care
    • VA Texas Valley health care
  • Noticing these are all late in the alphabet.
  • They all the rows that appear after row 154 - St Louis.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 18, 2023 05:25 Destroyed
@swirtSJW
Copy link
Contributor Author

Solved, the collection of keys was not unique enough to make an id.
Now it is.
image

@@ -132,7 +132,7 @@
"drupal/migrate_source_csv": "^3.4",
"drupal/migrate_source_ui": "^1.0",
"drupal/migrate_tools": "^6.0",
"drupal/migration_tools": "^2.7",
"drupal/migration_tools": "^2.8",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plugin: callback
callable: trim
-
plugin: gate_comparator
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +102 to +127
nid:
-
plugin: entity_lookup
access_check: false
ignore_case: true
entity_type: node
bundle_key: type
bundle: health_care_region_page
value_key: title
source: vamc_system_label
-
plugin: skip_on_empty
method: row
message: 'Entity lookup found no VAMC System for @vamc_system_label.'
-
plugin: entity_lookup
access_check: false
ignore_case: true
entity_type: node
bundle_key: type
bundle: vamc_system_va_police
value_key: field_office
-
plugin: skip_on_empty
method: row
message: 'Entity lookup found no police page for @vamc_system_label.'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dance is needed to lookup the nid so that it can update an existing node rather than migrate in a new one.

@swirtSJW swirtSJW marked this pull request as ready for review December 18, 2023 14:37
@swirtSJW swirtSJW requested review from a team as code owners December 18, 2023 14:37
Copy link
Contributor

@omahane omahane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the exception of the

Click the Execute button for "vamc_system_police_contact" and Execute the migration with no additional options.

actually requiring me to choose the "update" option because the nodes had already been migrated, everything else was as described.

This migration looks pretty hairy. Your solution is really impressive.

@swirtSJW swirtSJW merged commit 430efdc into main Dec 18, 2023
29 checks passed
@swirtSJW swirtSJW deleted the VACMS-16335-va-police-contact-migration branch December 18, 2023 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants