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-19060: Ensure job token export does not throw an error #20200

Merged
merged 3 commits into from
Jan 6, 2025

Conversation

dsasser
Copy link
Contributor

@dsasser dsasser commented Jan 3, 2025

Description

The CreateAdvancedQueueJob is a custom ECA Action plugin that we wrote for providing a way to send any email notification via a queue. We followed practices in ECA's own Actions that allow the primary object, in this case a Drupal\advancedqueue\Job object, to be exported as a token and therefore usable by downstream Events, Conditions, or Actions. However, as of today, the job token is not being used anywhere, and thus we weren't seeing any problems with mail delivery.

The errors we were seeing were resulting from Job object not being in an expected format (a Drupal entity, Typed Data object, or scalar value). This PR solves that by creating the token as an associative array.

Relates to #19060

Testing done

Tested by setting all ECA Models to run on every cron run (otherwise we could only test once a day, as per the configuration of the existing Models), and running cron, or running the ECA Cron service directly (ddev drush eval "\Drupal::service('eca_base.hook_handler')->cron();") which short circuits the very long running Drupal cron process.

QA steps

PRE QA steps (once per day; may already have been done today by me). We do this because the current ECA Workflows are set to trigger only once per cron at midnight and we need to be able to test them more frequently than that.

  1. Visit the ECA Workflow dashboard.

  2. Edit each ECA Model

Screenshot 2025-01-06 at 8 50 02 AM
  1. Edit the cron Event for a given Model
Screenshot 2025-01-06 at 8 50 15 AM
  1. Set the cron Event to trigger on every cron eg: * * * * *
Screenshot 2025-01-06 at 8 50 29 AM
  1. Repeat for each ECA Workflow

  2. Delete all existing log messages (makes reviewing easier)

Screenshot 2025-01-06 at 10 08 26 AM

As a site admin

  1. Run cron via the 'VA' menu -> Run Cron
    • Validate that there are no ECA errors in the db log

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

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 3, 2025 19:12 Destroyed
Copy link

github-actions bot commented Jan 3, 2025

Checking composer.lock changes...

@github-actions github-actions bot added the DO NOT MERGE Do not merge this PR label Jan 3, 2025
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 4, 2025 08:52 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 5, 2025 08:50 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 6, 2025 08:49 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 6, 2025 16:34 Destroyed
Copy link

github-actions bot commented Jan 6, 2025

Checking composer.lock changes...

@va-cms-bot
Copy link
Collaborator

Cypress Accessibility Violations

/test-data-dolorum

ID: button-name
Impact: critical
Tags: cat.name-role-value, wcag2a, wcag412, section508, section508.22.a, TTv5, TT6.a, EN-301-549, EN-9.4.1.2, ACT
Description: Ensure buttons have discernible text
Help: Buttons must have discernible text
Nodes:

  • HTML: <button class="proofing-element-help" role="tooltip" data-proofing-help-title="About 'Page introduction' field" data-proofing-help="Add an introduction that helps visitors understand if information on the page is relevant to them."> <span aria-hidden="true">i</span> </button>
    Impact: critical
    Target: .field--name-field-intro-text-limited-html > .field__label > .proofing-element-help[role="tooltip"]
    Summary: Fix any of the following:
    Element does not have inner text that is visible to screen readers
    aria-label attribute does not exist or is empty
    aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
    Element has no title attribute
    Element does not have an implicit (wrapped) <label>
    Element does not have an explicit <label>
    Element's default semantics were not overridden with role="none" or role="presentation"

  • HTML: <button class="proofing-element-help" role="tooltip" data-proofing-help-title="About 'Generate a table of contents from major headings' field" data-proofing-help="By checking this box, all h2's below this point on the page will be linked with with anchor links. This helps users navigate content on very long pages. Do not check this box unless there is at least 2 h2's on the page.">
    Impact: critical
    Target: .field--name-field-table-of-contents-boolean > .field__label > .proofing-element-help[role="tooltip"]
    Summary: Fix any of the following:
    Element does not have inner text that is visible to screen readers
    aria-label attribute does not exist or is empty
    aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
    Element has no title attribute
    Element does not have an implicit (wrapped) <label>
    Element does not have an explicit <label>
    Element's default semantics were not overridden with role="none" or role="presentation"

  • HTML: <button class="proofing-element-help" role="tooltip" data-proofing-help-title="About 'Main content' field" data-proofing-help="The main body of the page, which appears below the featured content."> <span aria-hidden="true">i</span> </button>
    Impact: critical
    Target: button[data-proofing-help-title="About 'Main content' field"]
    Summary: Fix any of the following:
    Element does not have inner text that is visible to screen readers
    aria-label attribute does not exist or is empty
    aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
    Element has no title attribute
    Element does not have an implicit (wrapped) <label>
    Element does not have an explicit <label>
    Element's default semantics were not overridden with role="none" or role="presentation"

@dsasser dsasser removed the DO NOT MERGE Do not merge this PR label Jan 6, 2025
@dsasser dsasser requested review from JakeBapple and omahane and removed request for JakeBapple January 6, 2025 18:12
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.

Ran cron and confirmed no ECA errors.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 6, 2025 19:29 Destroyed
Copy link

github-actions bot commented Jan 6, 2025

Checking composer.lock changes...

@dsasser dsasser merged commit e896d49 into main Jan 6, 2025
14 of 18 checks passed
@dsasser dsasser deleted the VACMS-19060-error-thrown-on-aging-content branch January 6, 2025 19:30
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.

3 participants